بنقرة واحدة
adv-cleanup
Active ADV cleanup triage: stale, abandoned, duplicate, and ready-to-archive changes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Active ADV cleanup triage: stale, abandoned, duplicate, and ready-to-archive changes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Architecture inconsistency detection via deterministic tools, research fallback, and AI heuristic
AI-generated code quality detection via AST, regex, and heuristic analysis
Backend technology stack evaluation — choose boring technology scaled by project context. Use when selecting languages, databases, async infra, or API styles for new or existing backends.
Competitive intelligence research methodology for source code and public information comparison
Improvement-discovery methodology for current-state, LBP, and external landscape analysis
Backlog reconciliation, bug priority assignment, and ROADMAP.md regeneration methodology
| name | adv-cleanup |
| description | Active ADV cleanup triage: stale, abandoned, duplicate, and ready-to-archive changes |
| keywords | ["adv","cleanup","stale","abandoned","duplicate","archive","triage"] |
| metadata | {"priority":"medium","source":"adv-cleanup-command"} |
Methodology for /adv-cleanup: bucket active changes, report candidates, and guide command-owned closure after strict approval. Skill is read-only guidance; command owns ADV tool calls, state mutation, and approval enforcement.
7d unless --age-threshold overrides.duplicate / stuck / abandoned / ready-to-archive./adv-archive {id}.Most-specific wins. First match owns classification.
| # | Bucket | Detection | Action target |
|---|---|---|---|
| 1 | Duplicate | Normalized title equals another active/archived title, OR ID matches <stem><N> where N >= 2, <stem> exists, and <stem> length >= 3 | Explicit close, reason: superseded, supersededBy required |
| 2 | Stuck at proposal | gates.proposal.status == "pending", tasks.length == 0, stale past threshold | Filter close, reason: not_planned |
| 3 | Abandoned mid-flight | Proposal done, any pending/in-progress task, stale past threshold, no gate completed within threshold | Filter close, reason: cancelled |
| 4 | Ready to archive | All gates except release done, all tasks done, no unresolved review findings | Recommend /adv-archive {id} |
| 5 | Healthy | Anything else | Skip |
Title normalization: trim, replace Unicode whitespace runs with one ASCII space, lowercase.
Duplicate ID suffix is a conservative hint only. If target cannot be verified before apply, skip that candidate.
Draft-only duplicate titles are not scanned until the draft appears in active cleanup list; cleanup handles active state, not proposal shaping.
Minimize tool calls:
lastActivityAgeMinutes <= threshold and not Duplicate → Healthy.For ~17 active changes with half stale, expect ~8 deep inspections. Cap each displayed bucket at 20 entries and append (N more not shown).
Before any closure bucket, check unarchived fast-follow children: any active change whose parent_change_id equals candidate ID.
If found, move candidate to Blocked: has unarchived child; do not include in approval prompt or close set.
Call adv_worktree_triage to produce a separate worktree drift report. This section is always report-only; even --execute does not delete worktrees here.
Classify each worktree into one of four drift groups:
| Group | Meaning |
|---|---|
| safe | No active sessions, not the current process CWD, eligible for cleanup |
| blocked | Has active sessions or is the current process CWD; skip deletion |
| dirty/in-use | Uncommitted changes or running processes detected; defer to user |
| needs-investigation | Classification ambiguous (missing registry entry, stale head, etc.) |
Required snippet:
Worktree drift report (report-only): {safe} safe, {blocked} blocked, {dirty/in-use} dirty/in-use, {needs-investigation} needs-investigation.Actual worktree deletion remains owned by adv_worktree_delete and adv_worktree_cleanup; /adv-cleanup never deletes worktrees.
Inline report, no question popup.
Required sections:
## /adv-cleanup triage report
Mode: {dry-run | execute}
Active changes scanned: {N}
Hot excluded: {M}
Age threshold: {value}
### Ready to archive ({count})
- {id} ({tasks done}/{total} tasks, all gates except release done)
→ Run `/adv-archive {id}` to ship.
### Stuck at proposal ({count})
- {id} (0/0 tasks, {age}h stale, proposal gate pending)
### Abandoned mid-flight ({count})
- {id} ({done}/{total} tasks, {age}h stale, last gate: {last-completed-gate})
### Duplicate/superseded ({count})
- {id} → superseded by {target-id} ({matching-rule: title-equality | suffix-pattern})
### Blocked: has unarchived child ({count})
- {id} → child {child-id} still active (close child or archive parent first)
Total candidates: {sum non-empty closure buckets}
If --bucket was used, prefix report with Filtered to bucket: <name>.
If all buckets empty: No cleanup candidates. All active changes are healthy or hot.
Dry-run footer: Re-run with --execute to apply per-bucket actions (each bucket requires Tier B approval).
Each closure bucket gets separate Tier B inline prompt. This is cancellation approval (rq-inlineApproval01.4), whitelist-only, no LLM fallback.
Prompt format:
{Bucket name} — closure requested for these changes:
1. {change-id} — "{title}" — Reason: {detection-rule summary}
2. {change-id} — "{title}" — Reason: {detection-rule summary}
Reply EXACTLY one of:
- `approve all` — close all listed changes
- `reject all` — keep all changes active
- `keep N` (or `keep N,M`) — close inverse of listed numbers
- `cancel N` (or `cancel N,M`) — close only the listed numbers
- `stop` / `abort` — halt; do not close anything
Parse replies after trim + case-fold:
| Regex | Meaning |
|---|---|
^approve all$ | close all listed |
^reject all$ | skip bucket |
^keep ([\d,\s]+)$ | close all except listed numbers |
^cancel ([\d,\s]+)$ | close only listed numbers |
^(stop|abort)$ | halt whole run |
Anything else → re-prompt same options. No LLM fallback.
reason: "superseded" is invalid.supersededBy; missing target skips affected candidates only.lastActivityBefore when all approved entries share safe filter semantics; otherwise explicit IDs are safer.Result lines:
✓ {Bucket name}: closed {N} change(s) — {reason}✗ {Bucket name}: failed — {error message}. No changes closed in this bucket.| × Bad | ✓ Good |
|---|---|
| Bulk-archive ready bucket | Recommend per-change /adv-archive {id} |
| LLM fallback on ambiguous reply | Re-prompt exact options |
Act directly with --execute | Per-bucket Tier B prompt first |
| Close parent with unarchived child | Move to blocked sub-bucket |
| Include hot-band changes | Use excludeRecencyBands: ["hot"] |