specweave 0.23.18 → 0.24.0

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.
Files changed (167) hide show
  1. package/.claude-plugin/marketplace.json +93 -49
  2. package/CLAUDE.md +137 -4
  3. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  4. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  5. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  6. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  7. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  8. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  9. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  10. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  11. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  15. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  16. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  17. package/dist/src/cli/helpers/smart-filter.js +265 -0
  18. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  19. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  20. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  21. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  22. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  23. package/dist/src/core/qa/risk-calculator.js +2 -2
  24. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  25. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  26. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  27. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  28. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  29. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  30. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  31. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  32. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  33. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  34. package/dist/src/integrations/jira/filter-processor.js +207 -0
  35. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  36. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  37. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  38. package/dist/src/integrations/jira/jira-client.js +33 -0
  39. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  40. package/dist/src/utils/ac-embedder.d.ts +63 -0
  41. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  42. package/dist/src/utils/ac-embedder.js +217 -0
  43. package/dist/src/utils/ac-embedder.js.map +1 -0
  44. package/dist/src/utils/env-manager.d.ts +86 -0
  45. package/dist/src/utils/env-manager.d.ts.map +1 -0
  46. package/dist/src/utils/env-manager.js +188 -0
  47. package/dist/src/utils/env-manager.js.map +1 -0
  48. package/package.json +1 -1
  49. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  50. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  51. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  52. package/plugins/specweave/commands/specweave-do.md +37 -0
  53. package/plugins/specweave/commands/specweave-done.md +159 -0
  54. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  55. package/plugins/specweave/commands/specweave-next.md +148 -3
  56. package/plugins/specweave/commands/specweave-qa.md +2 -2
  57. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  58. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  59. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  60. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  61. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  62. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  63. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  64. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  65. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  66. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  67. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  68. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  69. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  70. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  71. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  72. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  73. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  74. package/plugins/specweave-core/commands/code-review.md +213 -0
  75. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  76. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  77. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  78. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  79. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  80. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  81. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  82. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  83. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  84. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  85. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  86. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  87. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  88. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  89. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  90. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  91. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  92. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  93. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  94. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  95. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  96. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  97. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  98. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  99. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
  100. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  101. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  105. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  106. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  107. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  108. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  109. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  110. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  111. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  112. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  113. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
  114. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  115. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  117. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  118. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  119. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  120. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  121. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  122. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  123. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  124. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  125. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  126. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  127. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  128. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  129. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  130. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  131. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  132. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  133. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  134. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  135. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  136. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  137. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  138. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  139. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  140. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  141. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
  142. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  143. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  144. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  145. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  146. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  147. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  148. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  149. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  150. package/plugins/specweave-testing/commands/test-init.md +409 -0
  151. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  152. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  153. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  154. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  155. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  156. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  157. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  158. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  159. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  160. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  161. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  162. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  163. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  164. package/plugins/specweave/commands/check-hooks.md +0 -257
  165. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  166. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  167. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,168 @@
