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
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: archi-feature-relations
3
+ type: reviewer
4
+ description: featureRelations linkage handler. In isolated context, handles map.json featureRelations register/check/cleanup, ensures aggregator Tasks maintain correct linkage with their sources.
5
+ ---
6
+
7
+ # featureRelations Linkage Handler
8
+
9
+ ## System Flow Position
10
+
11
+ ```
12
+ /archi.* step_N → Verify phase
13
+
14
+ [This Skill] receives mode param → process featureRelations → return result
15
+
16
+ Main Agent Signoff (confirm linkage prompts)
17
+ ```
18
+
19
+ > **Skill responsibility boundary**:
20
+ > - Responsible: featureRelations register/check/cleanup
21
+ > - Not responsible: Modify business code, modify spec/plan docs
22
+
23
+ ---
24
+
25
+ ## Modes and Behavior
26
+
27
+ ### Mode `register` (caller: plan, inherit)
28
+
29
+ Determine if current Task is an "aggregator Task"; if so, append to `map.json` featureRelations.
30
+
31
+ **Aggregator Task criteria**:
32
+ - Core responsibility is **listing, aggregating, or dynamically reflecting** other Tasks of a class
33
+ - Code pattern: iterate/enumerate/dynamic load of similar modules (`for (const cmd of allCommands)`, `Object.values(registry)`, read dir then dynamic import)
34
+ - Description pattern: "aggregate all page entries", "register all routes", "list all commands"
35
+
36
+ **Action**:
37
+ 1. Analyze Task spec/goal description
38
+ 2. Determine if aggregator
39
+ 3. If yes → append featureRelations entry:
40
+ ```json
41
+ {
42
+ "aggregator": "<Task ID or file path>",
43
+ "sources": "<source scope description>",
44
+ "evidence": "<basis>",
45
+ "checkNote": "When such Tasks are added/removed, check if <aggregator> needs sync"
46
+ }
47
+ ```
48
+ 4. If no → output `NOT AGGREGATOR`, skip
49
+
50
+ ### Mode `check` (caller: scope, code)
51
+
52
+ Compare current Task with featureRelations sources field semantically, output linkage prompts.
53
+
54
+ **Action**:
55
+ 1. Read `map.json` featureRelations array
56
+ 2. If featureRelations empty → output `NO RELATIONS`, skip
57
+ 3. Compare this task/implemented feature with each sources semantically
58
+ 4. On match, output linkage prompt
59
+
60
+ ### Mode `cleanup` (caller: remove)
61
+
62
+ Remove featureRelations entries referencing removed Task, assess impact.
63
+
64
+ **Action**:
65
+ 1. Read `map.json` featureRelations array
66
+ 2. Find entries where aggregator or sources references removed Task
67
+ 3. Assess removal impact:
68
+ - Removed is aggregator → delete entire entry
69
+ - Removed is one of sources → update sources description, prompt to check if aggregator needs adjustment
70
+ 4. Output impact report
71
+
72
+ ---
73
+
74
+ ## Output Format
75
+
76
+ ### register mode
77
+
78
+ ```
79
+ ### Feature Relations: register
80
+
81
+ RESULT: AGGREGATOR REGISTERED
82
+ - aggregator: <ID>
83
+ - sources: <description>
84
+ - evidence: <basis>
85
+ ```
86
+
87
+ Or: `RESULT: NOT AGGREGATOR — This Task is not aggregator, skip`
88
+
89
+ ### check mode
90
+
91
+ ```
92
+ ### Feature Relations: check
93
+
94
+ HITS:
95
+ - [aggregator] — [checkNote]
96
+
97
+ NO HITS: [no matching relations]
98
+ ```
99
+
100
+ Or: `NO RELATIONS — featureRelations is empty`
101
+
102
+ ### cleanup mode
103
+
104
+ ```
105
+ ### Feature Relations: cleanup
106
+
107
+ REMOVED:
108
+ - [deleted entries]
109
+
110
+ UPDATED:
111
+ - [entries with updated sources]
112
+
113
+ IMPACT: [impact description]
114
+ ```
115
+
116
+ ---
117
+
118
+ > **Intermediate output**: This Skill is a review subprogram; after producing result, control returns to caller.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: archi-interview-protocol
3
+ type: specialist
3
4
  description: Architext supplementary interview protocol. Standardizes how to ask about information gaps: multiple-choice first, AI recommendation + [Recommended] marking, [Z] Custom fallback, complete AI+/AI- analysis, option descriptions state concrete behavior. Produces standard Q-table and INPUT prompt line, referenced by /archi.start, /archi.scope, and /archi.plan supplementary confirmation steps.
4
5
  ---
5
6
 
