ai-setup: Command for Claude Code

.claude/commands/plan.md

plan is a command for Claude Code from cbmono/ai-setup. It costs 0 tokens per session (2,634 once invoked), scanned A, original, MIT.

An implementation-plan command for larger coding tasks. It creates a written plan, asks independent reviewers to challenge the approach, and saves the refined version after approval.

In plain words
What is it for?
Use it before starting a non-trivial feature, fix, refactor, or migration when the work needs a reviewed sequence of files and steps.
Why use it?
It exposes weak assumptions and missing steps before they turn into expensive code changes. The saved plan travels with stacked pull requests, which are pull requests built on top of one another.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions subagents.

This is cbmono/ai-setup's own configuration. It tells Claude Code how to work on ai-setup itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-setup configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cbmono/ai-setup. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/cbmono/ai-setup/main/.claude/commands/plan.md
Clone the repo
git clone --depth 1 https://github.com/cbmono/ai-setup

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for plan

README.md
[![agentmods](https://agentmods.dev/badge/commands/cbmono/ai-setup/plan/github.svg)](https://agentmods.dev/commands/cbmono/ai-setup/plan)
Your own site
<a href="https://agentmods.dev/commands/cbmono/ai-setup/plan"><img src="https://agentmods.dev/badge/commands/cbmono/ai-setup/plan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for plan

Your own site · 80×15
<a href="https://agentmods.dev/commands/cbmono/ai-setup/plan"><img src="https://agentmods.dev/badge/commands/cbmono/ai-setup/plan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,634 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02634
Opus 5.5 $0.00000 $0.01054
Sonnet 5.5 $0.00000 $0.00527
Haiku 4.5 $0.00000 $0.00263

Measured 2mo ago against content hash cc81038143c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/plan.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Draft an implementation plan, grill it with independent adversarial reviewers, and — once the user approves — save the refined plan as a checked-in artifact that rides with the stacked PRs.

Use this for any non-trivial task where a weak plan would compound into a bad implementation.

/plan grills an approach — before any code exists; it attacks the reasoning. To grill a diff you've already written, use /grill instead. (Same adversarial fan-out, different target.)

Steps

  1. Derive a slug for the plan file:

    • Grep the current branch name and the last 5 commit subjects for \b[A-Z]{2,}-\d+\b. If a Jira-style key matches (e.g. AUTH-1234), slug = that key.
    • Otherwise, build a 3–5 kebab-case word summary of $ARGUMENTS, prefixed with a verb when one fits — feat-rotate-oauth-keys, fix-auth-race, chore-bump-deps, refactor-payments-module. If no prefix fits, drop it (migrate-to-rsc).
    • If $ARGUMENTS is empty or too thin to summarise, ask the user for a slug before continuing.
  2. Draft a plan based on $ARGUMENTS (the task). Structure:

    • Goal — one sentence.
    • Files to touch — concrete paths.
    • Steps — GitHub-checkbox list (- [ ] step); each small enough that progress is observable as work lands.
    • Edge cases — concurrency, retries, partial failure, untrusted inputs.
    • Out of scope — explicit non-goals.
    • Acceptance criteria — how we'll know it's done.

    Keep the plan tight — 10–20 bullet points, not an essay. Don't save it to disk yet.

  3. Grill the plan adversarially. A plan reviewed by the same model that wrote it self-anchors — it confirms its own assumptions instead of attacking them. Instead, fan out independent reviewer subagents, each a fresh context with one adversarial lens. Synthesis and the decision to loop back stay with you (the main loop).

    Size the grill to the plan — this is the cost dial; don't throw 8 Opus reviewers at a one-file fix. Announce the setup in one line and let the user retune before launching. Invoking /plan is your opt-in to run the Workflow, so don't ask whether — only let them change the model or lens set:

    • Small (bug fix, refactor, ≤ ~3 files / ≤ ~5 steps) → the core 4 lenses (★) on Sonnet.
    • Large (greenfield, many files, new abstractions) → all 8 lenses on Opus.
    • e.g. "Small plan → core 4 lenses on Sonnet. Say 'opus' or 'all 8' to widen, otherwise I'll launch."
    • Frontend plans (the plan adds/changes UI — .tsx/.jsx/.vue/.svelte/.html or component/page/form files, same signal as /grill) → invoke the test-locators skill first, then add the locators lens below. Skip it for backend-only plans.

    The lenses (core 4 marked ★) — each reviewer gets exactly one:

    • ★ assumptions — Which single assumption, if wrong, breaks the whole plan? What did the author inherit without confirming?
    • ★ failure_modes — What fails silently? Which new codepath has no error handling or a swallowed error?
    • ★ dependencies — Does each step really depend on the prior one, or is the order arbitrary? Is every acceptance criterion concrete and testable, not "works correctly"?
    • ★ alternatives — Was a simpler approach dismissed too fast? Is there a 1-file fix behind a 5-file plan?
    • scope_drift — What snuck in beyond the goal? What belongs in "Out of scope" but isn't there?
    • testing_gaps — What edge case passes the plan's checks but still breaks prod? What does each acceptance criterion actually prove?
    • missing_risks — What risk is suspiciously absent? (rollback path, data migration, observability gap)
    • business_fit — Does the approach serve the actual goal, or has it drifted into a neat solution to the wrong problem?
    • locators (frontend plans only) — Apply the test-locators skill: does the plan ensure new interactive/asserted elements get stable data-testid/data-test (business-meaningful, not position/CSS-based)? If the plan adds UI but never mentions test locators, that's the finding.

Read the full file on GitHub · 139 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 139 lines · 0 tokens per session scan A cc81038143c7

Subscribe to this mod's changes

plan is a command published in the GitHub repository cbmono/ai-setup (2 stars, last pushed 10d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,634 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.