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.
- package/CHANGELOG.md +56 -1
- package/README.md +94 -12
- package/README.zh-CN.md +94 -12
- package/dist/index.js +43 -39
- package/dist/templates/en/briefs/_base.md +44 -11
- package/dist/templates/en/briefs/_modules.md +31 -4
- package/dist/templates/en/docs/global/api_snapshot.json +24 -0
- package/dist/templates/en/docs/global/command_api.json +26 -0
- package/dist/templates/en/docs/global/env_registry.json +12 -0
- package/dist/templates/en/docs/global/map.json +5 -0
- package/dist/templates/en/docs/global/public_api.json +12 -0
- package/dist/templates/en/docs/prompts/audit.md +80 -94
- package/dist/templates/en/docs/prompts/code.md +100 -109
- package/dist/templates/en/docs/prompts/edit.md +52 -47
- 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 +110 -116
- package/dist/templates/en/docs/prompts/map.md +47 -69
- package/dist/templates/en/docs/prompts/plan.md +160 -171
- package/dist/templates/en/docs/prompts/recover.md +48 -0
- package/dist/templates/en/docs/prompts/ref.md +163 -0
- 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 +93 -139
- package/dist/templates/en/docs/shared/verify-result-handling.md +6 -0
- package/dist/templates/en/docs/templates/design.template.md +77 -0
- package/dist/templates/en/docs/templates/spec.template.md +60 -25
- 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 +83 -0
- package/dist/templates/en/skills/archi-decompose-roadmap/SKILL.md +166 -151
- package/dist/templates/en/skills/archi-design-patterns/SKILL.md +140 -0
- package/dist/templates/en/skills/archi-feature-relations/SKILL.md +118 -0
- 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 +118 -0
- package/dist/templates/en/skills/archi-ui-wireframe/SKILL.md +315 -270
- package/dist/templates/zh/briefs/_base.md +46 -14
- package/dist/templates/zh/briefs/_modules.md +29 -2
- package/dist/templates/zh/docs/global/api_snapshot.json +24 -0
- package/dist/templates/zh/docs/global/command_api.json +26 -0
- package/dist/templates/zh/docs/global/data_snapshot.json +0 -1
- package/dist/templates/zh/docs/global/design_tokens.json +0 -1
- package/dist/templates/zh/docs/global/dictionary.json +1 -1
- package/dist/templates/zh/docs/global/env_registry.json +12 -0
- package/dist/templates/zh/docs/global/error_codes.json +0 -8
- package/dist/templates/zh/docs/global/map.json +28 -3
- package/dist/templates/zh/docs/global/public_api.json +12 -0
- package/dist/templates/zh/docs/global/vision.md +1 -1
- package/dist/templates/zh/docs/prompts/audit.md +43 -57
- package/dist/templates/zh/docs/prompts/code.md +68 -77
- package/dist/templates/zh/docs/prompts/edit.md +44 -39
- package/dist/templates/zh/docs/prompts/fix.md +33 -26
- package/dist/templates/zh/docs/prompts/help.md +13 -21
- package/dist/templates/zh/docs/prompts/inherit.md +81 -87
- package/dist/templates/zh/docs/prompts/map.md +23 -45
- package/dist/templates/zh/docs/prompts/plan.md +134 -146
- package/dist/templates/zh/docs/prompts/recover.md +48 -0
- package/dist/templates/zh/docs/prompts/ref.md +163 -0
- package/dist/templates/zh/docs/prompts/remove.md +31 -83
- package/dist/templates/zh/docs/prompts/revise.md +43 -84
- package/dist/templates/zh/docs/prompts/scope.md +53 -93
- package/dist/templates/zh/docs/prompts/start.md +75 -121
- package/dist/templates/zh/docs/shared/verify-result-handling.md +6 -0
- package/dist/templates/zh/docs/templates/design.template.md +77 -0
- package/dist/templates/zh/docs/templates/spec.template.md +60 -25
- package/dist/templates/zh/rules/00_system.md +37 -80
- package/dist/templates/zh/rules/01_workflow.md +60 -58
- package/dist/templates/zh/rules/02_tech_stack.md +7 -6
- package/dist/templates/zh/rules/03_data_governance.md +43 -39
- package/dist/templates/zh/rules/99_context_glue.md +2 -2
- package/dist/templates/zh/skills/archi-data-sync/SKILL.md +83 -0
- package/dist/templates/zh/skills/archi-decompose-roadmap/SKILL.md +70 -56
- package/dist/templates/zh/skills/archi-design-patterns/SKILL.md +140 -0
- package/dist/templates/zh/skills/archi-feature-relations/SKILL.md +118 -0
- package/dist/templates/zh/skills/archi-interview-protocol/SKILL.md +2 -1
- package/dist/templates/zh/skills/archi-plan-options/SKILL.md +26 -25
- package/dist/templates/zh/skills/archi-silent-audit/SKILL.md +118 -0
- package/dist/templates/zh/skills/archi-ui-wireframe/SKILL.md +317 -269
- package/package.json +1 -1
- package/dist/templates/zh-Hant/briefs/_base.md +0 -115
- package/dist/templates/zh-Hant/briefs/_modules.md +0 -173
- package/dist/templates/zh-Hant/docs/global/data_snapshot.json +0 -31
- package/dist/templates/zh-Hant/docs/global/design_tokens.json +0 -135
- package/dist/templates/zh-Hant/docs/global/dictionary.json +0 -35
- package/dist/templates/zh-Hant/docs/global/error_codes.json +0 -19
- package/dist/templates/zh-Hant/docs/global/map.json +0 -94
- package/dist/templates/zh-Hant/docs/global/roadmap.json +0 -39
- package/dist/templates/zh-Hant/docs/global/vision.md +0 -82
- package/dist/templates/zh-Hant/docs/prompts/audit.md +0 -150
- package/dist/templates/zh-Hant/docs/prompts/code.md +0 -160
- package/dist/templates/zh-Hant/docs/prompts/edit.md +0 -87
- package/dist/templates/zh-Hant/docs/prompts/fix.md +0 -86
- package/dist/templates/zh-Hant/docs/prompts/help.md +0 -69
- package/dist/templates/zh-Hant/docs/prompts/inherit.md +0 -270
- package/dist/templates/zh-Hant/docs/prompts/map.md +0 -131
- package/dist/templates/zh-Hant/docs/prompts/plan.md +0 -252
- package/dist/templates/zh-Hant/docs/prompts/remove.md +0 -162
- package/dist/templates/zh-Hant/docs/prompts/revise.md +0 -160
- package/dist/templates/zh-Hant/docs/prompts/scope.md +0 -198
- package/dist/templates/zh-Hant/docs/prompts/start.md +0 -258
- package/dist/templates/zh-Hant/docs/templates/plan.template.json +0 -88
- package/dist/templates/zh-Hant/docs/templates/scope-brief.template.md +0 -58
- package/dist/templates/zh-Hant/docs/templates/spec.template.md +0 -51
- package/dist/templates/zh-Hant/docs/templates/ui.template.md +0 -51
- package/dist/templates/zh-Hant/rules/00_system.md +0 -123
- package/dist/templates/zh-Hant/rules/01_workflow.md +0 -93
- package/dist/templates/zh-Hant/rules/02_tech_stack.md +0 -192
- package/dist/templates/zh-Hant/rules/03_data_governance.md +0 -102
- package/dist/templates/zh-Hant/rules/04_cli_tools.md +0 -50
- package/dist/templates/zh-Hant/rules/90_custom_rules.md +0 -21
- package/dist/templates/zh-Hant/rules/99_context_glue.md +0 -53
- package/dist/templates/zh-Hant/skills/archi-decompose-roadmap/SKILL.md +0 -293
- package/dist/templates/zh-Hant/skills/archi-interview-protocol/SKILL.md +0 -86
- package/dist/templates/zh-Hant/skills/archi-plan-options/SKILL.md +0 -364
- 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
|
-
>
|
|
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
|
|
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,
|
|
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,
|
|
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
|
|
48
|
-
>
|
|
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
|
-
**
|
|
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
|
-
**
|
|
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
|
+
}
|
|
@@ -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
|
|
2
|
+
**Trigger**: `/archi.audit [id]` | Auto-loaded by Workflow Dispatch on natural language trigger
|
|
3
|
+
**Goal**: Independent deep code review. With `<id>` review that task's code implementation; without `<id>` run project-wide health check. Do not modify code; output review report and fix work items only.
|
|
4
4
|
|
|
5
5
|
<meta>
|
|
6
6
|
<style>Investigative, Thorough, Evidence-Based</style>
|
|
7
7
|
<language>English</language>
|
|
8
8
|
<principles>
|
|
9
|
-
1. **Read-Only**:
|
|
10
|
-
2. **Evidence-Based**:
|
|
11
|
-
3. **Actionable Output**:
|
|
12
|
-
4. **Vision Anchored**: Always use `vision.md` as
|
|
13
|
-
5. **Report Persistence**:
|
|
9
|
+
1. **Read-Only**: Do not modify any code files. Review ≠ Fix.
|
|
10
|
+
2. **Evidence-Based**: Each finding must include file path, line number, code snippet.
|
|
11
|
+
3. **Actionable Output**: Each issue must include recommended fix command (`/archi.fix`, `/archi.edit`, etc.).
|
|
12
|
+
4. **Vision Anchored**: Always use `vision.md` as direction anchor; detect drift.
|
|
13
|
+
5. **Report Persistence**: Review results must be written to file — task-level → `tasks/<id>_*/audit.md` (overwrite); project-level → `audits/YYYY-MM-DD.md` (date archive).
|
|
14
|
+
6. **IDE-Native First**: Leverage IDE native capabilities to drive execution rhythm; this protocol defines quality standards and checkpoints, not fight IDE planning/execution mechanisms.
|
|
14
15
|
</principles>
|
|
15
16
|
</meta>
|
|
16
17
|
|
|
17
18
|
<step_1_resolve>
|
|
18
|
-
**Role**: System Analyst
|
|
19
19
|
**Mode Gate**:
|
|
20
20
|
|
|
21
21
|
| Input | Mode | Next Steps |
|
|
22
22
|
|:---|:---|:---|
|
|
23
|
-
| `/archi.audit <id>` | Task-level deep
|
|
24
|
-
| `/archi.audit` | Project-level health check |
|
|
23
|
+
| `/archi.audit <id>` | Task-level deep review | step_2a_task → step_3_report |
|
|
24
|
+
| `/archi.audit` | Project-level health check | step_2b_project → step_3_report |
|
|
25
25
|
|
|
26
26
|
**Task-level — Resolve ID**:
|
|
27
|
-
1. Parse `<id>` from
|
|
28
|
-
2. **Status Gate** —
|
|
27
|
+
1. Parse `<id>` from roadmap.json → Task Name, Slug, status.
|
|
28
|
+
2. **Status Gate** — only `active` or `done` may be reviewed:
|
|
29
29
|
|
|
30
30
|
| Status | Handling |
|
|
31
31
|
|:---|:---|
|
|
32
32
|
| `active` / `done` | Pass |
|
|
33
|
-
| `pending` | Reject — no code to
|
|
34
|
-
| `blocked` | Reject —
|
|
35
|
-
|
|
36
|
-
3. **Load
|
|
37
|
-
- `[[__DOCS_DIR__]]/global/vision.md` — Project directional baseline
|
|
38
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/spec.md` — Task logic
|
|
39
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/plan.json` — Task checklist
|
|
40
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/ui.md` — Task UI scope declaration (if exists)
|
|
41
|
-
- [?UI] `[[__DOCS_DIR__]]/global/ui_context.md` — AI screen index (locate corresponding screen IDs)
|
|
42
|
-
- [?UI] `[[__DOCS_DIR__]]/global/ui_concept.html` — read-only visual reference (source of visual truth for #10 compliance comparison)
|
|
43
|
-
- `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/audit.md` — Previous audit report (if exists, for comparison)
|
|
44
|
-
- `02_tech_stack.md` — Technical red lines
|
|
45
|
-
- [?UI] `[[__DOCS_DIR__]]/global/design_tokens.json`
|
|
46
|
-
- [?Data] `[[__DOCS_DIR__]]/global/data_snapshot.json`
|
|
47
|
-
4. Read all code files corresponding to this task.
|
|
33
|
+
| `pending` | Reject — no code to review |
|
|
34
|
+
| `blocked` | Reject — upstream deps incomplete |
|
|
35
|
+
|
|
36
|
+
3. **Load**: vision.md (direction anchor) + task docs (spec/plan/ui) + prior audit.md (for comparison) + project context (tech_stack/design_tokens/data_snapshot/ui_context/ui_concept). Read all code files for this task.
|
|
48
37
|
|
|
49
38
|
**Project-level — Load Overview**:
|
|
50
|
-
1. Read
|
|
51
|
-
2.
|
|
52
|
-
3.
|
|
53
|
-
4. Read project code entry points and key modules.
|
|
39
|
+
1. Read vision.md, roadmap.json, map.json, 02_tech_stack.md.
|
|
40
|
+
2. Scan tasks/ directory structure.
|
|
41
|
+
3. Read project code entry points and key modules.
|
|
54
42
|
|
|
55
|
-
**Output**:
|
|
43
|
+
**Output**: Review scope and context checklist. Enter step_2a_task or step_2b_project.
|
|
56
44
|
</step_1_resolve>
|
|
57
45
|
|
|
58
|
-
<
|
|
46
|
+
<step_2a_task>
|
|
59
47
|
**Role**: Chief Auditor
|
|
60
|
-
**Scope**: Task-level deep code
|
|
48
|
+
**Scope**: Task-level deep code review (only when `/archi.audit <id>`).
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
Review dimension by dimension; each finding must include `file:line` + code snippet + severity:
|
|
63
51
|
|
|
64
|
-
| # | Dimension |
|
|
52
|
+
| # | Dimension | Review focus |
|
|
65
53
|
|:---|:---|:---|
|
|
66
|
-
| 1 | **Vision
|
|
67
|
-
| 2 | **Spec
|
|
68
|
-
| 3 | **Plan
|
|
69
|
-
| 4 | **Logic
|
|
70
|
-
| 5 | **Bug
|
|
71
|
-
| 6 | **Error
|
|
72
|
-
| 7 | **Tech Stack
|
|
73
|
-
| 8 | **Security** | Sensitive info
|
|
74
|
-
| 9 | **Performance** | Unnecessary full imports
|
|
75
|
-
| 10 |
|
|
76
|
-
| 11 |
|
|
77
|
-
| 12 |
|
|
78
|
-
| 13 | **Orphan .gitkeep** |
|
|
79
|
-
| 14 | **Spec-Code
|
|
80
|
-
| 15 |
|
|
81
|
-
|
|
82
|
-
**Output**:
|
|
83
|
-
</
|
|
84
|
-
|
|
85
|
-
<
|
|
54
|
+
| 1 | **Vision alignment** | Implementation direction conflicts or drift from `vision.md` |
|
|
55
|
+
| 2 | **Spec completeness** | Code covers all scenarios and boundaries in `spec.md` |
|
|
56
|
+
| 3 | **Plan truthfulness** | Tasks marked `done` actually implemented (prevent false completion) |
|
|
57
|
+
| 4 | **Logic correctness** | Business logic errors, contradictions, missing branches, state machine defects |
|
|
58
|
+
| 5 | **Bug hunting** | null/undefined, race conditions, resource leaks, infinite loops, off-by-one |
|
|
59
|
+
| 6 | **Error handling** | Swallowing, silent failure, error propagation chain, user-visible feedback |
|
|
60
|
+
| 7 | **Tech Stack compliance** | Per `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 (
|
|
75
|
+
**Scope**: Project-level health check (only when `/archi.audit` no args).
|
|
88
76
|
|
|
89
|
-
| # | Check
|
|
77
|
+
| # | Check | Description |
|
|
90
78
|
|:---|:---|:---|
|
|
91
|
-
| 1 | **Vision
|
|
92
|
-
| 2 | **Architecture
|
|
93
|
-
| 3 | **Roadmap
|
|
94
|
-
| 4 | **
|
|
95
|
-
| 5 | **Tech Stack
|
|
96
|
-
| 6 | **Cross-Task
|
|
97
|
-
| 7 | **Orphan .gitkeep** |
|
|
98
|
-
|
|
99
|
-
After
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
**Output**: Project health overview + deep audit recommendation list.
|
|
105
|
-
</step_2_project>
|
|
79
|
+
| 1 | **Vision drift** | `roadmap.json` task directions align with `vision.md` |
|
|
80
|
+
| 2 | **Architecture consistency** | `map.json` vs actual dir structure; drift or unregistered modules |
|
|
81
|
+
| 3 | **Roadmap health** | Consistency + progress stats + long blocked + dep cycle detection |
|
|
82
|
+
| 4 | **Doc completeness** | Each Task has spec.md + plan.json; orphan directories |
|
|
83
|
+
| 5 | **Tech Stack global compliance** | Spot-check key entry points and modules |
|
|
84
|
+
| 6 | **Cross-Task consistency** | Duplicate logic, naming conflicts, interface inconsistency |
|
|
85
|
+
| 7 | **Orphan .gitkeep** | `.gitkeep` exists when dir has other files |
|
|
86
|
+
|
|
87
|
+
After scan, recommend tasks for deep review (`done` but plan incomplete / large codebase no tests / long `active`).
|
|
88
|
+
|
|
89
|
+
**Output**: Project health overview + deep review recommendation list. Enter step_3_report.
|
|
90
|
+
</step_2b_project>
|
|
106
91
|
|
|
107
92
|
<step_3_report>
|
|
108
|
-
**Role**: Report Writer
|
|
109
93
|
**Action**:
|
|
110
94
|
|
|
111
95
|
**Issue Classification**:
|
|
112
96
|
|
|
113
97
|
| Level | Meaning | Example |
|
|
114
98
|
|:---|:---|:---|
|
|
115
|
-
| `CRITICAL` | Must fix, blocks release | Logic
|
|
116
|
-
| `WARNING` | Should fix,
|
|
117
|
-
| `INFO` | Suggested
|
|
99
|
+
| `CRITICAL` | Must fix, blocks release | Logic error, security hole, data corruption risk |
|
|
100
|
+
| `WARNING` | Should fix, risk exists | Missing error handling, performance hazard, Spec coverage gap |
|
|
101
|
+
| `INFO` | Suggested optimization | Non-standard naming, missing comments, simplifiable code |
|
|
118
102
|
|
|
119
103
|
**Issue Format** (each must include):
|
|
120
104
|
```
|
|
121
|
-
[LEVEL] file
|
|
122
|
-
Description: specific
|
|
105
|
+
[LEVEL] file:line — Dimension name
|
|
106
|
+
Description: specific problem
|
|
123
107
|
-> Recommended fix: /archi.fix <ID> <description> or /archi.edit <ID> <description>
|
|
124
108
|
```
|
|
125
109
|
|
|
126
|
-
**Action Routing
|
|
110
|
+
**Action Routing**:
|
|
127
111
|
|
|
128
112
|
| Issue Type | Recommended Command |
|
|
129
113
|
|:---|:---|
|
|
130
|
-
| Bug
|
|
131
|
-
| Spec gap
|
|
132
|
-
| Architecture-level
|
|
133
|
-
|
|
|
134
|
-
| Minor
|
|
135
|
-
|
|
136
|
-
**
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
114
|
+
| Bug | `/archi.fix <ID> <description>` |
|
|
115
|
+
| Spec gap | `/archi.edit <ID> <supplement description>` |
|
|
116
|
+
| Architecture-level | `/archi.revise <description>` |
|
|
117
|
+
| Feature incomplete | `/archi.code <ID>` |
|
|
118
|
+
| Minor | Address in next `/archi.code` |
|
|
119
|
+
|
|
120
|
+
**Pre-signoff Checklist** (confirm each item before writing report file):
|
|
121
|
+
□ (Task-level) All 15 review dimensions covered; inapplicable items marked N/A (not silently skipped)
|
|
122
|
+
□ (Project-level) All 7 checklist items evaluated
|
|
123
|
+
□ Each CRITICAL/WARNING finding includes `file:line` + code snippet
|
|
124
|
+
□ Each finding includes a recommended fix command (/archi.fix / /archi.edit etc.)
|
|
125
|
+
□ Report written to correct file (task-level: tasks/<id>/audit.md; project-level: audits/YYYY-MM-DD.md)
|
|
126
|
+
|
|
127
|
+
**Report Structure**: Review summary → Finding list (CRITICAL → WARNING → INFO) → Stats summary → Fix work items → Next Steps.
|
|
142
128
|
|
|
143
129
|
**Write Report File**:
|
|
144
130
|
- Task-level → `[[__DOCS_DIR__]]/tasks/<id>_<Slug>/audit.md` (overwrite)
|
|
145
|
-
- Project-level → `[[__DOCS_DIR__]]/audits/YYYY-MM-DD.md` (date
|
|
131
|
+
- Project-level → `[[__DOCS_DIR__]]/audits/YYYY-MM-DD.md` (date archive)
|
|
146
132
|
|
|
147
|
-
**Output**:
|
|
133
|
+
**Output**: Full review report (to conversation and file).
|
|
148
134
|
</step_3_report>
|
|
149
135
|
|
|
150
136
|
</protocol_audit>
|