plan

A specification-generation workflow step that turns an approved technical design into an implementation-ready OpenSpec. The output contains required behaviors and Gherkin scenarios, which describe software behavior as examples.

In plain words
What is it for?
Use it to generate software requirements, write behavior scenarios, review the specification, and optionally examine specific technical areas in more detail.
Why use it?
It gives a coding agent precise requirements to follow and provides review steps before implementation begins. This reduces ambiguity between product decisions and code.

Command

Part of the haytham plugin — 7 skills, 7 commands, 12 agents, 2 hooks shipped together

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/arslan70/haytham/plan
Clone the repo
git clone --depth 1 https://github.com/arslan70/haytham

Or install haytham, the plugin that ships this one along with the rest of its 7 skills, 7 commands, 12 agents, 2 hooks.

Per session 15 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,301 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.00015 $0.01301
Opus 5 $0.00008 $0.00651
Sonnet 5 $0.00003 $0.00260
Haiku 4.5 $0.00002 $0.00130

Measured 3d ago against content hash 1c68df07a7f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

commands/plan.md · 130 lines

How it starts

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

Haytham: Specification Generation (Phase 4 - SPECS)

You are running Phase 4 of the Haytham validation workflow. This phase generates an implementation-ready OpenSpec that a coding agent can use to build the system.

IMPORTANT: Always read agent output from files, not from conversation history.

Progress Tracking

After prerequisites pass, call TodoWrite once with:

  1. Step 1 — OpenSpec generation
  2. Step 2 — Review
  3. Step 3 — Detail review (optional drill-in)

Mark each todo in_progress when its step begins and completed when its output is produced or the founder finishes the review. Step 3 completes immediately if the founder says "looks good" without requesting a drill-in.

Prerequisites

Verify .haytham/session/phase-3-how/gate-decision.json exists. If it doesn't, tell the user:

"Phase 3 (technical design) must be completed first. Run /haytham:design to start."

Roadmap

Before launching any agents, tell the user:

Phase 4: Specification Generation

This will run 3 steps:

  1. OpenSpec Generation — produce SHALL requirements with Gherkin scenarios (~2 min)
  2. Review — you review the specification
  3. Detail Review — drill into specific domains if needed

Estimated total: ~3 minutes.

Step 1: OpenSpec Generation

Create .haytham/session/phase-4-specs/ directory if it doesn't exist.

Tell the user:

Step 1/3: OpenSpec Generation Turning capabilities and architecture decisions into a complete specification with SHALL requirements and testable scenarios.

Launch a spec-generator agent with this task:

Read capabilities from .haytham/session/phase-2-what/capabilities.json, MVP scope from .haytham/session/phase-2-what/mvp-scope.md, system traits from .haytham/session/phase-2-what/system-traits.json, architecture decisions from .haytham/session/phase-3-how/architecture-decisions.json, build/buy analysis from .haytham/session/phase-3-how/build-buy.json, and concept anchor from .haytham/session/phase-1-why/concept-anchor.json. Generate the OpenSpec directory tree. Write to .haytham/session/phase-4-specs/openspec/ (config.yaml, project.md, and specs/*/spec.md).

Read the full file on GitHub · 130 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 · 130 lines · 15 tokens per session scan A 1c68df07a7f0

Subscribe to this mod's changes

plan is a command published in the GitHub repository arslan70/haytham (13 stars, last pushed 1mo ago), licensed MIT. It adds 15 tokens to every session and 1,301 once invoked, about $0.0001 per session on Opus 5. 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-30.