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.
Files changed (84) hide show
  1. package/CHANGELOG.md +55 -1
  2. package/README.md +93 -14
  3. package/README.zh-CN.md +92 -14
  4. package/dist/index.js +53 -39
  5. package/dist/templates/en/briefs/_base.md +53 -13
  6. package/dist/templates/en/briefs/_modules.md +31 -4
  7. package/dist/templates/en/docs/global/error_memory.json +40 -0
  8. package/dist/templates/en/docs/global/map.json +46 -90
  9. package/dist/templates/en/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +6 -13
  10. package/dist/templates/en/{rules/02_tech_stack.md → docs/global/tech_stack.md} +7 -18
  11. package/dist/templates/en/docs/global/vision.md +1 -1
  12. package/dist/templates/en/docs/prompts/audit.md +80 -94
  13. package/dist/templates/en/docs/prompts/code.md +99 -89
  14. package/dist/templates/en/docs/prompts/edit.md +61 -51
  15. package/dist/templates/en/docs/prompts/fix.md +59 -43
  16. package/dist/templates/en/docs/prompts/help.md +23 -31
  17. package/dist/templates/en/docs/prompts/inherit.md +97 -117
  18. package/dist/templates/en/docs/prompts/map.md +48 -69
  19. package/dist/templates/en/docs/prompts/plan.md +141 -240
  20. package/dist/templates/en/docs/prompts/recover.md +19 -34
  21. package/dist/templates/en/docs/prompts/ref.md +43 -138
  22. package/dist/templates/en/docs/prompts/remove.md +63 -110
  23. package/dist/templates/en/docs/prompts/revise.md +71 -106
  24. package/dist/templates/en/docs/prompts/scope.md +78 -117
  25. package/dist/templates/en/docs/prompts/script.md +102 -0
  26. package/dist/templates/en/docs/prompts/start.md +98 -132
  27. package/dist/templates/en/docs/prompts/ui.md +113 -0
  28. package/dist/templates/en/docs/shared/ui-redlines.md +7 -0
  29. package/dist/templates/en/docs/templates/spec.template.md +1 -1
  30. package/dist/templates/en/docs/templates/ui.template.md +8 -8
  31. package/dist/templates/en/rules/00_system.md +268 -117
  32. package/dist/templates/en/rules/90_custom_rules.md +3 -1
  33. package/dist/templates/en/skills/archi-data-sync/SKILL.md +37 -23
  34. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +138 -240
  35. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +6 -1
  36. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +10 -6
  37. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -2
  38. package/dist/templates/en/skills/archi-plan-options/SKILL.md +77 -301
  39. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +24 -25
  40. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +175 -305
  41. package/dist/templates/icon.svg +16 -0
  42. package/dist/templates/zh/briefs/_base.md +56 -17
  43. package/dist/templates/zh/briefs/_modules.md +28 -1
  44. package/dist/templates/zh/docs/global/error_memory.json +40 -0
  45. package/dist/templates/zh/docs/global/map.json +39 -109
  46. package/dist/templates/zh/{rules/04_cli_tools.md → docs/global/references/cli_reference.md} +0 -7
  47. package/dist/templates/zh/{rules/02_tech_stack.md → docs/global/tech_stack.md} +9 -20
  48. package/dist/templates/zh/docs/global/vision.md +1 -1
  49. package/dist/templates/zh/docs/prompts/audit.md +43 -57
  50. package/dist/templates/zh/docs/prompts/code.md +66 -56
  51. package/dist/templates/zh/docs/prompts/edit.md +52 -42
  52. package/dist/templates/zh/docs/prompts/fix.md +39 -29
  53. package/dist/templates/zh/docs/prompts/help.md +13 -21
  54. package/dist/templates/zh/docs/prompts/inherit.md +67 -86
  55. package/dist/templates/zh/docs/prompts/map.md +28 -50
  56. package/dist/templates/zh/docs/prompts/plan.md +100 -199
  57. package/dist/templates/zh/docs/prompts/recover.md +9 -24
  58. package/dist/templates/zh/docs/prompts/ref.md +11 -106
  59. package/dist/templates/zh/docs/prompts/remove.md +39 -74
  60. package/dist/templates/zh/docs/prompts/revise.md +47 -88
  61. package/dist/templates/zh/docs/prompts/scope.md +52 -91
  62. package/dist/templates/zh/docs/prompts/script.md +102 -0
  63. package/dist/templates/zh/docs/prompts/start.md +75 -110
  64. package/dist/templates/zh/docs/prompts/ui.md +113 -0
  65. package/dist/templates/zh/docs/shared/ui-redlines.md +7 -0
  66. package/dist/templates/zh/docs/templates/spec.template.md +1 -1
  67. package/dist/templates/zh/docs/templates/ui.template.md +8 -8
  68. package/dist/templates/zh/rules/00_system.md +252 -131
  69. package/dist/templates/zh/rules/90_custom_rules.md +2 -1
  70. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +27 -13
  71. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +133 -235
  72. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +6 -1
  73. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +6 -2
  74. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -2
  75. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +77 -301
  76. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +4 -5
  77. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +174 -301
  78. package/package.json +3 -1
  79. package/dist/templates/en/rules/01_workflow.md +0 -93
  80. package/dist/templates/en/rules/03_data_governance.md +0 -102
  81. package/dist/templates/en/rules/99_context_glue.md +0 -53
  82. package/dist/templates/zh/rules/01_workflow.md +0 -94
  83. package/dist/templates/zh/rules/03_data_governance.md +0 -133
  84. package/dist/templates/zh/rules/99_context_glue.md +0 -53
