architext 0.0.3 → 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.
Files changed (118) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/README.md +94 -12
  3. package/README.zh-CN.md +94 -12
  4. package/dist/index.js +43 -39
  5. package/dist/templates/en/briefs/_base.md +44 -11
  6. package/dist/templates/en/briefs/_modules.md +31 -4
  7. package/dist/templates/en/docs/global/api_snapshot.json +24 -0
  8. package/dist/templates/en/docs/global/command_api.json +26 -0
  9. package/dist/templates/en/docs/global/env_registry.json +12 -0
  10. package/dist/templates/en/docs/global/map.json +5 -0
  11. package/dist/templates/en/docs/global/public_api.json +12 -0
  12. package/dist/templates/en/docs/prompts/audit.md +80 -94
  13. package/dist/templates/en/docs/prompts/code.md +100 -109
  14. package/dist/templates/en/docs/prompts/edit.md +52 -47
  15. package/dist/templates/en/docs/prompts/fix.md +49 -42
  16. package/dist/templates/en/docs/prompts/help.md +23 -31
  17. package/dist/templates/en/docs/prompts/inherit.md +110 -116
  18. package/dist/templates/en/docs/prompts/map.md +47 -69
  19. package/dist/templates/en/docs/prompts/plan.md +160 -171
  20. package/dist/templates/en/docs/prompts/recover.md +48 -0
  21. package/dist/templates/en/docs/prompts/ref.md +163 -0
  22. package/dist/templates/en/docs/prompts/remove.md +55 -107
  23. package/dist/templates/en/docs/prompts/revise.md +63 -106
  24. package/dist/templates/en/docs/prompts/scope.md +77 -117
  25. package/dist/templates/en/docs/prompts/start.md +93 -139
  26. package/dist/templates/en/docs/shared/verify-result-handling.md +6 -0
  27. package/dist/templates/en/docs/templates/design.template.md +77 -0
  28. package/dist/templates/en/docs/templates/spec.template.md +60 -25
  29. package/dist/templates/en/rules/00_system.md +36 -79
  30. package/dist/templates/en/rules/01_workflow.md +59 -57
  31. package/dist/templates/en/rules/03_data_governance.md +46 -42
  32. package/dist/templates/en/skills/archi-data-sync/SKILL.md +83 -0
  33. package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +166 -151
  34. package/dist/templates/en/skills/archi-design-patterns/SKILL.md +140 -0
  35. package/dist/templates/en/skills/archi-feature-relations/SKILL.md +118 -0
  36. package/dist/templates/en/skills/archi-interview-protocol/SKILL.md +2 -1
  37. package/dist/templates/en/skills/archi-plan-options/SKILL.md +4 -3
  38. package/dist/templates/en/skills/archi-silent-audit/SKILL.md +118 -0
  39. package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
  40. package/dist/templates/zh/briefs/_base.md +46 -14
  41. package/dist/templates/zh/briefs/_modules.md +29 -2
  42. package/dist/templates/zh/docs/global/api_snapshot.json +24 -0
  43. package/dist/templates/zh/docs/global/command_api.json +26 -0
  44. package/dist/templates/zh/docs/global/data_snapshot.json +0 -1
  45. package/dist/templates/zh/docs/global/design_tokens.json +0 -1
  46. package/dist/templates/zh/docs/global/dictionary.json +1 -1
  47. package/dist/templates/zh/docs/global/env_registry.json +12 -0
  48. package/dist/templates/zh/docs/global/error_codes.json +0 -8
  49. package/dist/templates/zh/docs/global/map.json +28 -3
  50. package/dist/templates/zh/docs/global/public_api.json +12 -0
  51. package/dist/templates/zh/docs/global/vision.md +1 -1
  52. package/dist/templates/zh/docs/prompts/audit.md +43 -57
  53. package/dist/templates/zh/docs/prompts/code.md +68 -77
  54. package/dist/templates/zh/docs/prompts/edit.md +44 -39
  55. package/dist/templates/zh/docs/prompts/fix.md +33 -26
  56. package/dist/templates/zh/docs/prompts/help.md +13 -21
  57. package/dist/templates/zh/docs/prompts/inherit.md +81 -87
  58. package/dist/templates/zh/docs/prompts/map.md +23 -45
  59. package/dist/templates/zh/docs/prompts/plan.md +134 -146
  60. package/dist/templates/zh/docs/prompts/recover.md +48 -0
  61. package/dist/templates/zh/docs/prompts/ref.md +163 -0
  62. package/dist/templates/zh/docs/prompts/remove.md +31 -83
  63. package/dist/templates/zh/docs/prompts/revise.md +43 -84
  64. package/dist/templates/zh/docs/prompts/scope.md +53 -93
  65. package/dist/templates/zh/docs/prompts/start.md +75 -121
  66. package/dist/templates/zh/docs/shared/verify-result-handling.md +6 -0
  67. package/dist/templates/zh/docs/templates/design.template.md +77 -0
  68. package/dist/templates/zh/docs/templates/spec.template.md +60 -25
  69. package/dist/templates/zh/rules/00_system.md +37 -80
  70. package/dist/templates/zh/rules/01_workflow.md +60 -58
  71. package/dist/templates/zh/rules/02_tech_stack.md +7 -6
  72. package/dist/templates/zh/rules/03_data_governance.md +43 -39
  73. package/dist/templates/zh/rules/99_context_glue.md +2 -2
  74. package/dist/templates/zh/skills/archi-data-sync/SKILL.md +83 -0
  75. package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +70 -56
  76. package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +140 -0
  77. package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +118 -0
  78. package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
  79. package/dist/templates/zh/skills/archi-plan-options/SKILL.md +26 -25
  80. package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +118 -0
  81. package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
  82. package/package.json +1 -1
  83. package/dist/templates/zh-Hant/briefs/_base.md +0 -115
  84. package/dist/templates/zh-Hant/briefs/_modules.md +0 -173
  85. package/dist/templates/zh-Hant/docs/global/data_snapshot.json +0 -31
  86. package/dist/templates/zh-Hant/docs/global/design_tokens.json +0 -135
  87. package/dist/templates/zh-Hant/docs/global/dictionary.json +0 -35
  88. package/dist/templates/zh-Hant/docs/global/error_codes.json +0 -19
  89. package/dist/templates/zh-Hant/docs/global/map.json +0 -94
  90. package/dist/templates/zh-Hant/docs/global/roadmap.json +0 -39
  91. package/dist/templates/zh-Hant/docs/global/vision.md +0 -82
  92. package/dist/templates/zh-Hant/docs/prompts/audit.md +0 -150
  93. package/dist/templates/zh-Hant/docs/prompts/code.md +0 -160
  94. package/dist/templates/zh-Hant/docs/prompts/edit.md +0 -87
  95. package/dist/templates/zh-Hant/docs/prompts/fix.md +0 -86
  96. package/dist/templates/zh-Hant/docs/prompts/help.md +0 -69
  97. package/dist/templates/zh-Hant/docs/prompts/inherit.md +0 -270
  98. package/dist/templates/zh-Hant/docs/prompts/map.md +0 -131
  99. package/dist/templates/zh-Hant/docs/prompts/plan.md +0 -252
  100. package/dist/templates/zh-Hant/docs/prompts/remove.md +0 -162
  101. package/dist/templates/zh-Hant/docs/prompts/revise.md +0 -160
  102. package/dist/templates/zh-Hant/docs/prompts/scope.md +0 -198
  103. package/dist/templates/zh-Hant/docs/prompts/start.md +0 -258
  104. package/dist/templates/zh-Hant/docs/templates/plan.template.json +0 -88
  105. package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +0 -58
  106. package/dist/templates/zh-Hant/docs/templates/spec.template.md +0 -51
  107. package/dist/templates/zh-Hant/docs/templates/ui.template.md +0 -51
  108. package/dist/templates/zh-Hant/rules/00_system.md +0 -123
  109. package/dist/templates/zh-Hant/rules/01_workflow.md +0 -93
  110. package/dist/templates/zh-Hant/rules/02_tech_stack.md +0 -192
  111. package/dist/templates/zh-Hant/rules/03_data_governance.md +0 -102
  112. package/dist/templates/zh-Hant/rules/04_cli_tools.md +0 -50
  113. package/dist/templates/zh-Hant/rules/90_custom_rules.md +0 -21
  114. package/dist/templates/zh-Hant/rules/99_context_glue.md +0 -53
  115. package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +0 -293
  116. package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +0 -86
  117. package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +0 -364
  118. package/dist/templates/zh-Hant/skills/archi-ui-wireframe/SKILL.md +0 -337
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## Project Overview
8
8
 
