musubi-sdd 5.1.0 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +106 -48
- package/README.md +110 -32
- package/bin/musubi-analyze.js +74 -67
- package/bin/musubi-browser.js +27 -26
- package/bin/musubi-change.js +48 -47
- package/bin/musubi-checkpoint.js +10 -7
- package/bin/musubi-convert.js +25 -25
- package/bin/musubi-costs.js +27 -10
- package/bin/musubi-gui.js +52 -46
- package/bin/musubi-init.js +1952 -10
- package/bin/musubi-orchestrate.js +327 -239
- package/bin/musubi-remember.js +69 -56
- package/bin/musubi-resolve.js +53 -45
- package/bin/musubi-trace.js +51 -22
- package/bin/musubi-validate.js +39 -30
- package/bin/musubi-workflow.js +33 -34
- package/bin/musubi.js +39 -2
- package/package.json +1 -1
- package/src/agents/agent-loop.js +94 -95
- package/src/agents/agentic/code-generator.js +119 -109
- package/src/agents/agentic/code-reviewer.js +105 -108
- package/src/agents/agentic/index.js +4 -4
- package/src/agents/browser/action-executor.js +13 -13
- package/src/agents/browser/ai-comparator.js +11 -10
- package/src/agents/browser/context-manager.js +6 -6
- package/src/agents/browser/index.js +5 -5
- package/src/agents/browser/nl-parser.js +31 -46
- package/src/agents/browser/screenshot.js +2 -2
- package/src/agents/browser/test-generator.js +6 -4
- package/src/agents/function-tool.js +71 -65
- package/src/agents/index.js +7 -7
- package/src/agents/schema-generator.js +98 -94
- package/src/analyzers/ast-extractor.js +158 -146
- package/src/analyzers/codegraph-auto-update.js +858 -0
- package/src/analyzers/complexity-analyzer.js +536 -0
- package/src/analyzers/context-optimizer.js +241 -126
- package/src/analyzers/impact-analyzer.js +1 -1
- package/src/analyzers/large-project-analyzer.js +766 -0
- package/src/analyzers/repository-map.js +77 -81
- package/src/analyzers/security-analyzer.js +19 -11
- package/src/analyzers/stuck-detector.js +19 -17
- package/src/converters/index.js +78 -57
- package/src/converters/ir/types.js +12 -12
- package/src/converters/parsers/musubi-parser.js +134 -126
- package/src/converters/parsers/openapi-parser.js +70 -53
- package/src/converters/parsers/speckit-parser.js +239 -175
- package/src/converters/writers/musubi-writer.js +123 -118
- package/src/converters/writers/speckit-writer.js +124 -113
- package/src/generators/rust-migration-generator.js +512 -0
- package/src/gui/public/index.html +1365 -1211
- package/src/gui/server.js +41 -40
- package/src/gui/services/file-watcher.js +23 -8
- package/src/gui/services/project-scanner.js +26 -20
- package/src/gui/services/replanning-service.js +27 -23
- package/src/gui/services/traceability-service.js +8 -8
- package/src/gui/services/workflow-service.js +14 -7
- package/src/index.js +151 -0
- package/src/integrations/cicd.js +90 -104
- package/src/integrations/codegraph-mcp.js +643 -0
- package/src/integrations/documentation.js +142 -103
- package/src/integrations/examples.js +95 -80
- package/src/integrations/github-client.js +17 -17
- package/src/integrations/index.js +5 -5
- package/src/integrations/mcp/index.js +21 -21
- package/src/integrations/mcp/mcp-context-provider.js +76 -78
- package/src/integrations/mcp/mcp-discovery.js +74 -72
- package/src/integrations/mcp/mcp-tool-registry.js +99 -94
- package/src/integrations/mcp-connector.js +70 -66
- package/src/integrations/platforms.js +50 -49
- package/src/integrations/tool-discovery.js +37 -31
- package/src/llm-providers/anthropic-provider.js +11 -11
- package/src/llm-providers/base-provider.js +16 -18
- package/src/llm-providers/copilot-provider.js +22 -19
- package/src/llm-providers/index.js +26 -25
- package/src/llm-providers/ollama-provider.js +11 -11
- package/src/llm-providers/openai-provider.js +12 -12
- package/src/managers/agent-memory.js +36 -24
- package/src/managers/checkpoint-manager.js +4 -8
- package/src/managers/delta-spec.js +19 -19
- package/src/managers/index.js +13 -4
- package/src/managers/memory-condenser.js +35 -45
- package/src/managers/repo-skill-manager.js +57 -31
- package/src/managers/skill-loader.js +25 -22
- package/src/managers/skill-tools.js +36 -72
- package/src/managers/workflow.js +30 -22
- package/src/monitoring/cost-tracker.js +48 -46
- package/src/monitoring/incident-manager.js +116 -106
- package/src/monitoring/index.js +144 -134
- package/src/monitoring/observability.js +75 -62
- package/src/monitoring/quality-dashboard.js +45 -41
- package/src/monitoring/release-manager.js +63 -53
- package/src/orchestration/agent-skill-binding.js +39 -47
- package/src/orchestration/error-handler.js +65 -107
- package/src/orchestration/guardrails/base-guardrail.js +26 -24
- package/src/orchestration/guardrails/guardrail-rules.js +50 -64
- package/src/orchestration/guardrails/index.js +5 -5
- package/src/orchestration/guardrails/input-guardrail.js +58 -45
- package/src/orchestration/guardrails/output-guardrail.js +104 -81
- package/src/orchestration/guardrails/safety-check.js +79 -79
- package/src/orchestration/index.js +38 -55
- package/src/orchestration/mcp-tool-adapters.js +96 -99
- package/src/orchestration/orchestration-engine.js +21 -21
- package/src/orchestration/pattern-registry.js +60 -45
- package/src/orchestration/patterns/auto.js +34 -47
- package/src/orchestration/patterns/group-chat.js +59 -65
- package/src/orchestration/patterns/handoff.js +67 -65
- package/src/orchestration/patterns/human-in-loop.js +51 -72
- package/src/orchestration/patterns/nested.js +25 -40
- package/src/orchestration/patterns/sequential.js +35 -34
- package/src/orchestration/patterns/swarm.js +63 -56
- package/src/orchestration/patterns/triage.js +150 -109
- package/src/orchestration/reasoning/index.js +9 -9
- package/src/orchestration/reasoning/planning-engine.js +143 -140
- package/src/orchestration/reasoning/reasoning-engine.js +206 -144
- package/src/orchestration/reasoning/self-correction.js +121 -128
- package/src/orchestration/replanning/adaptive-goal-modifier.js +107 -112
- package/src/orchestration/replanning/alternative-generator.js +37 -42
- package/src/orchestration/replanning/config.js +63 -59
- package/src/orchestration/replanning/goal-progress-tracker.js +98 -100
- package/src/orchestration/replanning/index.js +24 -20
- package/src/orchestration/replanning/plan-evaluator.js +49 -50
- package/src/orchestration/replanning/plan-monitor.js +32 -28
- package/src/orchestration/replanning/proactive-path-optimizer.js +175 -178
- package/src/orchestration/replanning/replan-history.js +33 -26
- package/src/orchestration/replanning/replanning-engine.js +106 -108
- package/src/orchestration/skill-executor.js +107 -109
- package/src/orchestration/skill-registry.js +85 -89
- package/src/orchestration/workflow-examples.js +228 -231
- package/src/orchestration/workflow-executor.js +65 -68
- package/src/orchestration/workflow-orchestrator.js +72 -73
- package/src/phase4-integration.js +47 -40
- package/src/phase5-integration.js +89 -30
- package/src/reporters/coverage-report.js +82 -30
- package/src/reporters/hierarchical-reporter.js +498 -0
- package/src/reporters/traceability-matrix-report.js +29 -20
- package/src/resolvers/issue-resolver.js +43 -31
- package/src/steering/advanced-validation.js +133 -124
- package/src/steering/auto-updater.js +60 -73
- package/src/steering/index.js +6 -6
- package/src/steering/quality-metrics.js +41 -35
- package/src/steering/steering-auto-update.js +83 -86
- package/src/steering/steering-validator.js +98 -106
- package/src/steering/template-constraints.js +53 -54
- package/src/templates/agents/claude-code/CLAUDE.md +32 -32
- package/src/templates/agents/claude-code/skills/agent-assistant/SKILL.md +13 -5
- package/src/templates/agents/claude-code/skills/ai-ml-engineer/mlops-guide.md +23 -23
- package/src/templates/agents/claude-code/skills/ai-ml-engineer/model-card-template.md +60 -41
- package/src/templates/agents/claude-code/skills/api-designer/api-patterns.md +27 -19
- package/src/templates/agents/claude-code/skills/api-designer/openapi-template.md +11 -7
- package/src/templates/agents/claude-code/skills/bug-hunter/SKILL.md +4 -3
- package/src/templates/agents/claude-code/skills/bug-hunter/root-cause-analysis.md +37 -15
- package/src/templates/agents/claude-code/skills/change-impact-analyzer/dependency-graph-patterns.md +36 -42
- package/src/templates/agents/claude-code/skills/change-impact-analyzer/impact-analysis-template.md +69 -60
- package/src/templates/agents/claude-code/skills/cloud-architect/aws-patterns.md +31 -38
- package/src/templates/agents/claude-code/skills/cloud-architect/azure-patterns.md +28 -23
- package/src/templates/agents/claude-code/skills/code-reviewer/SKILL.md +61 -0
- package/src/templates/agents/claude-code/skills/code-reviewer/best-practices.md +27 -0
- package/src/templates/agents/claude-code/skills/code-reviewer/review-checklist.md +29 -10
- package/src/templates/agents/claude-code/skills/code-reviewer/review-standards.md +29 -24
- package/src/templates/agents/claude-code/skills/constitution-enforcer/SKILL.md +8 -6
- package/src/templates/agents/claude-code/skills/constitution-enforcer/constitutional-articles.md +62 -26
- package/src/templates/agents/claude-code/skills/constitution-enforcer/phase-minus-one-gates.md +35 -16
- package/src/templates/agents/claude-code/skills/database-administrator/backup-recovery.md +27 -17
- package/src/templates/agents/claude-code/skills/database-administrator/tuning-guide.md +25 -20
- package/src/templates/agents/claude-code/skills/database-schema-designer/schema-patterns.md +39 -22
- package/src/templates/agents/claude-code/skills/devops-engineer/ci-cd-templates.md +25 -22
- package/src/templates/agents/claude-code/skills/issue-resolver/SKILL.md +24 -21
- package/src/templates/agents/claude-code/skills/orchestrator/SKILL.md +148 -63
- package/src/templates/agents/claude-code/skills/orchestrator/patterns.md +35 -16
- package/src/templates/agents/claude-code/skills/orchestrator/selection-matrix.md +69 -64
- package/src/templates/agents/claude-code/skills/performance-engineer/optimization-playbook.md +47 -47
- package/src/templates/agents/claude-code/skills/performance-optimizer/SKILL.md +69 -0
- package/src/templates/agents/claude-code/skills/performance-optimizer/benchmark-template.md +63 -45
- package/src/templates/agents/claude-code/skills/performance-optimizer/optimization-patterns.md +33 -35
- package/src/templates/agents/claude-code/skills/project-manager/SKILL.md +7 -6
- package/src/templates/agents/claude-code/skills/project-manager/agile-ceremonies.md +47 -28
- package/src/templates/agents/claude-code/skills/project-manager/project-templates.md +94 -78
- package/src/templates/agents/claude-code/skills/quality-assurance/SKILL.md +20 -17
- package/src/templates/agents/claude-code/skills/quality-assurance/qa-plan-template.md +63 -49
- package/src/templates/agents/claude-code/skills/release-coordinator/SKILL.md +5 -5
- package/src/templates/agents/claude-code/skills/release-coordinator/feature-flag-guide.md +30 -26
- package/src/templates/agents/claude-code/skills/release-coordinator/release-plan-template.md +67 -35
- package/src/templates/agents/claude-code/skills/requirements-analyst/ears-format.md +54 -42
- package/src/templates/agents/claude-code/skills/requirements-analyst/validation-rules.md +36 -33
- package/src/templates/agents/claude-code/skills/security-auditor/SKILL.md +77 -19
- package/src/templates/agents/claude-code/skills/security-auditor/audit-checklists.md +24 -24
- package/src/templates/agents/claude-code/skills/security-auditor/owasp-top-10.md +61 -20
- package/src/templates/agents/claude-code/skills/security-auditor/vulnerability-patterns.md +43 -11
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/SKILL.md +1 -0
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/incident-response-template.md +55 -25
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/observability-patterns.md +78 -68
- package/src/templates/agents/claude-code/skills/site-reliability-engineer/slo-sli-guide.md +73 -53
- package/src/templates/agents/claude-code/skills/software-developer/solid-principles.md +83 -37
- package/src/templates/agents/claude-code/skills/software-developer/test-first-workflow.md +38 -31
- package/src/templates/agents/claude-code/skills/steering/SKILL.md +1 -0
- package/src/templates/agents/claude-code/skills/steering/auto-update-rules.md +31 -0
- package/src/templates/agents/claude-code/skills/system-architect/adr-template.md +25 -7
- package/src/templates/agents/claude-code/skills/system-architect/c4-model-guide.md +74 -61
- package/src/templates/agents/claude-code/skills/technical-writer/doc-templates/documentation-templates.md +70 -52
- package/src/templates/agents/claude-code/skills/test-engineer/SKILL.md +2 -0
- package/src/templates/agents/claude-code/skills/test-engineer/ears-test-mapping.md +75 -71
- package/src/templates/agents/claude-code/skills/test-engineer/test-types.md +85 -63
- package/src/templates/agents/claude-code/skills/traceability-auditor/coverage-matrix-template.md +39 -36
- package/src/templates/agents/claude-code/skills/traceability-auditor/gap-detection-rules.md +22 -17
- package/src/templates/agents/claude-code/skills/ui-ux-designer/SKILL.md +1 -0
- package/src/templates/agents/claude-code/skills/ui-ux-designer/accessibility-guidelines.md +49 -75
- package/src/templates/agents/claude-code/skills/ui-ux-designer/design-system-components.md +71 -59
- package/src/templates/agents/codex/AGENTS.md +74 -42
- package/src/templates/agents/cursor/AGENTS.md +74 -42
- package/src/templates/agents/gemini-cli/GEMINI.md +74 -42
- package/src/templates/agents/github-copilot/AGENTS.md +83 -51
- package/src/templates/agents/qwen-code/QWEN.md +74 -42
- package/src/templates/agents/windsurf/AGENTS.md +74 -42
- package/src/templates/architectures/README.md +41 -0
- package/src/templates/architectures/clean-architecture/README.md +113 -0
- package/src/templates/architectures/event-driven/README.md +162 -0
- package/src/templates/architectures/hexagonal/README.md +130 -0
- package/src/templates/index.js +6 -1
- package/src/templates/locale-manager.js +16 -16
- package/src/templates/shared/delta-spec-template.md +20 -13
- package/src/templates/shared/github-actions/musubi-issue-resolver.yml +5 -5
- package/src/templates/shared/github-actions/musubi-security-check.yml +3 -3
- package/src/templates/shared/github-actions/musubi-validate.yml +4 -4
- package/src/templates/shared/steering/structure.md +95 -0
- package/src/templates/skills/browser-agent.md +21 -16
- package/src/templates/skills/web-gui.md +8 -0
- package/src/templates/template-constraints.js +50 -53
- package/src/validators/advanced-validation.js +30 -36
- package/src/validators/constitutional-validator.js +77 -73
- package/src/validators/critic-system.js +49 -59
- package/src/validators/delta-format.js +59 -55
- package/src/validators/traceability-validator.js +7 -11
|
@@ -16,14 +16,14 @@ const DocType = {
|
|
|
16
16
|
REFERENCE: 'reference',
|
|
17
17
|
FAQ: 'faq',
|
|
18
18
|
CHANGELOG: 'changelog',
|
|
19
|
-
ARCHITECTURE: 'architecture'
|
|
19
|
+
ARCHITECTURE: 'architecture',
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const DocFormat = {
|
|
23
23
|
MARKDOWN: 'markdown',
|
|
24
24
|
HTML: 'html',
|
|
25
25
|
PDF: 'pdf',
|
|
26
|
-
DOCX: 'docx'
|
|
26
|
+
DOCX: 'docx',
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// ============================================================================
|
|
@@ -41,12 +41,12 @@ class TemplateEngine {
|
|
|
41
41
|
// Default helpers
|
|
42
42
|
this.helpers.set('date', () => new Date().toISOString().split('T')[0]);
|
|
43
43
|
this.helpers.set('year', () => new Date().getFullYear());
|
|
44
|
-
this.helpers.set('uppercase',
|
|
45
|
-
this.helpers.set('lowercase',
|
|
46
|
-
this.helpers.set('capitalize',
|
|
47
|
-
this.helpers.set('kebabCase',
|
|
48
|
-
this.helpers.set('list',
|
|
49
|
-
this.helpers.set('numberedList',
|
|
44
|
+
this.helpers.set('uppercase', str => str.toUpperCase());
|
|
45
|
+
this.helpers.set('lowercase', str => str.toLowerCase());
|
|
46
|
+
this.helpers.set('capitalize', str => str.charAt(0).toUpperCase() + str.slice(1));
|
|
47
|
+
this.helpers.set('kebabCase', str => str.toLowerCase().replace(/\s+/g, '-'));
|
|
48
|
+
this.helpers.set('list', items => items.map(i => `- ${i}`).join('\n'));
|
|
49
|
+
this.helpers.set('numberedList', items => items.map((i, idx) => `${idx + 1}. ${i}`).join('\n'));
|
|
50
50
|
this.helpers.set('codeBlock', (code, lang = '') => `\`\`\`${lang}\n${code}\n\`\`\``);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -62,24 +62,38 @@ class TemplateEngine {
|
|
|
62
62
|
let result = template;
|
|
63
63
|
|
|
64
64
|
// Loops FIRST: {{#each items}}...{{/each}}
|
|
65
|
-
result = result.replace(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
result = result.replace(
|
|
66
|
+
/\{\{#each\s+([^}]+)\}\}([\s\S]*?)\{\{\/each\}\}/g,
|
|
67
|
+
(_, key, content) => {
|
|
68
|
+
const items = this.resolveValue(key.trim(), context);
|
|
69
|
+
if (!Array.isArray(items)) return '';
|
|
70
|
+
return items
|
|
71
|
+
.map(item => {
|
|
72
|
+
let itemContent = content;
|
|
73
|
+
// Replace {{this}} with the item
|
|
74
|
+
itemContent = itemContent.replace(
|
|
75
|
+
/\{\{this\}\}/g,
|
|
76
|
+
typeof item === 'object' ? JSON.stringify(item) : item
|
|
77
|
+
);
|
|
78
|
+
// Replace {{this.prop}} with item properties
|
|
79
|
+
itemContent = itemContent.replace(
|
|
80
|
+
/\{\{this\.([^}]+)\}\}/g,
|
|
81
|
+
(_, prop) => item[prop.trim()] || ''
|
|
82
|
+
);
|
|
83
|
+
return itemContent;
|
|
84
|
+
})
|
|
85
|
+
.join('');
|
|
86
|
+
}
|
|
87
|
+
);
|
|
77
88
|
|
|
78
89
|
// Conditionals: {{#if condition}}...{{/if}}
|
|
79
|
-
result = result.replace(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
result = result.replace(
|
|
91
|
+
/\{\{#if\s+([^}]+)\}\}([\s\S]*?)\{\{\/if\}\}/g,
|
|
92
|
+
(_, condition, content) => {
|
|
93
|
+
const value = this.resolveValue(condition.trim(), context);
|
|
94
|
+
return value ? content : '';
|
|
95
|
+
}
|
|
96
|
+
);
|
|
83
97
|
|
|
84
98
|
// Apply helpers: {{helper arg}}
|
|
85
99
|
for (const [name, fn] of this.helpers) {
|
|
@@ -144,7 +158,7 @@ class DocSection {
|
|
|
144
158
|
toMarkdown(level = 2) {
|
|
145
159
|
const heading = '#'.repeat(level);
|
|
146
160
|
let md = `${heading} ${this.title}\n\n`;
|
|
147
|
-
|
|
161
|
+
|
|
148
162
|
if (this.content) {
|
|
149
163
|
md += `${this.content}\n\n`;
|
|
150
164
|
}
|
|
@@ -163,7 +177,7 @@ class DocSection {
|
|
|
163
177
|
content: this.content,
|
|
164
178
|
subsections: this.subsections.map(s => s.toJSON()),
|
|
165
179
|
type: this.type,
|
|
166
|
-
metadata: this.metadata
|
|
180
|
+
metadata: this.metadata,
|
|
167
181
|
};
|
|
168
182
|
}
|
|
169
183
|
}
|
|
@@ -233,7 +247,10 @@ class DocPage {
|
|
|
233
247
|
html = html.replace(/^# (.+)$/gm, '<h1>$1</h1>');
|
|
234
248
|
|
|
235
249
|
// Code blocks
|
|
236
|
-
html = html.replace(
|
|
250
|
+
html = html.replace(
|
|
251
|
+
/```(\w+)?\n([\s\S]*?)```/g,
|
|
252
|
+
'<pre><code class="language-$1">$2</code></pre>'
|
|
253
|
+
);
|
|
237
254
|
|
|
238
255
|
// Inline code
|
|
239
256
|
html = html.replace(/`([^`]+)`/g, '<code>$1</code>');
|
|
@@ -264,7 +281,7 @@ class DocPage {
|
|
|
264
281
|
description: this.description,
|
|
265
282
|
sections: this.sections.map(s => s.toJSON()),
|
|
266
283
|
path: this.path,
|
|
267
|
-
type: this.type
|
|
284
|
+
type: this.type,
|
|
268
285
|
};
|
|
269
286
|
}
|
|
270
287
|
}
|
|
@@ -313,10 +330,12 @@ class DocSite {
|
|
|
313
330
|
for (const [type, pages] of pagesByType) {
|
|
314
331
|
nav.push({
|
|
315
332
|
title: type.charAt(0).toUpperCase() + type.slice(1),
|
|
316
|
-
items: pages
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
333
|
+
items: pages
|
|
334
|
+
.sort((a, b) => a.order - b.order)
|
|
335
|
+
.map(p => ({
|
|
336
|
+
title: p.title,
|
|
337
|
+
path: p.path || `/${p.id}`,
|
|
338
|
+
})),
|
|
320
339
|
});
|
|
321
340
|
}
|
|
322
341
|
|
|
@@ -329,7 +348,7 @@ class DocSite {
|
|
|
329
348
|
|
|
330
349
|
for (const [id, page] of this.pages) {
|
|
331
350
|
const path = page.path || `${id}.md`;
|
|
332
|
-
|
|
351
|
+
|
|
333
352
|
switch (format) {
|
|
334
353
|
case DocFormat.HTML:
|
|
335
354
|
output.set(path.replace('.md', '.html'), page.toHTML());
|
|
@@ -363,7 +382,7 @@ class DocSite {
|
|
|
363
382
|
|
|
364
383
|
generateIndex() {
|
|
365
384
|
let index = `# ${this.title}\n\n`;
|
|
366
|
-
|
|
385
|
+
|
|
367
386
|
if (this.description) {
|
|
368
387
|
index += `${this.description}\n\n`;
|
|
369
388
|
}
|
|
@@ -390,7 +409,7 @@ class DocSite {
|
|
|
390
409
|
baseUrl: this.baseUrl,
|
|
391
410
|
pages: Array.from(this.pages.values()).map(p => p.toJSON()),
|
|
392
411
|
navigation: this.navigation,
|
|
393
|
-
theme: this.theme
|
|
412
|
+
theme: this.theme,
|
|
394
413
|
};
|
|
395
414
|
}
|
|
396
415
|
}
|
|
@@ -423,15 +442,17 @@ class DocGenerator extends EventEmitter {
|
|
|
423
442
|
title: 'Product Overview',
|
|
424
443
|
description: steering.product.description || '',
|
|
425
444
|
type: DocType.GUIDE,
|
|
426
|
-
path: '/product'
|
|
445
|
+
path: '/product',
|
|
427
446
|
});
|
|
428
447
|
|
|
429
448
|
if (steering.product.features) {
|
|
430
|
-
productPage.addSection(
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
449
|
+
productPage.addSection(
|
|
450
|
+
new DocSection({
|
|
451
|
+
id: 'features',
|
|
452
|
+
title: 'Features',
|
|
453
|
+
content: steering.product.features.map(f => `- ${f}`).join('\n'),
|
|
454
|
+
})
|
|
455
|
+
);
|
|
435
456
|
}
|
|
436
457
|
|
|
437
458
|
pages.push(productPage);
|
|
@@ -444,16 +465,18 @@ class DocGenerator extends EventEmitter {
|
|
|
444
465
|
title: 'Architecture',
|
|
445
466
|
description: steering.structure.description || '',
|
|
446
467
|
type: DocType.ARCHITECTURE,
|
|
447
|
-
path: '/architecture'
|
|
468
|
+
path: '/architecture',
|
|
448
469
|
});
|
|
449
470
|
|
|
450
471
|
if (steering.structure.components) {
|
|
451
472
|
for (const [name, component] of Object.entries(steering.structure.components)) {
|
|
452
|
-
archPage.addSection(
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
473
|
+
archPage.addSection(
|
|
474
|
+
new DocSection({
|
|
475
|
+
id: name,
|
|
476
|
+
title: name,
|
|
477
|
+
content: component.description || '',
|
|
478
|
+
})
|
|
479
|
+
);
|
|
457
480
|
}
|
|
458
481
|
}
|
|
459
482
|
|
|
@@ -466,23 +489,27 @@ class DocGenerator extends EventEmitter {
|
|
|
466
489
|
id: 'technology',
|
|
467
490
|
title: 'Technology Stack',
|
|
468
491
|
type: DocType.REFERENCE,
|
|
469
|
-
path: '/technology'
|
|
492
|
+
path: '/technology',
|
|
470
493
|
});
|
|
471
494
|
|
|
472
495
|
if (steering.tech.languages) {
|
|
473
|
-
techPage.addSection(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
496
|
+
techPage.addSection(
|
|
497
|
+
new DocSection({
|
|
498
|
+
id: 'languages',
|
|
499
|
+
title: 'Languages',
|
|
500
|
+
content: steering.tech.languages.map(l => `- ${l}`).join('\n'),
|
|
501
|
+
})
|
|
502
|
+
);
|
|
478
503
|
}
|
|
479
504
|
|
|
480
505
|
if (steering.tech.frameworks) {
|
|
481
|
-
techPage.addSection(
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
506
|
+
techPage.addSection(
|
|
507
|
+
new DocSection({
|
|
508
|
+
id: 'frameworks',
|
|
509
|
+
title: 'Frameworks',
|
|
510
|
+
content: steering.tech.frameworks.map(f => `- ${f}`).join('\n'),
|
|
511
|
+
})
|
|
512
|
+
);
|
|
486
513
|
}
|
|
487
514
|
|
|
488
515
|
pages.push(techPage);
|
|
@@ -494,15 +521,17 @@ class DocGenerator extends EventEmitter {
|
|
|
494
521
|
id: 'rules',
|
|
495
522
|
title: 'Project Rules',
|
|
496
523
|
type: DocType.REFERENCE,
|
|
497
|
-
path: '/rules'
|
|
524
|
+
path: '/rules',
|
|
498
525
|
});
|
|
499
526
|
|
|
500
527
|
if (steering.rules.constitution) {
|
|
501
|
-
rulesPage.addSection(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
528
|
+
rulesPage.addSection(
|
|
529
|
+
new DocSection({
|
|
530
|
+
id: 'constitution',
|
|
531
|
+
title: 'Constitution',
|
|
532
|
+
content: steering.rules.constitution,
|
|
533
|
+
})
|
|
534
|
+
);
|
|
506
535
|
}
|
|
507
536
|
|
|
508
537
|
pages.push(rulesPage);
|
|
@@ -521,7 +550,7 @@ class DocGenerator extends EventEmitter {
|
|
|
521
550
|
title: mod.name,
|
|
522
551
|
description: mod.description || '',
|
|
523
552
|
type: DocType.API,
|
|
524
|
-
path: `/api/${mod.name}
|
|
553
|
+
path: `/api/${mod.name}`,
|
|
525
554
|
});
|
|
526
555
|
|
|
527
556
|
if (mod.exports) {
|
|
@@ -529,7 +558,7 @@ class DocGenerator extends EventEmitter {
|
|
|
529
558
|
const section = new DocSection({
|
|
530
559
|
id: exp.name,
|
|
531
560
|
title: exp.name,
|
|
532
|
-
content: this.formatAPIEntry(exp)
|
|
561
|
+
content: this.formatAPIEntry(exp),
|
|
533
562
|
});
|
|
534
563
|
page.addSection(section);
|
|
535
564
|
}
|
|
@@ -583,35 +612,41 @@ class DocGenerator extends EventEmitter {
|
|
|
583
612
|
frontMatter: {
|
|
584
613
|
difficulty: tutorial.difficulty || 'beginner',
|
|
585
614
|
duration: tutorial.duration || '10 minutes',
|
|
586
|
-
tags: tutorial.tags || []
|
|
587
|
-
}
|
|
615
|
+
tags: tutorial.tags || [],
|
|
616
|
+
},
|
|
588
617
|
});
|
|
589
618
|
|
|
590
619
|
if (tutorial.prerequisites) {
|
|
591
|
-
page.addSection(
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
620
|
+
page.addSection(
|
|
621
|
+
new DocSection({
|
|
622
|
+
id: 'prerequisites',
|
|
623
|
+
title: 'Prerequisites',
|
|
624
|
+
content: tutorial.prerequisites.map(p => `- ${p}`).join('\n'),
|
|
625
|
+
})
|
|
626
|
+
);
|
|
596
627
|
}
|
|
597
628
|
|
|
598
629
|
if (tutorial.steps) {
|
|
599
630
|
for (let i = 0; i < tutorial.steps.length; i++) {
|
|
600
631
|
const step = tutorial.steps[i];
|
|
601
|
-
page.addSection(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
632
|
+
page.addSection(
|
|
633
|
+
new DocSection({
|
|
634
|
+
id: `step-${i + 1}`,
|
|
635
|
+
title: `Step ${i + 1}: ${step.title}`,
|
|
636
|
+
content: step.content,
|
|
637
|
+
})
|
|
638
|
+
);
|
|
606
639
|
}
|
|
607
640
|
}
|
|
608
641
|
|
|
609
642
|
if (tutorial.nextSteps) {
|
|
610
|
-
page.addSection(
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
643
|
+
page.addSection(
|
|
644
|
+
new DocSection({
|
|
645
|
+
id: 'next-steps',
|
|
646
|
+
title: 'Next Steps',
|
|
647
|
+
content: tutorial.nextSteps.map(n => `- [${n.title}](${n.path})`).join('\n'),
|
|
648
|
+
})
|
|
649
|
+
);
|
|
615
650
|
}
|
|
616
651
|
|
|
617
652
|
this.emit('generatedTutorial', { page });
|
|
@@ -624,7 +659,7 @@ class DocGenerator extends EventEmitter {
|
|
|
624
659
|
title: 'Changelog',
|
|
625
660
|
description: 'All notable changes to this project.',
|
|
626
661
|
type: DocType.CHANGELOG,
|
|
627
|
-
path: '/changelog'
|
|
662
|
+
path: '/changelog',
|
|
628
663
|
});
|
|
629
664
|
|
|
630
665
|
for (const release of releases) {
|
|
@@ -645,11 +680,13 @@ class DocGenerator extends EventEmitter {
|
|
|
645
680
|
content.push(release.breaking.map(b => `- ⚠️ ${b}`).join('\n'));
|
|
646
681
|
}
|
|
647
682
|
|
|
648
|
-
page.addSection(
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
683
|
+
page.addSection(
|
|
684
|
+
new DocSection({
|
|
685
|
+
id: `v${release.version}`,
|
|
686
|
+
title: `[${release.version}] - ${release.date}`,
|
|
687
|
+
content: content.join('\n'),
|
|
688
|
+
})
|
|
689
|
+
);
|
|
653
690
|
}
|
|
654
691
|
|
|
655
692
|
return page;
|
|
@@ -661,15 +698,17 @@ class DocGenerator extends EventEmitter {
|
|
|
661
698
|
title: 'Frequently Asked Questions',
|
|
662
699
|
description: 'Common questions and answers about this project.',
|
|
663
700
|
type: DocType.FAQ,
|
|
664
|
-
path: '/faq'
|
|
701
|
+
path: '/faq',
|
|
665
702
|
});
|
|
666
703
|
|
|
667
704
|
for (const q of questions) {
|
|
668
|
-
page.addSection(
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
705
|
+
page.addSection(
|
|
706
|
+
new DocSection({
|
|
707
|
+
id: q.id || q.question.substring(0, 20).toLowerCase().replace(/\s+/g, '-'),
|
|
708
|
+
title: q.question,
|
|
709
|
+
content: q.answer,
|
|
710
|
+
})
|
|
711
|
+
);
|
|
673
712
|
}
|
|
674
713
|
|
|
675
714
|
return page;
|
|
@@ -678,11 +717,11 @@ class DocGenerator extends EventEmitter {
|
|
|
678
717
|
build(site, options = {}) {
|
|
679
718
|
const format = options.format || DocFormat.MARKDOWN;
|
|
680
719
|
const output = site.build(format);
|
|
681
|
-
|
|
682
|
-
this.emit('built', {
|
|
683
|
-
format,
|
|
720
|
+
|
|
721
|
+
this.emit('built', {
|
|
722
|
+
format,
|
|
684
723
|
files: Array.from(output.keys()),
|
|
685
|
-
site
|
|
724
|
+
site,
|
|
686
725
|
});
|
|
687
726
|
|
|
688
727
|
return output;
|
|
@@ -691,7 +730,7 @@ class DocGenerator extends EventEmitter {
|
|
|
691
730
|
toJSON() {
|
|
692
731
|
return {
|
|
693
732
|
projectRoot: this.projectRoot,
|
|
694
|
-
site: this.site ? this.site.toJSON() : null
|
|
733
|
+
site: this.site ? this.site.toJSON() : null,
|
|
695
734
|
};
|
|
696
735
|
}
|
|
697
736
|
}
|
|
@@ -724,17 +763,17 @@ module.exports = {
|
|
|
724
763
|
// Constants
|
|
725
764
|
DocType,
|
|
726
765
|
DocFormat,
|
|
727
|
-
|
|
766
|
+
|
|
728
767
|
// Classes
|
|
729
768
|
TemplateEngine,
|
|
730
769
|
DocSection,
|
|
731
770
|
DocPage,
|
|
732
771
|
DocSite,
|
|
733
772
|
DocGenerator,
|
|
734
|
-
|
|
773
|
+
|
|
735
774
|
// Factories
|
|
736
775
|
createDocGenerator,
|
|
737
776
|
createDocSite,
|
|
738
777
|
createDocPage,
|
|
739
|
-
createDocSection
|
|
778
|
+
createDocSection,
|
|
740
779
|
};
|