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.
npx agentmods add commands/marcelsud/spec-driven-agentic-development/diagramgit clone --depth 1 https://github.com/marcelsud/spec-driven-agentic-developmentWhat 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 | $0.00009 | $0.02310 |
| Opus 5 | $0.00005 | $0.01155 |
| Sonnet 5 | $0.00002 | $0.00462 |
| Haiku 4.5 | $0.00001 | $0.00231 |
Grade A, and why
diagram 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.
How it starts
The opening of the file, as written. The whole thing — 401 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate Feature Diagrams
Generate Mermaid diagrams to visualize architecture, flows, and relationships from feature specifications.
Feature: $ARGUMENTS
Feature Selection
-
IF a feature name is provided in
$ARGUMENTS:- Find a directory in
features/that matches$ARGUMENTS - If no exact match, search for closest match and ask for confirmation
- Find a directory in
-
IF no feature name is provided:
- List all directories under
features/ - If only one exists, select it automatically
- If multiple exist, ask user to specify using
AskUserQuestion
- List all directories under
Your Task
Generate Mermaid diagrams that visualize the feature's architecture and flows based on its specification.
Process
Step 1: Load Feature Context
Read the specification files:
features/[feature-name]/context.mdfeatures/[feature-name]/requirements.md
Extract key information:
- Components: From Technical Decisions and Architecture sections
- Actors: Users, external systems, services mentioned
- Data flows: How data moves through the system
- States: Any state-driven (WHILE) requirements
- Decisions: Conditional (IF/THEN) and event-driven (WHEN/THEN) logic
Step 2: Ask User for Diagram Types
Use AskUserQuestion with multiSelect enabled:
"Which diagram type(s) would you like to generate for [feature-name]?"
Options:
- Flowchart - Process flows and decision logic (best for IF/THEN, WHEN/THEN requirements)
- Sequence Diagram - Actor interactions and API calls (best for multi-component flows)
- Class Diagram - Component and entity relationships (best for data models)
- State Diagram - State transitions and lifecycle (best for WHILE requirements)
- ER Diagram - Data model and entity relationships (best for database design)
Step 3: Generate Selected Diagrams
For each selected diagram type, analyze the spec and generate appropriate Mermaid code.
Flowchart Generation
Best for: Process flows, conditional logic, decision trees
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.
- 3d ago First seen · 401 lines · 9 tokens per session scan A 21a66f553258
diagram is a command published in the GitHub repository marcelsud/spec-driven-agentic-development (174 stars, last pushed 9mo ago), licensed MIT. It adds 9 tokens to every session and 2,310 once invoked, about $0.0000 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.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.