Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/srnichols/plan-forgenpx agentmods add commands/srnichols/plan-forge/step2-harden-planWrote 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.
[](https://agentmods.dev/commands/srnichols/plan-forge/step2-harden-plan)<a href="https://agentmods.dev/commands/srnichols/plan-forge/step2-harden-plan"><img src="https://agentmods.dev/badge/commands/srnichols/plan-forge/step2-harden-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.
<a href="https://agentmods.dev/commands/srnichols/plan-forge/step2-harden-plan"><img src="https://agentmods.dev/badge/commands/srnichols/plan-forge/step2-harden-plan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00027 | $0.05817 |
| Opus 5 | $0.00014 | $0.02908 |
| Sonnet 5 | $0.00005 | $0.01163 |
| Haiku 4.5 | $0.00003 | $0.00582 |
Grade C, and why
step2-harden-plan scanned grade C with 3 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 today.
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.
Downloads and executes remote codehighSupply chain
curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.
| **No `/dev/stdin`** | `curl ... \| node -e "...readFileSync('/dev/stdin',...)"` | `readFileSync(0,'utf8')` for fd 0, or move to vitest | Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
| **No `/dev/stdin`** | `curl ... \| node -e "...readFileSync('/dev/stdin',...)"` | `readFileSync(0,'utf8')` for fd 0, or move to vitest | Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
Gate commands run via `execSync` on the host OS — on Windows this means `cmd.exe`, not bash. How it starts
The opening of the file, as written. The whole thing — 337 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Step 2: Harden the Plan
Pipeline: Step 2 of 5 (Session 1 — Plan Hardening) When: After pre-flight passes (Step 1) Model suggestion: Claude (best at structured plan generation and scope contract design) Next Step:
step3-execute-slice.prompt.md(new session)
⚠️ Do not harden plans with headless
gh copilot(meta-bug #86).gh copilotin-p/--autopilotmode runs in a sandboxed session that cannot write to your repository regardless of the flags you pass (--allow-all,--allow-all-tools --allow-all-paths --no-ask-user,--yolo --no-ask-userall fail the same way). The CLI will either exit 1 withPermission denied and could not request permission from user, or exit 0 with the edits written to~/.copilot/session-state/<sid>/files/instead of your repo.Use interactive hardening instead: open this prompt in VS Code Copilot chat (agent mode), or call
forge_master_askwithmode: "harden". Both can write to the workspace directly.
Replace <YOUR-PLAN> with your plan filename (without path or .md extension).
Read these files first:
- docs/plans/AI-Plan-Hardening-Runbook.md
- docs/plans/.md
- docs/plans/DEPLOYMENT-ROADMAP.md
- .github/copilot-instructions.md
Also check for prior phase lessons (if they exist — skip if not found):
/memories/repo/conventions.md— patterns and conventions from earlier phases/memories/repo/lessons-learned.md— past mistakes to avoid/memories/repo/forbidden-patterns.md— patterns that caused regressions
Prior plan postmortems (Phase-25 L5 closed loop):
Before hardening, also scan .forge/plans/<plan-basename>/postmortem-*.json for
the plan you are hardening (same basename as the draft). If any exist, read the
newest 3 and factor them into the Scope Contract:
- If
retriesPerSliceshows a slice that flapped 3+ times, strengthen its validation gate or split it into smaller slices. - If
gateFlaps > 0on multiple prior runs, your gate commands are unstable — replace grep/pipe-based gates with allowlisted node assertions. - If
topFailureReasonrepeats across postmortems, add a mitigation in the current plan's Risks section and reference the prior failure. - If
costDelta.deltatrends upward across runs, flag a budget risk in the plan's Budget section. - If no postmortems exist, note "No prior postmortems — first execution."
This is a READ of the postmortems — do NOT modify them. Pure signal for the hardener.
Now act as a PLAN HARDENING AGENT (see the Plan Hardening Prompt in the runbook).
CLARIFICATION CHECK: Before hardening, scan the plan for [NEEDS CLARIFICATION] markers.
If any exist, list them all and wait for the user to resolve them before proceeding.
Harden .md by adding all 6 Mandatory Template Blocks from the runbook:
- Scope Contract (in-scope, out-of-scope, forbidden actions)
- Required Decisions (flag anything implicit as TBD)
- Acceptance Criteria (use MUST: and SHOULD: prefixes for each criterion — the analyzer scores these)
- Execution Slices (30-120 min each, with Depends On + Context Files + Parallelism tag)
- Re-anchor Checkpoints
- Definition of Done (must include Reviewer Gate checkbox)
- Stop Conditions
IMPORTANT: Format Acceptance Criteria as:
- **MUST**: Description of required criterion
- **SHOULD**: Description of recommended criterion
Do NOT use - [ ] checkbox format — the analyzer cannot score checkboxes as effectively.
For each Execution Slice:
- Tag as [parallel-safe] (with Parallel Group) or [sequential]
- Include relevant .github/instructions/*.instructions.md files in Context Files
- List only instruction files whose domain matches the slice (not all 17 — each consumes context budget)
- Add a Parallel Merge Checkpoint after each parallel group
- Validation gates MUST be executable commands, not prose descriptions:
- Good:
**Validation Gate**:\n\``bash\ndotnet test\n```` - Good:
**Validation Gate**: \dotnet build`` - Bad:
**Validation Gate**: Files compile, DTOs have correct properties - For manual checks that can't be automated, prefix with
[manual]:**Validation Gate**: [manual] UI layout matches mockup
- Good:
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.
- today First seen · 337 lines · 27 tokens per session scan C 3dfb044d30a9
step2-harden-plan is a command published in the GitHub repository srnichols/plan-forge (5 stars, last pushed today), licensed MIT. It adds 27 tokens to every session and 5,817 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 3 findings (downloads and executes remote code, makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.
Other commands, from other repositories
sdd-init
Initialize SDD context — detects project stack and bootstraps persistence backend.
modernization-flow
Workflow for converting, modernizing, upgrading, or re-architecting code (e.g. C++→Java, monolith→microservices), etc.
init-workspace-flow-discovery
Phase 3 Discovery of init-workspace-flow.
ui-aqa-flow-test-report-analysis
Phase 7 Test Report Analysis of ui-aqa-flow.
ui-aqa-flow-code-analysis
Phase 3 Code Analysis of ui-aqa-flow.
adhoc-flow
Workflow for the rest of tasks: lightweight documentation, build, track, synchronize, etc.