9
- **Project Name**:
9
+ **Project Name**:
10
10
  **One-line description**: [What the project is, who it serves, what problem it solves]
11
11
  **Problem statement**: [Core pain points for target users? Where do existing solutions fall short?]
12
12
 
@@ -20,12 +20,27 @@
20
20
 
21
21
  ## Core Tasks
22
22
 
23
- > MVP must-have tasks (recommend 3–7), each in one sentence describing expected behavior.
23
+ > Must-have tasks, each in one paragraph describing expected behavior.
24
24
  > Detailed specs are defined in `/archi.plan`; here just clarify "what to build."
25
25
 
26
- 1.
27
- 2.
28
- 3.
26
+ 1.
27
+ 2.
28
+ 3.
29
+
30
+ ---
31
+
32
+ ## Business Process
33
+
34
+ > If your project has clear user journeys or core workflows, describe them here.
35
+ > No need for diagrams—describe steps in text; AI will infer system behavior from this.
36
+ > Leave blank if not applicable; AI will derive from core tasks.
37
+
38
+ <!-- Format reference:
39
+ ### [Process name]
40
+ 1. User [action] → System [response]
41
+ 2. User [action] → System [response]
42
+ 3. ...
43
+ -->
29
44
 
30
45
  ---
31
46
 
@@ -36,7 +51,7 @@
36
51
  >
