From breeze
Generate a functional specification document from the functional graph. Outputs structured Markdown grouped by persona with citations. Use when: "generate spec", "generate document", "functional spec", "create specification", "export functional graph".
How this skill is triggered — by the user, by Claude, or both
Slash command
/breeze:generate-specThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill needs a `projectUuid` — follow CLAUDE.md's project-resolution rules (`--project` override → `.breeze.json` fallback → announce active project header). Auth handling on Breeze MCP failures is also covered in CLAUDE.md.
This skill needs a projectUuid — follow CLAUDE.md's project-resolution rules (--project override → .breeze.json fallback → announce active project header). Auth handling on Breeze MCP failures is also covered in CLAUDE.md.
Determine scope from $ARGUMENTS:
If $ARGUMENTS is empty or missing, do NOT generate anything.
Instead, present the user with a guide:
**What would you like to generate?**
| Option | Command | Description |
|--------|---------|-------------|
| **Plain Markdown** | `--plain` | Functional Requirements Document with numbered sections (FR-001), scenario IDs (SC-01), nested step/action format. Best for: quick reference, sharing in PRs, formal specs. |
| **Rich Markdown** | `--full` | Everything in plain + AI-synthesized document overview, project context, business objectives, stakeholders, per-outcome business value, NFR section, glossary. Best for: stakeholder reviews, client deliverables, comprehensive documentation. |
| **Plain HTML** | `--html` | Interactive single-file viewer with sidebar navigation, search, collapsible accordions, light/dark theme. Best for: team browsing, client demos, embedding in wikis. |
| **Rich HTML** | `--html --full` | Everything in plain HTML + all AI enrichments rendered visually — stakeholder cards, persona descriptions. Best for: client deliverables, executive presentations, full specification review. |
**Additional options** (append to any command above):
- `--mermaid` — Include mermaid workflow diagrams per outcome (requires `--full`)
- Scope: full project (default), single persona, or single outcome
**Examples:**
- `/breeze:generate-spec --plain` — plain FRD markdown
- `/breeze:generate-spec --full --mermaid` — rich FRD with diagrams
- `/breeze:generate-spec --html --full --mermaid` — rich HTML with diagrams
- `/breeze:generate-spec --full "Financial Institution User"` — single persona
**Export to other formats** (after generating markdown):
- Word: `/breeze:generate-spec --export docx`
- PDF: `/breeze:generate-spec --export pdf`
**After generation**, you can review and give feedback to improve any section — I'll update and regenerate instantly.
What would you like to generate?
Wait for the user to choose before proceeding.
--export)When $ARGUMENTS contains --export docx or --export pdf:
Check if {project-name}-functional-spec.md exists in the project root.
If not, tell the user to generate the markdown first.
Check if pandoc is installed:
which pandoc
If not found, tell the user:
"pandoc is required for export. Install it with:
sudo apt install pandoc (Linux) or brew install pandoc (Mac)"
Pre-render mermaid diagrams:
python3 {SKILL_BASE_DIR}/scripts/render-mermaid.py {project-name}-functional-spec.md {project-name}-functional-spec-export.md
{project-name}-functional-spec-export.md for conversion{project-name}-functional-spec.md directly{project-name}-functional-spec.md
("Mermaid diagrams will appear as code blocks. Install chromium for rendered diagrams.")Run the conversion:
# For DOCX
pandoc <source.md> -o {project-name}-functional-spec.docx --from=gfm
# For PDF (requires a LaTeX engine)
pandoc <source.md> -o {project-name}-functional-spec.pdf --from=gfm --pdf-engine=xelatex
Clean up temporary files:
rm -rf _mermaid_images/ {project-name}-functional-spec-export.md
Print: "Exported to {project-name}-functional-spec.docx" (or .pdf)
Note: The --full markdown works best for export since it includes
all the enrichment content (including mermaid diagrams rendered as
images). Plain markdown exports work too but will be more concise.
If the scope is ambiguous, ask the user to clarify.
Call Get_complete_functional_graph with the project UUID.
This returns the entire hierarchy in a single call:
{
project: { ... },
personas: [
{
id, persona, outcomes: [
{
id, outcome, description, citations, scenarios: [
{
id, scenario, description, steps: [
{
id, step, description, order, actions: [
{ id, action, description, order }
]
}
]
}
]
}
]
}
],
summary: { ... }
}
The response will be large (often 500K+ characters) and will be auto-saved to a file on disk. This is expected — NOT an error. The file path will be shown in the tool result message.
To process the data, use Bash with python3 or jq to:
personas array from the nested wrapper:
data[0].text → parse JSON → [0].text → parse JSON → [0].data.personasThis approach avoids loading the entire graph into the conversation context. Use a single Bash script to read, transform, and write.
If scope is a specific persona, filter the personas array
to that persona only.
If scope is a specific outcome, find it within the personas array and generate only that outcome's section (include the parent persona name for context).
For scoped queries, you MAY use the individual hierarchy tools instead to avoid the expensive full-graph call:
Get_all_personas -> Get_all_outcomes_for_a_persona_id
-> Get_all_scenarios_for_a_outcome_id
-> Get_all_steps_actions_for_a_scenario_idParallelize calls at each level.
citations from outcome entities. Citations contain
documentId and documentName. Collect unique document names
for the Sources column.Once all data is collected, generate a single Markdown document following the structure below exactly.
--plain or default)Use this mode when $ARGUMENTS does NOT contain --full.
Generates a Functional Requirements Document (FRD) with nested structure:
# {Project Name}
## Functional Requirements Document
| | |
|---|---|
| **Version** | 1.0 |
| **Date** | {current date} |
| **Source** | Breeze.AI Functional Graph — {N} personas, {N} outcomes, ... |
---
## Table of Contents
1. [Persona Summary](#persona-summary)
2. [FR-001 — {Persona Name}](#fr-001--{persona-slug})
- 2.1 [{Outcome Name}](#anchor)
---
## 1. Persona Summary
| ID | Persona | Outcomes | Description |
|----|---------|----------|-------------|
| FR-001 | {Persona Name} | {N} | |
---
## 2. FR-001 — {Persona Name}
### 2.1 {Outcome Name}
> **Sources:** `{document1.pdf}`, `{document2.pdf}`
- **SC-01 {Scenario Name}** — {description}
- **Step 1: {Step Name}**
- → {Action 1}
- → {Action 2}
- **Step 2: {Step Name}**
- → {Action 1}
- **SC-02 {Scenario 2}**
- **Step 1: {Step Name}**
- → {Action 1}
---
Format rules:
order attribute when present--full)Use this mode when $ARGUMENTS contains --full.
Generates the same FRD structure as plain mode, plus AI-synthesized enrichment sections:
## 1. Document Overview
{Executive summary synthesized from all personas, outcomes, scenarios}
| | |
|---|---|
| **Personas** | {N} |
| **Outcomes** | {N} |
...
## 2. Project Context
### Key Business Objectives
1. {Objective}
### Key Stakeholders
| Role | Interest |
|------|----------|
| {Persona name} | {What they care about} |
### Key Capabilities
- {Capability}
The persona summary table includes descriptions, and per-outcome sections include business value text.
Full mode rules:
--mermaid flag is
passed. Do NOT generate them otherwise.After generating the document:
Use the project name from the graph data for output filenames.
Lowercase and hyphenate: e.g., "Kinective" → kinective-functional-spec.md.
Use the markdown generator script:
# Plain mode (no enrichments)
python3 {SKILL_BASE_DIR}/scripts/generate-markdown.py <saved-json-file> {project-name}-functional-spec.md
# Full mode with enrichments
python3 {SKILL_BASE_DIR}/scripts/generate-markdown.py <saved-json-file> {project-name}-functional-spec.md --enrichments enrichments.json
The script generates a Functional Requirements Document (FRD) with:
order attribute when present--enrichments): adds document overview, project
context, business objectives, stakeholders, persona descriptions,
per-outcome business value, optional mermaid diagrams, NFR and
glossary sectionsCustom templates (requires pip install jinja2):
python3 {SKILL_BASE_DIR}/scripts/generate-markdown.py <saved-json-file> output.md --template /path/to/custom.md.j2
Built-in templates are in {SKILL_BASE_DIR}/scripts/templates/:
frd-plain.md.j2 — FRD markdown (default, no enrichments)frd-full.md.j2 — FRD with enrichments (overview, context, NFR, glossary)plain.html.j2 — HTML without enrichmentsfull.html.j2 — HTML with enrichmentsTemplates receive a standard context with personas (preprocessed with
_outcomes, _scenarios, _sorted_steps, _enrichment etc.),
project_name, generated, totals, enrichments, and
has_enrichments. See template_engine.py for the full context schema
and available Jinja2 filters (slugify, escape_pipe, e, url_encode,
sort_by_order, get_citations).
Print a summary:
Written to {project-name}-functional-spec.md
{N} personas, {N} outcomes, {N} scenarios, {N} steps, {N} actions
To convert to other formats:
docx: pandoc {project-name}-functional-spec.md -o {project-name}-functional-spec.docx
pdf: pandoc {project-name}-functional-spec.md -o {project-name}-functional-spec.pdf
html: use --html flag instead
--html)When $ARGUMENTS contains --html:
Call Get_complete_functional_graph to get the full graph JSON.
The response will be saved to a file on disk (expected behavior).
If --full is also present, generate AI enrichments using
the extraction script and AI synthesis:
a. Run the extraction script to produce a compact outline:
python3 {SKILL_BASE_DIR}/scripts/extract-graph-summary.py <saved-json-file> outline outline.json
This produces a ~60-130 KB JSON with persona/outcome/scenario names and step names — small enough to read in conversation context.
b. Read outline.json (in chunks if needed per persona) and
synthesize the top-level enrichments:
executiveSummary, keyBusinessObjectives, keyStakeholders,
keyCapabilities, personaEnrichmentsc. For per-outcome enrichments, use batch extraction:
python3 {SKILL_BASE_DIR}/scripts/extract-graph-summary.py <saved-json-file> batch outcome-details/
This produces one JSON file per outcome (~2-10KB each) in
outcome-details/ with a _manifest.json index. Read each
outcome file and synthesize its enrichments.
Alternatively, for a single outcome:
python3 {SKILL_BASE_DIR}/scripts/extract-graph-summary.py <saved-json-file> outcome <outcome-id> outcome-detail.json
d. Write the combined enrichments.json file:
{
"executiveSummary": "2-3 paragraph overview...",
"keyBusinessObjectives": ["Objective 1", "Objective 2"],
"keyStakeholders": [
{
"role": "<actual persona name>",
"interest": "What this persona cares about"
}
],
"keyCapabilities": ["Capability 1", "Capability 2"],
"personaEnrichments": {
"<persona-name>": {
"description": "1-2 sentence description"
}
},
"outcomeEnrichments": {
"<outcome-id>": {
"businessValue": "1-2 sentence value statement",
"mermaidDiagram": "graph TD\n A[Persona] -->|action| B[Feature]" // only if --mermaid
}
}
}
Synthesis guidelines:
Top-level (from outline):
Per-outcome (from outcome detail files): Synthesize across ALL scenarios — do not document individually.
--mermaid flag is present):
graph TD format. Represent the outcome as a container/subgraph.
Show high-level flow and dependencies. 5-10 nodes max. Avoid
UI-level or step-level detail. Skip for straightforward CRUD
outcomes. Do NOT generate mermaid diagrams unless the user
explicitly passes --mermaid.Run the HTML generator script:
# Without enrichments (--html only)
python3 {SKILL_BASE_DIR}/scripts/generate-html.py <saved-json-file> {project-name}-functional-spec.html
# With enrichments (--html --full)
python3 {SKILL_BASE_DIR}/scripts/generate-html.py <saved-json-file> {project-name}-functional-spec.html --enrichments enrichments.json
# Custom template (requires pip install jinja2)
python3 {SKILL_BASE_DIR}/scripts/generate-html.py <saved-json-file> output.html --template /path/to/custom.html.j2
Where {SKILL_BASE_DIR} is the base directory of this skill
(provided at the top of the skill prompt).
The script:
After generating a document, the user may want to review and improve it. The enrichments architecture makes this a simple edit-regenerate loop.
The AI-synthesized content lives in enrichments.json, separate from
the graph data. The scripts (generate-html.py, generate-markdown.py)
are pure renderers — they just combine graph + enrichments into output.
So to improve the document:
enrichments.json (targeted edit, not full regeneration)When the user gives feedback after document generation:
Check if enrichments.json exists in the project root.
If yes, read it — you'll edit it, not regenerate from scratch.
Map feedback to enrichment fields:
| User says | Edit in enrichments.json |
|---|---|
| "executive summary is too generic" | Update executiveSummary |
| "wrong persona description" | Update personaEnrichments.<name>.description |
| "mermaid for X is wrong" | Update outcomeEnrichments.<id>.mermaidDiagram |
| "stakeholder interest is inaccurate" | Update keyStakeholders[].interest |
| "this outcome description doesn't reflect what it does" | Update outcomeEnrichments.<id>.businessValue |
For deeper feedback (e.g., "the Manage Integrations section doesn't capture the full workflow"), use the extraction script to get the outcome detail, re-read the scenarios, and update the relevant enrichment fields with better synthesis:
python3 {SKILL_BASE_DIR}/scripts/extract-graph-summary.py <saved-json-file> outcome <outcome-id> /tmp/outcome-detail.json
Read the detail, re-synthesize, update enrichments.json.
Re-run the generator script (same command as initial generation):
# For HTML
python3 {SKILL_BASE_DIR}/scripts/generate-html.py <saved-json-file> {project-name}-functional-spec.html --enrichments enrichments.json
# For Markdown
python3 {SKILL_BASE_DIR}/scripts/generate-markdown.py <saved-json-file> {project-name}-functional-spec.md --enrichments enrichments.json
Tell the user what was changed and that the document has been regenerated.
This skill currently supports --type functional only (the default).
Future versions may support:
--type architecture — Generate from architecture ontology--type code — Generate from code ontologyDo NOT implement these yet. If the user asks for them, inform them that only functional document generation is currently supported.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub accionlabs/breezeai-hubexo-plugin