@haaaiawd/anws 2.3.0 → 2.4.1

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 (95) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +53 -23
  3. package/lib/diff.js +5 -2
  4. package/lib/init.js +217 -96
  5. package/lib/install-state.js +18 -3
  6. package/lib/manifest.js +364 -79
  7. package/lib/prompt.js +68 -0
  8. package/lib/resources/index.js +36 -2
  9. package/lib/update.js +12 -6
  10. package/package.json +48 -47
  11. package/templates/.agents/skills/anws-system/SKILL.md +107 -105
  12. package/templates/.agents/skills/code-reviewer/SKILL.md +171 -115
  13. package/templates/.agents/skills/concept-modeler/SKILL.md +230 -179
  14. package/templates/.agents/skills/craft-authoring/SKILL.md +186 -183
  15. package/templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +42 -0
  16. package/templates/.agents/skills/design-reviewer/SKILL.md +265 -190
  17. package/templates/.agents/skills/e2e-testing-guide/SKILL.md +246 -135
  18. package/templates/.agents/skills/nexus-mapper/SKILL.md +321 -321
  19. package/templates/.agents/skills/nexus-mapper/references/probe-protocol.md +1 -1
  20. package/templates/.agents/skills/nexus-query/SKILL.md +1 -1
  21. package/templates/.agents/skills/output-contract/SKILL.md +37 -0
  22. package/templates/.agents/skills/runtime-inspector/SKILL.md +150 -99
  23. package/templates/.agents/skills/sequential-thinking/SKILL.md +222 -225
  24. package/templates/.agents/skills/spec-writer/SKILL.md +75 -30
  25. package/templates/.agents/skills/system-architect/SKILL.md +538 -678
  26. package/templates/.agents/skills/system-designer/SKILL.md +124 -537
  27. package/templates/.agents/skills/task-planner/SKILL.md +1 -2
  28. package/templates/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +2 -2
  29. package/templates/.agents/skills/task-reviewer/SKILL.md +421 -386
  30. package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
  31. package/templates/.agents/workflows/blueprint.md +156 -68
  32. package/templates/.agents/workflows/challenge.md +322 -494
  33. package/templates/.agents/workflows/change.md +182 -339
  34. package/templates/.agents/workflows/craft.md +159 -197
  35. package/templates/.agents/workflows/design-system.md +202 -674
  36. package/templates/.agents/workflows/explore.md +187 -399
  37. package/templates/.agents/workflows/forge.md +650 -609
  38. package/templates/.agents/workflows/genesis.md +438 -351
  39. package/templates/.agents/workflows/probe.md +215 -240
  40. package/templates/.agents/workflows/quickstart.md +304 -123
  41. package/templates/.agents/workflows/upgrade.md +145 -182
  42. package/templates_en/.agents/skills/anws-system/SKILL.md +110 -0
  43. package/templates_en/.agents/skills/code-reviewer/SKILL.md +171 -0
  44. package/templates_en/.agents/skills/concept-modeler/SKILL.md +230 -0
  45. package/templates_en/.agents/skills/craft-authoring/SKILL.md +179 -0
  46. package/templates_en/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +42 -0
  47. package/templates_en/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +92 -0
  48. package/templates_en/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +52 -0
  49. package/templates_en/.agents/skills/design-reviewer/SKILL.md +264 -0
  50. package/templates_en/.agents/skills/e2e-testing-guide/SKILL.md +246 -0
  51. package/templates_en/.agents/skills/nexus-mapper/SKILL.md +306 -0
  52. package/templates_en/.agents/skills/nexus-mapper/references/language-customization.md +167 -0
  53. package/templates_en/.agents/skills/nexus-mapper/references/output-schema.md +311 -0
  54. package/templates_en/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
  55. package/templates_en/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
  56. package/templates_en/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
  57. package/templates_en/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
  58. package/templates_en/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
  59. package/templates_en/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
  60. package/templates_en/.agents/skills/nexus-query/SKILL.md +114 -0
  61. package/templates_en/.agents/skills/nexus-query/scripts/extract_ast.py +706 -0
  62. package/templates_en/.agents/skills/nexus-query/scripts/git_detective.py +194 -0
  63. package/templates_en/.agents/skills/nexus-query/scripts/languages.json +127 -0
  64. package/templates_en/.agents/skills/nexus-query/scripts/query_graph.py +556 -0
  65. package/templates_en/.agents/skills/nexus-query/scripts/requirements.txt +6 -0
  66. package/templates_en/.agents/skills/output-contract/SKILL.md +37 -0
  67. package/templates_en/.agents/skills/runtime-inspector/SKILL.md +150 -0
  68. package/templates_en/.agents/skills/sequential-thinking/SKILL.md +214 -0
  69. package/templates_en/.agents/skills/spec-writer/SKILL.md +153 -0
  70. package/templates_en/.agents/skills/spec-writer/references/prd_template.md +177 -0
  71. package/templates_en/.agents/skills/system-architect/SKILL.md +538 -0
  72. package/templates_en/.agents/skills/system-architect/references/rfc_template.md +59 -0
  73. package/templates_en/.agents/skills/system-designer/SKILL.md +188 -0
  74. package/templates_en/.agents/skills/system-designer/references/system-design-detail-template.md +187 -0
  75. package/templates_en/.agents/skills/system-designer/references/system-design-template.md +605 -0
  76. package/templates_en/.agents/skills/task-planner/SKILL.md +251 -0
  77. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +109 -0
  78. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md +176 -0
  79. package/templates_en/.agents/skills/task-reviewer/SKILL.md +422 -0
  80. package/templates_en/.agents/skills/tech-evaluator/SKILL.md +252 -0
  81. package/templates_en/.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md +78 -0
  82. package/templates_en/.agents/workflows/blueprint.md +200 -0
  83. package/templates_en/.agents/workflows/challenge.md +326 -0
  84. package/templates_en/.agents/workflows/change.md +182 -0
  85. package/templates_en/.agents/workflows/craft.md +159 -0
  86. package/templates_en/.agents/workflows/design-system.md +202 -0
  87. package/templates_en/.agents/workflows/explore.md +187 -0
  88. package/templates_en/.agents/workflows/forge.md +651 -0
  89. package/templates_en/.agents/workflows/genesis.md +438 -0
  90. package/templates_en/.agents/workflows/probe.md +215 -0
  91. package/templates_en/.agents/workflows/quickstart.md +305 -0
  92. package/templates_en/.agents/workflows/upgrade.md +145 -0
  93. package/templates_en/AGENTS.md +149 -0
  94. package/templates/.agents/skills/report-template/SKILL.md +0 -92
  95. package/templates/.agents/skills/report-template/references/REPORT_TEMPLATE.md +0 -100