37
52
  > Format:
38
53
  > - **[Task/page name]**: Describe behavior, flow, constraints
39
- > - May include screenshot/sketch links
54
+ > - May include screenshot/sketch (see "Design Assets" below)
40
55
 
41
56
  ---
42
57
 
@@ -45,7 +60,7 @@
45
60
  > Fill in what's confirmed. Leave blank or write "recommend" for the rest; AI will recommend based on project characteristics.
46
61
 
47
62
  **Project type**: [[__PROJECT_TYPE__]]
48
- <!-- Auto-filled by archi init; if writing manually, refer to the project type table in the archi-decompose-roadmap SKILL -->
63
+ <!-- Auto-filled by archi init; if writing manually, choose from ui/data/api/cli/lib/mobile/desktop/miniapp/extension/realtime/ai -->
49
64
  **Language/runtime**: [e.g.: TypeScript + Node.js 22]
50
65
  **Core framework**: [e.g.: Next.js 15 / Fastify / Tauri]
51
66
  **Package manager**: [e.g.: pnpm / npm / yarn / cargo]
@@ -78,14 +93,33 @@
78
93
  > What already exists that AI should know—to avoid reinventing or making conflicting decisions.
79
94
 
80
95
  **Project starting point**: [Greenfield / based on existing repo (brief status and tech debt)]
81
- **Design assets**: [Figma link / design mockup screenshots / none (AI designs)]
82
- **Brand guidelines**: [Existing logo/colors/fonts → describe or link / none]
83
96
  **Existing API/backend**: [API docs link / brief available endpoints / none (build from scratch)]
84
97
  **Third-party services**: [Confirmed services, e.g.: Auth0, Stripe, AWS S3, Resend...]
85
98
  **Existing data**: [Existing DB/data sources? Format? Migration needed? / none]
86
99
 
87
100
  ---
88
101
 
