architext 0.0.4 → 0.0.5
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 +27 -1
- package/README.md +84 -7
- package/README.zh-CN.md +84 -7
- package/dist/index.js +38 -38
- package/dist/templates/en/briefs/_base.md +44 -11
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +87 -89
- package/dist/templates/en/docs/prompts/edit.md +47 -51
- package/dist/templates/en/docs/prompts/fix.md +49 -42
- package/dist/templates/en/docs/prompts/help.md +23 -31
- package/dist/templates/en/docs/prompts/inherit.md +91 -116
- package/dist/templates/en/docs/prompts/map.md +47 -69
- package/dist/templates/en/docs/prompts/plan.md +134 -239
- 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 +55 -107
- package/dist/templates/en/docs/prompts/revise.md +63 -106
- package/dist/templates/en/docs/prompts/scope.md +77 -117
- package/dist/templates/en/docs/prompts/start.md +89 -129
- package/dist/templates/en/rules/00_system.md +36 -79
- package/dist/templates/en/rules/01_workflow.md +59 -57
- package/dist/templates/en/rules/03_data_governance.md +46 -42
- package/dist/templates/en/skills/archi-data-sync/SKILL.md +12 -12
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +3 -34
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +4 -4
- package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
- package/dist/templates/en/skills/archi-silent-audit/SKILL.md +20 -20
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
- package/dist/templates/zh/briefs/_base.md +44 -12
- package/dist/templates/zh/briefs/_modules.md +27 -0
- package/dist/templates/zh/docs/prompts/audit.md +42 -56
- package/dist/templates/zh/docs/prompts/code.md +47 -49
- package/dist/templates/zh/docs/prompts/edit.md +38 -42
- package/dist/templates/zh/docs/prompts/fix.md +30 -29
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +59 -83
- package/dist/templates/zh/docs/prompts/map.md +24 -47
- package/dist/templates/zh/docs/prompts/plan.md +92 -197
- 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 +31 -71
- package/dist/templates/zh/docs/prompts/revise.md +37 -86
- package/dist/templates/zh/docs/prompts/scope.md +51 -91
- package/dist/templates/zh/docs/prompts/start.md +67 -106
- package/dist/templates/zh/rules/00_system.md +18 -91
- package/dist/templates/zh/rules/01_workflow.md +60 -59
- package/dist/templates/zh/rules/03_data_governance.md +41 -68
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +2 -33
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +1 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
- package/package.json +1 -1
|
@@ -1,153 +1,151 @@
|
|
|
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 `02_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/ui_concept) + 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 `02_tech_stack.md`.
|
|
53
|
+
- (When this task involves UI) **Design Tokens Only**: Styles strictly use Token/Preset; no hardcoded magic values.
|
|
54
|
+
- **Type-Safe**: Complete type definitions; use project type system to guard boundaries.
|
|
55
|
+
- **Code Organization**: Follow `02_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 `02_tech_stack.md` Section 5):
|
|
85
72
|
|
|
86
|
-
**Automated Check**: Run `[[__DOCS_DIR__]]/scripts/validate` (if exists); otherwise execute
|
|
73
|
+
**Automated Check**: Run `[[__DOCS_DIR__]]/scripts/validate` (if exists); otherwise execute checklist:
|
|
87
74
|
|
|
88
|
-
| Phase | Check
|
|
75
|
+
| Phase | Check | Requirement |
|
|
89
76
|
|:---|:---|:---|
|
|
90
|
-
| **Static** | Build | Zero
|
|
77
|
+
| **Static** | Build | Zero compile errors |
|
|
91
78
|
| | Type Check | Zero type errors |
|
|
92
|
-
| | Lint | Zero
|
|
93
|
-
| | Format | Compliant
|
|
94
|
-
| **Test** | Existing Tests |
|
|
95
|
-
| | New Coverage | Add tests for
|
|
79
|
+
| | Lint | Zero Lint errors (warnings require reason) |
|
|
80
|
+
| | Format | Compliant (auto-fix then re-check if fail) |
|
|
81
|
+
| **Test** | Existing Tests | All pass; do not break old tests |
|
|
82
|
+
| | New Coverage | Add tests for new/modified critical logic |
|
|
96
83
|
|
|
97
|
-
**Task Verification (
|
|
84
|
+
**Task Verification (mandatory)**
|
|
98
85
|
|
|
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.
|
|
86
|
+
> Do not mark complete by code review only; must actually run target feature and verify.
|
|
87
|
+
> **Prefer `notes.验证`**: First read current task `notes` end `Verify: [...]` and run e2e; fallback to table by type when no verify field.
|
|
102
88
|
|
|
103
89
|
| Project Type | Verification Action | Pass Criteria |
|
|
104
90
|
|:---|:---|:---|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
91
|
+
| When this task involves UI | Browser: operate target feature path | Render OK, interaction no errors |
|
|
92
|
+
| When this task involves API | Call new/modified endpoint | Status and Body match spec |
|
|
93
|
+
| When this task involves CLI | Execute target command (normal + edge params) | stdout expected, exit code correct |
|
|
94
|
+
| When this task involves lib | Run sample code to verify exported API | No runtime error, return correct |
|
|
95
|
+
| When this task involves mobile | Simulator/device: operate | UI OK, interaction responsive |
|
|
96
|
+
| When this task involves desktop | Launch app and operate | Window OK, feature works |
|
|
111
97
|
|
|
112
|
-
**Evidence**:
|
|
113
|
-
**Fallback**: If verification keeps failing
|
|
98
|
+
**Evidence**: Attach verification result (command output summary / screenshot / error log).
|
|
99
|
+
**Fallback**: If verification keeps failing → `scripts/dev-reset` → `scripts/dev-up` → retry.
|
|
114
100
|
|
|
115
|
-
**Output**: ✅/❌ status and reason
|
|
101
|
+
**Output**: Each check ✅/❌ status and reason; Task Verification evidence.
|
|
116
102
|
</step_4_validate>
|
|
117
103
|
|
|
118
104
|
<step_5_verify>
|
|
119
105
|
**Role**: Independent Reviewer
|
|
120
106
|
|
|
121
107
|
**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
|
|
108
|
+
[[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
109
|
|
|
124
110
|
**5B. Linkage check**:
|
|
125
|
-
[[SUBAGENT: archi-feature-relations|mode: check, context:
|
|
111
|
+
[[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
112
|
|
|
127
113
|
**5C. Data governance sync**:
|
|
128
|
-
[[SUBAGENT: archi-data-sync|context: Scan
|
|
114
|
+
[[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema from implementation; incrementally sync per 03_data_governance.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md` and follow its protocol)]]
|
|
129
115
|
|
|
130
116
|
[[INCLUDE: shared/verify-result-handling.md]]
|
|
131
117
|
</step_5_verify>
|
|
132
118
|
|
|
133
119
|
<step_6_signoff>
|
|
134
|
-
**Terminal Gate** (
|
|
120
|
+
**Terminal Gate** (do not skip):
|
|
135
121
|
| Step | Command | Pass Condition |
|
|
136
122
|
|:---|:---|:---|
|
|
137
|
-
| 1 | `npx archi plan <ID>` | All
|
|
123
|
+
| 1 | `npx archi plan <ID>` | All complete or exempt only; if fail do not sign off, return to step_3 |
|
|
138
124
|
| 2 | `npx archi task <ID> --status done` | Task status updated |
|
|
139
|
-
| 3 |
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
125
|
+
| 3 | Standard check (task --check + render) | No ERROR + views generated |
|
|
126
|
+
|
|
127
|
+
**Action** (after Gate passes):
|
|
128
|
+
1. Confirm `plan.json` each task `done` flag updated.
|
|
129
|
+
2. **Drift Warning**: Compare code changes with `spec.md` key points. If beyond spec coverage → mark `⚠️ Spec drift`, suggest `/archi.edit <ID>`.
|
|
130
|
+
3. Output completed task list and patch links.
|
|
131
|
+
4. Provide next steps and Git Commit Suggestion (Conventional Commits).
|
|
132
|
+
|
|
133
|
+
**Pre-signoff Checklist** (confirm each item before Output):
|
|
134
|
+
□ plan.json — every task done flag updated in real-time (not batch-updated at signoff)
|
|
135
|
+
□ Step 4 — Build / type check / Lint / format all passed
|
|
136
|
+
□ Step 4 — Task Verification executed for each project type with Evidence attached
|
|
137
|
+
□ Step 5A Silent Audit — executed, all CRITICAL issues resolved
|
|
138
|
+
□ Step 5B featureRelations check — executed
|
|
139
|
+
□ Step 5C data governance sync — executed
|
|
140
|
+
□ Terminal Gate — npx archi plan <ID> all complete (exempt items only)
|
|
141
|
+
|
|
142
|
+
**Output**: Completion summary with completed tasks, exempt items (if any), Git Commit suggestion, Next Steps:
|
|
143
|
+
|
|
144
|
+
| Priority | Action | Notes |
|
|
145
|
+
|:---|:---|:---|
|
|
146
|
+
| Recommended | `/archi.audit <ID>` | Independent review of implementation |
|
|
147
|
+
| (If Spec drift) | `/archi.edit <ID>` | Update docs before continuing |
|
|
148
|
+
| (If next pending task) | `/archi.plan <next pending ID>` | Plan the next task |
|
|
151
149
|
</step_6_signoff>
|
|
152
150
|
|
|
153
151
|
</protocol_code>
|
|
@@ -1,96 +1,92 @@
|
|
|
1
1
|
<protocol_edit>
|
|
2
|
-
**Trigger**: `/archi.edit <id> [context]`
|
|
3
|
-
**Goal**:
|
|
2
|
+
**Trigger**: `/archi.edit <id> [context]` | Auto-loaded by Workflow Dispatch on natural language trigger
|
|
3
|
+
**Goal**: Update managed module's Spec/UI docs per new requirements/feedback, and append development plan.
|
|
4
4
|
|
|
5
5
|
<meta>
|
|
6
6
|
<style>Collaborative, Iterative, Traceable</style>
|
|
7
7
|
<language>English</language>
|
|
8
8
|
<principles>
|
|
9
|
-
1. **Doc First**: Must modify docs (Spec/UI) first, then generate Plan.
|
|
10
|
-
2. **Incremental**: Only append new Tasks to Plan
|
|
9
|
+
1. **Doc First**: Must modify docs (Spec/UI) first, then generate Plan. Do not skip docs to change code plan.
|
|
10
|
+
2. **Incremental**: Only append new Tasks to Plan; keep completed history (unless rollback needed).
|
|
11
11
|
3. **Conflict Check**: Check if new requirements conflict with tech_stack / design_tokens.
|
|
12
|
-
4. **Frontmatter Preservation**:
|
|
12
|
+
4. **Frontmatter Preservation**: Do not break existing document Metadata.
|
|
13
|
+
5. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints, not fight IDE planning/execution mechanisms.
|
|
13
14
|
</principles>
|
|
14
15
|
</meta>
|
|
15
16
|
|
|
16
17
|
<step_1_load>
|
|
17
|
-
**Role**: Product Manager
|
|
18
18
|
**Action**:
|
|
19
|
-
- Read `[[__DOCS_DIR__]]/tasks/<ID>_<Slug
|
|
20
|
-
-
|
|
21
|
-
- Check `Spec-Status`
|
|
22
|
-
|
|
23
|
-
- `Stub` → Proceed to step_1_5_enrich.
|
|
24
|
-
- [?Major UX Change] Quick search for similar product best practices.
|
|
19
|
+
- Read spec.md, ui.md, plan.json under `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/`.
|
|
20
|
+
- (UI projects only) Read ui_context.md (locate screen scope and navigation for this feature).
|
|
21
|
+
- Check `Spec-Status` in spec.md: `Full` → normal flow step_2 | `Stub` → step_1_5_enrich.
|
|
22
|
+
- (Major UX change) Quick search for similar product best practices.
|
|
25
23
|
</step_1_load>
|
|
26
24
|
|
|
27
25
|
<step_1_5_enrich>
|
|
28
|
-
**
|
|
29
|
-
**Trigger**: spec.md contains `Spec-Status: Stub` (lightweight snapshot generated by `/archi.inherit`).
|
|
26
|
+
**Trigger**: spec.md contains `Spec-Status: Stub` (lightweight snapshot from `/archi.inherit`).
|
|
30
27
|
|
|
31
28
|
**Action**:
|
|
32
|
-
1. Inform user: "This task only
|
|
33
|
-
2. Extract source
|
|
34
|
-
3.
|
|
35
|
-
4.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
7. Generate `plan.json` (all tasks as done, recording implemented content).
|
|
42
|
-
8. Present enriched spec summary to user.
|
|
43
|
-
|
|
44
|
-
**Gate**: User confirms enriched content is correct before proceeding to step_2_refine_docs.
|
|
29
|
+
1. Inform user: "This task has only a lightweight snapshot; must complete full spec before modification."
|
|
30
|
+
2. Extract source paths from stub "Associated Files"; read each (entry + core logic).
|
|
31
|
+
3. Enrich into full spec from code analysis: keep existing overview and flows; add Gherkin Scenarios + interface/type definitions.
|
|
32
|
+
4. Update `Spec-Status: Stub → Full`.
|
|
33
|
+
5. (UI projects only) If module has UI → generate `ui.md`; if new screens needed, [[SKILL: archi-ui-wireframe|invoke skill]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md`)]].
|
|
34
|
+
6. Generate `plan.json` (all tasks done).
|
|
35
|
+
7. Output enriched spec summary to user.
|
|
36
|
+
|
|
37
|
+
**Gate**: Proceed to step_2_refine_docs after user confirms.
|
|
45
38
|
**Exception**: Associated files missing/moved → prompt user to update paths.
|
|
46
39
|
</step_1_5_enrich>
|
|
47
40
|
|
|
48
41
|
<step_2_refine_docs>
|
|
49
|
-
**Role**: Requirements Analyst & Designer
|
|
50
42
|
**Action**:
|
|
51
|
-
- Modify spec.md
|
|
52
|
-
-
|
|
43
|
+
- Modify spec.md and ui.md per `[context]`.
|
|
44
|
+
- (UI modified) [[SKILL: archi-ui-wireframe|Follow the skill protocol to sync `ui_concept.html` + `ui_context.md`]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md`)]]:
|
|
53
45
|
|
|
54
|
-
| Change Type | Criteria |
|
|
46
|
+
| Change Type | Criteria | Handling |
|
|
55
47
|
|:---|:---|:---|
|
|
56
|
-
| No screen impact | Logic/data only
|
|
57
|
-
| Minor UI tweak | New/modified state, popup,
|
|
58
|
-
| Screen structure change | Layout refactor, new
|
|
59
|
-
| Task reduction | Screen/region removed entirely | Call skill
|
|
48
|
+
| No screen impact | Logic/data change only | Update spec.md only |
|
|
49
|
+
| Minor UI tweak | New/modified state, popup, local area | Call skill to update; output `MODIFIED: S-XX` |
|
|
50
|
+
| Screen structure change | Layout refactor, new screen, navigation change | Call skill to update |
|
|
51
|
+
| Task reduction | Screen/region removed entirely | Call skill to remove; output `REMOVED: S-XX` |
|
|
60
52
|
|
|
61
|
-
- Ask user
|
|
53
|
+
- Ask user when requirements are vague.
|
|
62
54
|
|
|
63
|
-
**Output**: Updated
|
|
55
|
+
**Output**: Updated docs and change summary.
|
|
64
56
|
</step_2_refine_docs>
|
|
65
57
|
|
|
66
58
|
<step_3_update_plan>
|
|
67
|
-
**Role**: Tech Lead
|
|
68
59
|
**Action**:
|
|
69
|
-
- Append new Phase
|
|
70
|
-
-
|
|
71
|
-
- **Status Transition**: If current task status=`done`, reset to `active` after appending the Phase (otherwise `/archi.code` will be rejected by the Status Gate).
|
|
60
|
+
- Append new Phase to `plan.json` with specific Tasks; each must be verifiable.
|
|
61
|
+
- **Status transition**: When status=`done`, after appending Phase must reset to `active`.
|
|
72
62
|
|
|
73
|
-
**Terminal Gate** (
|
|
63
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
74
64
|
| Step | Command | Pass Condition |
|
|
75
65
|
|:---|:---|:---|
|
|
76
|
-
|
|
|
77
|
-
| 2 | `npx archi render` | `.md` views generated |
|
|
78
|
-
| 3 | [if current status=done] `npx archi task <ID> --status active` | Task status reset to active |
|
|
66
|
+
| 3 | [when status=done] `npx archi task <ID> --status active` | Status reset |
|
|
79
67
|
|
|
80
|
-
**Output**: plan.json with new tasks appended; if status transition
|
|
68
|
+
**Output**: plan.json with new tasks appended; if status transition performed, output `MODIFIED: roadmap.json <ID>.status done→active`. Enter step_4_verify.
|
|
81
69
|
</step_3_update_plan>
|
|
82
70
|
|
|
83
|
-
<
|
|
71
|
+
<step_4_verify>
|
|
84
72
|
**Role**: Independent Reviewer
|
|
85
73
|
|
|
86
|
-
[[SUBAGENT: archi-silent-audit|mode: plan-docs, context: Review step_2 updated spec.md/ui.md and step_3 appended plan.json new Phase
|
|
74
|
+
[[SUBAGENT: archi-silent-audit|mode: plan-docs, context: Review step_2 updated spec.md/ui.md and step_3 appended plan.json new Phase]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: plan-docs review)]]
|
|
87
75
|
|
|
88
76
|
[[INCLUDE: shared/verify-result-handling.md]]
|
|
89
|
-
</
|
|
77
|
+
</step_4_verify>
|
|
78
|
+
|
|
79
|
+
<step_5_summary>
|
|
80
|
+
**Pre-signoff Checklist** (confirm each item before Output):
|
|
81
|
+
□ spec.md — updated per context, changes tracked
|
|
82
|
+
□ (if UI changed) ui.md + ui_concept.html + ui_context.md — synced
|
|
83
|
+
□ plan.json — new Phase appended (history tasks fully preserved)
|
|
84
|
+
□ (if original status=done) roadmap.json — status reset to active
|
|
85
|
+
□ Step 4 Silent Audit — executed, all CRITICAL issues resolved
|
|
86
|
+
□ Terminal Gate — task --check no ERROR (executed in step_3)
|
|
90
87
|
|
|
91
|
-
<step_4_summary>
|
|
92
88
|
**Action** (Gate must complete in step_3):
|
|
93
89
|
**Output**: Task update summary with Spec/UI/Plan change overview and Next Steps table. Recommend running `/archi.code <ID>`.
|
|
94
|
-
</
|
|
90
|
+
</step_5_summary>
|
|
95
91
|
|
|
96
92
|
</protocol_edit>
|
|
@@ -1,86 +1,93 @@
|
|
|
1
1
|
<protocol_fix>
|
|
2
|
-
**Trigger**: `/archi.fix [id] <context>`
|
|
3
|
-
**Goal**: Diagnose
|
|
2
|
+
**Trigger**: `/archi.fix [id] <context>` | Auto-loaded by Workflow Dispatch on natural language trigger
|
|
3
|
+
**Goal**: Diagnose and fix bugs. If `[id]` not provided, auto-locate related feature module by context.
|
|
4
4
|
|
|
5
5
|
<meta>
|
|
6
6
|
<style>Diagnostic, Surgical, Spec-Compliant</style>
|
|
7
7
|
<language>English</language>
|
|
8
8
|
<principles>
|
|
9
|
-
1. **Spec Immutable**:
|
|
10
|
-
2. **Reproduction**: Must
|
|
11
|
-
3. **Root Cause**: Must analyze root cause, not patch
|
|
9
|
+
1. **Spec Immutable**: Do not modify `spec.md` / `ui.md` (unless the bug is a doc error).
|
|
10
|
+
2. **Reproduction**: Must have reproduction steps or test case first.
|
|
11
|
+
3. **Root Cause**: Must analyze root cause, not patch surface.
|
|
12
12
|
4. **Test-Driven**: Fix plan must include new test cases.
|
|
13
|
-
5. **Auto-Discovery**: If ID not specified, locate Task via
|
|
13
|
+
5. **Auto-Discovery**: If ID not specified, locate Task via context semantic search.
|
|
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_diagnose>
|
|
18
|
-
**Role**:
|
|
19
|
+
**Role**: Failure Analyst
|
|
19
20
|
**Action**:
|
|
20
21
|
1. **Resolve Target**:
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
2. Read all docs
|
|
25
|
-
3. Read
|
|
26
|
-
4. Analyze `[context]
|
|
27
|
-
5. **Hypothesis**: Propose 1
|
|
28
|
-
|
|
29
|
-
**Output**: Root Cause Analysis
|
|
22
|
+
- With `<id>`: Lock `tasks/<ID>_<Slug>/`.
|
|
23
|
+
- Without `<id>`: Analyze `[context]` to find most relevant module.
|
|
24
|
+
Single match → auto lock | Multiple matches → list candidates and ask | Cannot locate → error, request ID.
|
|
25
|
+
2. Read all docs and related code in target directory.
|
|
26
|
+
3. Read 02_tech_stack.md (tech red lines) and vision.md (direction anchor).
|
|
27
|
+
4. Analyze `[context]` with code logic to locate potential fault points.
|
|
28
|
+
5. **Hypothesis**: Propose 1–3 root cause hypotheses.
|
|
29
|
+
|
|
30
|
+
**Output**: Fault diagnosis report (Root Cause Analysis).
|
|
30
31
|
</step_1_diagnose>
|
|
31
32
|
|
|
32
33
|
<step_2_plan_fix>
|
|
33
|
-
**Role**: Tech Lead
|
|
34
34
|
**Action**:
|
|
35
|
-
- Update
|
|
36
|
-
- Tasks: 1) Create reproduction test (Red) 2)
|
|
35
|
+
- Update plan.json; append phase `Bugfix: <Bug Title>`.
|
|
36
|
+
- Tasks: 1) Create reproduction test (Red) 2) Fix (Green) 3) Regression test.
|
|
37
37
|
|
|
38
|
-
**Terminal Gate** (
|
|
39
|
-
| Step | Command | Pass Condition |
|
|
40
|
-
|:---|:---|:---|
|
|
41
|
-
| 1 | `npx archi render` | `.md` views generated |
|
|
38
|
+
**Terminal Gate** (do not skip): Standard check (task --check + render).
|
|
42
39
|
|
|
43
40
|
**Output**: plan.json with fix tasks appended.
|
|
44
41
|
</step_2_plan_fix>
|
|
45
42
|
|
|
46
43
|
<step_3_execute_fix>
|
|
47
|
-
**Role**: Senior Engineer (Surgical Fix — bug only, no scope creep)
|
|
48
44
|
**Action**:
|
|
49
|
-
- Modify code
|
|
50
|
-
-
|
|
51
|
-
- Error handling follows `code.md` specs (no swallowing errors/no silent failures).
|
|
45
|
+
- Modify code per Plan. Fix bug only; do not refactor.
|
|
46
|
+
- Error handling follows `code.md` protocol.
|
|
52
47
|
</step_3_execute_fix>
|
|
53
48
|
|
|
54
49
|
<step_4_verify>
|
|
55
|
-
**
|
|
56
|
-
**Terminal Gate** (Do not skip; must complete before step_5 output):
|
|
50
|
+
**Terminal Gate** (do not skip):
|
|
57
51
|
| Step | Command | Pass Condition |
|
|
58
52
|
|:---|:---|:---|
|
|
59
|
-
| 1 | Run build command | Build
|
|
53
|
+
| 1 | Run build command | Build success |
|
|
60
54
|
| 2 | Run type check | Zero type errors |
|
|
61
55
|
| 3 | Run Lint/Format | Pass |
|
|
62
|
-
| 4 | Run tests | Reproduction + regression
|
|
56
|
+
| 4 | Run tests | Reproduction test + regression test pass |
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
Fix any failure until pass.
|
|
59
|
+
|
|
60
|
+
**Code quality review**:
|
|
61
|
+
[[SUBAGENT: archi-silent-audit|mode: code-impl, context: Review fix code; focus Tech/Security/Performance + Spec Immutable]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: code-impl check)]]
|
|
62
|
+
|
|
63
|
+
[[INCLUDE: shared/verify-result-handling.md]]
|
|
65
64
|
</step_4_verify>
|
|
66
65
|
|
|
67
|
-
<
|
|
68
|
-
**Role**: Tech Lead
|
|
66
|
+
<step_5_plan_update>
|
|
69
67
|
**Action**:
|
|
70
|
-
1. Update
|
|
71
|
-
2. [
|
|
72
|
-
3. [Bugfix
|
|
68
|
+
1. Update plan.json Bugfix Phase completed tasks `done: true`.
|
|
69
|
+
2. [status=`done` and Bugfix all pass] → keep `done`.
|
|
70
|
+
3. [Bugfix has incomplete items] → `npx archi task <ID> --status active`; signoff note to re-run `/archi.code`.
|
|
71
|
+
|
|
72
|
+
**Output**: `MODIFIED: plan.json Bugfix Phase done flags`. Enter step_6_summary.
|
|
73
|
+
</step_5_plan_update>
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
<step_6_summary>
|
|
76
|
+
**Pre-signoff Checklist** (confirm each item before Output):
|
|
77
|
+
□ Root cause analyzed (not surface patch), Hypothesis output in step_1
|
|
78
|
+
□ plan.json — Bugfix Phase appended (step_2)
|
|
79
|
+
□ Reproduction test created and verified (Red → Green)
|
|
80
|
+
□ Code fix targets Bug only, no opportunistic refactoring
|
|
81
|
+
□ Step 4 Terminal Gate — Build / type check / Lint / tests all passed
|
|
82
|
+
□ Step 4 Silent Audit — executed, all CRITICAL issues resolved
|
|
83
|
+
□ plan.json Bugfix Phase — done flags updated (step_5)
|
|
76
84
|
|
|
77
|
-
<step_5_summary>
|
|
78
85
|
**Output**: Bug fix summary with Root Cause analysis, fix content, new tests, and Next Steps table:
|
|
79
86
|
|
|
80
87
|
| Priority | Action | Notes |
|
|
81
88
|
|:---|:---|:---|
|
|
82
|
-
| Recommended | `/archi.audit <ID>` | Re-audit to confirm fix
|
|
83
|
-
| Optional | `/archi.code <ID>` | If
|
|
89
|
+
| Recommended | `/archi.audit <ID>` | Re-audit to confirm fix complete |
|
|
90
|
+
| Optional | `/archi.code <ID>` | If incomplete items, continue implementation |
|
|
84
91
|
</step_5_summary>
|
|
85
92
|
|
|
86
93
|
</protocol_fix>
|