1
+ # /specweave-diagrams:diagrams-generate
2
+
3
+ Generate Mermaid architecture diagrams following C4 Model conventions.
4
+
5
+ You are an expert in creating clear, comprehensive architecture diagrams using Mermaid syntax and C4 Model principles.
6
+
7
+ ## Your Task
8
+
9
+ Generate architecture diagrams based on the user's requirements using Mermaid.js syntax. Follow these guidelines:
10
+
11
+ ### 1. Diagram Types
12
+
13
+ Support these diagram types:
14
+ - **C4 Context Diagrams**: System context with external actors and systems
15
+ - **C4 Container Diagrams**: High-level technology choices and container relationships
16
+ - **C4 Component Diagrams**: Internal component structure
17
+ - **Sequence Diagrams**: Interaction flows and timing
18
+ - **ER Diagrams**: Database schema and relationships
19
+ - **Deployment Diagrams**: Infrastructure and deployment architecture
20
+
21
+ ### 2. C4 Model Conventions
22
+
23
+ **Context Level**:
24
+ ```mermaid
25
+ C4Context
26
+ title System Context diagram for [System Name]
27
+
28
+ Person(user, "User", "End user of the system")
29
+ System(systemA, "System A", "Core system")
30
+ System_Ext(systemB, "External System", "Third-party service")
31
+
32
+ Rel(user, systemA, "Uses")
33
+ Rel(systemA, systemB, "Integrates with", "HTTPS")
34
+ ```
35
+
36
+ **Container Level**:
37
+ ```mermaid
38
+ C4Container
39
+ title Container diagram for [System Name]
40
+
41
+ Container(web, "Web Application", "React", "User interface")
42
+ Container(api, "API", "Node.js", "Business logic")
43
+ ContainerDb(db, "Database", "PostgreSQL", "Data storage")
44
+
45
+ Rel(web, api, "Calls", "HTTPS/JSON")
46
+ Rel(api, db, "Reads/Writes", "SQL")
47
+ ```
48
+
49
+ **Component Level**:
50
+ ```mermaid
51
+ C4Component
52
+ title Component diagram for [Container Name]
53
+
54
+ Component(controller, "Controller", "Express", "Handles HTTP requests")
55
+ Component(service, "Service", "TypeScript", "Business logic")
56
+ Component(repository, "Repository", "TypeORM", "Data access")
57
+
58
+ Rel(controller, service, "Uses")
59
+ Rel(service, repository, "Uses")
60
+ ```
61
+
62
+ ### 3. Sequence Diagrams
63
+
64
+ ```mermaid
65
+ sequenceDiagram
66
+ actor User
67
+ participant Frontend
68
+ participant API
69
+ participant Database
70
+
71
+ User->>Frontend: Login request
72
+ Frontend->>API: POST /auth/login
73
+ API->>Database: Validate credentials
74
+ Database-->>API: User data
75
+ API-->>Frontend: JWT token
76
+ Frontend-->>User: Success
77
+ ```
78
+
79
+ ### 4. ER Diagrams
80
+
81
+ ```mermaid
82
+ erDiagram
83
+ USER ||--o{ ORDER : places
84
+ ORDER ||--|{ ORDER_ITEM : contains
85
+ PRODUCT ||--o{ ORDER_ITEM : "ordered in"
86
+
87
+ USER {
88
+ uuid id PK
89
+ string email
90
+ string name
91
+ timestamp created_at
92
+ }
93
+
94
+ ORDER {
95
+ uuid id PK
96
+ uuid user_id FK
97
+ decimal total
98
+ timestamp created_at
99
+ }
100
+ ```
101
+
102
+ ### 5. Best Practices
103
+
104
+ 1. **Clear Labels**: Use descriptive names for all elements
105
+ 2. **Consistent Direction**: Top-to-bottom or left-to-right flow
106
+ 3. **Technology Stack**: Include tech choices in container/component diagrams
107
+ 4. **Relationships**: Label all connections with protocol/method
108
+ 5. **Color Coding**: Use consistent colors for similar element types
109
+ 6. **Boundaries**: Show system boundaries clearly
110
+
111
+ ### 6. Output Format
112
+
113
+ Always wrap diagrams in proper Mermaid code blocks:
114
+
115
+ \`\`\`mermaid
116
+ [diagram code]
117
+ \`\`\`
118
+
119
+ Include:
120
+ - Diagram title
121
+ - Legend if needed
122
+ - Notes for complex interactions
123
+ - Tech stack documentation
124
+
125
+ ### 7. Validation
126
+
127
+ Ensure diagrams:
128
+ - Use valid Mermaid syntax
129
+ - Follow C4 conventions
130
+ - Are readable at default zoom
131
+ - Include all requested elements
132
+ - Show data flow direction clearly
133
+
134
+ ## Example Usage
135
+
136
+ **User**: "Create a C4 context diagram for an e-commerce system"
137
+
138
+ **Response**:
139
+ ```mermaid
140
+ C4Context
141
+ title E-Commerce System - Context Diagram
142
+
143
+ Person(customer, "Customer", "Shops for products online")
144
+ Person(admin, "Admin", "Manages products and orders")
145
+
146
+ System(ecommerce, "E-Commerce Platform", "Online shopping system")
147
+ System_Ext(payment, "Payment Gateway", "Processes payments")
148
+ System_Ext(shipping, "Shipping Provider", "Handles delivery")
149
+ System_Ext(email, "Email Service", "Sends notifications")
150
+
151
+ Rel(customer, ecommerce, "Browses products, places orders")
152
+ Rel(admin, ecommerce, "Manages catalog, views analytics")
153
+ Rel(ecommerce, payment, "Processes payments", "HTTPS/API")
154
+ Rel(ecommerce, shipping, "Creates shipments", "HTTPS/API")
155
+ Rel(ecommerce, email, "Sends notifications", "SMTP")
156
+ ```
157
+
158
+ ## When to Use
159
+
160
+ This command is ideal for:
161
+ - System architecture documentation
162
+ - Technical design reviews
163
+ - Database schema visualization
164
+ - API interaction flows
165
+ - Deployment architecture
166
+ - Component relationships
167
+
168
+ Generate diagrams that are clear, comprehensive, and follow industry best practices!
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "specweave-docs",
3
+ "version": "0.24.0",
4
+ "description": "Documentation generation and management - Docusaurus, spec-driven docs, API documentation, living documentation",
5
+ "author": {
6
+ "name": "Anton Abyzov",
7
+ "email": "anton.abyzov@gmail.com"
8
+ },
9
+ "hooks": {}
10
+ }
@@ -0,0 +1,441 @@
1
+ # Docs Generate - Generate Documentation from Code
2
+
3
+ Generate documentation automatically from TypeScript/JavaScript code, OpenAPI specs, GraphQL schemas, and SpecWeave specifications. Creates comprehensive API docs, type references, and usage examples.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /specweave-docs:docs-generate <source-type> <path> [options]
9
+ ```
10
+
11
+ ## Source Types
12
+
13
+ ### 1. TypeScript/JavaScript Code
14
+ ```bash
15
+ /specweave-docs:docs-generate code ./src \
16
+ --output ./docs/api \
17
+ --format markdown
18
+ ```
19
+
20
+ ### 2. OpenAPI/Swagger Specs
21
+ ```bash
22
+ /specweave-docs:docs-generate openapi ./api/openapi.yaml \
23
+ --output ./docs/api \
24
+ --interactive
25
+ ```
26
+
27
+ ### 3. GraphQL Schema
28
+ ```bash
29
+ /specweave-docs:docs-generate graphql ./schema.graphql \
30
+ --output ./docs/graphql
31
+ ```
32
+
33
+ ### 4. SpecWeave Living Docs
34
+ ```bash
35
+ /specweave-docs:docs-generate specweave ./.specweave/docs \
36
+ --output ./docs/specs \
37
+ --include features,modules,architecture
38
+ ```
39
+
40
+ ## Options
41
+
42
+ ### General Options
43
+ - `--output <path>` - Output directory (default: `./docs/generated`)
44
+ - `--format <format>` - Output format: markdown, html, json (default: markdown)
45
+ - `--template <template>` - Custom template directory
46
+ - `--watch` - Watch for changes and regenerate
47
+
48
+ ### Code Documentation Options
49
+ - `--exclude <patterns>` - Exclude files/directories (glob patterns)
50
+ - `--include-private` - Include private members (default: false)
51
+ - `--include-internal` - Include @internal tagged members (default: false)
52
+ - `--examples` - Generate usage examples (default: true)
53
+ - `--types` - Generate type reference docs (default: true)
54
+
55
+ ### OpenAPI Options
56
+ - `--interactive` - Generate interactive API playground (default: true)
57
+ - `--group-by <field>` - Group endpoints by: tag, path, method (default: tag)
58
+ - `--show-examples` - Include request/response examples (default: true)
59
+
60
+ ### SpecWeave Options
61
+ - `--include <types>` - Comma-separated: features, modules, architecture, team
62
+ - `--depth <number>` - Directory depth to traverse (default: unlimited)
63
+ - `--format-adrs` - Special formatting for ADRs (default: true)
64
+
65
+ ## Generated Documentation
66
+
67
+ ### From TypeScript Code
68
+
69
+ Generates comprehensive API documentation using TypeDoc:
70
+
71
+ **Input**: TypeScript source files
72
+ ```typescript
73
+ /**
74
+ * User management service
75
+ * @category Services
76
+ * @example
77
+ * ```ts
78
+ * const service = new UserService();
79
+ * const user = await service.getUser(123);
80
+ * ```
81
+ */
82
+ export class UserService {
83
+ /**
84
+ * Retrieve user by ID
85
+ * @param userId - Unique user identifier
86
+ * @returns User object or null if not found
87
+ * @throws {UserNotFoundError} If user doesn't exist
88
+ */
89
+ async getUser(userId: number): Promise<User | null> {
90
+ // implementation
91
+ }
92
+ }
93
+ ```
94
+
95
+ **Output**: Markdown documentation
96
+ ```markdown
97
+ # UserService
98
+
99
+ User management service
100
+
101
+ ## Methods
102
+
103
+ ### getUser
104
+
105
+ Retrieve user by ID
106
+
107
+ **Parameters:**
108
+ - `userId`: number - Unique user identifier
109
+
110
+ **Returns:** `Promise<User | null>` - User object or null if not found
111
+
112
+ **Throws:**
113
+ - `UserNotFoundError` - If user doesn't exist
114
+
115
+ **Example:**
116
+ \```typescript
117
+ const service = new UserService();
118
+ const user = await service.getUser(123);
119
+ \```
120
+ ```
121
+
122
+ ### From OpenAPI Specification
123
+
124
+ Generates interactive API documentation:
125
+
126
+ **Input**: OpenAPI YAML/JSON
127
+ ```yaml
128
+ paths:
129
+ /users/{id}:
130
+ get:
131
+ summary: Get user by ID
132
+ parameters:
133
+ - name: id
134
+ in: path
135
+ required: true
136
+ schema:
137
+ type: integer
138
+ responses:
139
+ '200':
140
+ description: Successful response
141
+ content:
142
+ application/json:
143
+ schema:
144
+ $ref: '#/components/schemas/User'
145
+ ```
146
+
147
+ **Output**: Interactive Markdown with API playground
148
+ ```markdown
149
+ # GET /users/{id}
150
+
151
+ Get user by ID
152
+
153
+ ## Parameters
154
+
155
+ | Name | In | Type | Required | Description |
156
+ |------|------|---------|----------|-------------|
157
+ | id | path | integer | Yes | User ID |
158
+
159
+ ## Responses
160
+
161
+ ### 200 OK
162
+
163
+ Successful response
164
+
165
+ **Response Schema:**
166
+ \```json
167
+ {
168
+ "id": 123,
169
+ "name": "John Doe",
170
+ "email": "john@example.com"
171
+ }
172
+ \```
173
+
174
+ ## Try it out
175
+
176
+ [Interactive API Playground]
177
+
178
+ \```bash
179
+ curl -X GET https://api.example.com/users/123 \
180
+ -H "Authorization: Bearer YOUR_TOKEN"
181
+ \```
182
+ ```
183
+
184
+ ### From SpecWeave Living Docs
185
+
186
+ Generates consolidated documentation from `.specweave/docs/`:
187
+
188
+ **Input**: SpecWeave directory structure
189
+ ```
190
+ .specweave/docs/
191
+ ├── features/
192
+ │ ├── FS-001/
193
+ │ │ ├── feature.md
194
+ │ │ └── user-stories/
195
+ │ │ ├── US-001.md
196
+ │ │ └── US-002.md
197
+ │ └── FS-002/
198
+ ├── modules/
199
+ │ ├── authentication/
200
+ │ │ └── module.md
201
+ │ └── payments/
202
+ └── architecture/
203
+ ├── adr/
204
+ │ ├── 0001-tech-stack.md
205
+ │ └── 0002-database-choice.md
206
+ └── diagrams/
207
+ ```
208
+
209
+ **Output**: Organized Docusaurus docs
210
+ ```
211
+ docs/
212
+ ├── features/
213
+ │ ├── fs-001-user-authentication.md
214
+ │ ├── fs-002-payment-processing.md
215
+ │ └── index.md
216
+ ├── modules/
217
+ │ ├── authentication.md
218
+ │ ├── payments.md
219
+ │ └── index.md
220
+ └── architecture/
221
+ ├── decisions/
222
+ │ ├── adr-0001.md
223
+ │ ├── adr-0002.md
224
+ │ └── index.md
225
+ └── diagrams.md
226
+ ```
227
+
228
+ ## Configuration
229
+
230
+ ### TypeDoc Configuration
231
+
232
+ Create `typedoc.json`:
233
+ ```json
234
+ {
235
+ "entryPoints": ["./src"],
236
+ "out": "./docs/api",
237
+ "plugin": ["typedoc-plugin-markdown"],
238
+ "readme": "none",
239
+ "excludePrivate": true,
240
+ "excludeInternal": true,
241
+ "categorizeByGroup": true,
242
+ "categoryOrder": ["Services", "Models", "Utils", "*"],
243
+ "sort": ["source-order"]
244
+ }
245
+ ```
246
+
247
+ ### Custom Templates
248
+
249
+ Create custom Handlebars templates:
250
+
251
+ ```handlebars
252
+ {{!-- templates/class.hbs --}}
253
+ # {{name}}
254
+
255
+ {{#if comment}}
256
+ {{comment}}
257
+ {{/if}}
258
+
259
+ ## Constructor
260
+
261
+ \```typescript
262
+ new {{name}}({{#each constructorParams}}{{name}}: {{type}}{{#unless @last}}, {{/unless}}{{/each}})
263
+ \```
264
+
265
+ ## Methods
266
+
267
+ {{#each methods}}
268
+ ### {{name}}
269
+
270
+ {{comment}}
271
+
272
+ **Signature:**
273
+ \```typescript
274
+ {{signature}}
275
+ \```
276
+ {{/each}}
277
+ ```
278
+
279
+ ## Continuous Documentation
280
+
281
+ ### Watch Mode
282
+
283
+ Auto-regenerate on file changes:
284
+ ```bash
285
+ /specweave-docs:docs-generate code ./src --watch
286
+ ```
287
+
288
+ ### CI/CD Integration
289
+
290
+ ```yaml
291
+ # .github/workflows/docs.yml
292
+ name: Generate Documentation
293
+
294
+ on:
295
+ push:
296
+ branches: [main]
297
+ paths:
298
+ - 'src/**'
299
+ - 'api/**'
300
+
301
+ jobs:
302
+ docs:
303
+ runs-on: ubuntu-latest
304
+ steps:
305
+ - uses: actions/checkout@v3
306
+ - name: Generate API docs
307
+ run: |
308
+ npm install
309
+ npx claude /specweave-docs:docs-generate code ./src
310
+ - name: Deploy to GitHub Pages
311
+ uses: peaceiris/actions-gh-pages@v3
312
+ with:
313
+ github_token: ${{ secrets.GITHUB_TOKEN }}
314
+ publish_dir: ./docs
315
+ ```
316
+
317
+ ## Use Cases
318
+
319
+ ### 1. API Reference Documentation
320
+ Generate comprehensive API docs from TypeScript interfaces and JSDoc comments.
321
+
322
+ ### 2. OpenAPI Documentation
323
+ Create interactive API explorers from OpenAPI/Swagger specifications.
324
+
325
+ ### 3. Architecture Documentation
326
+ Consolidate ADRs, diagrams, and technical specifications into searchable docs.
327
+
328
+ ### 4. Living Documentation
329
+ Auto-sync SpecWeave features, user stories, and modules to documentation site.
330
+
331
+ ### 5. Type Documentation
332
+ Generate TypeScript type reference guides for library consumers.
333
+
334
+ ## Advanced Features
335
+
336
+ ### Custom Transformers
337
+
338
+ ```typescript
339
+ // transformers/custom-transformer.ts
340
+ import { DocNode } from 'typedoc';
341
+
342
+ export function transformNode(node: DocNode): DocNode {
343
+ // Custom transformation logic
344
+ if (node.kind === 'method' && node.name.startsWith('_')) {
345
+ return null; // Skip private methods
346
+ }
347
+ return node;
348
+ }
349
+ ```
350
+
351
+ ### Multi-Source Aggregation
352
+
353
+ ```bash
354
+ # Generate from multiple sources
355
+ /specweave-docs:docs-generate code ./src --output ./docs/api
356
+ /specweave-docs:docs-generate openapi ./api/openapi.yaml --output ./docs/api
357
+ /specweave-docs:docs-generate specweave ./.specweave/docs --output ./docs/specs
358
+
359
+ # Combine all outputs
360
+ cat ./docs/api/index.md ./docs/specs/index.md > ./docs/complete-reference.md
361
+ ```
362
+
363
+ ### Internationalization
364
+
365
+ ```bash
366
+ # Generate docs in multiple languages
367
+ /specweave-docs:docs-generate code ./src --output ./docs/en --lang en
368
+ /specweave-docs:docs-generate code ./src --output ./docs/es --lang es
369
+ /specweave-docs:docs-generate code ./src --output ./docs/fr --lang fr
370
+ ```
371
+
372
+ ## Examples
373
+
374
+ ### Generate TypeScript API Docs
375
+ ```bash
376
+ /specweave-docs:docs-generate code ./src/api \
377
+ --output ./docs/api-reference \
378
+ --exclude "**/*.test.ts" \
379
+ --include-examples
380
+ ```
381
+
382
+ ### Generate OpenAPI Docs with Playground
383
+ ```bash
384
+ /specweave-docs:docs-generate openapi ./api/v1/openapi.yaml \
385
+ --output ./docs/api/v1 \
386
+ --interactive \
387
+ --group-by tag
388
+ ```
389
+
390
+ ### Generate SpecWeave Architecture Docs
391
+ ```bash
392
+ /specweave-docs:docs-generate specweave ./.specweave/docs \
393
+ --output ./docs/architecture \
394
+ --include architecture,modules \
395
+ --format-adrs
396
+ ```
397
+
398
+ ### Watch Mode for Development
399
+ ```bash
400
+ /specweave-docs:docs-generate code ./src --watch
401
+ ```
402
+
403
+ ## Related Commands
404
+
405
+ - `/specweave-docs:docs-init` - Initialize Docusaurus documentation site
406
+ - `/specweave-docs-preview:preview` - Preview generated documentation
407
+ - `/specweave-docs-preview:build` - Build static site from generated docs
408
+
409
+ ## Requirements
410
+
411
+ - **TypeDoc**: For TypeScript/JavaScript documentation
412
+ - **Redocly**: For OpenAPI documentation
413
+ - **GraphQL Code Generator**: For GraphQL schema docs
414
+ - **Node.js 18+**: Runtime requirement
415
+
416
+ ## Performance Tips
417
+
418
+ 1. **Incremental Generation**: Use `--watch` for development
419
+ 2. **Exclude Tests**: Skip test files with `--exclude "**/*.test.ts"`
420
+ 3. **Parallel Processing**: Generate different sources concurrently
421
+ 4. **Cache Results**: Reuse generated docs when source hasn't changed
422
+
423
+ ## Troubleshooting
424
+
425
+ ### Missing Dependencies
426
+ ```bash
427
+ npm install --save-dev typedoc typedoc-plugin-markdown @redocly/cli
428
+ ```
429
+
430
+ ### Large Codebases
431
+ ```bash
432
+ # Increase Node.js memory
433
+ NODE_OPTIONS="--max-old-space-size=4096" \
434
+ /specweave-docs:docs-generate code ./src
435
+ ```
436
+
437
+ ### Broken Links in Generated Docs
438
+ ```bash
439
+ # Validate generated docs
440
+ npx markdown-link-check ./docs/**/*.md
441
+ ```