102
+ ## Design Assets
103
+
104
+ > Provide visual/design input for AI—directly impacts UI and architecture decision quality.
105
+ > Two ways to provide files:
106
+ > 1. **Local files**: Place files in `brief-assets/` directory, reference by format below
107
+ > 2. **External links**: Paste URL directly
108
+ >
109
+ > Reference format: `- [semantic label] ./brief-assets/filename`
110
+ >
111
+ > Format reference:
112
+ > - [Competitor reference - home] ./brief-assets/linear-dashboard.png
113
+ > - [My sketch] ./brief-assets/sketch-v1.png
114
+ > - [Brand palette] ./brief-assets/brand-colors.pdf
115
+ > - [API docs] ./brief-assets/api-spec.yaml
116
+ > - [Database Schema] ./brief-assets/schema.sql
117
+
118
+ **Design mockups/screenshots**: [Reference local files per format above / Figma link / none (AI designs)]
119
+ **Brand guidelines**: [Existing logo/colors/fonts → reference file or describe / none]
120
+
121
+ ---
122
+
89
123
  <!-- @slot:style -->
90
124
 
91
125
  ## Scope & Constraints
@@ -94,7 +128,6 @@
94
128
  - [e.g.: No i18n this release / no mobile adaption / no paid features]
95
129
 
96
130
  **Hard constraints**:
97
- - **Timeline**: [e.g.: 4-week MVP / no hard deadline]
98
131
  - **Compatibility**: [e.g.: Chrome 90+ / Node 18+ / iOS 15+]
99
132
  - **Performance**: [e.g.: First paint < 2s / API P99 < 500ms / no special requirements]
100
133
  - **Compliance/accessibility**: [e.g.: WCAG 2.1 AA / GDPR / none]
@@ -112,4 +145,4 @@
112
145
 
113
146
  ## Additional Notes
114
147
 
115
- > Anything not covered above: background story, special requirements, rationale for decisions, team tech preferences, etc.
148
+ > Anything not covered above: background story, special requirements, rationale for decisions, etc.
@@ -5,10 +5,37 @@
5
5
  <!-- @tech:data -->
6
6
  **Database**: [e.g.: PostgreSQL / MongoDB / SQLite]
7
7
  **ORM / Query Builder**: [e.g.: Prisma / Drizzle / TypeORM]
8
+
9
+ ### Data Model Draft
10
+
11
+ > If you already know core data entities and relationships, describe them here. No need for full schema—list entity names and key fields.
12
+ > AI will generate detailed data model in `/archi.plan`; here just clarify "what data exists."
13
+ > Leave blank if not applicable; AI will derive from core tasks.
14
+
15
+ <!-- Format reference:
16
+ - **User**: email, name, role (admin/user), avatar
17
+ - **Post**: title, content, status (draft/published), author → User
18
+ - **Comment**: body, author → User, post → Post
19
+ - User 1:N Post, Post 1:N Comment
20
+ -->
21
+
8
22
  <!-- @end -->
9
23
 
10
24
  <!-- @tech:api -->
11
25
  **API style**: [e.g.: RESTful / GraphQL / gRPC / tRPC]
26
+
27
+ ### Existing API Endpoints
28
+
29
+ > If you have existing backend API (self-hosted or third-party), list core endpoints here. Or place full docs in `brief-assets/`.
30
+ > Leave blank if not applicable.
31
+
32
+ <!-- Format reference:
33
+ - `POST /auth/login` → returns JWT token
34
+ - `GET /users/:id` → user detail
35
+ - `POST /posts` → create post (auth required)
36
+ - Full docs: [API docs] ./brief-assets/api-spec.yaml
37
+ -->
38
+
12
39
  <!-- @end -->
13
40
 
14
41
  <!-- @tech:cli -->
@@ -44,8 +71,8 @@
44
71
 
45
72
  ### Visual Reference
46
73
 
47
- > Provides aesthetic input for AI directly impacts `ui_concept.html` quality.
48
- > Fill in any of the fields below; the more you provide, the closer AI can match your vision.
74
+ > Provides aesthetic input for AI—directly impacts `ui_concept.html` visual quality.
75
+ > Any field below is valid; the more you fill, the better AI can match your expected style.
49
76
 
50
77
  **Competitor/inspiration screenshots**: [paste image / Figma link / URL]
51
78
  **Brand palette**: [primary color Hex / gradient description / none (AI generates from aesthetic direction)]
