Initial commit
This commit is contained in:
47
commands/c4-generate.md
Normal file
47
commands/c4-generate.md
Normal file
@@ -0,0 +1,47 @@
|
||||
---
|
||||
description: Generate C4 diagrams from a Feature Design Document (FDD). Usage: /generate-c4 <path-to-fdd.md> [output-folder] [--no-images]
|
||||
---
|
||||
|
||||
You MUST invoke the c4-diagram-generator agent using the Task tool with subagent_type="c4-diagram-generator".
|
||||
|
||||
Extract the FDD file path, optional output folder, and optional --no-images flag from the command arguments:
|
||||
- FDD file path (required)
|
||||
- Output folder (optional, default: "docs/c4")
|
||||
- --no-images flag (optional, if present: skip PNG generation, if absent: generate PNG images by default)
|
||||
|
||||
Pass the following prompt to the agent:
|
||||
|
||||
"Generate C4 diagrams from the Feature Design Document located at [FDD_FILE_PATH].
|
||||
|
||||
Output folder: [OUTPUT_FOLDER]
|
||||
PNG generation: [PNG_INSTRUCTION]
|
||||
|
||||
Execute your complete workflow (Phases 1-6) following all internal guidelines.
|
||||
|
||||
CRITICAL REMINDERS:
|
||||
- Create separate .puml files using Write tool for EACH diagram (c1, c2, c3, c4) - this is MANDATORY
|
||||
- Create ONE .md file with analysis ONLY (NO PlantUML code inside)
|
||||
- Only generate diagrams with sufficient FDD information - never fabricate
|
||||
- [PNG_BEHAVIOR]
|
||||
|
||||
REPORT must include:
|
||||
- Detected language of FDD
|
||||
- Explicit list of ALL created files (.puml, .md, and .png if applicable)
|
||||
- Number of diagrams generated with brief justification
|
||||
- Skipped diagrams with specific reasons
|
||||
- Verification: 'Created N .puml files for N diagrams'
|
||||
- PNG generation results (if applicable)"
|
||||
|
||||
Replace [FDD_FILE_PATH] with the actual file path from command arguments.
|
||||
Replace [OUTPUT_FOLDER] with the specified output folder or "docs/c4" if not provided.
|
||||
Replace [feature-name] with the appropriate feature name extracted from the FDD filename.
|
||||
|
||||
Replace [PNG_INSTRUCTION] and [PNG_BEHAVIOR] based on --no-images flag:
|
||||
|
||||
If --no-images flag IS present:
|
||||
- [PNG_INSTRUCTION] = "DISABLED"
|
||||
- [PNG_BEHAVIOR] = "Skip PNG generation (Phase 5.6) entirely"
|
||||
|
||||
If --no-images flag IS NOT present (default):
|
||||
- [PNG_INSTRUCTION] = "ENABLED"
|
||||
- [PNG_BEHAVIOR] = "Execute Phase 5.6: Generate PNG images with automatic error correction (max 3 attempts per file)"
|
||||
57
commands/mermaid-generate.md
Normal file
57
commands/mermaid-generate.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
description: Generate Mermaid diagrams from a Feature Design Document (FDD). Usage: /generate-mermaid <path-to-fdd.md> [output-folder]
|
||||
---
|
||||
|
||||
You MUST invoke the mermaid-diagram-generator agent using the Task tool with subagent_type="mermaid-diagram-generator".
|
||||
|
||||
Extract the FDD file path and optional output folder from the command arguments:
|
||||
- FDD file path (required)
|
||||
- Output folder (optional, default: "docs/mermaid")
|
||||
|
||||
Pass the following detailed prompt to the agent:
|
||||
|
||||
"Generate Mermaid diagrams from the Feature Design Document located at [FDD_FILE_PATH].
|
||||
|
||||
Output folder: [OUTPUT_FOLDER]
|
||||
|
||||
The agent will execute its complete workflow (Phases 1-9). Your task is to ensure the agent receives the correct FDD path and output folder.
|
||||
|
||||
Key requirements the agent will follow:
|
||||
|
||||
ANALYSIS & SELECTION:
|
||||
- Read FDD completely and detect language (Portuguese, English, Spanish, etc.)
|
||||
- Extract explicit elements and identify what is central to system success
|
||||
- Evaluate significance rigorously using 5 criteria (main flow, difficult parts, architectural decisions, public contracts, relationships)
|
||||
- Select appropriate diagram types (Sequence, Flowchart TD/LR, Class, ER)
|
||||
- Prune to most valuable diagrams (typical: 6-8, up to 10 maximum if truly justified)
|
||||
|
||||
GENERATION:
|
||||
- Create ONE markdown file: [OUTPUT_FOLDER]/[feature-name]-diagrams.md
|
||||
- Translate ALL section headers to FDD language with proper accents
|
||||
- Keep technical terms in English (Service, Gateway, Redis, etc.)
|
||||
- Write concise paragraphs (3-5 sentences) for each diagram
|
||||
- Use concise labels (3 words max per node)
|
||||
- Use proper accents EVERYWHERE (markdown text AND diagram node labels)
|
||||
- Apply Mermaid syntax validation and guardrails automatically
|
||||
|
||||
QUALITY ASSURANCE:
|
||||
- Mandatory internal review: re-read FDD and document, identify and correct ALL inconsistencies
|
||||
- Validate: language matches FDD, 1-10 diagrams (typical: 6-8), significance criteria met, no redundancy/fabrication/excluded items
|
||||
- Create self-contained complete file
|
||||
- Report: detected language, file path, number of diagrams, rationale, validation results
|
||||
|
||||
CRITICAL RULES:
|
||||
- Never invent information not in the FDD
|
||||
- Generate diagrams in FDD language with proper accents EVERYWHERE
|
||||
- Better 6 excellent diagrams than 10 mediocre ones
|
||||
- Mandatory internal review before completion
|
||||
- Keep technical terms in English
|
||||
- No emojis anywhere
|
||||
- Use proper accents in node labels (Mermaid supports UTF-8)
|
||||
- Keep node labels simple; avoid complex expressions
|
||||
- Put technical details in notes section below diagram, not in labels
|
||||
- The agent handles all syntax validation and guardrails automatically"
|
||||
|
||||
Replace [FDD_FILE_PATH] with the actual file path from command arguments.
|
||||
Replace [OUTPUT_FOLDER] with the specified output folder or "docs/mermaid" if not provided.
|
||||
Replace [feature-name] with the appropriate feature name extracted from the FDD filename (e.g., "ratelimiter" from "ratelimiter-fdd.md").
|
||||
Reference in New Issue
Block a user