speccrew 0.6.34 → 0.6.36
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/.speccrew/agents/speccrew-system-designer.md +101 -94
- package/.speccrew/agents/speccrew-team-leader-xml.md +3 -3
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch-xml/SKILL.md +863 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions-xml/SKILL.md +859 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-quality-xml/SKILL.md +687 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style-xml/SKILL.md +597 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-xml/SKILL.md +297 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index-xml/SKILL.md +277 -0
- package/.speccrew/skills/speccrew-knowledge-techs-init-xml/SKILL.md +309 -0
- package/package.json +1 -1
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-knowledge-techs-generate-xml
|
|
3
|
+
description: Stage 2 of technology knowledge initialization - Generate technology documentation for a specific platform using XML workflow blocks. Extracts tech stack, architecture, and conventions from configuration files and source code. Creates INDEX.md, tech-stack.md, architecture.md, and conventions-*.md files. Used by Worker Agent in parallel for each detected platform.
|
|
4
|
+
tools: Read, Write, Glob, Grep, Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **⚠️ DEPRECATED**: This skill has been superseded by `speccrew-knowledge-techs-generate-conventions-xml` and `speccrew-knowledge-techs-generate-ui-style-xml`. Use those skills for new requests. This file is kept for backward compatibility only.
|
|
8
|
+
>
|
|
9
|
+
> **Do NOT invoke this skill directly.** Use the specialized skills via `speccrew-knowledge-techs-dispatch` Stage 2 dual-worker orchestration.
|
|
10
|
+
|
|
11
|
+
# Stage 2: Generate Platform Technology Documents (XML Workflow)
|
|
12
|
+
|
|
13
|
+
Generate comprehensive technology documentation for a specific platform by analyzing its configuration files and source code structure.
|
|
14
|
+
|
|
15
|
+
## Language Adaptation
|
|
16
|
+
|
|
17
|
+
**CRITICAL**: Generate all content in the language specified by the `language` parameter.
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
|
|
21
|
+
- `platform_id`: Platform identifier (e.g., "web-react", "backend-nestjs")
|
|
22
|
+
- `platform_type`: Platform type (web, mobile, backend, desktop)
|
|
23
|
+
- `framework`: Primary framework (react, nestjs, flutter, etc.)
|
|
24
|
+
- `source_path`: Platform source directory
|
|
25
|
+
- `config_files`: List of configuration file paths
|
|
26
|
+
- `convention_files`: List of convention file paths (eslint, prettier, etc.)
|
|
27
|
+
- `output_path`: Output directory for generated documents
|
|
28
|
+
- `language`: Target language (e.g., "zh", "en") - **REQUIRED**
|
|
29
|
+
- `completed_dir`: (Optional) Directory for analysis coverage report output
|
|
30
|
+
|
|
31
|
+
## Output
|
|
32
|
+
|
|
33
|
+
**Required Documents (All Platforms)**: INDEX.md, tech-stack.md, architecture.md, conventions-design.md, conventions-dev.md, conventions-unit-test.md, conventions-system-test.md, conventions-build.md
|
|
34
|
+
|
|
35
|
+
**Optional Documents**: conventions-data.md (backend required), ui-style/ (frontend only)
|
|
36
|
+
|
|
37
|
+
**Quality Assurance**: After document generation, quality checks are performed by `speccrew-knowledge-techs-generate-quality` skill.
|
|
38
|
+
|
|
39
|
+
## Workflow
|
|
40
|
+
|
|
41
|
+
<!--
|
|
42
|
+
== Block Types ==
|
|
43
|
+
input : Workflow input parameters (required=mandatory, default=default value)
|
|
44
|
+
output : Workflow output results (from=data source variable)
|
|
45
|
+
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
46
|
+
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
47
|
+
loop : Iterate over collection (over=collection, as=current item)
|
|
48
|
+
event : Log/confirm/signal (action: log | confirm | signal)
|
|
49
|
+
error-handler : Exception handling (try > catch > finally)
|
|
50
|
+
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
51
|
+
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
52
|
+
-->
|
|
53
|
+
|
|
54
|
+
<workflow>
|
|
55
|
+
|
|
56
|
+
<!-- Global Rules -->
|
|
57
|
+
<rule id="GLOBAL-R1" level="mandatory" description="Continuous Execution: Execute all steps in sequence without interruption. Worker must complete all steps before reporting results." />
|
|
58
|
+
<rule id="GLOBAL-R-TECHSTACK" level="mandatory" description="Technology Stack Constraint: All generated documents must align with the detected technology stack of the platform." />
|
|
59
|
+
|
|
60
|
+
<!-- Input Block -->
|
|
61
|
+
<input name="platform_id" type="string" required="true" description="Platform identifier (e.g., web-react, backend-nestjs)" />
|
|
62
|
+
<input name="platform_type" type="string" required="true" description="Platform type (web, mobile, backend, desktop)" />
|
|
63
|
+
<input name="framework" type="string" required="true" description="Primary framework (react, nestjs, flutter, etc.)" />
|
|
64
|
+
<input name="source_path" type="string" required="true" description="Platform source directory" />
|
|
65
|
+
<input name="config_files" type="array" required="true" description="List of configuration file paths" />
|
|
66
|
+
<input name="convention_files" type="array" required="false" description="List of convention file paths" />
|
|
67
|
+
<input name="output_path" type="string" required="true" description="Output directory for generated documents" />
|
|
68
|
+
<input name="language" type="string" required="true" description="Target language (e.g., zh, en)" />
|
|
69
|
+
<input name="completed_dir" type="string" required="false" description="Directory for analysis coverage report output" />
|
|
70
|
+
|
|
71
|
+
<!-- Step 0: Read Document Templates -->
|
|
72
|
+
<task id="step0-read-templates" action="run-skill" description="Read document templates from templates directory">
|
|
73
|
+
<run-skill skill="read-templates" template-path="../speccrew-knowledge-techs-generate/templates/" />
|
|
74
|
+
</task>
|
|
75
|
+
|
|
76
|
+
<!-- Step 1: Read Configuration Files -->
|
|
77
|
+
<task id="step1-read-configs" action="read-files" description="Read primary configuration and convention files">
|
|
78
|
+
<read-files files="{config_files}, {convention_files}" />
|
|
79
|
+
</task>
|
|
80
|
+
|
|
81
|
+
<!-- Step 2: Extract Technology Stack -->
|
|
82
|
+
<task id="step2-extract-techstack" action="analyze" description="Parse configuration files to extract technology stack">
|
|
83
|
+
<extract>
|
|
84
|
+
<item name="core_framework" source="package.json|pom.xml|requirements.txt|pubspec.yaml|go.mod" />
|
|
85
|
+
<item name="dependencies" source="dependencies section" />
|
|
86
|
+
<item name="build_tools" source="devDependencies, scripts" />
|
|
87
|
+
</extract>
|
|
88
|
+
</task>
|
|
89
|
+
|
|
90
|
+
<!-- Step 3: Analyze Conventions -->
|
|
91
|
+
<task id="step3-analyze-conventions" action="analyze" description="Extract conventions from config files and analyze project structure">
|
|
92
|
+
<analyze>
|
|
93
|
+
<read file="speccrew-workspace/docs/rules/mermaid-rule.md" />
|
|
94
|
+
<extract from="ESLint/Prettier configs" />
|
|
95
|
+
<analyze-dir path="{source_path}" for="directory-conventions" />
|
|
96
|
+
</analyze>
|
|
97
|
+
</task>
|
|
98
|
+
|
|
99
|
+
<!-- Step 4: UI Style Analysis (Frontend Platforms Only) -->
|
|
100
|
+
<gateway id="step4-gateway" mode="exclusive" description="Check if platform is frontend">
|
|
101
|
+
<condition test="platform_type in [web, mobile, desktop]">
|
|
102
|
+
<task id="step4-ui-analyze" action="run-skill" description="Invoke UI style analysis skill">
|
|
103
|
+
<run-skill skill="speccrew-knowledge-techs-ui-analyze" args="source_path={source_path};platform_id={platform_id};platform_type={platform_type};framework={framework};output_path={output_path}/ui-style/;language={language}" />
|
|
104
|
+
</task>
|
|
105
|
+
</condition>
|
|
106
|
+
<fallback>
|
|
107
|
+
<event action="log" message="UI style analysis skipped for backend platform" />
|
|
108
|
+
</fallback>
|
|
109
|
+
</gateway>
|
|
110
|
+
|
|
111
|
+
<!-- Step 5: Generate Documents -->
|
|
112
|
+
<task id="step5-generate-docs" action="generate" description="Generate all required documents using template fill workflow">
|
|
113
|
+
<generate-docs template-path="../speccrew-knowledge-techs-generate/templates/" output-path="{output_path}">
|
|
114
|
+
<doc name="INDEX.md" template="INDEX-TEMPLATE.md" />
|
|
115
|
+
<doc name="tech-stack.md" template="TECH-STACK-TEMPLATE.md" />
|
|
116
|
+
<doc name="architecture.md" template="ARCHITECTURE-TEMPLATE.md" />
|
|
117
|
+
<doc name="conventions-design.md" template="CONVENTIONS-DESIGN-TEMPLATE.md" />
|
|
118
|
+
<doc name="conventions-dev.md" template="CONVENTIONS-DEV-TEMPLATE.md" />
|
|
119
|
+
<doc name="conventions-unit-test.md" template="CONVENTIONS-UNIT-TEST-TEMPLATE.md" />
|
|
120
|
+
<doc name="conventions-system-test.md" template="CONVENTIONS-SYSTEM-TEST-TEMPLATE.md" />
|
|
121
|
+
<doc name="conventions-build.md" template="CONVENTIONS-BUILD-TEMPLATE.md" />
|
|
122
|
+
</generate-docs>
|
|
123
|
+
</task>
|
|
124
|
+
|
|
125
|
+
<!-- Step 5b: Generate conventions-data.md for Backend -->
|
|
126
|
+
<gateway id="step5b-gateway" mode="exclusive" description="Check if data layer document needed">
|
|
127
|
+
<condition test="platform_type == backend or data_layer_detected">
|
|
128
|
+
<task id="step5b-generate-data" action="generate" description="Generate data layer conventions">
|
|
129
|
+
<generate-doc template="CONVENTIONS-DATA-TEMPLATE.md" output="{output_path}/conventions-data.md" />
|
|
130
|
+
</task>
|
|
131
|
+
</condition>
|
|
132
|
+
</gateway>
|
|
133
|
+
|
|
134
|
+
<!-- Step 6: Write Output Files -->
|
|
135
|
+
<task id="step6-write-output" action="write" description="Write all generated documents to output directory">
|
|
136
|
+
<write-files to="{output_path}" />
|
|
137
|
+
</task>
|
|
138
|
+
|
|
139
|
+
<!-- Step 7: Generate Analysis Coverage Report -->
|
|
140
|
+
<task id="step7-coverage-report" action="generate" description="Generate analysis coverage JSON report">
|
|
141
|
+
<generate-report output="{completed_dir}/{platform_id}.analysis.json" format="json">
|
|
142
|
+
<include name="topics_analysis" />
|
|
143
|
+
<include name="config_files_analyzed" />
|
|
144
|
+
<include name="source_dirs_scanned" />
|
|
145
|
+
<include name="documents_generated" />
|
|
146
|
+
</generate-report>
|
|
147
|
+
</task>
|
|
148
|
+
|
|
149
|
+
<!-- Step 8: Report Results -->
|
|
150
|
+
<event id="step8-report" action="log" description="Report generation results">
|
|
151
|
+
<report format="structured">
|
|
152
|
+
Platform Technology Documents Generated: {platform_id}
|
|
153
|
+
- INDEX.md: ✓
|
|
154
|
+
- tech-stack.md: ✓
|
|
155
|
+
- architecture.md: ✓
|
|
156
|
+
- conventions-design.md: ✓
|
|
157
|
+
- conventions-dev.md: ✓
|
|
158
|
+
- conventions-unit-test.md: ✓
|
|
159
|
+
- conventions-system-test.md: ✓
|
|
160
|
+
- conventions-build.md: ✓
|
|
161
|
+
- conventions-data.md: ✓ (or skipped)
|
|
162
|
+
- ui-style-guide.md: ✓ (frontend only)
|
|
163
|
+
- Output Directory: {output_path}
|
|
164
|
+
</report>
|
|
165
|
+
</event>
|
|
166
|
+
|
|
167
|
+
<!-- Output Block -->
|
|
168
|
+
<output name="status" from="generation_status" />
|
|
169
|
+
<output name="documents_generated" from="generated_files_list" />
|
|
170
|
+
<output name="coverage_report" from="analysis_coverage" />
|
|
171
|
+
|
|
172
|
+
</workflow>
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Reference Guides
|
|
177
|
+
|
|
178
|
+
### Mermaid Diagram Guide
|
|
179
|
+
|
|
180
|
+
**Key Requirements:** Use basic node definitions only. No HTML tags, no nested subgraphs, no `direction` keyword, no `style` definitions.
|
|
181
|
+
|
|
182
|
+
**Diagram Types**: `graph TB/LR` (structure), `flowchart TD` (logic), `sequenceDiagram` (interactions), `classDiagram` (classes), `erDiagram` (database), `stateDiagram-v2` (states)
|
|
183
|
+
|
|
184
|
+
### Source Traceability Requirements
|
|
185
|
+
|
|
186
|
+
**CRITICAL: All source file links MUST use RELATIVE PATHS.** No absolute paths, no `file://` protocol.
|
|
187
|
+
|
|
188
|
+
**Relative Path Calculation**: Documents at `speccrew-workspace/knowledges/techs/{platform_id}/` are 4 levels deep. Use `../../../../` prefix to reference project root files.
|
|
189
|
+
|
|
190
|
+
**Required Elements**:
|
|
191
|
+
1. File reference block at document beginning listing referenced files
|
|
192
|
+
2. `**Diagram Source**` annotation after each Mermaid diagram
|
|
193
|
+
3. `**Section Source**` annotation at end of major sections
|
|
194
|
+
|
|
195
|
+
### Document Content Specifications
|
|
196
|
+
|
|
197
|
+
#### INDEX.md
|
|
198
|
+
Platform summary, technology stack overview, navigation links, agent usage guide.
|
|
199
|
+
|
|
200
|
+
#### tech-stack.md
|
|
201
|
+
Overview, Core Technologies table, Dependencies (grouped), Development Tools, Configuration Files.
|
|
202
|
+
|
|
203
|
+
#### architecture.md
|
|
204
|
+
**Web**: Component Architecture, State Management, Routing, API Integration, Styling. **Backend**: Layered Architecture, DI, Module Organization, API Design, Middleware. **Mobile**: Widget Structure, State Management, Navigation, Platform considerations.
|
|
205
|
+
|
|
206
|
+
#### conventions-design.md
|
|
207
|
+
Design Principles (SOLID, DRY), Design Patterns, UI Design Conventions (reference ui-style/), Data Flow, Error Handling, Security, Performance.
|
|
208
|
+
|
|
209
|
+
#### conventions-dev.md
|
|
210
|
+
Naming Conventions, Directory Structure, Code Style (from ESLint/Prettier), Import/Export Patterns, Git Commit Conventions, Pre-Development Checklist, Code Review Checklist.
|
|
211
|
+
|
|
212
|
+
**Source extraction**: Prettier (.prettierrc), ESLint (.eslintrc), EditorConfig (.editorconfig), Git hooks (.husky/), Commit conventions (.commitlintrc), Runtime version (.nvmrc), IDE config (.vscode/).
|
|
213
|
+
|
|
214
|
+
#### conventions-unit-test.md / conventions-system-test.md
|
|
215
|
+
Unit Testing (framework, naming, location, template, run command), Integration Testing, E2E Testing (frontend only), Database Testing (backend only), Performance Testing, Coverage Requirements, Troubleshooting.
|
|
216
|
+
|
|
217
|
+
#### conventions-build.md
|
|
218
|
+
Build Tool & Configuration, Environment Management, Build Profiles & Outputs, CI/CD (if detected), Docker (if detected), Dependency Management.
|
|
219
|
+
|
|
220
|
+
#### conventions-data.md (Optional)
|
|
221
|
+
ORM/Database Tool, Data Modeling, Migrations, Query Optimization, Caching.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Template Usage
|
|
226
|
+
|
|
227
|
+
Templates are located at `../speccrew-knowledge-techs-generate/templates/`:
|
|
228
|
+
|
|
229
|
+
| Template File | Purpose |
|
|
230
|
+
|---------------|---------|
|
|
231
|
+
| INDEX-TEMPLATE.md | Platform overview |
|
|
232
|
+
| TECH-STACK-TEMPLATE.md | Technology stack |
|
|
233
|
+
| ARCHITECTURE-TEMPLATE.md | Architecture patterns |
|
|
234
|
+
| CONVENTIONS-DESIGN-TEMPLATE.md | Design principles |
|
|
235
|
+
| CONVENTIONS-DEV-TEMPLATE.md | Development conventions |
|
|
236
|
+
| CONVENTIONS-UNIT-TEST-TEMPLATE.md | Unit testing |
|
|
237
|
+
| CONVENTIONS-SYSTEM-TEST-TEMPLATE.md | System testing |
|
|
238
|
+
| CONVENTIONS-BUILD-TEMPLATE.md | Build/deployment |
|
|
239
|
+
| CONVENTIONS-DATA-TEMPLATE.md | Data layer |
|
|
240
|
+
|
|
241
|
+
## Checklist
|
|
242
|
+
|
|
243
|
+
### Pre-Generation
|
|
244
|
+
- [ ] All configuration files read and parsed
|
|
245
|
+
- [ ] Technology stack extracted accurately
|
|
246
|
+
- [ ] Conventions analyzed from config files
|
|
247
|
+
- [ ] Platform type identified
|
|
248
|
+
- [ ] Data layer detection completed for non-backend platforms
|
|
249
|
+
|
|
250
|
+
### Required Documents (All Platforms)
|
|
251
|
+
- [ ] INDEX.md, tech-stack.md, architecture.md
|
|
252
|
+
- [ ] conventions-design.md, conventions-dev.md
|
|
253
|
+
- [ ] conventions-unit-test.md, conventions-system-test.md, conventions-build.md
|
|
254
|
+
|
|
255
|
+
### Optional Document
|
|
256
|
+
- [ ] conventions-data.md (if applicable)
|
|
257
|
+
|
|
258
|
+
### UI Style Analysis (Frontend Platforms)
|
|
259
|
+
- [ ] ui-analyze skill invoked
|
|
260
|
+
- [ ] ui-style-guide.md generated
|
|
261
|
+
- [ ] UI conventions referenced in conventions-design.md
|
|
262
|
+
|
|
263
|
+
## Task Completion Report
|
|
264
|
+
|
|
265
|
+
Upon completion, output the following structured report:
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"status": "success | partial | failed",
|
|
270
|
+
"skill": "speccrew-knowledge-techs-generate-xml",
|
|
271
|
+
"output_files": [
|
|
272
|
+
"{output_path}/INDEX.md",
|
|
273
|
+
"{output_path}/tech-stack.md",
|
|
274
|
+
"{output_path}/architecture.md"
|
|
275
|
+
],
|
|
276
|
+
"summary": "Tech documentation generated for {platform_id}",
|
|
277
|
+
"metrics": {
|
|
278
|
+
"documents_generated": 0,
|
|
279
|
+
"sections_filled": 0,
|
|
280
|
+
"code_examples_included": 0
|
|
281
|
+
},
|
|
282
|
+
"errors": [],
|
|
283
|
+
"next_steps": ["Run quality check via speccrew-knowledge-techs-generate-quality"]
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## CONTINUOUS EXECUTION RULES
|
|
290
|
+
|
|
291
|
+
This skill follows the continuous execution pattern defined in `GLOBAL-R1`:
|
|
292
|
+
|
|
293
|
+
1. **Sequential Execution**: All workflow steps must execute in the defined order without interruption.
|
|
294
|
+
2. **No User Prompts**: Worker must not pause for user confirmation between steps.
|
|
295
|
+
3. **Complete All Steps**: Worker must complete all steps before reporting results.
|
|
296
|
+
4. **Error Handling**: If any step fails, continue with remaining steps if possible, then report all errors together.
|
|
297
|
+
5. **Technology Stack Constraint**: Per `GLOBAL-R-TECHSTACK`, all generated documents must align with the detected technology stack.
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speccrew-knowledge-techs-index-xml
|
|
3
|
+
description: Stage 3 of technology knowledge initialization - Generate root INDEX.md by aggregating all platform technology documents using XML workflow blocks. Creates the master index that maps platforms to their documentation and provides Agent-to-Platform mapping guide. Used by Worker Agent after all platform documents are generated.
|
|
4
|
+
tools: Read, Write, Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Stage 3: Generate Root Technology Index (XML Workflow)
|
|
8
|
+
|
|
9
|
+
Aggregate all platform technology documentation into a single root INDEX.md that serves as the master navigation hub for technology knowledge.
|
|
10
|
+
|
|
11
|
+
## Language Adaptation
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: Generate all content in the language specified by the `language` parameter.
|
|
14
|
+
|
|
15
|
+
- `language: "zh"` → Generate all content in 中文
|
|
16
|
+
- `language: "en"` → Generate all content in English
|
|
17
|
+
- Other languages → Use the specified language
|
|
18
|
+
|
|
19
|
+
## Trigger Scenarios
|
|
20
|
+
|
|
21
|
+
- "Generate techs root index"
|
|
22
|
+
- "Create technology knowledge index"
|
|
23
|
+
- "Aggregate platform tech docs"
|
|
24
|
+
- "Generate master tech index"
|
|
25
|
+
|
|
26
|
+
## User
|
|
27
|
+
|
|
28
|
+
Worker Agent (speccrew-task-worker)
|
|
29
|
+
|
|
30
|
+
## Input
|
|
31
|
+
|
|
32
|
+
- `manifest_path`: Path to techs-manifest.json
|
|
33
|
+
- `techs_base_path`: Base path for techs documentation (default: `speccrew-workspace/knowledges/techs/`)
|
|
34
|
+
- `output_path`: Output path for root INDEX.md (default: `speccrew-workspace/knowledges/techs/`)
|
|
35
|
+
- `language`: Target language (e.g., "zh", "en") - **REQUIRED**
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
- `{{output_path}}/INDEX.md` - Root technology knowledge index
|
|
40
|
+
|
|
41
|
+
**INDEX.md Content Structure**:
|
|
42
|
+
- Introduction (generation info, platform count)
|
|
43
|
+
- Platform Overview (table with links to all platform docs)
|
|
44
|
+
- Quick Reference (links organized by document type)
|
|
45
|
+
- Agent-to-Platform Mapping (maps agents to their platform docs)
|
|
46
|
+
- Document Guide (explains each document type)
|
|
47
|
+
- Usage Guide (how to use the knowledge)
|
|
48
|
+
|
|
49
|
+
## Workflow
|
|
50
|
+
|
|
51
|
+
<!--
|
|
52
|
+
== Block Types ==
|
|
53
|
+
input : Workflow input parameters (required=mandatory, default=default value)
|
|
54
|
+
output : Workflow output results (from=data source variable)
|
|
55
|
+
task : Execute action (action: run-skill | run-script | dispatch-to-worker)
|
|
56
|
+
gateway : Conditional branch/gate (mode: exclusive | guard | parallel)
|
|
57
|
+
loop : Iterate over collection (over=collection, as=current item)
|
|
58
|
+
event : Log/confirm/signal (action: log | confirm | signal)
|
|
59
|
+
error-handler : Exception handling (try > catch > finally)
|
|
60
|
+
checkpoint : Persistent milestone (name=checkpoint name, verify=verification condition)
|
|
61
|
+
rule : Constraint declaration (level: forbidden | mandatory | note)
|
|
62
|
+
-->
|
|
63
|
+
|
|
64
|
+
<workflow>
|
|
65
|
+
|
|
66
|
+
<!-- Global Rules -->
|
|
67
|
+
<rule id="GLOBAL-R1" level="mandatory" description="Continuous Execution: Execute all steps in sequence without interruption. Worker must complete all steps before reporting results." />
|
|
68
|
+
<rule id="GLOBAL-R-TECHSTACK" level="mandatory" description="Technology Stack Constraint: All generated index documents must accurately reflect detected platform technology stacks." />
|
|
69
|
+
|
|
70
|
+
<!-- Input Block -->
|
|
71
|
+
<input name="manifest_path" type="string" required="true" description="Path to techs-manifest.json" />
|
|
72
|
+
<input name="techs_base_path" type="string" required="false" default="speccrew-workspace/knowledges/techs/" description="Base path for techs documentation" />
|
|
73
|
+
<input name="output_path" type="string" required="false" default="speccrew-workspace/knowledges/techs/" description="Output path for root INDEX.md" />
|
|
74
|
+
<input name="language" type="string" required="true" description="Target language (e.g., zh, en)" />
|
|
75
|
+
|
|
76
|
+
<!-- Step 0: Read Root Index Template -->
|
|
77
|
+
<task id="step0-read-template" action="read" description="Read root index template to understand required structure">
|
|
78
|
+
<read-file path="../speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md" />
|
|
79
|
+
</task>
|
|
80
|
+
|
|
81
|
+
<!-- Step 1: Read Manifest -->
|
|
82
|
+
<task id="step1-read-manifest" action="read" description="Read techs-manifest.json to get platform list">
|
|
83
|
+
<read-file path="{manifest_path}" />
|
|
84
|
+
</task>
|
|
85
|
+
|
|
86
|
+
<!-- Step 2: Verify Platform Documents -->
|
|
87
|
+
<loop id="step2-verify-docs" over="platforms" as="platform" description="Scan each platform directory for document availability">
|
|
88
|
+
<task id="step2a-scan-dir" action="list" description="List all .md files in platform directory">
|
|
89
|
+
<list-dir path="{techs_base_path}/{platform.platform_id}/" filter="*.md" />
|
|
90
|
+
</task>
|
|
91
|
+
<task id="step2b-verify-required" action="verify" description="Check required documents exist">
|
|
92
|
+
<verify-docs>
|
|
93
|
+
<required name="INDEX.md" on-missing="skip-platform" />
|
|
94
|
+
<required name="tech-stack.md" on-missing="mark-incomplete" />
|
|
95
|
+
<required name="architecture.md" on-missing="mark-incomplete" />
|
|
96
|
+
<required name="conventions-design.md" on-missing="mark-incomplete" />
|
|
97
|
+
<required name="conventions-dev.md" on-missing="mark-incomplete" />
|
|
98
|
+
<required name="conventions-test.md" on-missing="mark-incomplete" />
|
|
99
|
+
<required name="conventions-build.md" on-missing="mark-incomplete" />
|
|
100
|
+
<optional name="conventions-data.md" />
|
|
101
|
+
</verify-docs>
|
|
102
|
+
</task>
|
|
103
|
+
</loop>
|
|
104
|
+
|
|
105
|
+
<!-- Step 3: Extract Platform Summaries -->
|
|
106
|
+
<loop id="step3-extract-summaries" over="platforms" as="platform" description="Read each platform INDEX.md for summary extraction">
|
|
107
|
+
<gateway mode="guard" condition="platform.documents.INDEX.md exists">
|
|
108
|
+
<task action="read" description="Read platform INDEX.md">
|
|
109
|
+
<read-file path="{techs_base_path}/{platform.platform_id}/INDEX.md" />
|
|
110
|
+
</task>
|
|
111
|
+
<task action="extract" description="Extract platform name, framework, language, key technologies">
|
|
112
|
+
<extract-fields>
|
|
113
|
+
<field name="platform_name" />
|
|
114
|
+
<field name="framework" />
|
|
115
|
+
<field name="language" />
|
|
116
|
+
<field name="key_technologies" />
|
|
117
|
+
</extract-fields>
|
|
118
|
+
</task>
|
|
119
|
+
</gateway>
|
|
120
|
+
</loop>
|
|
121
|
+
|
|
122
|
+
<!-- Step 4: Get Timestamp -->
|
|
123
|
+
<task id="step4-get-timestamp" action="run-skill" description="Get current timestamp for generated_at field">
|
|
124
|
+
<run-skill skill="speccrew-get-timestamp" />
|
|
125
|
+
</task>
|
|
126
|
+
|
|
127
|
+
<!-- Step 5: Generate Root INDEX.md -->
|
|
128
|
+
<task id="step5-generate-index" action="generate" description="Generate root INDEX.md using template fill workflow">
|
|
129
|
+
<generate-index template-path="../speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md" output-path="{output_path}/INDEX.md">
|
|
130
|
+
<copy-template />
|
|
131
|
+
<fill-sections>
|
|
132
|
+
<section name="header" with="{generated_at}, {source_path}, {platform_count}" />
|
|
133
|
+
<section name="platform-overview" with="dynamic_links_from_verification" />
|
|
134
|
+
<section name="quick-reference" with="organized_links" />
|
|
135
|
+
<section name="agent-mapping" with="platform_agent_documents" />
|
|
136
|
+
<section name="document-guide" with="document_descriptions" />
|
|
137
|
+
<section name="usage-guide" with="agent_usage_instructions" />
|
|
138
|
+
</fill-sections>
|
|
139
|
+
</generate-index>
|
|
140
|
+
</task>
|
|
141
|
+
|
|
142
|
+
<!-- Step 6: Write Output -->
|
|
143
|
+
<task id="step6-write-output" action="write" description="Write generated INDEX.md to output path">
|
|
144
|
+
<write-file path="{output_path}/INDEX.md" />
|
|
145
|
+
</task>
|
|
146
|
+
|
|
147
|
+
<!-- Step 7: Report Results -->
|
|
148
|
+
<event id="step7-report" action="log" description="Report generation results">
|
|
149
|
+
<report format="structured">
|
|
150
|
+
Stage 3 completed: Root Technology Index Generated
|
|
151
|
+
- Platforms Indexed: {platform_count}
|
|
152
|
+
- web-react: ✓
|
|
153
|
+
- backend-nestjs: ✓
|
|
154
|
+
- Root Index: {output_path}/INDEX.md
|
|
155
|
+
- Agent Mappings: Documented for all platforms
|
|
156
|
+
</report>
|
|
157
|
+
</event>
|
|
158
|
+
|
|
159
|
+
<!-- Output Block -->
|
|
160
|
+
<output name="status" from="generation_status" />
|
|
161
|
+
<output name="platforms_indexed" from="indexed_platforms_list" />
|
|
162
|
+
<output name="output_file" from="index_file_path" />
|
|
163
|
+
|
|
164
|
+
</workflow>
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Template Usage
|
|
169
|
+
|
|
170
|
+
Templates are located at `../speccrew-knowledge-techs-index/templates/`:
|
|
171
|
+
|
|
172
|
+
**Template Variables:**
|
|
173
|
+
- `{{generated_at}}`: ISO timestamp
|
|
174
|
+
- `{{source_path}}`: Source path
|
|
175
|
+
- `{{platform_count}}`: Number of platforms
|
|
176
|
+
- `{{#each platforms}}`: Loop through platforms
|
|
177
|
+
- `{{platform_id}}`: Platform identifier
|
|
178
|
+
- `{{platform_type}}`: Platform type
|
|
179
|
+
- `{{framework}}`: Framework name
|
|
180
|
+
- `{{language}}`: Programming language
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Document Structure Details
|
|
185
|
+
|
|
186
|
+
### Section 1: Header
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
# Technology Knowledge Index
|
|
190
|
+
|
|
191
|
+
**Files Referenced in This Document**
|
|
192
|
+
|
|
193
|
+
- [techs-manifest.json](../../../speccrew-workspace/knowledges/techs/techs-manifest.json)
|
|
194
|
+
|
|
195
|
+
> **Target Audience**: devcrew-designer-*, devcrew-dev-*, devcrew-test-*
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Section 2: Platform Overview
|
|
199
|
+
|
|
200
|
+
Summary table of all platforms with **dynamically generated document links**:
|
|
201
|
+
|
|
202
|
+
```markdown
|
|
203
|
+
## Platform Overview
|
|
204
|
+
|
|
205
|
+
| Platform | Type | Framework | Stack | Arch | Design | Dev | Test | Build | Data |
|
|
206
|
+
|----------|------|-----------|-------|------|--------|-----|------|-------|------|
|
|
207
|
+
| [web-react](web-react/INDEX.md) | web | React | [Stack](web-react/tech-stack.md) | ... | ... | ... | ... | ... | - |
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Dynamic Link Generation Rules:**
|
|
211
|
+
|
|
212
|
+
1. **Always include links to required documents** (if they exist)
|
|
213
|
+
2. **Conditionally include conventions-data.md**: Show `-` if not exists
|
|
214
|
+
3. **Link Format**: Use short abbreviations to save space
|
|
215
|
+
|
|
216
|
+
### Section 3: Quick Reference
|
|
217
|
+
|
|
218
|
+
Quick links organized by document type (Technology Stacks, Architecture Guidelines, Design Conventions, etc.)
|
|
219
|
+
|
|
220
|
+
### Section 4: Agent-to-Platform Mapping
|
|
221
|
+
|
|
222
|
+
Critical section that defines how Agents map to platform documentation. **Must dynamically adjust based on actual document availability.**
|
|
223
|
+
|
|
224
|
+
**Dynamic Adjustment Rules:**
|
|
225
|
+
|
|
226
|
+
1. **Designer Agent Documents**: Primary + Optional (conventions-data.md, ui-style-patterns/)
|
|
227
|
+
2. **Developer Agent Documents**: Primary (conventions-dev.md, conventions-build.md) + Optional
|
|
228
|
+
3. **Tester Agent Documents**: Primary (conventions-test.md, conventions-build.md) + Optional
|
|
229
|
+
|
|
230
|
+
### Section 5: Document Guide
|
|
231
|
+
|
|
232
|
+
Explain what each document type contains.
|
|
233
|
+
|
|
234
|
+
### Section 6: Usage Guide
|
|
235
|
+
|
|
236
|
+
How to use the technology knowledge for Designer, Developer, and Tester Agents.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Checklist
|
|
241
|
+
|
|
242
|
+
### Pre-Generation
|
|
243
|
+
- [ ] techs-manifest.json read successfully
|
|
244
|
+
- [ ] Platform list extracted from manifest
|
|
245
|
+
|
|
246
|
+
### Dynamic Document Detection
|
|
247
|
+
- [ ] Each platform directory scanned for actual document existence
|
|
248
|
+
- [ ] Document availability map created for each platform
|
|
249
|
+
- [ ] Required documents verified
|
|
250
|
+
- [ ] Optional conventions-data.md existence checked per platform
|
|
251
|
+
|
|
252
|
+
### Content Generation
|
|
253
|
+
- [ ] Platform summaries extracted from existing INDEX.md files
|
|
254
|
+
- [ ] Root INDEX.md generated with all sections
|
|
255
|
+
- [ ] **Platform Overview table**: Links dynamically generated based on actual document existence
|
|
256
|
+
- [ ] **Agent-to-Platform mapping**: Document recommendations adjusted per platform
|
|
257
|
+
- [ ] Document guide included
|
|
258
|
+
- [ ] Usage guide included
|
|
259
|
+
|
|
260
|
+
### Quality & Validation
|
|
261
|
+
- [ ] No broken links to non-existent documents
|
|
262
|
+
- [ ] conventions-data.md links only included for platforms where it exists
|
|
263
|
+
- [ ] **Source traceability**: File reference block added to root INDEX.md
|
|
264
|
+
- [ ] Output file written successfully
|
|
265
|
+
- [ ] Results reported with document availability summary
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## CONTINUOUS EXECUTION RULES
|
|
270
|
+
|
|
271
|
+
This skill follows the continuous execution pattern defined in `GLOBAL-R1`:
|
|
272
|
+
|
|
273
|
+
1. **Sequential Execution**: All workflow steps must execute in the defined order without interruption.
|
|
274
|
+
2. **No User Prompts**: Worker must not pause for user confirmation between steps.
|
|
275
|
+
3. **Complete All Steps**: Worker must complete all steps before reporting results.
|
|
276
|
+
4. **Error Handling**: If any step fails, continue with remaining steps if possible, then report all errors together.
|
|
277
|
+
5. **Technology Stack Constraint**: Per `GLOBAL-R-TECHSTACK`, all generated index documents must accurately reflect detected platform technology stacks.
|