@@ -1,96 +1,106 @@
1
1
  <protocol_edit>
2
- **Trigger**: `/archi.edit <id> [context]`
3
- **Goal**: Based on new requirements/feedback, update Spec/UI docs of an already managed module and append development plans.
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. Prohibited from skipping docs to change code plans directly.
10
- 2. **Incremental**: Only append new Tasks to Plan, keep completed history (unless rollback needed).
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**: Prohibited from destroying existing document Metadata.
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>/` spec.md, ui.md, plan.json.
20
- - [?UI] Read `[[__DOCS_DIR__]]/global/ui_context.md` (locate the screen scope and navigation graph for this task).
21
- - Check `Spec-Status` field in spec.md:
22
- - `Full` Normal flow, proceed to step_2.
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
- **Role**: Reverse Engineer
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 has a lightweight snapshot. A full spec must be generated before modifications can proceed."
33
- 2. Extract source file paths from the stub's "Associated Files" section.
34
- 3. Read each associated file with medium-depth scan (entry point + core logic).
35
- 4. Enrich the stub into a full spec based on code analysis:
36
- - Preserve existing overview and key flows
37
- - Add Gherkin Scenarios (covering normal flows + exception paths)
38
- - Add interface/type definitions (if this task is upstream of others)
39
- 5. Update `Spec-Status: Stub → Full`.
40
- 6. [?UI] If module has UI → generate or update `ui.md` (scope declaration); if new screens are needed, [[SKILL: archi-ui-wireframe|invoke skill or notify user to run]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and prompt user to follow the document)]] (Skill syncs both `ui_concept.html` + `ui_context.md`).
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 (logic/rule changes) and ui.md (structure/interaction changes) based on `[context]`.
52
- - [?UI Modification] [[SKILL: archi-ui-wireframe|Follow the skill protocol to sync `ui_concept.html` + `ui_context.md` (Skill is the sole writer of both files)]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md` and follow its protocol)]]:
43
+ - Modify spec.md and ui.md per `[context]`.
44
+ - (UI modified) [[SKILL: archi-ui-wireframe|Follow the skill protocol to sync `screens/S-XX.html` + `ui_context.md`]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-ui-wireframe/SKILL.md`)]]:
53
45
 
54
- | Change Type | Criteria | Action |
46
+ | Change Type | Criteria | Handling |
55
47
  |:---|:---|:---|
56
- | No screen impact | Logic/data only, no visual diff | Update spec.md only; `ui_concept.html` / `ui_context.md` unchanged |
57
- | Minor UI tweak | New/modified state, popup, or local area; overall layout unchanged | Call skill (Modify screens mode) to update both files; output `MODIFIED: S-XX` |
58
- | Screen structure change | Layout refactor, new standalone screen, navigation path change | Call skill (Modify screens mode) to update both files; output `MODIFIED: S-XX`; if Phase 2 coloring is done, re-color only the modified screen |
59
- | Task reduction | Screen/region removed entirely | Call skill (Remove screens mode) to update both files; output `REMOVED: S-XX` |
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: screens/S-XX.html` |
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: screens/S-XX.html` |
60
52
 
61
- - Ask user questions (A/B/C/D options) to confirm details when requirements are vague.
53
+ - Ask user when requirements are vague.
62
54
 
63
- **Output**: Updated Spec, UI documents, and `ui_concept.html` / `ui_context.md` change summary.
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 object to `plan.json` phases array.
70
- - List specific Tasks (API update, UI tweak, Test update); each must be verifiable.
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** (Do not skip; must complete before step_3_5 starts):
63
+ **Terminal Gate** (do not skip): Standard check (task --check + render).
74
64
  | Step | Command | Pass Condition |
75
65
  |:---|:---|:---|
76
- | 1 | `npx archi task --check` | No ERROR-level issues |
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 was performed, output `MODIFIED: roadmap.json <ID>.status done→active`.
68
+ **Output**: plan.json with new tasks appended; if status transition performed, output `MODIFIED: roadmap.json <ID>.status done→active`. Enter step_4_data_sync.
81
69
  </step_3_update_plan>
82
70
 
83
- <step_3_5_verify>
71
+ <step_4_data_sync>
72
+ **Data governance sync**:
73
+
74
+ [[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema/endpoints/commands/exports from requirement changes, incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md`, follow its execution protocol)]]
75
+ </step_4_data_sync>
76
+
77
+ <step_4_verify>
84
78
  **Role**: Independent Reviewer