@@ -0,0 +1,230 @@
1
+ ---
2
+ name: concept-modeler
3
+ description: Use when user needs are vague or terminology is unclear. Clarifies domain concepts through interactive follow-up questions, extracting entities, flows, and dark matter (missing_components). Invoked by **`/genesis` Step 1** after Step 0 has set `TARGET_DIR = .anws/v{N}`; use with **`/genesis`** in the same workspace.
4
+ ---
5
+
6
+ # Domain Modeler
7
+
8
+ > "If you cannot describe it clearly, you cannot build it." — Eric Evans
9
+
10
+ This skill turns user "feel words" into a clear domain model through **interactive follow-up questions** and persists a **structured contract** consumable by `spec-writer` and later steps.
11
+
12
+ ---
13
+
14
+ <phase_context>
15
+ You are the **DOMAIN MODELER**.
16
+
17
+ **Mission**: In `/genesis` **Step 1**, converge vague user wording into **Ubiquitous Language** and a machine-readable/writable `concept_model.json`; supply unambiguous nouns, verbs, and known gaps for PRD writing.
18
+ **Capabilities**: Vagueness scan (entities / verbs / dark matter / boundaries), controlled questioning (multiple choice or very short answers), incremental model maintenance on every answer, `glossary` and `clarifications` traceability.
19
+ **Constraints**: **Output only one question to the user at a time** (queue is internal only; do not dump the full list at the user); do not skip follow-up and fill JSON from memory; if the host provides a structured questioning tool (e.g. `ask question`), **prefer the tool** to ask.
20
+ **Sub-agents (optional)**: Bounded slices only (e.g. "only generate vagueness candidates", "only reconcile glossary synonym conflicts"); after merge **the parent agent** is the sole writer of `.anws/v{N}/concept_model.json`; sub-agents must not race the same file.
21
+ **Output Goal**: `.anws/v{N}/concept_model.json` with field semantics matching the **spec contract** below; user-side closure on key terminology.
22
+ </phase_context>
23
+
24
+ ---
25
+
26
+ ## CRITICAL methodology anchors
27
+
28
+ > [!IMPORTANT]
29
+ > **Clarify once, skip a rework round; written to disk is the contract.**
30
+ >
31
+ > - **Awaken, do not proclaim**: Scan and name "where it's fuzzy" first, then offer options; do not declare domain understood before vagueness is identified.
32
+ > - **One focus at a time**: The user can only answer one question well per turn; however long the internal queue, only the current question is shown outward.
33
+ > - **Elevate, then ground**: Lift colloquial speech into JSON fields (entity types, flows, missing-component categories and priority); "seems clear" is not deliverable.
34
+ > - **Incremental closure, not a final monologue**: Update the on-disk model after every answer; do not wait until "all questions are done" to write.
35
+
36
+ ---
37
+
38
+ ## CRITICAL: spec contract (`concept_model.json` + `glossary`)
39
+
40
+ **On-disk path**: `.anws/v{N}/concept_model.json` (`v{N}` is set by `/genesis` Step 0; below we refer to **`concept_model.json`** under `TARGET_DIR`).
41
+
42
+ **Top-level structure (all keys below must exist; arrays may be `[]`, objects `{}`, but keys must not be omitted)**:
43
+
44
+ | Key | JSON type | Semantics (normative) |
45
+ | :--- | :--- | :--- |
46
+ | `glossary` | object | **Glossary**: keys are domain terms (align with `entities[].name` / nouns in flows); values are **one actionable sentence** definition (Ubiquitous Language entry). |
47
+ | `entities` | array | **Noun model**: each element describes a domain object, its modeling role, and necessity. |
48
+ | `flows` | array | **Verb model**: each element describes an action from one end to another, carried data, triggers or modes, etc. |
49
+ | `missing_components` | array | **Dark matter / gap list**: components not raised by the user but required or foreseeable to close the system, with category and priority rationale. |
50
+ | `clarifications` | array | **Q&A trace**: each record is one question and its confirmed answer—the evidence chain for "why the JSON looks like this". |
51
+
52
+ **`entities[]` element (object field semantics)**:
53
+
54
+ | Field | Type | Semantics |
55
+ | :--- | :--- | :--- |
56
+ | `name` | string | Entity name (aligned with terminology the team will use). |
57
+ | `type` | string | Modeling classification (examples: `aggregate root`, `entity`); extend per project convention but explain in `glossary` or in conversation. |
58
+ | `necessity` | string | Necessity for this scope (example: `required`). |
59
+ | `description` | string | **Role narrative** distinct from glossary entries (may be longer, may reference relationships). |
60
+
61
+ **`flows[]` element (object field semantics)**:
62
+
63
+ | Field | Type | Semantics |
64
+ | :--- | :--- | :--- |
65
+ | `from` | string | Initiator (role, aggregate, external system, etc.). |
66
+ | `action` | string | Verb / operation name. |
67
+ | `to` | string | Target of the action. |
68
+ | `data` | string | Data carried or exchanged (identifiers, payload summary, etc.). |
69
+ | `trigger` | string | (Optional) What triggers this flow; include when user clarification matters. |
70
+ | `mode` | string | (Optional) Behavioral mode (e.g. sync direction, real-time); prefer when verb ambiguity was clarified. |
71
+
72
+ **`missing_components[]` element (object field semantics)**:
73
+
74
+ | Field | Type | Semantics |
75
+ | :--- | :--- | :--- |
76
+ | `component` | string | Short name of missing or foreseeable component. |
77
+ | `category` | string | Category dimension (examples: `error handling`, `reliability`). |
78
+ | `priority` | string | Relative priority (examples: `high`, `medium`, `low`). |
79
+ | `reason` | string | **Why** it is a gap (business / concurrency / consistency, etc.). |
80
+
81
+ **`clarifications[]` element (object field semantics)**:
82
+
83
+ | Field | Type | Semantics |
84
+ | :--- | :--- | :--- |
85
+ | `question` | string | Question posed to the user (or equivalent paraphrase). |
86
+ | `answer` | string | User-confirmed or selected answer (or multi-option labels plus gist). |
87
+
88
+ **Example shape (values are illustrative; structure must satisfy the tables)**:
89
+
90
+ ```json
91
+ {
92
+ "glossary": {
93
+ "Wishlist": "User wishlist: add items without immediate checkout",
94
+ "Sync": "Real-time bidirectional sync keeping multi-device data consistent"
95
+ },
96
+ "entities": [
97
+ { "name": "Wishlist", "type": "aggregate root", "necessity": "required", "description": "The user's wishlist" },
98
+ { "name": "WishlistItem", "type": "entity", "necessity": "required", "description": "A product line item in the wishlist" }
99
+ ],
100
+ "flows": [
101
+ { "from": "User", "action": "add", "to": "Wishlist", "data": "Product ID", "trigger": "user clicks" },
102
+ { "from": "Wishlist", "action": "sync", "to": "RemoteServer", "data": "full payload", "mode": "real-time bidirectional" }
103
+ ],
104
+ "missing_components": [
105
+ { "component": "sync conflict resolution", "category": "error handling", "priority": "high", "reason": "concurrent edits on multiple devices" },
106
+ { "component": "offline queue", "category": "reliability", "priority": "medium", "reason": "buffer operations when network is down" }
107
+ ],
108
+ "clarifications": [
109
+ { "question": "Is sync real-time or batch?", "answer": "real-time bidirectional sync" }
110
+ ]
111
+ }
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Triggering and host pairing
117
+
118
+ - **Primary path**: **`/genesis` Step 1**: after Step 0 has set `TARGET_DIR`, load this skill, run requirement clarification, and write `concept_model.json`.
119
+ - **Secondary path**: if the user does domain scaffolding outside genesis, still follow this skill and write `concept_model.json` for the currently active version (path rules unchanged).
120
+
121
+ ---
122
+
123
+ ## Modeling flow (three main phases)
124
+
125
+ ### Phase A: scan fuzzy areas
126
+
127
+ #### What
128
+
129
+ Read the requirement text and check across four buckets: **entity fuzziness**, **verb fuzziness**, **dark matter** (beyond happy path), **boundary fuzziness** (permissions / scale / concurrency, etc.); internally build **up to 5** follow-up candidates sorted by impact; **do not** show the candidate list to the user.
130
+
131
+ #### Why
132
+
133
+ Without scanning, questioning is unordered or misses critical verbs/dark matter, and the PRD later freezes wrong assumptions.
134
+
135
+ #### How to validate
136
+
137
+ Ordered internal queue exists; at least one clarification area is identifiable, or you explicitly record "no fuzziness" with rationale in `clarifications` / `glossary`.
138
+
139
+ ---
140
+
141
+ ### Phase B: interactive follow-up loop
142
+
143
+ #### What
144
+
145
+ From the queue, **output only one question at a time**; format is **multiple choice** or **short answer (<= 5 words)**; at most **5** outward questions; append Q&A to `clarifications`.
146
+
147
+ #### Why
148
+
149
+ Many questions at once hurt answer quality; crisp formats map cleanly to JSON.
150
+
151
+ #### How to validate
152
+
153
+ The user sees at most **one** pending question at any time; every answer enters `clarifications`; stop when one of: critical fuzziness resolved, user says `done`/`ok`/`continue`, or 5 questions asked.
154
+
155
+ **Multiple-choice template**:
156
+
157
+ ```markdown
158
+ **Recommended:** Option B — Real-time bidirectional sync preserves consistency and suits multi-device use.
159
+
160
+ | Option | Description |
161
+ | :--- | :--- |
162
+ | A | One-way sync (upload only) |
163
+ | B | Real-time bidirectional sync |
164
+ | C | Scheduled batch sync |
165
+ | Custom | Short description (<= 5 words) |
166
+
167
+ Reply with the option letter (e.g. "B"), say "yes" or "recommended" to accept the recommendation, or give a custom answer.
168
+ ```
169
+
170
+ **Short-answer template**:
171
+
172
+ ```markdown
173
+ **Suggestion:** User wishlist — the most common term in e-commerce flows.
174
+
175
+ Format: short answer (<= 5 words). Say "yes" or "suggestion" to accept, or supply your answer.
176
+ ```
177
+
178
+ ---
179
+
180
+ ### Phase C: incremental model updates
181
+
182
+ #### What
183
+
184
+ After **each** answer, immediately update `concept_model.json`: entity clarification -> `entities`; verb clarification -> `flows` (optional fields such as `trigger`/`mode` aligned with the answer); dark matter -> `missing_components`; term alignment -> `glossary`.
185
+
186
+ #### Why
187
+
188
+ Deferring writes loses conversation context and field mapping; incremental disk writes are the lowest-cost traceable-contract approach.
189
+
190
+ #### How to validate
191
+
192
+ JSON on disk matches the latest conversation; no "answered everything then fabricated once" mismatch; clarified verb details appear in `data`/`trigger`/`mode` or equivalent on `flows` entries.
193
+
194
+ ---
195
+
196
+ ## Veteran rules (stacked with this SKILL contract)
197
+
198
+ 1. **Do not assume**: Never default-understand user vocabulary; questions are contract sources.
199
+ 2. **One at a time**: Only one outward question.
200
+ 3. **Recommendation first**: Give a recommendation and rationale to lower decision cost.
201
+ 4. **Incremental updates**: Save the file after every answer.
202
+ 5. **Term consistency**: Locked-in terms stay consistent across later questions and JSON.
203
+ 6. **Tool-first questioning**: Prefer structured questioning from the environment to reduce free-text noise.
204
+
205
+ ---
206
+
207
+ ## Sub-agent orchestration (optional)
208
+
209
+ **Parent agent**: Holds full user need, `TARGET_DIR`, final say on this skill and the **spec contract**; **sole writer** of `concept_model.json`.
210
+ **Sub-agent (if used)**: May be tasked with "only list fuzziness points", "only check glossary vs `entities[].name` mismatch", etc.—read-only or draft; hand back **merge-ready** patch notes or JSON snippet drafts.
211
+ **Handoff closure** (sub -> parent): 1) state executed or skipped with one-line reason 2) drafts must not blindly overwrite keys the parent already wrote 3) term conflicts resolved at parent before final write.
212
+
213
+ ---
214
+
215
+ ## Collaboration
216
+
217
+ - **Before**: `/genesis` Step 0 finalized `TARGET_DIR`; user gives fuzzy requirement narrative.
218
+ - **After**: `spec-writer` produces `01_PRD.md` from clarified terms and structure.
219
+ - **Synergy**: This file supplies the **Ubiquitous Language** base for downstream architecture and task breakdown.
220
+
221
+ ---
222
+
223
+ ## `<completion_criteria>` (session close self-check)
224
+
225
+ - [ ] **CRITICAL methodology anchors** and **`concept_model.json` spec contract** (five top-level keys + per-array element semantics) visibly followed during execution; JSON semantics not stripped.
226
+ - [ ] Critical fuzzy terms are in **`glossary`**; core **`entities`** / **`flows`** reflect current consensus; **`missing_components`** captures visible dark matter.
227
+ - [ ] **`clarifications`** matches outward question count or gaps are explainable.
228
+ - [ ] Model saved to **`TARGET_DIR/concept_model.json`** (equivalent **`.anws/v{N}/concept_model.json`**).
229
+ - [ ] User confirmed terminology understanding (verbal or "continue"-class signal—next genesis step gating is host-defined).
230
+ - [ ] Session uses only workspace **`.agents/skills/concept-modeler/SKILL.md`**; no alternate-path paraphrase of the same skill.
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: craft-authoring
3
+ description: Required when running /craft. Provides Workflow / Skill / Prompt scaffolds and quality guardrails using judgment-driven criteria.
4
+ ---
5
+
6
+ # Craft Authoring - Scaffolds and Self-Check
7
+
8
+ This skill carries the execution detail of `/craft`.
9
+ `/craft` defines direction; this file defines landing. Direction without landing becomes rhetoric. Landing without direction becomes mechanical output.
10
+
11
+ ## Global Authoring Protocol
12
+
13
+ 1. Keep language precise and intentional.
14
+ 2. Let narration add force, not noise.
15
+ 3. Prefer judgment signals over decorative phrasing.
16
+ 4. Ensure every major section answers: what / why / how to validate.
17
+ 5. Build meaning first, then rules, then verification.
18
+
19
+ **Judgment bar**:
20
+ - A good document makes execution clearer, steadier, and reproducible.
21
+ - A weak document sounds energetic but depends on improvisation.
22
+
23
+ > **Split from `output-contract`**: This file covers **scaffolds** for workflows/skills/prompts only. Shared on-disk spec, parent/child delegation, and single-writer rules live in **`.agents/skills/output-contract/SKILL.md`**.
24
+ > **CLI install manifest**: what copies on `anws init`, registry + **`BUNDLE_POLICY`** boundaries—read **`references/BUNDLE_POLICY.md`**.
25
+
26
+ ---
27
+
28
+ ## Workflow Skeleton (minimal)
29
+
30
+ ```markdown
31
+ ---
32
+ description: [one-line purpose]
33
+ ---
34
+
35
+ # /name
36
+
37
+ <phase_context>
38
+ You are **[role]**.
39
+ **Mission**: …
40
+ **Capabilities**: …
41
+ **Constraints**: …
42
+ **Relationship to user**: …
43
+ **Output Goal**: `path`
44
+ </phase_context>
45
+
46
+ ---
47
+
48
+ ## CRITICAL Writing Constraints
49
+
50
+ > [!IMPORTANT]
51
+ > Writing constraints are defined in `/craft` and should not be duplicated here.
52
+
53
+ ---
54
+
55
+ ## Step 1: [Title]
56
+
57
+ ### What
58
+ ...
59
+
60
+ ### Why
61
+ ...
62
+
63
+ ### How to Validate
64
+ - ...
65
+ - ...
66
+
67
+ ---
68
+
69
+ <completion_criteria>
70
+ - [observable done condition]
71
+ </completion_criteria>
72
+ ```
73
+
74
+ ## Skill Skeleton (`description` is the trigger)
75
+
76
+ ```markdown
77
+ ---
78
+ name: kebab-name
79
+ description: When [concrete trigger scenario], load this skill. [Capability summary]
80
+ ---
81
+
82
+ # Title
83
+
84
+ ## What
85
+ ...
86
+
87
+ ## Why
88
+ ...
89
+
90
+ ## How to Validate
91
+ - Input contract: ...
92
+ - Output contract: ...
93
+ ```
94
+
95
+ **Bad description**: capability slogan.
96
+ **Good description**: precise trigger boundary.
97
+
98
+ **Judgment bar**:
99
+ A strong description behaves like a gate, not a banner.
100
+ It defines both when to activate and when not to activate.
101
+
102
+ ## Prompt Skeleton
103
+
104
+ ```markdown
105
+ # Title
106
+
107
+ ## What
108
+ ...
109
+
110
+ ## Why
111
+ ...
112
+
113
+ ## How to Validate
114
+ - Constraints: ...
115
+ - Output format: ...
116
+ ```
117
+
118
+ ## Guardrail Cheat Sheet
119
+
120
+ | Mechanism | Use |
121
+ | --- | --- |
122
+ | `[!IMPORTANT]` | non-skippable node |
123
+ | `## CRITICAL` | loud boundary |
124
+ | `you **must**` | hard action |
125
+ | `<completion_criteria>` | definition of done |
126
+
127
+ Strong constraints explain at least: what, why, and drift signal.
128
+
129
+ ## Filling Pass (equivalent to old Step 5)
130
+
131
+ Use `sequential-thinking` for 3-5 thoughts to cover goals, risks, I/O, and where research lands.
132
+
133
+ Quick checks:
134
+ - Is each section actionable?
135
+ - Is each critical rule justified?
136
+ - Is completion externally verifiable?
137
+
138
+ **Judgment bar**:
139
+ If a paragraph cannot tell the executor what to do, it is noise.
140
+ If it cannot tell why, it is command theater.
141
+ If it cannot tell how to verify, it is wishful writing.
142
+
143
+ ## Validation (before ship)
144
+
145
+ Structure:
146
+ - frontmatter
147
+ - `phase_context` (workflow use)
148
+ - CRITICAL block
149
+ - `<completion_criteria>`
150
+
151
+ Content:
152
+ - correct path and naming
153
+ - clear trigger boundaries
154
+ - complete input/output contracts
155
+ - externally observable failure signals
156
+
157
+ ## Scoring Gate (before release)
158
+
159
+ Before shipping, run static scoring:
160
+
161
+ - read `references/PROMPT_QUALITY_RUBRIC.md`
162
+ - produce a scorecard using `references/SCORECARD_TEMPLATE.md`
163
+ - report Tier (T0/T1/T2/T3) and weighted seven-dimension score
164
+
165
+ Hard rules:
166
+
167
+ - if Hard Fail Gate is triggered, final verdict must be `Infeasible`
168
+ - if no Hard Fail and weighted score < 4.0, run one repair iteration and re-score
169
+
170
+ ## Self-Critique (last gate)
171
+
172
+ Use `sequential-thinking` for 3-5 thoughts:
173
+ - where users might stall
174
+ - where the model might skip
175
+ - which section still mixes too many concerns
176
+ - what to revise before shipping
177
+
178
+ Final question:
179
+ If this document is executed repeatedly, are you willing to own its consequences?
@@ -0,0 +1,42 @@
1
+ # Template bundle contract (CLI · package templates)
2
+
3
+ This document defines **install boundaries**: what the CLI copies. The product ships **one** `RESOURCE_REGISTRY`. **`zh` / `en`** only selects which on-disk tree supplies text for the **same relative paths**—not two competing product authorities.
4
+ Any change to **`lib/manifest.js`** `RESOURCE_REGISTRY` is an **explicit** change to what users receive—document it in **release notes**.
5
+
6
+ ---
7
+
8
+ ## 1. Single source for CLI copies
9
+
10
+ | Mechanism | Role |
11
+ |-----------|------|
12
+ | **`RESOURCE_REGISTRY`** | Array in `lib/manifest.js`; **only** driver for paths written by `anws init` / `anws update` (per IDE projection). |
13
+ | **`TEMPLATE_ROOT`** / **`TEMPLATE_ROOT_EN`** | `src/anws/templates/` and `src/anws/templates_en/` (see `lib/resources`). **`resolveCanonicalPath(rel, templateLocale)`** reads **`templates/`** for **`zh`**; for **`en`** it prefers the same **relative path** under **`templates_en/`**, falling back to **`templates/`** when missing. |
14
+ | **Check** | `scripts/check-canonical-templates.js`: every registry **`source`** must exist under **`templates/`** as a regular file. |
15
+
16
+ Relative paths that **do not** appear in **`RESOURCE_REGISTRY`**—even if present on disk under **`templates/`**—are **not** installed by default CLI. Example: a **`nexus-query/`** tree maintained in-repo but **not** registered is **not** CLI-delivered—use **registry + this doc** as authority.
17
+
18
+ ---
19
+
20
+ ## 2. `templateLocale`: `templates/` and `templates_en/`
21
+
22
+ - **`templates/`**: default zh copy tree in the npm package; also the **registry existence check root**.
23
+ - **`templates_en/`**: English mirror; when **`install-lock`** has **`templateLocale: en`**, init/update reads the same **relative paths** from **`templates_en/`**, with fallback to **`templates/`** for missing files.
24
+ - Maintainer duty: keep **the same `source` relative paths** semantically aligned across zh/en—avoid EN-only drift.
25
+
26
+ ---
27
+
28
+ ## 3. Split vs `/craft` and `output-contract`
29
+
30
+ | Artifact | Owns |
31
+ |----------|------|
32
+ | **`craft-authoring` SKILL** | Authoring scaffolds + scoring gate for `/craft`. |
33
+ | **`output-contract`** | Runtime persisted-report spec + delegation + single-writer rules. |
34
+ | **This `BUNDLE_POLICY`** | **What the CLI installs**, locale root selection, registry **decisions**. |
35
+
36
+ ---
37
+
38
+ ## 4. Slim-down roadmap (suggested order)
39
+
40
+ 1. **Registry gap**: if a path under **`templates/`** should ship but is missing from **`RESOURCE_REGISTRY`**, either **register** it or **delete** unused disk clutter.
41
+ 2. **Dedupe**: replace duplicated bullets in reviewers/workflows with **one-line pointers** to **`output-contract`** / this policy.
42
+ 3. **Heavy skills** (e.g. **`system-architect`**): shrink embedded templates; **link** one authoritative file instead of mirroring ADR tables—then revisit large merges.
@@ -0,0 +1,92 @@
1
+ ## Prompt Quality Rubric v1.0 (Static)
2
+
3
+ Purpose: evaluate Workflow / Skill / Prompt quality through static review without runtime sampling.
4
+
5
+ ---
6
+
7
+ ## 0. Precondition: Static Ablation
8
+
9
+ Before scoring, remove external attachments:
10
+
11
+ - emotional imperative phrases
12
+ - format-forcing clauses
13
+ - anti-hallucination patch sentences
14
+
15
+ Keep the core skeleton:
16
+
17
+ - Role
18
+ - Context / Worldview
19
+ - Core Concepts
20
+ - Reasoning Path
21
+
22
+ If the skeleton collapses after ablation, prioritize T2 or T3.
23
+
24
+ ---
25
+
26
+ ## 1. Tier Classification
27
+
28
+ - `T0` Native Resonance: stable style and control loop survive ablation
29
+ - `T1` Structural Anchoring: reliability mainly comes from strong structure
30
+ - `T2` External Attachment: behavior depends on imperative patches
31
+ - `T3` Cognitive Collapse: factual or logical premise is invalid
32
+
33
+ > Rule: if T3 is hit, mark infeasible regardless of high sub-scores.
34
+
35
+ ---
36
+
37
+ ## 2. Seven-Dimension Matrix (0-5)
38
+
39
+ Each dimension must include: `score` + `evidence` + `fix` + `confidence`.
40
+
41
+ ### D1 Structure (weight 20%)
42
+ - clarity of segmentation and structural control
43
+
44
+ ### D2 Alignment (weight 20%)
45
+ - consistency among objective, steps, and validation
46
+
47
+ ### D3 Robustness (weight 15%)
48
+ - resilience to adversarial, missing, or contradictory input
49
+
50
+ ### D4 Efficiency (weight 10%)
51
+ - token cost versus control benefit
52
+
53
+ ### D5 Meta-Isomorphism (weight 15%)
54
+ - whether demanded quality matches textual quality
55
+
56
+ ### D6 Groundability (weight 10%)
57
+ - ability to convert abstraction into executable behavior
58
+
59
+ ### D7 Ablation Survivability (weight 10%)
60
+ - whether the ablated skeleton still drives behavior
61
+
62
+ ---
63
+
64
+ ## 3. Hard Fail Gate
65
+
66
+ Trigger hard fail if any is true:
67
+
68
+ 1. feasibility check finds fictional core premises (T3)
69
+ 2. critical steps have no verifiable completion signal
70
+ 3. critical dependency path is unresolved and has no blocker exit
71
+
72
+ Hard fail output: `Infeasible` + evidence + minimum repair actions.
73
+
74
+ ---
75
+
76
+ ## 4. Consistency Protocol
77
+
78
+ - Prefer two independent reviewers
79
+ - Any single-dimension gap > 1.0 goes to arbitration
80
+ - Arbitration must cite text evidence, never impression-only judgment
81
+
82
+ ---
83
+
84
+ ## 5. Final Score and Grade
85
+
86
+ - Weighted final score: 0-5
87
+ - `A`: >= 4.5
88
+ - `B`: 4.0-4.49
89
+ - `C`: 3.0-3.99
90
+ - `D`: < 3.0
91
+
92
+ If hard fail gate is triggered, final verdict is forced to `Infeasible`.
@@ -0,0 +1,52 @@
1
+ # Prompt Scorecard
2
+
3
+ ## Target
4
+ - Artifact:
5
+ - Path:
6
+ - Date:
7
+ - Reviewer:
8
+
9
+ ## Ablation Result
10
+ - Removed layers:
11
+ - Remaining skeleton summary:
12
+ - Ablation survivability note:
13
+
14
+ ## Tier
15
+ - Tier: T0 / T1 / T2 / T3
16
+ - Tier rationale:
17
+
18
+ ## Dimension Scores
19
+ | Dimension | Weight | Score (0-5) | Confidence | Evidence | Fix |
20
+ | --- | ---: | ---: | --- | --- | --- |
21
+ | Structure | 20% | | high/medium/low | | |
22
+ | Alignment | 20% | | high/medium/low | | |
23
+ | Robustness | 15% | | high/medium/low | | |
24
+ | Efficiency | 10% | | high/medium/low | | |
25
+ | Meta-Isomorphism | 15% | | high/medium/low | | |
26
+ | Groundability | 10% | | high/medium/low | | |
27
+ | Ablation Survivability | 10% | | high/medium/low | | |
28
+
29
+ ## Hard Fail Gate Check
30
+ - Triggered: Yes / No
31
+ - Condition:
32
+ - Evidence:
33
+ - Minimal repair actions:
34
+
35
+ ## Weighted Score
36
+ - Score:
37
+ - Grade: A / B / C / D
38
+ - Final verdict: Pass / Needs Iteration / Infeasible
39
+
40
+ ## Top Risks
41
+ 1.
42
+ 2.
43
+ 3.
44
+
45
+ ## Top Fixes
46
+ 1.
47
+ 2.
48
+ 3.
49
+
50
+ ## Re-score Expectation
51
+ - Expected tier after fixes:
52
+ - Expected score delta: