architext 0.0.4 → 0.0.6
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/CHANGELOG.md +55 -1
- package/README.md +93 -14
- package/README.zh-CN.md +92 -14
- package/dist/index.js +53 -39
- package/dist/templates/en/briefs/_base.md +53 -13
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/global/error_memory.json +40 -0
- package/dist/templates/en/docs/global/map.json +46 -90
- package/dist/templates/en/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +6 -13
- package/dist/templates/en/{rules/02_tech_stack.md → docs/global/tech_stack.md} +7 -18
- package/dist/templates/en/docs/global/vision.md +1 -1
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +99 -89
- package/dist/templates/en/docs/prompts/edit.md +61 -51
- package/dist/templates/en/docs/prompts/fix.md +59 -43
- package/dist/templates/en/docs/prompts/help.md +23 -31
- package/dist/templates/en/docs/prompts/inherit.md +97 -117
- package/dist/templates/en/docs/prompts/map.md +48 -69
- package/dist/templates/en/docs/prompts/plan.md +141 -240
- package/dist/templates/en/docs/prompts/recover.md +19 -34
- package/dist/templates/en/docs/prompts/ref.md +43 -138
- package/dist/templates/en/docs/prompts/remove.md +63 -110
- package/dist/templates/en/docs/prompts/revise.md +71 -106
- package/dist/templates/en/docs/prompts/scope.md +78 -117
- package/dist/templates/en/docs/prompts/script.md +102 -0
- package/dist/templates/en/docs/prompts/start.md +98 -132
- package/dist/templates/en/docs/prompts/ui.md +113 -0
- package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/en/docs/templates/spec.template.md +1 -1
- package/dist/templates/en/docs/templates/ui.template.md +8 -8
- package/dist/templates/en/rules/00_system.md +268 -117
- package/dist/templates/en/rules/90_custom_rules.md +3 -1
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +37 -23
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +138 -240
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -1
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +10 -6
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -2
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -301
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +24 -25
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +175 -305
- package/dist/templates/icon.svg +16 -0
- package/dist/templates/zh/briefs/_base.md +56 -17
- package/dist/templates/zh/briefs/_modules.md +28 -1
- package/dist/templates/zh/docs/global/error_memory.json +40 -0
- package/dist/templates/zh/docs/global/map.json +39 -109
- package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
- package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
- package/dist/templates/zh/docs/global/vision.md +1 -1
- package/dist/templates/zh/docs/prompts/audit.md +43 -57
- package/dist/templates/zh/docs/prompts/code.md +66 -56
- package/dist/templates/zh/docs/prompts/edit.md +52 -42
- package/dist/templates/zh/docs/prompts/fix.md +39 -29
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +67 -86
- package/dist/templates/zh/docs/prompts/map.md +28 -50
- package/dist/templates/zh/docs/prompts/plan.md +100 -199
- package/dist/templates/zh/docs/prompts/recover.md +9 -24
- package/dist/templates/zh/docs/prompts/ref.md +11 -106
- package/dist/templates/zh/docs/prompts/remove.md +39 -74
- package/dist/templates/zh/docs/prompts/revise.md +47 -88
- package/dist/templates/zh/docs/prompts/scope.md +52 -91
- package/dist/templates/zh/docs/prompts/script.md +102 -0
- package/dist/templates/zh/docs/prompts/start.md +75 -110
- package/dist/templates/zh/docs/prompts/ui.md +113 -0
- package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
- package/dist/templates/zh/docs/templates/spec.template.md +1 -1
- package/dist/templates/zh/docs/templates/ui.template.md +8 -8
- package/dist/templates/zh/rules/00_system.md +252 -131
- package/dist/templates/zh/rules/90_custom_rules.md +2 -1
- package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -235
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -1
- package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -2
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -301
- package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +174 -301
- package/package.json +3 -1
- package/dist/templates/en/rules/01_workflow.md +0 -93
- package/dist/templates/en/rules/03_data_governance.md +0 -102
- package/dist/templates/en/rules/99_context_glue.md +0 -53
- package/dist/templates/zh/rules/01_workflow.md +0 -94
- package/dist/templates/zh/rules/03_data_governance.md +0 -133
- package/dist/templates/zh/rules/99_context_glue.md +0 -53
|
@@ -1,150 +1,136 @@
|
|
|
1
1
|
<protocol_audit>
|
|
2
|
-
**Trigger**: `/archi.audit [id]`
|
|
3
|
-
**Goal**: Independent deep code
|
|
2
|
+
**Trigger**: `/archi.audit [id]` | Auto-loaded by Workflow Dispatch on natural language trigger
|
|
3
|
+
**Goal**: Independent deep code review. With `<id>` review that task's code implementation; without `<id>` run project-wide health check. Do not modify code; output review report and fix work items only.
|
|
4
4
|
|
|
5
5
|
<meta>
|
|
6
6
|
<style>Investigative, Thorough, Evidence-Based</style>
|
|
7
7
|
<language>English</language>
|
|
8
8
|
<principles>
|
|
9
|
-
1. **Read-Only**:
|
|
10
|
-
2. **Evidence-Based**:
|
|
11
|
-
3. **Actionable Output**:
|
|
12
|
-
4. **Vision Anchored**: Always use `vision.md` as
|
|
13
|
-
5. **Report Persistence**:
|
|
9
|
+
1. **Read-Only**: Do not modify any code files. Review ≠ Fix.
|
|
10
|
+
2. **Evidence-Based**: Each finding must include file path, line number, code snippet.
|
|
11
|
+
3. **Actionable Output**: Each issue must include recommended fix command (`/archi.fix`, `/archi.edit`, etc.).
|
|
12
|
+
4. **Vision Anchored**: Always use `vision.md` as direction anchor; detect drift.
|
|
13
|
+
5. **Report Persistence**: Review results must be written to file — task-level → `tasks/<id>_*/audit.md` (overwrite); project-level → `audits/YYYY-MM-DD.md` (date archive).
|
|
14
|
+
6. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints, not fight IDE planning/execution mechanisms.
|
|
14
15
|
</principles>
|
|
15
16
|
</meta>
|
|
16
17
|
|
|
17
18
|
<step_1_resolve>
|
|
18
|
-
**Role**: System Analyst
|
|
19
19
|
**Mode Gate**:
|
|
20
20
|
|
|
21
21
|
| Input | Mode | Next Steps |
|
|
22
22
|
|:---|:---|:---|
|
|
23
|
-
| `/archi.audit <id>` | Task-level deep
|
|
24
|
-
| `/archi.audit` | Project-level health check |
|
|
23
|
+
| `/archi.audit <id>` | Task-level deep review | step_2a_task → step_3_report |
|
|
24
|
+
| `/archi.audit` | Project-level health check | step_2b_project → step_3_report |
|
|
25
25
|
|
|
26
26
|
**Task-level — Resolve ID**:
|
|
27
|
-
1. Parse `<id>` from
|
|
28
|
-
2. **Status Gate** —
|
|
27
|
+
1. Parse `<id>` from roadmap.json → Task Name, Slug, status.
|
|
28
|
+
2. **Status Gate** — only `active` or `done` may be reviewed:
|
|
29
29
|
|
|
30
30
|
| Status | Handling |
|
|
31
31
|
|:---|:---|
|
|
32
32
|
| `active` / `done` | Pass |
|
|
33
|
-
| `pending` | Reject — no code to
|
|
34
|
-
| `blocked` | Reject —
|
|
35
|
-
|
|
36
|
-
3. **Load
|
|
37
|
-
- `[[__DOCS_DIR__]]/global/vision.md` — Project directional baseline
|
|
38
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/spec.md` — Task logic
|
|
39
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/plan.json` — Task checklist
|
|
40
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/ui.md` — Task UI scope declaration (if exists)
|
|
41
|
-
- [?UI] `[[__DOCS_DIR__]]/global/ui_context.md` — AI screen index (locate corresponding screen IDs)
|
|
42
|
-
- [?UI] `[[__DOCS_DIR__]]/global/ui_concept.html` — read-only visual reference (source of visual truth for #10 compliance comparison)
|
|
43
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/audit.md` — Previous audit report (if exists, for comparison)
|
|
44
|
-
- `02_tech_stack.md` — Technical red lines
|
|
45
|
-
- [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
|
|
46
|
-
- [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
|
|
47
|
-
4. Read all code files corresponding to this task.
|
|
33
|
+
| `pending` | Reject — no code to review |
|
|
34
|
+
| `blocked` | Reject — upstream deps incomplete |
|
|
35
|
+
|
|
36
|
+
3. **Load**: vision.md (direction anchor) + task docs (spec/plan/ui) + prior audit.md (for comparison) + project context (tech_stack/design_tokens/data_snapshot/ui_context/screens/). Read all code files for this task.
|
|
48
37
|
|
|
49
38
|
**Project-level — Load Overview**:
|
|
50
|
-
1. Read
|
|
51
|
-
2.
|
|
52
|
-
3.
|
|
53
|
-
4. Read project code entry points and key modules.
|
|
39
|
+
1. Read vision.md, roadmap.json, map.json, tech_stack.md.
|
|
40
|
+
2. Scan tasks/ directory structure.
|
|
41
|
+
3. Read project code entry points and key modules.
|
|
54
42
|
|
|
55
|
-
**Output**:
|
|
43
|
+
**Output**: Review scope and context checklist. Enter step_2a_task or step_2b_project.
|
|
56
44
|
</step_1_resolve>
|
|
57
45
|
|
|
58
|
-
<
|
|
46
|
+
<step_2a_task>
|
|
59
47
|
**Role**: Chief Auditor
|
|
60
|
-
**Scope**: Task-level deep code
|
|
48
|
+
**Scope**: Task-level deep code review (only when `/archi.audit <id>`).
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
Review dimension by dimension; each finding must include `file:line` + code snippet + severity:
|
|
63
51
|
|
|
64
|
-
| # | Dimension |
|
|
52
|
+
| # | Dimension | Review focus |
|
|
65
53
|
|:---|:---|:---|
|
|
66
|
-
| 1 | **Vision
|
|
67
|
-
| 2 | **Spec
|
|
68
|
-
| 3 | **Plan
|
|
69
|
-
| 4 | **Logic
|
|
70
|
-
| 5 | **Bug
|
|
71
|
-
| 6 | **Error
|
|
72
|
-
| 7 | **Tech Stack
|
|
73
|
-
| 8 | **Security** | Sensitive info
|
|
74
|
-
| 9 | **Performance** | Unnecessary full imports
|
|
75
|
-
| 10 |
|
|
76
|
-
| 11 |
|
|
77
|
-
| 12 |
|
|
78
|
-
| 13 | **Orphan .gitkeep** |
|
|
79
|
-
| 14 | **Spec-Code
|
|
80
|
-
| 15 |
|
|
81
|
-
|
|
82
|
-
**Output**:
|
|
83
|
-
</
|
|
84
|
-
|
|
85
|
-
<
|
|
54
|
+
| 1 | **Vision alignment** | Implementation direction conflicts or drift from `vision.md` |
|
|
55
|
+
| 2 | **Spec completeness** | Code covers all scenarios and boundaries in `spec.md` |
|
|
56
|
+
| 3 | **Plan truthfulness** | Tasks marked `done` actually implemented (prevent false completion) |
|
|
57
|
+
| 4 | **Logic correctness** | Business logic errors, contradictions, missing branches, state machine defects |
|
|
58
|
+
| 5 | **Bug hunting** | null/undefined, race conditions, resource leaks, infinite loops, off-by-one |
|
|
59
|
+
| 6 | **Error handling** | Swallowing, silent failure, error propagation chain, user-visible feedback |
|
|
60
|
+
| 7 | **Tech Stack compliance** | Per `tech_stack.md`: forbidden patterns, outdated API, hardcoding |
|
|
61
|
+
| 8 | **Security** | Sensitive info leak, unvalidated input, injection risk, permission checks |
|
|
62
|
+
| 9 | **Performance** | Unnecessary full imports, large loops, dead computation, memory leaks, N+1 queries |
|
|
63
|
+
| 10 | (When this task involves UI) **Design compliance** | Token usage; no hardcoded magic values; visual consistency with `screens/S-XX.html` |
|
|
64
|
+
| 11 | (When this task involves data) **Data consistency** | Field names/types match `data_snapshot.json` |
|
|
65
|
+
| 12 | (i18n projects only) **I18n compliance** | No hardcoded strings; must use Key/dictionary refs |
|
|
66
|
+
| 13 | **Orphan .gitkeep** | `.gitkeep` exists when dir has other files — remove |
|
|
67
|
+
| 14 | **Spec-Code drift** | Interface/type/behavior match `spec.md`; manual changes synced to docs |
|
|
68
|
+
| 15 | (When this task involves UI) **UI ref completeness** | `ui.md` `ref: screens/S-XX.html` pointers still valid |
|
|
69
|
+
|
|
70
|
+
**Output**: Finding list grouped by dimension; each with level, location, description. Enter step_3_report.
|
|
71
|
+
</step_2a_task>
|
|
72
|
+
|
|
73
|
+
<step_2b_project>
|
|
86
74
|
**Role**: Chief Auditor
|
|
87
|
-
**Scope**: Project-level health check (
|
|
75
|
+
**Scope**: Project-level health check (only when `/archi.audit` no args).
|
|
88
76
|
|
|
89
|
-
| # | Check
|
|
77
|
+
| # | Check | Description |
|
|
90
78
|
|:---|:---|:---|
|
|
91
|
-
| 1 | **Vision
|
|
92
|
-
| 2 | **Architecture
|
|
93
|
-
| 3 | **Roadmap
|
|
94
|
-
| 4 | **
|
|
95
|
-
| 5 | **Tech Stack
|
|
96
|
-
| 6 | **Cross-Task
|
|
97
|
-
| 7 | **Orphan .gitkeep** |
|
|
98
|
-
|
|
99
|
-
After
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
**Output**: Project health overview + deep audit recommendation list.
|
|
105
|
-
</step_2_project>
|
|
79
|
+
| 1 | **Vision drift** | `roadmap.json` task directions align with `vision.md` |
|
|
80
|
+
| 2 | **Architecture consistency** | `map.json` vs actual dir structure; drift or unregistered modules |
|
|
81
|
+
| 3 | **Roadmap health** | Consistency + progress stats + long blocked + dep cycle detection |
|
|
82
|
+
| 4 | **Doc completeness** | Each Task has spec.md + plan.json; orphan directories |
|
|
83
|
+
| 5 | **Tech Stack global compliance** | Spot-check key entry points and modules |
|
|
84
|
+
| 6 | **Cross-Task consistency** | Duplicate logic, naming conflicts, interface inconsistency |
|
|
85
|
+
| 7 | **Orphan .gitkeep** | `.gitkeep` exists when dir has other files |
|
|
86
|
+
|
|
87
|
+
After scan, recommend tasks for deep review (`done` but plan incomplete / large codebase no tests / long `active`).
|
|
88
|
+
|
|
89
|
+
**Output**: Project health overview + deep review recommendation list. Enter step_3_report.
|
|
90
|
+
</step_2b_project>
|
|
106
91
|
|
|
107
92
|
<step_3_report>
|
|
108
|
-
**Role**: Report Writer
|
|
109
93
|
**Action**:
|
|
110
94
|
|
|
111
95
|
**Issue Classification**:
|
|
112
96
|
|
|
113
97
|
| Level | Meaning | Example |
|
|
114
98
|
|:---|:---|:---|
|
|
115
|
-
| `CRITICAL` | Must fix, blocks release | Logic
|
|
116
|
-
| `WARNING` | Should fix,
|
|
117
|
-
| `INFO` | Suggested
|
|
99
|
+
| `CRITICAL` | Must fix, blocks release | Logic error, security hole, data corruption risk |
|
|
100
|
+
| `WARNING` | Should fix, risk exists | Missing error handling, performance hazard, Spec coverage gap |
|
|
101
|
+
| `INFO` | Suggested optimization | Non-standard naming, missing comments, simplifiable code |
|
|
118
102
|
|
|
119
103
|
**Issue Format** (each must include):
|
|
120
104
|
```
|
|
121
|
-
[LEVEL] file
|
|
122
|
-
Description: specific
|
|
105
|
+
[LEVEL] file:line — Dimension name
|
|
106
|
+
Description: specific problem
|
|
123
107
|
-> Recommended fix: /archi.fix <ID> <description> or /archi.edit <ID> <description>
|
|
124
108
|
```
|
|
125
109
|
|
|
126
|
-
**Action Routing
|
|
110
|
+
**Action Routing**:
|
|
127
111
|
|
|
128
112
|
| Issue Type | Recommended Command |
|
|
129
113
|
|:---|:---|
|
|
130
|
-
| Bug
|
|
131
|
-
| Spec gap
|
|
132
|
-
| Architecture-level
|
|
133
|
-
|
|
|
134
|
-
| Minor
|
|
135
|
-
|
|
136
|
-
**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
114
|
+
| Bug | `/archi.fix <ID> <description>` |
|
|
115
|
+
| Spec gap | `/archi.edit <ID> <supplement description>` |
|
|
116
|
+
| Architecture-level | `/archi.revise <description>` |
|
|
117
|
+
| Feature incomplete | `/archi.code <ID>` |
|
|
118
|
+
| Minor | Address in next `/archi.code` |
|
|
119
|
+
|
|
120
|
+
**Pre-signoff Checklist** (confirm each item before writing report file):
|
|
121
|
+
□ (Task-level) All 15 review dimensions covered; inapplicable items marked N/A (not silently skipped)
|
|
122
|
+
□ (Project-level) All 7 checklist items evaluated
|
|
123
|
+
□ Each CRITICAL/WARNING finding includes `file:line` + code snippet
|
|
124
|
+
□ Each finding includes a recommended fix command (/archi.fix / /archi.edit etc.)
|
|
125
|
+
□ Report written to correct file (task-level: tasks/<id>/audit.md; project-level: audits/YYYY-MM-DD.md)
|
|
126
|
+
|
|
127
|
+
**Report Structure**: Review summary → Finding list (CRITICAL → WARNING → INFO) → Stats summary → Fix work items → Next Steps.
|
|
142
128
|
|
|
143
129
|
**Write Report File**:
|
|
144
130
|
- Task-level → `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/audit.md` (overwrite)
|
|
145
|
-
- Project-level → `[[__DOCS_DIR__]]/audits/YYYY-MM-DD.md` (date
|
|
131
|
+
- Project-level → `[[__DOCS_DIR__]]/audits/YYYY-MM-DD.md` (date archive)
|
|
146
132
|
|
|
147
|
-
**Output**:
|
|
133
|
+
**Output**: Full review report (to conversation and file).
|
|
148
134
|
</step_3_report>
|
|
149
135
|
|
|
150
136
|
</protocol_audit>
|
|
@@ -1,153 +1,163 @@
|
|
|
1
1
|
<protocol_code>
|
|
2
|
-
**Trigger**: `/archi.code <id>`
|
|
3
|
-
**Goal**:
|
|
2
|
+
**Trigger**: `/archi.code <id>` | Auto-loaded by Workflow Dispatch on natural language trigger
|
|
3
|
+
**Goal**: Complete feature development per `tasks/<id>_<Slug>/plan.json` task list; follow `tech_stack.md` (UI projects only: also follow `design_tokens.json`); pass build, types, Lint, format, tests and audit.
|
|
4
4
|
|
|
5
5
|
<meta>
|
|
6
6
|
<style>Deterministic, Type-Safe, SOTA-First</style>
|
|
7
7
|
<language>English</language>
|
|
8
8
|
<principles>
|
|
9
|
-
1. **Frontmatter Preservation**:
|
|
10
|
-
2. **Follow Conventions**: Use only existing
|
|
11
|
-
3. **Security First**:
|
|
12
|
-
4. **SOTA Pattern Check**: Reject outdated
|
|
9
|
+
1. **Frontmatter Preservation**: Do not change existing files' YAML Frontmatter.
|
|
10
|
+
2. **Follow Conventions**: Use only repo-existing libs and patterns; read before modify.
|
|
11
|
+
3. **Security First**: Do not introduce/print secrets; sensitive info must not be persisted.
|
|
12
|
+
4. **SOTA Pattern Check**: Reject outdated patterns; use tech_stack defined best practices.
|
|
13
13
|
5. **No Commit Policy**: Do not commit without authorization; present changes as patches.
|
|
14
|
-
6. **Static Check First**: Must pass all static checks (
|
|
15
|
-
7. **Plan Completion Gate**: Verify Plan completion before
|
|
14
|
+
6. **Static Check First**: Must pass all static checks (types/Lint/format).
|
|
15
|
+
7. **Plan Completion Gate**: Verify Plan completion before finish. All tasks AI can complete must be done; only exempt "manual intervention" and "force majeure".
|
|
16
|
+
8. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints, not fight IDE planning/execution mechanisms.
|
|
16
17
|
</principles>
|
|
17
18
|
</meta>
|
|
18
19
|
|
|
19
20
|
<step_1_resolve>
|
|
20
|
-
**Role**: System Analyst
|
|
21
21
|
**Action**:
|
|
22
|
-
1. **Resolve ID**: Parse `<id>` → Task Name, Slug, phase/status
|
|
23
|
-
2. **Status Gate** —
|
|
22
|
+
1. **Resolve ID**: Parse `<id>` from roadmap.json → Task Name, Slug, phase/status.
|
|
23
|
+
2. **Status Gate** — only `active` may enter code flow:
|
|
24
24
|
|
|
25
25
|
| Status | Handling |
|
|
26
26
|
|:---|:---|
|
|
27
27
|
| `active` | Pass, continue |
|
|
28
28
|
| `pending` | Reject — prompt to run `/archi.plan <ID>` first |
|
|
29
|
-
| `blocked` | Reject —
|
|
30
|
-
| `done` | Reject — already
|
|
31
|
-
|
|
32
|
-
3. **Load
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- [?Complex] `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/design.md` — Technical design (if exists): state machine/pipeline/protocol definitions, parameter table, invariants
|
|
36
|
-
- [?UI] `[[__DOCS_DIR__]]/global/ui_context.md` — AI screen index (screen IDs / routes / states / navigation graph / shared components)
|
|
37
|
-
- [?UI] `[[__DOCS_DIR__]]/global/ui_concept.html` — read-only visual reference (calibrate layout against this during implementation; do not redesign — design is already locked in ui.md)
|
|
38
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/plan.json` — Task breakdown (contains `notes` shorthand; must reference during execution)
|
|
39
|
-
- `02_tech_stack.md` — Technical Red Lines
|
|
40
|
-
- [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
|
|
41
|
-
- [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
|
|
42
|
-
- **Read Refs** (if any): Read `[[__DOCS_DIR__]]/refs/index.json` (if exists); match by tags and spec.md tech domain semantics; load only matched ref files as supplementary context; skip if `refs/` missing or empty.
|
|
43
|
-
|
|
44
|
-
**Output**: Atomic list of tasks to implement, marking dependencies and order.
|
|
29
|
+
| `blocked` | Reject — upstream deps incomplete |
|
|
30
|
+
| `done` | Reject — already done; use `/archi.edit <ID>` for changes |
|
|
31
|
+
|
|
32
|
+
3. **Load**: task docs (spec/ui/design/plan) + project context (tech_stack/design_tokens/data_snapshot/ui_context/screens/) + refs (match by tags; load only matched files).
|
|
33
|
+
|
|
34
|
+
**Output**: Atomic task list to implement with dependencies and order.
|
|
45
35
|
</step_1_resolve>
|
|
46
36
|
|
|
47
37
|
<step_2_plan>
|
|
48
|
-
**Role**: Tech Lead
|
|
49
38
|
**Action**:
|
|
50
|
-
Generate execution blueprint (
|
|
51
|
-
- **Phase A (Domain/Data/API)**: Data models/interfaces/validation
|
|
52
|
-
- **Phase B (UI/Presentation)**: Component structure/
|
|
53
|
-
- **Phase C (Integration)**: End-to-end wiring (state
|
|
39
|
+
Generate execution blueprint (adjust by project type):
|
|
40
|
+
- **Phase A (Domain/Data/API)**: Data models / interfaces / validation
|
|
41
|
+
- **Phase B (UI/Presentation)**: Component structure / styles (Design Tokens only); non-UI projects adjust to corresponding presentation layer
|
|
42
|
+
- **Phase C (Integration)**: End-to-end wiring (state, routing, data flow, error handling)
|
|
54
43
|
|
|
55
|
-
|
|
44
|
+
Each task must have completion criteria: static checks pass, tests pass, comply with tech_stack.
|
|
56
45
|
|
|
57
|
-
**Output**:
|
|
46
|
+
**Output**: Atomic task list for implementation (Checkbox).
|
|
58
47
|
</step_2_plan>
|
|
59
48
|
|
|
60
49
|
<step_3_implement>
|
|
61
|
-
**Role**: Senior Engineer
|
|
62
50
|
**Protocol**:
|
|
63
|
-
- **Read First**: Must read target file before
|
|
64
|
-
- **Use Existing Stack**: Use only
|
|
65
|
-
-
|
|
66
|
-
- **Type-Safe**: Complete type definitions; use
|
|
67
|
-
- **Code Organization**: Follow
|
|
68
|
-
- **Comments**: Explain Why, not What
|
|
69
|
-
- **Naming**: Self-
|
|
70
|
-
-
|
|
71
|
-
- **Error Handling**:
|
|
72
|
-
- **Robustness**: Explicitly handle
|
|
51
|
+
- **Read First**: Must read target file before modify; follow existing project code style.
|
|
52
|
+
- **Use Existing Stack**: Use only tech and libs declared in `tech_stack.md`.
|
|
53
|
+
- (When this task involves UI) [[INCLUDE: shared/ui-redlines.md]]
|
|
54
|
+
- **Type-Safe**: Complete type definitions; use project type system to guard boundaries.
|
|
55
|
+
- **Code Organization**: Follow `tech_stack.md` architecture and file placement.
|
|
56
|
+
- **Comments**: Explain Why, not What.
|
|
57
|
+
- **Naming**: Self-explanatory names; no meaningless names.
|
|
58
|
+
- Complex tasks only: **Design Adherence**: When `design.md` exists, implementation must strictly follow its state machine/pipeline/protocol; params reference § 3 values; must satisfy all § 4 Invariants.
|
|
59
|
+
- **Error Handling**: No swallowing/silent failure; propagate and give callers observable feedback.
|
|
60
|
+
- **Robustness**: Explicitly handle boundaries (Loading/Error/Empty/Timeout); no Happy Path only.
|
|
73
61
|
- **SOTA**: Follow tech_stack best practices; reject explicitly forbidden outdated patterns.
|
|
74
|
-
- **Scaffold Safety**:
|
|
75
|
-
- **.gitkeep Cleanup**:
|
|
76
|
-
- **Patch Output**: Output changes as patches
|
|
77
|
-
- **Progress Tracking**: After
|
|
62
|
+
- **Scaffold Safety**: Non-empty dirs must protect `[[__DOCS_DIR__]]/`.
|
|
63
|
+
- **.gitkeep Cleanup**: Remove `.gitkeep` when adding files to dir.
|
|
64
|
+
- **Patch Output**: Output changes as patches with Code Reference.
|
|
65
|
+
- **Progress Tracking**: After each task, update `plan.json` corresponding `done: true` immediately; do not batch at signoff.
|
|
78
66
|
|
|
79
|
-
**Action**: Implement
|
|
67
|
+
**Action**: Implement phase A/B/C item by item; produce complete, production-ready code (including necessary tests).
|
|
80
68
|
</step_3_implement>
|
|
81
69
|
|
|
82
70
|
<step_4_validate>
|
|
83
|
-
**
|
|
84
|
-
**Action** (Fix and re-run on failure; commands subject to `02_tech_stack.md` Section 5):
|
|
71
|
+
**Action** (on failure fix and re-run; commands per `tech_stack.md` Section 5):
|
|
85
72
|
|
|
86
|
-
**Automated Check**:
|
|
73
|
+
**Automated Check**: Check `scripts/validate`:
|
|
74
|
+
- **Exists** → Must run, results per script output
|
|
75
|
+
- **Not exists** → Execute checklist below
|
|
87
76
|
|
|
88
|
-
|
|
77
|
+
> **Scripts Check**: If `scripts/` directory does not exist → Suggest running `/archi.script` to generate automation scripts first.
|
|
78
|
+
|
|
79
|
+
| Phase | Check | Requirement |
|
|
89
80
|
|:---|:---|:---|
|
|
90
|
-
| **Static** | Build | Zero
|
|
81
|
+
| **Static** | Build | Zero compile errors |
|
|
91
82
|
| | Type Check | Zero type errors |
|
|
92
|
-
| | Lint | Zero
|
|
93
|
-
| | Format | Compliant
|
|
94
|
-
| **Test** | Existing Tests |
|
|
95
|
-
| | New Coverage | Add tests for
|
|
83
|
+
| | Lint | Zero Lint errors (warnings require reason) |
|
|
84
|
+
| | Format | Compliant (auto-fix then re-check if fail) |
|
|
85
|
+
| **Test** | Existing Tests | All pass; do not break old tests |
|
|
86
|
+
| | New Coverage | Add tests for new/modified critical logic |
|
|
96
87
|
|
|
97
|
-
**Task Verification (
|
|
88
|
+
**Task Verification (mandatory)**
|
|
98
89
|
|
|
99
|
-
>
|
|
100
|
-
>
|
|
101
|
-
> **Read `notes.Verify` first**: Read the `Verify: [...]` portion at the end of the current task's `notes` field and use that operation as the concrete e2e step. Fall back to the table below only if the `notes` field has no `Verify` entry.
|
|
90
|
+
> Do not mark complete by code review only; must actually run target feature and verify.
|
|
91
|
+
> **Prefer `notes.验证`**: First read current task `notes` end `Verify: [...]` and run e2e; fallback to table by type when no verify field.
|
|
102
92
|
|
|
103
93
|
| Project Type | Verification Action | Pass Criteria |
|
|
104
94
|
|:---|:---|:---|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
95
|
+
| When this task involves UI | Browser: operate target feature path | Render OK, interaction no errors |
|
|
96
|
+
| When this task involves API | Call new/modified endpoint | Status and Body match spec |
|
|
97
|
+
| When this task involves CLI | Execute target command (normal + edge params) | stdout expected, exit code correct |
|
|
98
|
+
| When this task involves lib | Run sample code to verify exported API | No runtime error, return correct |
|
|
99
|
+
| When this task involves mobile | Simulator/device: operate | UI OK, interaction responsive |
|
|
100
|
+
| When this task involves desktop | Launch app and operate | Window OK, feature works |
|
|
111
101
|
|
|
112
|
-
**Evidence**:
|
|
113
|
-
**Fallback**: If verification keeps failing
|
|
102
|
+
**Evidence**: Attach verification result (command output summary / screenshot / error log).
|
|
103
|
+
**Fallback**: If verification keeps failing → `scripts/dev-reset` → `scripts/dev-up` → retry.
|
|
114
104
|
|
|
115
|
-
**Output**: ✅/❌ status and reason
|
|
105
|
+
**Output**: Each check ✅/❌ status and reason; Task Verification evidence.
|
|
116
106
|
</step_4_validate>
|
|
117
107
|
|
|
118
108
|
<step_5_verify>
|
|
119
109
|
**Role**: Independent Reviewer
|
|
120
110
|
|
|
121
111
|
**5A. Code quality review**:
|
|
122
|
-
[[SUBAGENT: archi-silent-audit|mode: code-impl, context: Review step_3 implemented code (Tech/SOTA/Security/Performance + conditional dimensions)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: code-impl review dimension table
|
|
112
|
+
[[SUBAGENT: archi-silent-audit|mode: code-impl, context: Review step_3 implemented code (Tech/SOTA/Security/Performance + conditional dimensions)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: code-impl review dimension table)]]
|
|
123
113
|
|
|
124
114
|
**5B. Linkage check**:
|
|
125
|
-
[[SUBAGENT: archi-feature-relations|mode: check, context:
|
|
115
|
+
[[SUBAGENT: archi-feature-relations|mode: check, context: Compare implemented feature with featureRelations sources semantically]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-feature-relations/SKILL.md`, follow mode: check logic)]]
|
|
126
116
|
|
|
127
117
|
**5C. Data governance sync**:
|
|
128
|
-
[[SUBAGENT: archi-data-sync|context: Scan
|
|
118
|
+
[[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema from implementation; incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md` and follow its protocol)]]
|
|
129
119
|
|
|
130
120
|
[[INCLUDE: shared/verify-result-handling.md]]
|
|
131
121
|
</step_5_verify>
|
|
132
122
|
|
|
133
123
|
<step_6_signoff>
|
|
134
|
-
**Terminal Gate** (
|
|
124
|
+
**Terminal Gate** (do not skip):
|
|
135
125
|
| Step | Command | Pass Condition |
|
|
136
126
|
|:---|:---|:---|
|
|
137
|
-
| 1 | `npx archi plan <ID>` | All
|
|
127
|
+
| 1 | `npx archi plan <ID>` | All complete or exempt only; if fail do not sign off, return to step_3 |
|
|
138
128
|
| 2 | `npx archi task <ID> --status done` | Task status updated |
|
|
139
|
-
| 3 |
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
129
|
+
| 3 | Standard check (task --check + render) | No ERROR + views generated |
|
|
130
|
+
|
|
131
|
+
**Action** (after Gate passes):
|
|
132
|
+
1. Confirm `plan.json` each task `done` flag updated.
|
|
133
|
+
2. **Drift Warning**: Compare code changes with `spec.md` key points. If beyond spec coverage → mark `⚠️ Spec drift`, suggest `/archi.edit <ID>`.
|
|
134
|
+
3. Output completed task list and patch links.
|
|
135
|
+
4. Provide next steps.
|
|
136
|
+
|
|
137
|
+
**Pre-signoff Checklist** (confirm each item before Output):
|
|
138
|
+
□ plan.json — every task done flag updated in real-time (not batch-updated at signoff)
|
|
139
|
+
□ Step 4 — Build / type check / Lint / format all passed
|
|
140
|
+
□ Step 4 — Task Verification executed for each project type with Evidence attached
|
|
141
|
+
□ Step 5A Silent Audit — executed, all CRITICAL issues resolved
|
|
142
|
+
□ Step 5B featureRelations check — executed
|
|
143
|
+
- Check if modified files affect other linked files
|
|
144
|
+
□ Step 5C data governance sync — executed:
|
|
145
|
+
- dictionary.json + error_codes.json + env_registry.json — required
|
|
146
|
+
- (UI projects only) design_tokens.json + ui_context.md
|
|
147
|
+
- (Data projects only) data_snapshot.json
|
|
148
|
+
- (API projects only) api_snapshot.json
|
|
149
|
+
- (CLI projects only) command_api.json
|
|
150
|
+
- (Lib projects only) public_api.json
|
|
151
|
+
□ Terminal Gate — npx archi plan <ID> all complete (exempt items only)
|
|
152
|
+
|
|
153
|
+
**Output**: Completion summary with completed tasks, exempt items (if any), Next Steps:
|
|
154
|
+
|
|
155
|
+
| Priority | Action | Notes |
|
|
156
|
+
|:---|:---|:---|
|
|
157
|
+
| (If no scripts/) | `/archi.script` | Generate automation scripts (validate/dev-up/dev-reset) |
|
|
158
|
+
| Recommended | `/archi.audit <ID>` | Independent review of implementation |
|
|
159
|
+
| (If Spec drift) | `/archi.edit <ID>` | Update docs before continuing |
|
|
160
|
+
| (If next pending task) | `/archi.plan <next pending ID>` | Plan the next task |
|
|
151
161
|
</step_6_signoff>
|
|
152
162
|
|
|
153
163
|
</protocol_code>
|