@@ -116,7 +143,7 @@
116
143
  **Real-time transport**: [e.g.: Socket.io / native WebSocket / SSE / WebRTC]
117
144
  **Real-time framework/hosting**: [e.g.: Ably / Pusher / Liveblocks / self-hosted]
118
145
  **Room/channel model**: [e.g.: subscribe by user ID / room by document ID / broadcast]
119
- **[?CRDT] Conflict resolution**: [e.g.: Yjs / Automerge / not needed (broadcast only)]
146
+ **(CRDT projects only) Conflict resolution**: [e.g.: Yjs / Automerge / not needed (broadcast only)]
120
147
  **Offline support**: [e.g.: offline queue + reconnect sync / not needed]
121
148
  <!-- @end -->
122
149
 
@@ -125,7 +152,7 @@
125
152
  **AI framework**: [e.g.: Vercel AI SDK / LangChain / LlamaIndex / direct API calls]
126
153
  **Tool/Function Calling**: [e.g.: needed (list tool names) / not needed]
127
154
  **Memory approach**: [e.g.: vector DB (pgvector/Pinecone) / sliding window history / none]
128
- **[?MCP] MCP protocol**: [e.g.: @modelcontextprotocol/sdk / not needed]
155
+ **(MCP projects only) MCP protocol**: [e.g.: @modelcontextprotocol/sdk / not needed]
129
156
  **Streaming output**: [e.g.: SSE streaming / batch response]
130
157
  <!-- @end -->
131
158
 
