agent-plan

An interactive workflow for planning one coherent code change in a single document. It gathers details, scans the repository, creates a plan, waits for approval, then carries out the work and reports what was completed.

In plain words
What is it for?
Use it for feature work or other focused changes when you want repository research, clarification questions, plan approval, execution, and a completion report in one workflow.
Why use it?
It turns an unclear request into an agreed sequence of implementation steps before code is changed.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/ruizrica/toolkit/agent-plan
Clone the repo
git clone --depth 1 https://github.com/ruizrica/toolkit
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 1,583 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01583
Opus 5 $0.00000 $0.00792
Sonnet 5 $0.00000 $0.00317
Haiku 4.5 $0.00000 $0.00158

Measured 3d ago against content hash 40444d179748, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-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 3d 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.

docs/commands/agent-plan.md · 154 lines

How it starts

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

/agent-plan

Interactive single-document plan workflow. Gathers the full shape of a plan via AskUserQuestion, writes a maximally robust markdown plan, gates on agent-viewer plan approval, then executes in the same session and closes the loop with an auto-generated completion report.

Sister command to /agent-spec, which is the multi-document (requirements/design/tasks) equivalent. Use /agent-plan when the work is a single coherent change; use /agent-spec when the feature needs requirements/design/tasks separation.

Usage

/agent-plan [plan topic] [--name NAME] [--agent inline|haiku|sonnet|opus]

Arguments

Argument Required Description
plan topic Yes Plain-language description of the work
--name NAME No Plan name (defaults to YYYY-MM-DD-<slug>)
--agent inline|haiku|sonnet|opus No Execution mode (default: inline)

Workflow Phases

The command runs 5 phases end-to-end:

Phase 1 — Context

Spawns one Haiku scout agent that scans the repo for:

  • Files/modules/functions relevant to the topic
  • Existing patterns, conventions, test styles
  • In-progress changes that might conflict

Lightweight by design — plans are single-document and smaller than specs, so one agent is enough.

Phase 2 — Interactive Q&A

Groups of 2–4 questions per AskUserQuestion call, covering:

Group Questions
Goal & Scope problem, success criterion, in/out-of-scope
Constraints & Approach technical/time/stakeholder constraints, preferred strategy, things to avoid
Staging & Risks natural breakpoints, failure modes, rollback, external dependencies
Verification test plan, acceptance gate

All Q&A is appended to .context/plans/<plan_name>.qa.md (audit trail).

Phase 3 — Assemble

Writes the plan to .context/plans/<plan_name>.md with every section the viewer renders — Context, Goal, Scope, Approach (with Mermaid), per-Phase task checklists with Files-touched lists, Risks table, Verification Plan, Rollback, Open Questions. Sections that don't apply are written as N/A — reason rather than omitted.

Read the full file on GitHub · 154 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. 3d ago First seen · 154 lines · 0 tokens per session scan A 40444d179748

Subscribe to this mod's changes

agent-plan is a command published in the GitHub repository ruizrica/toolkit (5 stars, last pushed 18d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,583 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.