@@ -19,7 +20,7 @@ Information gap detected
19
20
  > - Responsible for: how to ask (format / rules / tone)
20
21
  > - Not responsible for: what to ask (determined by caller's gap list), how to handle user answers (determined by caller)
21
22
 
22
- ## Callers & Trigger Conditions
23
+ ## Invocation Modes
23
24
 
24
25
  | Caller | Trigger Step | Trigger Condition | Max Questions |
25
26
  |:---|:---|:---|:---|
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: archi-plan-options
3
+ type: subprocess
3
4
  description: Architext architecture decision option library. Defines candidate approaches and AI+/AI- analysis for five core dimensions (Core Structure / Interaction Pattern / Data Flow / Error Handling / Access & Scope), covering Web/CLI/API/Lib/Mobile/MiniApp/Extension/Desktop/AI Agent project types. Includes convention inheritance rules, project tag routing logic, and recommend vs. expand criteria. Referenced by /archi.plan step_2 Part 2 (architecture recommendation phase).
4
5
  ---
5
6
 
@@ -14,7 +15,7 @@ description: Architext architecture decision option library. Defines candidate a
14
15
 
15
16
  Direct recommendation row (most dimensions) or Q-table (when user decision needed)
16
17
 
17
- Written into Feature Proposal architecture recommendation table
18
+ Written into Task Proposal architecture recommendation table
18
19
  ```
19
20
 
20
21
  > **Skill responsibility boundary**:
@@ -36,7 +37,7 @@ Read `02_tech_stack.md` Section 9 (project conventions).
36
37
 
37
38
  ### Step 2 · Project Tag Routing
38
39
 
39
- Use project tags activated in step_1_load (`[?UI]` / `[?Data]` / `[?CLI]` / `[?Lib]` / `[?API]` / `[?Mobile]` / `[?MiniApp]` / `[?Extension]` / `[?Desktop]` / `[?AI]`) to select applicable dimensions; skip inapplicable ones. Routing rules are in each dimension's heading.
40
+ Use project tags activated in step_1_load (`ui` / `data` / `cli` / `lib` / `api` / `mobile` / `miniapp` / `extension` / `desktop` / `ai`) to select applicable dimensions; skip inapplicable ones. Routing rules are in each dimension's heading.
40
41
 
41
42
  ### Step 3 · Recommend vs. Expand
42
43
 
@@ -361,4 +362,4 @@ Only add supplementary handling if this feature has **special exception scenario
361
362
 
362
363
  ---
363
364
 
364
- > **Intermediate artifact**: This Skill is a subroutine. After producing a recommendation row or Q-table, control returns to `/archi.plan` step_2, where the caller assembles the output into the Feature Proposal's architecture recommendation table.
365
+ > **Intermediate artifact**: This Skill is a subroutine. After producing a recommendation row or Q-table, control returns to `/archi.plan` step_2, where the caller assembles the output into the Task Proposal's architecture recommendation table.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: archi-silent-audit
3
+ type: reviewer
4
+ description: Embedded lightweight review. In an isolated context, reviews main Agent output, filters review dimensions by mode, returns finding list. Must not generate report files. Shares dimension definitions with audit.md but differs in responsibility: audit.md is user-triggered standalone deep review; this Skill is protocol-triggered lightweight check.
5
+ ---
6
+
7
+ # Embedded Lightweight Review
8
+
9
+ ## System Flow Position
10
+
11
+ ```
12
+ /archi.* step_N → Verify phase
13
+
14
+ [This Skill] receives mode param → isolated review → returns finding list
15
+
16
+ Main Agent Signoff (must respond to findings)
17
+ ```
18
+
19
+ > **Skill responsibility boundary**:
20
+ > - Responsible: Review main Agent output in isolated context, output graded finding list
21
+ > - Not responsible: Fix issues (return to main Agent), generate report files (that is audit.md's job), run Terminal Gate commands
22
+
23
+ > **Relationship with `audit.md`**:
24
+ > - `audit.md` = Standalone deep review protocol, generates report file, only user-triggered via `/archi.audit`
25
+ > - This Skill = Embedded lightweight check, inline finding list, protocol-triggered
26
+ > - Both share review dimension definitions (see `audit.md` step_2_task); this Skill filters by mode
27
+
28
+ ---
29
+
30
+ ## Modes and Review Dimensions
31
+
32
+ ### Mode `init` (caller: start, inherit)
33
+
34
+ Review global file quality for new/inherited projects.
35
+
36
+ | # | Dimension | Review Points |
37
+ |:---|:---|:---|
38
+ | 1 | **Vision-Roadmap alignment** | Roadmap task direction aligns with vision.md north star |
39
+ | 2 | **Tech Stack consistency** | `02_tech_stack.md` matches actual deps/config |
40
+ | 3 | **Global file completeness** | Required global files present (vision, roadmap, map, dictionary, tech_stack, custom_rules) |
41
+ | 4 | **Zero info omission** | All Brief/code info routed to corresponding files |
42
+ | 5 | [?UI] **Design Tokens** | `design_tokens.json` has base colors/fonts/spacing |
43
+
44
+ ### Mode `plan-docs` (caller: plan)
45
+
46
+ Review planning doc (spec/ui/plan) quality.
47
+
48
+ | # | Dimension | Review Points |
49
+ |:---|:---|:---|
50
+ | 1 | **Design Fidelity** | spec § 2 fully covers confirmed functional design |
51
+ | 2 | **Dimension Match** | spec § 2 dimension format matches Task Type |
52
+ | 3 | **Tech Consistency** | No tech not declared in `02_tech_stack.md` |
53
+ | 4 | **WBS Coverage** | plan.json 100% covers each AC in spec |
54
+ | 5 | **Notes Quality** | plan.json each task notes has deliverable+constraint+executable verification |
55
+ | 6 | **Interface Exports** | INF task § 4 filled; interface declared when downstream deps exist |
56
+ | 7 | **Constraints** | § 5 includes vision.md + tech_stack red lines |
57
+ | 8 | [?Data] **Data Integrity** | Entities and fields match confirmed core entities |
58
+ | 9 | [?Complex] **Design Trace** | design.md § 6 all ACs traceable |
59
+ | 10 | [?Complex] **Parameter Specificity** | design.md § 3 params concrete (no vague terms) |
60
+ | 11 | [?Complex] **Self-Check Pass** | design.md § 2 mechanism self-check list passes |
61
+
62
+ ### Mode `code-impl` (caller: code)
63
+
64
+ Review code implementation quality.
65
+
66
+ | # | Dimension | Review Points |
67
+ |:---|:---|:---|
68
+ | 1 | **Tech Consistency** | Matches `02_tech_stack.md` (libs/patterns/API style) |
69
+ | 2 | **SOTA** | Reject outdated patterns; use tech_stack best practices |
70
+ | 3 | **Security** | No sensitive info leak; input validated |
71
+ | 4 | **Performance** | Avoid unnecessary large deps/full imports/useless computation/memory leaks |
72
+ | 5 | [?UI] **Design Compliance** | Styles use Token/Preset only; no hardcoded magic values |
73
+ | 6 | [?UI] **Accessibility** | Necessary a11y attributes present |
74
+ | 7 | [?Data] **Data Integrity** | Matches `data_snapshot.json`; field names/types consistent |
75
+ | 8 | [?i18n] **I18n** | No hardcoded strings; use Key/dictionary reference |
76
+ | 9 | [?Complex] **Design Compliance** | State transitions/flows/protocols match design.md § 2 |
77
+ | 10 | [?Complex] **Invariant Enforcement** | design.md § 4 invariants have assert/runtime checks in code |
78
+ | 11 | [?Complex] **Parameter Alignment** | Code values match design.md § 3 param table |
79
+
80
+ ---
81
+
82
+ ## Execution Protocol
83
+
84
+ 1. **Load context**: Load required docs and code per caller-provided file paths
85
+ 2. **Filter dimensions by mode**: Execute only dimensions for current mode
86
+ 3. **Review item by item**: Each dimension outputs PASS or finding (level+location+description)
87
+ 4. **Output finding list**: Return sorted by level
88
+
89
+ ### Finding Levels
90
+
91
+ | Level | Meaning | Main Agent must |
92
+ |:---|:---|:---|
93
+ | `CRITICAL` | Blocking issue | **Must fix** before signoff, cannot skip |
94
+ | `WARNING` | Risk | **Must explain** handling in signoff report |
95
+ | `INFO` | Suggestion | May decide whether to handle |
96
+
97
+ ### Output Format
98
+
99
+ ```
100
+ ### Silent Audit Results (mode: <mode>)
101
+
102
+ **CRITICAL** (must fix):
103
+ - [Dimension] location: description
104
+
105
+ **WARNING** (must explain):
106
+ - [Dimension] location: description
107
+
108
+ **INFO** (suggestion):
109
+ - [Dimension] location: description
110
+
111
+ **Summary**: X CRITICAL / Y WARNING / Z INFO
112
+ ```
113
+
114
+ When no findings: `### Silent Audit Results (mode: <mode>) — ALL PASS`
115
+
116
+ ---
117
+
118
+ > **Intermediate output**: This Skill is a review subprogram; after producing finding list, control returns to caller; main Agent responds to findings in Signoff.