@@ -0,0 +1,24 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "method": "[GET | POST | PUT | DELETE | PATCH]",
5
+ "path": "[/resource/:id]",
6
+ "description": "[One-sentence endpoint responsibility]",
7
+ "auth": "[required | public | optional]",
8
+ "requestBody": "[Schema description or N/A]",
9
+ "responses": {
10
+ "200": "[Success response structure]",
11
+ "[4xx]": "[ref: error_codes.json#ERR_CODE]"
12
+ },
13
+ "owner": "[FEAT-xxx | INF-xxx]"
14
+ }
15
+ ],
16
+ "protocolMapping": [
17
+ {
18
+ "statusCode": "[400 | 401 | 403 | 404 | 500 | ...]",
19
+ "code": "[ERR_CODE]",
20
+ "meaning": "[Meaning]",
21
+ "action": "[Caller behavior: Toast / Redirect / Retry / ...]"
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "commands": [
3
+ {
4
+ "name": "[command-name]",
5
+ "aliases": ["[alias]"],
6
+ "description": "[One-sentence command responsibility]",
7
+ "args": [
8
+ {
9
+ "name": "[arg-name]",
10
+ "required": true,
11
+ "description": "[Argument description]"
12
+ }
13
+ ],
14
+ "flags": [
15
+ {
16
+ "name": "--[flag-name]",
17
+ "short": "-[f]",
18
+ "type": "[string | boolean | number]",
19
+ "default": "[Default or null]",
20
+ "description": "[Flag description]"
21
+ }
22
+ ],
23
+ "owner": "[FEAT-xxx | INF-xxx]"
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "variables": [
3
+ {
4
+ "name": "[ENV_VAR_NAME]",
5
+ "required": true,
6
+ "default": null,
7
+ "description": "[Purpose]",
8
+ "example": "[Example value]",
9
+ "owner": "[FEAT-xxx | INF-xxx]"
10
+ }
11
+ ]
12
+ }
@@ -81,6 +81,11 @@
81
81
  "category": "UI/UX",
82
82
  "purpose": "Task-level UI scope declaration — references screen IDs from ui_context.md to define this task's screen/component scope"
83
83
  },
84
+ {
85
+ "file": "design.md",
86
+ "category": "Technical Design",
87
+ "purpose": "[?Complex] Technical design — state machine/pipeline/protocol definitions, parameter table, invariants"
88
+ },
84
89
  {
85
90
  "file": "plan.json",
86
91
  "category": "Plan",
@@ -0,0 +1,12 @@
1
+ {
2
+ "exports": [
3
+ {
4
+ "name": "[exportName]",
5
+ "type": "[function | class | type | constant | enum]",
6
+ "signature": "[TypeScript signature]",
7
+ "description": "[One-sentence export responsibility]",
8
+ "stability": "[stable | experimental | deprecated]",
9
+ "owner": "[FEAT-xxx | INF-xxx]"
10
+ }
11
+ ]
12
+ }
@@ -1,150 +1,136 @@
1
1
  <protocol_audit>
2
- **Trigger**: `/archi.audit [id]`
3
- **Goal**: Independent deep code audit. With `<id>`, audit the task's code implementation; without `<id>`, execute project-level health check. No code modifications output audit report and fix tickets only.
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**: Prohibited from modifying any code files. Audit ≠ Fix.
10
- 2. **Evidence-Based**: Every finding must include file path, line number, and code snippet.
11
- 3. **Actionable Output**: Every issue must include a recommended fix command (`/archi.fix`, `/archi.edit`, etc.).
12
- 4. **Vision Anchored**: Always use `vision.md` as directional baseline to detect deviations.
13
- 5. **Report Persistence**: Audit results must be written to file — task-level → `tasks/<id>_*/audit.md` (overwrite), project-level → `audits/YYYY-MM-DD.md` (date-archived, same-day overwrite).
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 audit | step_2_task → step_3_report |
24
- | `/archi.audit` | Project-level health check | step_2_project → step_3_report |
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 `[[__DOCS_DIR__]]/global/roadmap.json` → Task Name, Slug, status.
28
- 2. **Status Gate** — Only `active` or `done` can be audited:
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 audit, run `/archi.plan` + `/archi.code` first |
34
- | `blocked` | Reject — prerequisites not completed |
35
-
36
- 3. **Load Context**:
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/ui_concept). Read all code files for this task.
48
37
 
49
38
  **Project-level — Load Overview**:
50
- 1. Read `[[__DOCS_DIR__]]/global/vision.md`, `roadmap.json`, `map.json`.
51
- 2. Read `02_tech_stack.md`.
52
- 3. Scan `[[__DOCS_DIR__]]/tasks/` directory structure.
53
- 4. Read project code entry points and key modules.
39
+ 1. Read vision.md, roadmap.json, map.json, 02_tech_stack.md.
40
+ 2. Scan tasks/ directory structure.
41
+ 3. Read project code entry points and key modules.
54
42
 
55
- **Output**: Audit scope and context inventory.
43
+ **Output**: Review scope and context checklist. Enter step_2a_task or step_2b_project.
56
44
  </step_1_resolve>
57
45
 
58
- <step_2_task>
46
+ <step_2a_task>
59
47
  **Role**: Chief Auditor
60
- **Scope**: Task-level deep code audit (execute only for `/archi.audit <id>`).
48
+ **Scope**: Task-level deep code review (only when `/archi.audit <id>`).
61
49
 
62
- Audit dimension by dimension; every finding must include `file:line` + code snippet + severity:
50
+ Review dimension by dimension; each finding must include `file:line` + code snippet + severity:
63
51
 
64
- | # | Dimension | Audit Focus |
52
+ | # | Dimension | Review focus |
65
53
  |:---|:---|:---|
66
- | 1 | **Vision Alignment** | Does the implementation direction conflict with or deviate from `vision.md` |
67
- | 2 | **Spec Completeness** | Does code cover all scenarios and edge cases in `spec.md` |
68
- | 3 | **Plan Truthfulness** | Are tasks marked `done` actually implemented in code (detect false marks) |
69
- | 4 | **Logic Correctness** | Business logic errors, contradictions, missing branches, state machine defects |
70
- | 5 | **Bug Hunting** | Null/undefined, race conditions, resource leaks, infinite loops, off-by-one |
71
- | 6 | **Error Handling** | Swallowed errors, silent failures, error propagation chain integrity, user-visible feedback |
72
- | 7 | **Tech Stack Compliance** | Against `02_tech_stack.md`: forbidden patterns, outdated APIs, hardcoded values |
73
- | 8 | **Security** | Sensitive info leakage, unvalidated input, injection risks, permission checks |
74
- | 9 | **Performance** | Unnecessary full imports/large loops/useless computation/memory leaks/N+1 queries |
75
- | 10 | [?UI] **Design Compliance** | Styles use visual patterns from Tokens; no hardcoded magic values; implementation visually consistent with corresponding screen in `ui_concept.html` |
76
- | 11 | [?Data] **Data Integrity** | Field names/types consistent with `data_snapshot.json` |
77
- | 12 | [?I18n] **I18n Compliance** | No hardcoded strings; must use Key/dictionary references |
78
- | 13 | **Orphan .gitkeep** | Dir has other files but still contains `.gitkeep` must remove |
79
- | 14 | **Spec-Code Drift** | Do code interfaces/types/behaviors match `spec.md`; have manual changes been synced to docs |
80
- | 15 | [?UI] **UI Reference Integrity** | Are `ref: ui_concept.html#S-XX` pointers in `ui.md` still valid; have referenced screens/components been renamed or removed after edit/revise |
81
-
82
- **Output**: Findings list grouped by dimension, each with severity, location, description.
83
- </step_2_task>
84
-
85
- <step_2_project>
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 `02_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 `ui_concept.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: ui_concept.html#S-XX` 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 (execute only for `/archi.audit` without arguments).
75
+ **Scope**: Project-level health check (only when `/archi.audit` no args).
88
76
 
89
- | # | Check Item | Description |
77
+ | # | Check | Description |
90
78
  |:---|:---|:---|
91
- | 1 | **Vision Drift** | Are `roadmap.json` task directions consistent with `vision.md` |
92
- | 2 | **Architecture Consistency** | `map.json` vs actual directory structure drift or unregistered modules |
93
- | 3 | **Roadmap Health** | Consistency + progress stats + long-term blocked tasks + dependency cycle detection |
94
- | 4 | **Documentation Completeness** | Each Task has spec.md + plan.json; detect orphan directories |
95
- | 5 | **Tech Stack Global Compliance** | Spot-check key entry points and modules for global violations |
96
- | 6 | **Cross-Task Consistency** | Duplicate logic, naming conflicts, interface inconsistencies |
97
- | 7 | **Orphan .gitkeep** | Dir has other files but still contains `.gitkeep` — must remove |
98
-
99
- After scanning, prioritize and recommend Tasks needing deep audit:
100
- - `done` but plan not fully completed
101
- - Large codebase but no tests
102
- - Long-term `active` with no progress
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 errors, security vulnerabilities, data corruption risk |
116
- | `WARNING` | Should fix, carries risk | Missing error handling, performance hazards, incomplete Spec coverage |
117
- | `INFO` | Suggested improvement | Naming conventions, missing comments, simplifiable code |
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/path:line — Dimension Name
122
- Description: specific issue
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** (recommend command by issue type):
110
+ **Action Routing**:
127
111
 
128
112
  | Issue Type | Recommended Command |
129
113
  |:---|:---|
130
- | Bug (logic error, edge case miss) | `/archi.fix <ID> <description>` |
131
- | Spec gap (task not fully implemented) | `/archi.edit <ID> <supplement>` |
132
- | Architecture-level issue (global violation) | `/archi.revise <description>` |
133
- | Incomplete task (plan falsely marked done) | `/archi.code <ID>` |
134
- | Minor issue (naming, comments, simplification) | Address in next `/archi.code` |
135
-
136
- **Report Structure**:
137
- 1. Audit summary (mode, scope, date)
138
- 2. Findings list (sorted by severity: CRITICAL WARNING → INFO)
139
- 3. Statistics summary (count per severity level)
140
- 4. Fix ticket summary (directly executable command list)
141
- 5. Next Steps table
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-archived, same-day overwrite)
131
+ - Project-level → `[[__DOCS_DIR__]]/audits/YYYY-MM-DD.md` (date archive)
146
132
 
147
- **Output**: Complete audit report (output to both conversation and file).
133
+ **Output**: Full review report (to conversation and file).
148
134
  </step_3_report>
149
135
 
150
136
  </protocol_audit>