85
79
 
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; ensure doc logic is consistent and new Phase tasks are verifiable]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-silent-audit/SKILL.md`, follow mode: plan-docs review dimension table item by item)]]
80
+ [[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
81
 
88
82
  [[INCLUDE: shared/verify-result-handling.md]]
89
- </step_3_5_verify>
83
+ </step_4_verify>
84
+
85
+ <step_6_summary>
86
+ **Pre-signoff Checklist** (confirm each item before Output):
87
+ □ spec.md — updated per context, changes tracked
88
+ □ (if UI changed) ui.md + screens/S-XX.html + ui_context.md — synced
89
+ □ plan.json — new Phase appended (history tasks fully preserved)
90
+ □ (if original status=done) roadmap.json — status reset to active
91
+ □ Global files — related JSON files synced for changes:
92
+ - dictionary.json + error_codes.json + env_registry.json — required
93
+ - (UI projects only) design_tokens.json + ui_context.md
94
+ - (Data projects only) data_snapshot.json
95
+ - (API projects only) api_snapshot.json
96
+ - (CLI projects only) command_api.json
97
+ - (Lib projects only) public_api.json
98
+ □ Step 4 Data Sync — archi-data-sync executed
99
+ □ Step 4 Silent Audit — executed, all CRITICAL issues resolved
100
+ □ Terminal Gate — task --check no ERROR (executed in step_3)
90
101
 
91
- <step_4_summary>
92
102
  **Action** (Gate must complete in step_3):
93
103
  **Output**: Task update summary with Spec/UI/Plan change overview and Next Steps table. Recommend running `/archi.code <ID>`.
94
- </step_4_summary>
104
+ </step_6_summary>
95
105
 
96
106
  </protocol_edit>
@@ -1,86 +1,102 @@
1
1
  <protocol_fix>
2
- **Trigger**: `/archi.fix [id] <context>`
3
- **Goal**: Diagnose Bug and execute fix directly. If `[id]` not provided, auto-locate relevant task module.
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**: Prohibited from modifying `spec.md` / `ui.md` (unless Bug itself is a documentation error).
10
- 2. **Reproduction**: Must conceive reproduction steps or test cases first.
11
- 3. **Root Cause**: Must analyze root cause, not patch the surface.
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 Context semantic search.
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**: Fault Analyst
19
+ **Role**: Failure Analyst
19
20
  **Action**:
20
21
  1. **Resolve Target**:
21
- - Has `<id>`: Lock target `tasks/<ID>_<Slug>/`.
22
- - No `<id>`: Analyze `[context]` to search most relevant module.
23
- Unique match → Auto lock | Multiple matches → List candidates and ask | Cannot locate → Report error requesting ID.
24
- 2. Read all docs under target directory (`spec.md`, `ui.md`, `plan.json`) and related code.
25
- 3. Read `02_tech_stack.md` (ensure fix does not violate tech red lines) and `[[__DOCS_DIR__]]/global/vision.md` (ensure fix direction stays aligned with project vision).
26
- 4. Analyze `[context]`, combine with code logic to locate potential failure points.
27
- 5. **Hypothesis**: Propose 1-3 root cause hypotheses.
28
-
29
- **Output**: Root Cause Analysis report.
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 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 13 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 `[[__DOCS_DIR__]]/tasks/<ID>_<Slug>/plan.json`, append to `phases` array a phase object with `name`: `Bugfix: <Bug Title>`.
36
- - Tasks: 1) Create reproduction test (Red) 2) Apply fix (Green) 3) Regression test.
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** (Do not skip; must complete before step_5 output):
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 directly according to Plan.
50
- - Fix Bug only; prohibited from opportunistic refactoring or modifying unrelated code.
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
- **Role**: QA Engineer
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 succeeds |
53
+ | 0 | Check `scripts/validate` | If exists, must run; results per script |
54
+ | 1 | Run build command | Build success |
60
55
  | 2 | Run type check | Zero type errors |
61
56
  | 3 | Run Lint/Format | Pass |
62
- | 4 | Run tests | Reproduction + regression tests pass |
57
+ | 4 | Run tests | Reproduction test + regression test pass |
58
+
59
+ Fix any failure until pass.
63
60
 
64
- Any failure must be fixed until passed.
61
+ **Code quality review**:
62
+ [[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)]]
63
+
64
+ [[INCLUDE: shared/verify-result-handling.md]]
65
65
  </step_4_verify>
66
66
 
67
- <step_4_5_plan_update>
68
- **Role**: Tech Lead
67
+ <step_4_5_data_sync>
68
+ **Data governance sync**:
69
+
70
+ [[SUBAGENT: archi-data-sync|context: Scan new business entities/error codes/Schema from Bug fix, incrementally sync per 00_system.md]][[NO-SKILL: (Skill not installed: read `[[__DOCS_DIR__]]/skills/archi-data-sync/SKILL.md`, follow its execution protocol)]]
71
+ </step_4_5_data_sync>
72
+
73
+ <step_5_plan_update>
69
74
  **Action**:
70
- 1. Update `plan.json`: set `done: true` for completed tasks in the Bugfix Phase.
71
- 2. [current status=`done` and all Bugfix Phase tasks passed] → Keep status as `done`.
72
- 3. [Bugfix Phase has unresolved tasks] → Run `npx archi task <ID> --status active`; note in signoff that `/archi.code` is needed to complete remaining fixes.
75
+ 1. Update plan.json Bugfix Phase completed tasks `done: true`.
76
+ 2. [status=`done` and Bugfix all pass] → keep `done`.
77
+ 3. [Bugfix has incomplete items] → `npx archi task <ID> --status active`; signoff note to re-run `/archi.code`.
78
+
79
+ **Output**: `MODIFIED: plan.json Bugfix Phase done flags`. Enter step_6_summary.
80
+ </step_5_plan_update>
73
81
 
74
- **Output**: `MODIFIED: plan.json Bugfix Phase done marks` (if status changed, append `MODIFIED: roadmap.json <ID>.status`).
75
- </step_4_5_plan_update>
82
+ <step_6_summary>
83
+ **Pre-signoff Checklist** (confirm each item before Output):
84
+ □ Root cause analyzed (not surface patch), Hypothesis output in step_1
85
+ □ plan.json — Bugfix Phase appended (step_2)
86
+ □ Reproduction test created and verified (Red → Green)
87
+ □ Code fix targets Bug only, no opportunistic refactoring
88
+ □ Step 4.5 Data Sync — archi-data-sync executed
89
+ □ Step 4 Terminal Gate — Build / type check / Lint / tests all passed
90
+ □ Step 4 Silent Audit — executed, all CRITICAL issues resolved
91
+ □ plan.json Bugfix Phase — done flags updated (step_5)
76
92
 
77
- <step_5_summary>
78
93
  **Output**: Bug fix summary with Root Cause analysis, fix content, new tests, and Next Steps table:
79
94
 
80
95
  | Priority | Action | Notes |
81
96
  |:---|:---|:---|
82
- | Recommended | `/archi.audit <ID>` | Re-audit to confirm fix is complete and no new issues introduced |
83
- | Optional | `/archi.code <ID>` | If Bugfix Phase has remaining incomplete tasks |
84
- </step_5_summary>
97
+ | (If no scripts/) | `/archi.script` | Generate automation validation scripts |
98
+ | Recommended | `/archi.audit <ID>` | Re-audit to confirm fix complete |
99
+ | Optional | `/archi.code <ID>` | If incomplete items, continue implementation |
100
+ </step_6_summary>
85
101
 
86
102
  </protocol_fix>
@@ -1,69 +1,61 @@
1
1
  <protocol_help>
2
2
  **Trigger**: `/archi.help [question]`
3
- **Goal**: Project navigation and contextual Q&A. Analyze current project state to recommend next actions; or answer user questions based on project context.
3
+ **Goal**: Project navigation and context Q&A. Analyze project current state, recommend next actions; or answer user questions based on project context.
4
4
 
5
5
  <meta>
6
6
  <style>Concise, Contextual, Actionable</style>
7
7
  <language>English</language>
8
8
  <principles>
9
- 1. **Context-Aware**: Answer based on real project state. No guessing.
10
- 2. **Actionable Output**: Every output must include an executable next step (specific command + args).
11
- 3. **Minimal Token**: Keep output concise. Don't repeat what the user already knows. Only present conclusions and recommendations.
12
- 4. **No Audit**: No deep auditing (that's `/archi.audit`'s job). Focus on navigation and Q&A.
9
+ 1. **Context-Aware**: Answer based on actual project state; no guessing.
10
+ 2. **Actionable Output**: Every output must include executable next-step suggestions (concrete command + params).
11
+ 3. **Minimal Token**: Concise output; don't restate known info. Present reasoning and suggestions only.
12
+ 4. **No Audit**: Do not do deep audit (that's `/archi.audit`). Focus on navigation and Q&A.
13
13
  </principles>
14
14
  </meta>
15
15
 
16
16
  <step_1_load_context>
17
- **Role**: Project Observer
18
17
  **Action**:
19
- 1. Read `[[__DOCS_DIR__]]/global/roadmap.json` — extract only `id/title/status/deps/tag` fields per task; skip `goal/notes` (navigation and status aggregation do not need these details).
20
- 2. Scan `[[__DOCS_DIR__]]/tasks/` directory — get existing Tasks and their doc completeness (spec.md / ui.md / plan.json).
21
- 3. [?question] If user provided a question, locate relevant files by semantic match (spec / plan / vision / tech_stack / data_snapshot, etc.), read as needed.
18
+ 1. **Load**: roadmap.json (id/title/status/deps/tag only; skip goal/notes).
19
+ 2. **Scan Tasks**: Scan tasks/ — get existing Tasks and doc completeness (has spec.md / ui.md / plan.json).
20
+ 3. [?question] If user provided a question, locate and read relevant files by semantics.
22
21
 
23
22
  **Output**: Internal context (not shown to user).
24
23
  </step_1_load_context>
25
24
 
26
25
  <step_2_route>
27
- **Role**: Router
28
- **Action**: Branch based on input:
26
+ **Action**: Branch by input:
29
27
 
30
28
  | Input | Branch |
31
29
  |:---|:---|
32
30
  | No args | → step_3_navigate (project navigation) |
33
- | Has `[question]` | → step_4_answer (contextual Q&A) |
31
+ | Has `[question]` | → step_4_answer (context Q&A) |
34
32
 
35
33
  </step_2_route>
36
34
 
37
35
  <step_3_navigate>
38
- **Role**: Project Navigator
39
36
  **Action**:
40
37
  1. **Determine project phase**:
41
38
 
42
- | Signal | Phase | Recommendation |
39
+ | Signal | Phase | Suggestion |
43
40
  |:---|:---|:---|
44
41
  | roadmap.json missing | Not initialized | New project → `/archi.start`; existing code → `/archi.inherit` |
45
- | Has roadmap but no Task dirs | Started, not planned | Run `/archi.scope` to plan new tasks |
46
- | Has Legacy stubs (Spec-Status: Stub) | Inherited, not enriched | Run `/archi.edit LEG-xx` to enrich spec |
47
- | Has active tasks with complete plan.json | Ready to code | Run `/archi.code <ID>` |
48
- | Has active tasks but missing spec/plan | Planning incomplete | Run `/archi.plan <ID>` to complete |
49
- | All tasks done | Complete | Run `/archi.scope` to plan new tasks or release |
50
- | Has blocked tasks | Blocked | Show blocking reason and prerequisites |
51
-
52
- 2. **Output format**:
53
- - One-line summary of current state
54
- - Recommended next action (with specific command)
55
- - If multiple paths available, list by priority (max 3)
42
+ | Has roadmap but no tasks/ | Started, not planned | `/archi.scope` to plan new tasks |
43
+ | Has Legacy stub (Spec-Status: Stub) | Inherited, not enriched | `/archi.edit LEG-xx` to enrich spec |
44
+ | Has active task and plan.json complete | Ready to code | `/archi.code <ID>` |
45
+ | Has active task but missing spec/plan | Planning incomplete | `/archi.plan <ID>` to complete |
46
+ | All tasks done | Completed | `/archi.scope` to plan new or release |
47
+ | Has blocked task | Blocked | Show block reason and upstream deps |
48
+
49
+ 2. **Output**: One-line state summary + recommended next step (with command) + optional paths (≤3, by priority).
56
50
  </step_3_navigate>
57
51
 
58
52
  <step_4_answer>
59
- **Role**: Project Advisor
60
53
  **Action**:
61
- 1. Parse `[question]` semantics, locate relevant project files.
62
- 2. Read relevant files, synthesize answer.
63
- 3. If question involves an action (e.g. "how to do X"), include specific command suggestions.
64
- 4. If insufficient info to answer, state what's missing instead of fabricating.
54
+ 1. Parse `[question]` semantics; locate and read relevant project files.
55
+ 2. Answer comprehensively; operational questions must include concrete command suggestions.
56
+ 3. When info insufficient, state what's missing; do not fabricate.
65
57
 
66
- **Output**: Concise answer based on project context + relevant file references.
58
+ **Output**: Concise answer based on project context + relevant file refs.
67
59
  </step_4_answer>
68
60
 
69
61
  </protocol_help>