Skip to content
Back to skills

Sweep Plans

ASecurity

Reclaim stale ~/.workflow-plans/ session artifacts: deletes non-plan files by default; plan and user-requested files only with --include-plan-and-user-requested and approval

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
ai-agentsbash

Security analysis

A100/100

Scanned November 25, 2026

npx -y skills add nirecom/agents --skill sweep-plans --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sweep Plans?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sweep Plans
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nirecom-sweep-plans/badge)](https://www.skillsdirectory.com/skills/nirecom-sweep-plans)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sweep-plans
description: Reclaim stale ~/.workflow-plans/ session artifacts: deletes non-plan files by default; plan and user-requested files only with --include-plan-and-user-requested and approval
user-invocable: true
model: sonnet
---

# /sweep-plans

Reclaim stale session artifacts under `~/.workflow-plans/`.

- Every file falls into one of four classes, decided by its kind in `hooks/lib/plans-artifact-registry.js`: `non-plan`, `plan`, `user-requested`, `unknown`.
- The user flags are `--include-plan-and-user-requested`, `--dry-run`, `--sweep-age-days N`, and `--ci-mode`.

## Procedure

SP-1. Run `bash "$AGENTS_MAIN_ROOT/bin/sweep-plans.sh"` and forward the user's flags verbatim; when they include `--include-plan-and-user-requested` without `--ci-mode` or `--dry-run`, also pass `--gate-session "$CLAUDE_CODE_SESSION_ID"`.
SP-2. Show stdout verbatim; never summarize or filter it.
SP-3. Run the human gate on a `<<<APPROVAL-GATE-SP3` block, checking every Other token against the block's token rows:
   - Stop when stdout has no such block.
   - Note the block's `# gate-id:` value.
   - Ask one `AskUserQuestion` (`metadata.source=sweep-plans.delete`) with the options "Delete every listed session" and "Delete nothing"; a subset arrives as tokens typed in Other.
   - Stop without deleting when any Other token is missing from the gate's token rows.
   - Stop on "Delete nothing".
   - Resolve `<PLANS_DIR>` per `skills/_shared/resolve-plans-dir.md`; write the approved tokens, one per line, with the Write tool into `<PLANS_DIR>` as the registry kind `sweep-plans-approved-sessions` (file name `<session-id>-sweep-plans-approved-sessions.txt`).
   - Rerun with `--include-plan-and-user-requested --gate-session "$CLAUDE_CODE_SESSION_ID" --gate-id <noted value> --approved-sessions-file <that file>` plus the user's `--sweep-age-days`; show stdout verbatim.

## Rules

- `--gate-session`, `--gate-id`, and `--approved-sessions-file` are the internal protocol with the script; never offer them to the user.
- `--include-plan-and-user-requested` changes neither the write mode nor the candidate set.
- Approve only tokens shown in the gate; the script repeats the same check against the gate artifact.
- Keep a flagless run non-interactive; never put `AskUserQuestion` on the default path. <!-- askuser-none -->
- `--ci-mode` is non-interactive; candidates appear only in the JSON `approval_candidates`.
- The approved-sessions file lives in PLANS_DIR; the script owns the gate artifact in the control dir, and the model never writes it.
- Never add `context: fork`: the human gate needs the parent conversation.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.