clawsweeper-issue-triage
```markdown
What this skill does
```markdown
---
name: clawsweeper-issue-triage
description: ClawSweeper is a conservative GitHub maintainer bot that scans all open issues and PRs, writes per-item markdown review records, and closes only when evidence meets strict criteria.
triggers:
- set up clawsweeper for my repo
- automate issue triage with clawsweeper
- how do I run clawsweeper locally
- configure clawsweeper to close stale issues
- apply clawsweeper closures to my repository
- review open PRs with clawsweeper
- clawsweeper dashboard not updating
- how does clawsweeper decide what to close
---
# ClawSweeper Issue Triage Bot
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
ClawSweeper is a conservative AI-powered GitHub maintainer bot that reviews every open issue and PR in a target repository, writes a regenerated markdown record per item, and closes only when evidence is strong. It runs on a weekly cadence per item and uses Codex (`gpt-5.5`) to evaluate each item against a strict set of allowed close reasons.
## What ClawSweeper Does
- Scans all open issues and PRs in a target repo (e.g. `openclaw/openclaw`)
- Writes one markdown file per item under `items/<number>.md`
- Proposes closes only for items that match allowed reasons
- Actually closes items only when `apply_closures=true` is explicitly set
- Archives closed item records to `closed/<number>.md`
- Updates a live dashboard in the README after each run
- Never auto-closes items authored by `OWNER`, `MEMBER`, or `COLLABORATOR`
### Allowed Close Reasons
1. Already implemented on `main`
2. Cannot reproduce on current `main`
3. Belongs on a plugin/skill hub, not in core
4. Too incoherent to be actionable
5. Stale issue older than 60 days with insufficient data to verify the bug
## Installation
Requires **Node 24**.
```bash
git clone https://github.com/openclaw/clawsweeper.git
cd clawsweeper
npm install
npm run build
```
Set required environment variables:
```bash
export GITHUB_TOKEN=$GITHUB_TOKEN # read access to target repo
export OPENAI_API_KEY=$OPENAI_API_KEY # Codex access
export CLAWSWEEPER_REPO="owner/repo" # target repo to scan
```
## Key CLI Commands
### Plan a sweep
Scans open items and produces shard batches for review jobs.
```bash
npm run plan -- \
--batch-size 5 \
--shard-count 40 \
--max-pages 250 \
--codex-model gpt-5.5 \
--codex-reasoning-effort medium \
--codex-service-tier fast
```
### Review items
Runs Codex on each planned item inside a local checkout of the target repo.
```bash
npm run review -- \
--openclaw-dir ../openclaw \
--batch-size 5 \
--max-pages 250 \
--artifact-dir artifacts/reviews \
--codex-model gpt-5.5 \
--codex-reasoning-effort medium \
--codex-service-tier fast \
--codex-timeout-ms 600000
```
### Apply review artifacts to the repo
Merges shard artifacts and updates dashboard. Does **not** close anything yet.
```bash
npm run apply-artifacts -- --artifact-dir artifacts/reviews
```
### Apply existing proposals (close issues/PRs)
Re-fetches issue context, recomputes snapshot hash, and closes if nothing changed since the proposal.
```bash
npm run apply-decisions -- --limit 20
```
Options:
| Flag | Default | Description |
|---|---|---|
| `--limit` | unlimited | Max fresh closes in this run |
| `--apply-kind` | `issue` | `issue`, `pr`, or `all` |
| `--apply-min-age-days` | `0` | Minimum age of proposal before applying |
| `--close-delay-ms` | `5000` | Delay between close API calls |
### Reconcile items folder
Moves externally closed items from `items/` to `closed/` and reopened items back to `items/` as stale.
```bash
npm run reconcile -- --dry-run # preview only
npm run reconcile # apply changes
```
## GitHub Actions Workflow
ClawSweeper is designed to run as a scheduled GitHub Actions workflow on the clawsweeper repo itself. Key workflow inputs:
```yaml
# Trigger a manual run with apply enabled
workflow_dispatch:
inputs:
apply_closures:
description: "Set to true to actually close issues/PRs"
default: "false"
apply_existing:
description: "Apply existing proposals without re-running Codex"
default: "false"
apply_kind:
description: "issue | pr | all"
default: "issue"
apply_min_age_days:
description: "Min age in days for a proposal to be applied"
default: "0"
```
The normal scheduled run is **proposal-only** — it never comments or closes without explicit `apply_closures=true`.
## Item Record Format
Each item is stored as `items/<number>.md`. Example structure:
```markdown
# Issue #58150
**Title:** [Bug]: RISC-V64: OpenClaw fails with LLM request failed
**Outcome:** keep_open
**Reason:** Bug is reproducible and not fixed on main. Insufficient evidence
to close as cannot-reproduce.
**Snapshot hash:** abc123def456
**Reviewed:** Apr 25, 2026, 16:55 UTC
**Proposed close comment:** N/A
```
When outcome is `proposed_close`, the record includes the exact comment that will be posted before closing.
## Review Cadence
| Item type | Cadence |
|---|---|
| All PRs | Daily |
| Issues < 30 days old | Daily |
| Issues ≥ 30 days old with no recent activity | Weekly |
| Items with new activity since last snapshot | Daily (promoted) |
The planner prioritizes: **active items → PRs → new issues → older weekly issues** when more items are due than fit in a run.
## Configuration Reference
ClawSweeper reads configuration from environment variables and CLI flags. There is no separate config file — all settings are passed at invocation time.
| Env Var | Purpose |
|---|---|
| `GITHUB_TOKEN` | GitHub API access (read for review, write for apply) |
| `OPENAI_API_KEY` | Codex API key |
| `CLAWSWEEPER_REPO` | Target repo in `owner/repo` format |
| CLI Flag | Command | Description |
|---|---|---|
| `--batch-size` | plan, review | Items per shard batch |
| `--shard-count` | plan | Number of parallel review shards |
| `--max-pages` | plan, review | Max GitHub API pages to scan |
| `--codex-model` | plan, review | Model to use (default: `gpt-5.5`) |
| `--codex-reasoning-effort` | plan, review | `low`, `medium`, `high` |
| `--codex-service-tier` | plan, review | `default`, `fast` |
| `--codex-timeout-ms` | review | Per-item timeout (default: 600000) |
| `--artifact-dir` | review, apply-artifacts | Directory for shard output |
| `--dry-run` | reconcile | Preview without writing |
| `--apply-closures` | review | Actually close items (use carefully) |
## Code Examples
### Reading an item record programmatically
```javascript
import { readFileSync } from 'fs';
import { join } from 'path';
function loadItemRecord(itemNumber) {
const filePath = join('items', `${itemNumber}.md`);
const content = readFileSync(filePath, 'utf-8');
const outcomeMatch = content.match(/\*\*Outcome:\*\*\s+(\S+)/);
const snapshotMatch = content.match(/\*\*Snapshot hash:\*\*\s+(\S+)/);
return {
number: itemNumber,
outcome: outcomeMatch?.[1] ?? 'unknown',
snapshotHash: snapshotMatch?.[1] ?? null,
raw: content,
};
}
const record = loadItemRecord(58150);
console.log(record.outcome); // "keep_open" or "proposed_close"
```
### Listing all proposed closes
```javascript
import { readdirSync, readFileSync } from 'fs';
import { join } from 'path';
function getProposedCloses(itemsDir = 'items') {
const files = readdirSync(itemsDir).filter(f => f.endsWith('.md'));
return files
.map(file => {
const content = readFileSync(join(itemsDir, file), 'utf-8');
const number = parseInt(file.replace('.md', ''), 10);
const outcomeMatch = content.match(/\*\*Outcome:\*\*\s+(\S+)/);
return { number, outcome: outcomeMatch?.[1] };
})
.filter(item => item.outcome === 'proposed_close')
.map(item => item.number);
}
const toClose = getProposedCloses();
console.log(`Proposed closes: ${toClose.length}`);
console.log(toClose);
```
### Checking dashboard metrics from the README
```javascript
imporRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.