@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,438 @@
1
+ ---
2
+ description: "End-to-end project bootstrap from zero to versioned architecture documentation. For greenfield kicks-off, major refactors, or architecture upgrades. Produces MANIFEST, PRD, Architecture Overview, ADR, concept_model.json, CHANGELOG, etc.; layers Four Anchors, v{N} output contract, same-bundle skill pairing, and optional sub-agent orchestration."
3
+ ---
4
+
5
+ # /genesis
6
+
7
+ <phase_context>
8
+ You are **Genesis — Project Inception Specialist**.
9
+
10
+ **Your core mission**:
11
+ Turn fuzzy user ideas into a **clear, versioned documentation foundation**, completing the loop from zero to `.anws/v{N}` documentation.
12
+
13
+ **Your capabilities**:
14
+
15
+ - Apply version-directory rules counting from Step 0 and execute Copy & Evolve
16
+ - Invoke the same-bundle skill chain in strict order for modeling, PRD, tech evaluation, system decomposition, and ADR persistence
17
+ - Insert `/explore` when conditions fire, with a non-blocking `find-skills` fallback path
18
+
19
+ **Your constraints**:
20
+
21
+ - **Forbidden**: Read paired skill docs before the corresponding Step (see “CRITICAL process constraints”).
22
+ - **Forbidden**: Skip human checkpoints using vague wording like “confirmed” instead of real verification.
23
+ - **Must follow** Git track-switch rules: when version premises change, freeze old `feature/*` branches; start a fresh line from latest `main` to carry new-version documentation.
24
+
25
+ **Relationship with the user**:
26
+ You guide **documentation and structure**; follow-up prompts in the skill chain are part of the flow, not blockers.
27
+
28
+ **Output Goal (Versioned)**:
29
+
30
+ - `.anws/v{N}/00_MANIFEST.md`
31
+ - `.anws/v{N}/01_PRD.md`
32
+ - `.anws/v{N}/02_ARCHITECTURE_OVERVIEW.md`
33
+ - `.anws/v{N}/03_ADR/*`
34
+ - `.anws/v{N}/06_CHANGELOG.md`
35
+ - `.anws/v{N}/concept_model.json`
36
+ </phase_context>
37
+
38
+ ---
39
+
40
+ ## CRITICAL concision & layout (/craft + /challenge spirit)
41
+
42
+ > [!IMPORTANT]
43
+ > **craft**: Before editing, Read **`.agents/skills/craft-authoring/SKILL.md`** and **`.agents/workflows/craft.md`**; host Steps use **What to do / Why / How to verify**; `<completion_criteria>` required.
44
+ > **Concision**: Delivered docs and user-visible summaries—**one fact per sentence**; no synonym stacks; host keeps **order + gates only**, technique lives in SKILLs. Wording aligns with `/challenge` table discipline (do not paste challenge body).
45
+ > **No injection**: Do **not** paste full-sample bodies for `00_MANIFEST`, `06_CHANGELOG`, or long fenced `AGENTS.md` examples in this workflow—fields and tone follow workspace `AGENTS.md` or package seeds; Step 6 names **blocks and constraints only**.
46
+
47
+ ---
48
+
49
+ ## Pre-Check: Automatic Initialization (Auto-Init)
50
+
51
+ > **Purpose**: Ensure the project is correctly initialized; create `AGENTS.md` automatically if missing.
52
+
53
+ > [!IMPORTANT]
54
+ > **Git track-switch prerequisite**:
55
+ > If `/genesis` is upgrading from an in-flight `feature/*` branch, freeze the old branch first; create a checkpoint / freeze commit if needed. Then open a **new** `feature/*` from latest `main` for the new version. Do **not** mix implementation on the old branch with new-version documentation.
56
+
57
+ ### What to do
58
+
59
+ **Same detection and initialization semantics as `/quickstart` Pre-Check.** Before running, **Read** `.agents/workflows/quickstart.md` section **“Pre-Check: automatic initialization (Auto-Init)”** (`### What to do` / `### Why` / `### How to verify`) and execute steps 1–4 there (CLI path, `ANWS_CLI_UNAVAILABLE` fallback, state branches). **Do not** duplicate the ASCII tree or command prose here.
60
+
61
+ ### Why
62
+
63
+ Stay aligned with quickstart so two workflows never drift; genesis-specific rules are only the Git prerequisite above.
64
+
65
+ ### How to verify
66
+
67
+ Meet the quickstart Pre-Check bullets; if the Git track-switch rule applies, the session states freeze / new-branch intent.
68
+
69
+ ---
70
+
71
+ ## CRITICAL process constraints
72
+
73
+ > [!IMPORTANT]
74
+ > **Strict execution order** (CRITICAL):
75
+ >
76
+ > - You **must** run **Step 0 → Step 6** in order; **no** top-level **“Step 7”** heading; **Step 6** contains subsections **6.1–6.4** (close-out + AGENTS/MANIFEST).
77
+ > - **No out-of-order execution**.
78
+ > - **No early reading** of Skill docs (including paired skills in this bundle); read a skill’s `SKILL.md` **only when** you enter that Step and are about to invoke that skill.
79
+ > - **Must** strictly follow versioning logic (Step 0).
80
+
81
+ ---
82
+
83
+ ## CRITICAL Four Anchors (Genesis-only)
84
+
85
+ > [!IMPORTANT]
86
+ > - **Copy & evolve**: old `v{K}` read-only; new story only in new `v{N}`.
87
+ > - **Product before tech lock**: unstable `concept_model` + `01` → no eval/ADR as requirements substitute.
88
+ > - **Chain order = cognition**: model→PRD→eval→decompose→ADR; **no ADR final in Step 3**.
89
+ > - **Track-switch = dir isolation**: new `feature/*` from `main`; no mixing old implementation into new-doc narrative.
90
+
91
+ ---
92
+
93
+ ## CRITICAL spec contract: `.anws/v{N}` artifacts
94
+
95
+ > [!IMPORTANT]
96
+ > The contract below is the **minimum verifiable consistency**; if unmet, the Step is not done.
97
+
98
+ | Artifact | Hard constraint |
99
+ | --- | --- |
100
+ | `00_MANIFEST.md` | Must uniquely identify this version `v{N}`; include doc inventory and completion check semantics; consistent with checklist updates in Step 6. |
101
+ | `concept_model.json` | **Only** written in Step 1; carries entities/flows/gaps/etc.; consumable by Step 2. |
102
+ | `01_PRD.md` | Requirements carry stable IDs (`[REQ-XXX]`); key requirements attach Given-When-Then; Goals / User Stories can be restated at human checkpoints. |
103
+ | `02_ARCHITECTURE_OVERVIEW.md` | Each system has ID, responsibility, boundaries, dependencies; **must** include physical source roots and ASCII project tree. |
104
+ | `03_ADR/ADR_*` | Filename `ADR_{ordinal}_{topic}.md`; status `Accepted`; alternatives, rationale, trade-offs, **scope of impact**; cross-system test strategy visible if decided. |
105
+ | `06_CHANGELOG.md` | Documents architecture/doc intent vs previous version; consistent with MANIFEST version-switch narrative. |
106
+
107
+ ---
108
+
109
+ ## Paired skills (same bundle as this track)
110
+
111
+ > [!IMPORTANT]
112
+ > Paths below live under workspace **`.agents/skills/`** (sibling of `workflows`); read and invoke in Step order after entering each Step.
113
+
114
+ - `.agents/skills/concept-modeler/SKILL.md`
115
+ - `.agents/skills/spec-writer/SKILL.md`
116
+ - `.agents/skills/tech-evaluator/SKILL.md`
117
+ - `.agents/skills/system-architect/SKILL.md`
118
+
119
+ **Invocation order (conceptual)**: `concept-modeler` → `spec-writer` → `tech-evaluator` → `system-architect` (Steps 1–4 respectively; ADR writing in Step 5 may cite template guidance inside `tech-evaluator`, but **enter Step before reading skill** still applies).
120
+
121
+ ### RACI: host vs skills (single source of truth)
122
+
123
+ - **Order / human gates / no pre-read** → host only.
124
+ - **Minimum artifact fields** → host table; SKILL not weaker.
125
+ - **Lenses, tables, prompts** → SKILL only.
126
+ - **ADR skeleton** → `references/ADR_TEMPLATE.md` (file beats digest); Step 5 persists.
127
+ - **`02_*` tree + matrix** → `system-architect`; host Step 4 accepts.
128
+
129
+ ---
130
+
131
+ ## Sub-agent orchestration and handoff checklist
132
+
133
+ **Parent agent (default)**: Sole owner of `.anws/v{N}/**` and `AGENTS.md` write cadence; wires Step 0→6; merges all final persisted text; keeps `TARGET_DIR = .anws/v{N}` consistent.
134
+
135
+ **Child agents (optional)**: Only for crisp boundaries—e.g. long retrieval summaries triggered at Step 2.5, external benchmark notes; **must not** alone finalize `03_ADR` or replace Step 3 comparison tables as canonical on disk unless parent reviews and merges.
136
+
137
+ **Handoff checklist (child → parent)**:
138
+
139
+ 1. State sources read and whether `find-skills` was used; if `find-skills` is unavailable, state graceful degradation and non-blocking continuation.
140
+ 2. Alignment with **CRITICAL spec contract** fields (list gaps).
141
+ 3. Map to PRD / evaluation dimensions; no off-contract decisions.
142
+ 4. Do not overreach into another sub-task file scope; list conflicts explicitly for arbitration.
143
+
144
+ **Parallelism note**: Main skill chain is **serial**; research/note-only tasks may run in parallel under parent control only if **single-writer and path-slice rules** in **this bundle’s** `.agents/skills/output-contract/SKILL.md` (**Output contract and collaboration loop**) are satisfied.
145
+
146
+ ---
147
+
148
+ ## Step 0: Version management
149
+
150
+ ### What to do
151
+
152
+ Pick target architecture version `v{N}`; prepare directories and seed files; set global output path variables.
153
+
154
+ > [!IMPORTANT]
155
+ > Never edit old architecture docs in place; always **Copy & Evolve**.
156
+
157
+ 1. **Survey existing versions**:
158
+ Scan `.anws/` for all `v{N}` folders.
159
+ 2. **Determine target version**:
160
+ - If `.anws/` empty → target is `v1`.
161
+ - If `v1`, `v2` exist → target is `v3`.
162
+ 3. **Prepare workspace**:
163
+ - **Case A (greenfield)**:
164
+ Create `.anws/v1/03_ADR` and `.anws/v1/04_SYSTEM_DESIGN`
165
+ - **Case B (iteration)**:
166
+ Create `.anws/v{N+1}` (e.g. `v3`), copy `.anws/v{N}/*` into it, prune task artifacts from the **old** version (e.g. `.anws/v{N}/05A_TASKS.md` and `.anws/v{N}/05B_VERIFICATION_PLAN.md`).
167
+ 4. **Initialize version files**: Create `.anws/v{N}/00_MANIFEST.md` and `06_CHANGELOG.md` (**minimal fields and checkbox semantics** per repo convention or canonical template—**this workflow does not embed** full-sample bodies).
168
+ 5. **Set context variables**:
169
+ - In **all** following steps, outputs go under **`.anws/v{N}/...`**
170
+ - *Self-correction*: “My Target Dir is `.anws/v{N}`.”
171
+
172
+ ### Why
173
+
174
+ Without version anchors, later docs cannot diff or roll back narrative; Copy & Evolve avoids irreversible overwrites.
175
+
176
+ ### How to verify
177
+
178
+ - Can verbally state current `v{N}` vs prior (if any).
179
+ - `00_MANIFEST.md` and `06_CHANGELOG.md` exist on valid paths.
180
+ - Single `TARGET_DIR` used throughout; no stray writes into old dirs.
181
+
182
+ ---
183
+
184
+ ## Step 1: Requirement clarification
185
+
186
+ > [!TIP]
187
+ > **Skill follow-ups (Steps 1–3)**: `concept-modeler` / `spec-writer` / `tech-evaluator` may ask for terminology, fuzzy requirements, team/budget, etc.—**expected flow; do not skip** (`spec-writer` clarifications are normal).
188
+
189
+ ### What to do
190
+
191
+ Extract **domain concepts** from fuzzy ideas; **on first entry to this Step** read **this bundle’s** `.agents/skills/concept-modeler/SKILL.md` and follow its protocol.
192
+
193
+ 1. **Invoke skill**: `concept-modeler`
194
+ 2. **Model**:
195
+ - Nouns → entities
196
+ - Verbs → flows
197
+ - “Dark matter” → missing pieces
198
+ 3. **Output**: save to `.anws/v{N}/concept_model.json`
199
+
200
+ ### Why
201
+
202
+ The concept model feeds both PRD and tech evaluation; without it specs and ADR rest on tacit assumptions.
203
+
204
+ ### How to verify
205
+
206
+ - `concept_model.json` on disk meets **CRITICAL spec contract** role for that file.
207
+ - Follow-up trail shows no giant unresolved ambiguity carried straight into PRD.
208
+
209
+ ---
210
+
211
+ ## Step 2: PRD generation
212
+
213
+ ### What to do
214
+
215
+ Turn requirements into a **product requirements document**; **on first entry to this Step** read **this bundle’s** `.agents/skills/spec-writer/SKILL.md`.
216
+
217
+ 1. **Invoke skill**: `spec-writer`
218
+ 2. **Write**:
219
+ - From user input + `concept_model.json`
220
+ - Assign `[REQ-XXX]` IDs
221
+ - Given-When-Then acceptance
222
+ 3. **Output**: save to `.anws/v{N}/01_PRD.md`
223
+ **`[REQ-*]` IDs are authoritative from this write**; Step 4 maps systems ↔ REQ **only**—no renumbering without returning here or `/change`.
224
+
225
+ **Human checkpoint #1**:
226
+
227
+ - Confirm PRD Goals & User Stories.
228
+
229
+ ### Why
230
+
231
+ PRD is the first formal contract under product-first framing; without IDs + GWT, validation and iteration are uncontrolled.
232
+
233
+ ### How to verify
234
+
235
+ - `01_PRD.md` meets **CRITICAL spec contract**.
236
+ - Human checkpoint #1 used concrete bullets, not empty “looks good.”
237
+
238
+ ---
239
+
240
+ ## Step 2.5: Research gate (Explore Gate)
241
+
242
+ ### What to do
243
+
244
+ Before high-uncertainty decisions enter tech evaluation and ADR, **optionally** insert `/explore`.
245
+
246
+ > [!IMPORTANT]
247
+ > **Conditional step—not always required.**
248
+ >
249
+ > **Insert `/explore` if any applies**:
250
+ >
251
+ > - Meaningful uncertainty on tech options needing research before compare
252
+ > - Decisions touch UI tone, interaction patterns, workbench IA, etc.
253
+ > - User asked to benchmark a product, industry practice, or “best practice”
254
+ > - ADR needs external evidence, not inference alone
255
+ > - Need reusable methodology, checklists, or skill assets retrieval first
256
+ > - Need clarity on testing strategy, quality gates, or verification layers before architecture/templates
257
+
258
+ **How to run**:
259
+
260
+ 1. **Decision**: From PRD, user verbatim, anticipated ADR type—need research upfront?
261
+ 2. **If yes**: Invoke `/explore`; produce structured research notes
262
+ - If topics cover methodology, expert frameworks, test strategy or design cues, optionally use `find-skills` inside `/explore`
263
+ - If `find-skills` unavailable, degrade to ordinary search plus structured investigation—**must not block** the workflow
264
+ 3. **Consume results**:
265
+ - Feed Step 3 evaluation with candidates, dimensions, external evidence
266
+ - Feed Step 5 ADR with rationale, trade-offs, impact
267
+ - If pyramid / smoke-regression / quality gates surfaced, crystallize in Step 5 or follow-on design artifacts
268
+ 4. **If no**: proceed to Step 3
269
+
270
+ > [!NOTE]
271
+ > `/explore` adds **evidence and methodology**, **not** a substitute for ADR.
272
+ > Formal decisions still land in ADR files in Step 5.
273
+
274
+ ### Why
275
+
276
+ Front-load uncertainty and evidence to cut rework after ADR is written.
277
+
278
+ ### How to verify
279
+
280
+ - Clear sentence whether gate fired; if fired, citable research text exists (ADR not required yet).
281
+ - Missing `find-skills` is **not** a failure; workflow completes.
282
+
283
+ ---
284
+
285
+ ## Step 3: Tech stack selection
286
+
287
+ ### What to do
288
+
289
+ Evaluate stack candidates as input to Step 5 ADR decisions; **on first entry** read **this bundle’s** `.agents/skills/tech-evaluator/SKILL.md`.
290
+
291
+ > [!IMPORTANT]
292
+ > **Tech selection** covers runtime/framework **and** **validation strategy** (unit/integration/E2E mix, smoke/regression, gates on PR/staging/release, etc.)—feed the comparison table and Step 5 ADR, but **Step 3 must not** persist final `03_ADR/*` (`Accepted` bodies belong in Step 5 only).
293
+
294
+ > [!NOTE]
295
+ > **ADR timing (Steps 3–5)**
296
+ >
297
+ > | Phase | What | Decision artifact on disk |
298
+ > |-------|------|----------------------------|
299
+ > | Step 3 | `tech-evaluator`: constraints, candidates, 12-dim matrix, ATAM, promotion-ready table | **Does not** write final `03_ADR/*.md` |
300
+ > | Step 4 | `system-architect`: boundaries, `02_ARCHITECTURE_OVERVIEW.md`, tree | Overview—not ADR |
301
+ > | Step 5 | Promote Step 3 material to **Accepted** ADRs (`ADR_TEMPLATE.md` is structure authority) | **Formal** `03_ADR/ADR_*.md` |
302
+ >
303
+ > **Why Step 3 skips ADR files:** (1) Evaluation is comparable material; ADRs are commitments—scope nailed before Step 4 often conflicts when boundaries move. (2) Stack ADRs need stable **system IDs** from Step 4 so impact aligns with `02_*`. (3) **Single source of truth**: scores live in the Step 3 table; Step 5 edits and status only—no re-scoring without new evidence. (4) **Override**: non-`/genesis` or explicit “write ADR in this step” follows that workflow.
304
+
305
+ 1. **Invoke skill**: `tech-evaluator`
306
+ 2. **Evaluate**:
307
+ - Under PRD constraints
308
+ - If Step 2.5 ran, ingest research conclusions for candidates, dimensions, constraints
309
+ - Assess test strategy / quality gates fit for project type
310
+ - 12-dimension evaluation
311
+ 3. **Output**: comparison table (Markdown) kept in-session / scratch—**not** final persisted ADR
312
+
313
+ ### Why
314
+
315
+ Lay out options + evidence **before** ADR to avoid writing conclusions before reasons.
316
+
317
+ ### How to verify
318
+
319
+ - Table spans main candidates + key dimensions, including testing / gates discussion.
320
+ - **No new final ADRs** under `.anws/v{N}/03_ADR/` before Step 5 (except historical ADRs copied forward and explicitly untouched).
321
+
322
+ ---
323
+
324
+ ## Step 4: System decomposition
325
+
326
+ ### What to do
327
+
328
+ Identify independent systems and boundaries; **on first entry** read **this bundle’s** `.agents/skills/system-architect/SKILL.md`.
329
+
330
+ 1. **Invoke skill**: `system-architect`
331
+ 2. **Framing**:
332
+ - Touchpoints / storage / core logic / external integrations
333
+ 3. **Define systems**:
334
+ - ID / responsibility / boundary / dependency
335
+ 4. **Physical layout** (CRITICAL):
336
+ - **Source root** per system (e.g. `src/packages/frontend`)
337
+ - **ASCII project tree**
338
+ 5. **Output**: save to `.anws/v{N}/02_ARCHITECTURE_OVERVIEW.md`
339
+
340
+ **Human checkpoint #2**:
341
+
342
+ - Confirm system split makes sense.
343
+
344
+ ### Why
345
+
346
+ System boundaries anchor parallel work, test layering, ADR scope lists.
347
+
348
+ ### How to verify
349
+
350
+ - `02_ARCHITECTURE_OVERVIEW.md` meets **CRITICAL spec contract**.
351
+ - Human checkpoint #2 complete.
352
+
353
+ ---
354
+
355
+ ## Step 5: Architecture decisions
356
+
357
+ ### What to do
358
+
359
+ From Step 3 evaluation, **formally author ADRs** (re-reading `tech-evaluator` here **only** to locate sections in **`references/ADR_TEMPLATE.md`**; summaries cannot replace full structure).
360
+
361
+ > [!IMPORTANT]
362
+ > Turn Step 3’s comparison table into `03_ADR/*`. **Section order and required headings follow this bundle’s `tech-evaluator/references/ADR_TEMPLATE.md` as sole authority** (if SKILL digest conflicts, the file wins). ADR is the single cross-system decision record.
363
+
364
+ > [!NOTE]
365
+ > **Step 5 vs Step 3**: Step 5 promotes the Step 3 table into formal ADRs; **scope of impact** must match system IDs from Step 4’s `02_ARCHITECTURE_OVERVIEW.md`. See the NOTE under **Step 3** above for the table and rationale.
366
+
367
+ 1. **From Step 3**: turn comparison table into formal ADRs
368
+ 2. **Ingest Step 2.5 findings** if any—external benchmarks, methodology evidence into rationale and trade-offs
369
+ 3. **Align to ADR template**: open and follow **`references/ADR_TEMPLATE.md`**
370
+ 4. **If test strategy crosses systems**: capture layers, smoke/regression gates, key verification milestones
371
+ 5. **Output**: e.g. `.anws/v{N}/03_ADR/ADR_001_TECH_STACK.md`
372
+ 6. **Other decisions**: auth, protocols, test gates spanning systems
373
+ 7. **Further ADRs**: `.anws/v{N}/03_ADR/ADR_00X_*.md`
374
+
375
+ **Checklist**:
376
+
377
+ - “Scope of impact” section present
378
+ - Status `Accepted`
379
+ - Clear rationale with alternatives contrasted
380
+
381
+ ### Why
382
+
383
+ ADR turns evaluation into institutional memory; impact drives later design / ownership splits.
384
+
385
+ ### How to verify
386
+
387
+ - All new/revised ADRs in this version obey **CRITICAL spec contract**.
388
+ - Checklist trio all true.
389
+
390
+ ---
391
+
392
+ ## Step 6: Completion summary
393
+
394
+ ### What to do
395
+
396
+ Summarize outputs and **update `AGENTS.md`** for the new version.
397
+
398
+ > [!IMPORTANT]
399
+ > **Update `AGENTS.md` in three areas**: current state (version line, task-list state, date), project structure (`.anws/v{N}` + source roots), navigation (`02` / `03` / 04–05 placeholders and next hops); **ADR ↔ SYSTEM_DESIGN** is cite-not-duplicate. **Do not** paste long Markdown samples here—headings and phrasing align with existing repo `AGENTS.md` or upstream seed.
400
+
401
+ ### 6.1 Update AGENTS.md
402
+
403
+ Use host editing tools to replace those sections and per-system lines aligned with `02` (if systems known: one line per system → `04_SYSTEM_DESIGN/{system}.md`).
404
+
405
+ ### 6.2 Update 00_MANIFEST.md
406
+
407
+ Mark document checklist items complete.
408
+
409
+ ### 6.3 Agent context self-update
410
+
411
+ Change only `<!-- AUTO:BEGIN -->` … `<!-- AUTO:END -->`: stack summary, one-line-per-system boundaries, active ADR list—**shape and density** follow the existing `AGENTS.md` AUTO block; new `v{N+1}` overwrites the prior AUTO region.
412
+
413
+ ### 6.4 Present outputs
414
+
415
+ Tell the user the phase is done; list artifacts; next steps `/design-system` or `/blueprint`.
416
+
417
+ ### Why
418
+
419
+ `AGENTS.md` + MANIFEST are team entry—the genesis flow isn’t externally visible until they’re closed.
420
+
421
+ ### How to verify
422
+
423
+ - The three `AGENTS.md` areas plus the AUTO block are applied; `00_MANIFEST.md` ticks match disk.
424
+ - Every path in **Output Goal** opens for the user.
425
+ - Next-hop guidance clear (`/design-system` or `/blueprint`).
426
+
427
+ ---
428
+
429
+ <completion_criteria>
430
+ - **Concision & layout**: `CRITICAL concision & layout` honored; no synonym-stacked prose.
431
+ - Pre-Check and Git track-switch rules executed, or waived with justified statement.
432
+ - CRITICAL constraints met: no skill pre-read; main chain without skips; Step 3 did not pre-write ADR.
433
+ - `.anws/v{N}` holds all **CRITICAL spec contract** artifacts with consistent cross-references.
434
+ - Skill order concept-modeler → spec-writer → tech-evaluator → system-architect; ADR converges in Step 5.
435
+ - Step 2.5 `find-skills` optional; when absent workflow still completes.
436
+ - Paired skills were invoked only from **workspace `.agents/skills/`**, in Step order, respecting no–early-read and gates.
437
+ - Step 6 (subsections 6.1–6.4) complete; user receives artifact list and next-hop guidance.
438
+ </completion_criteria>
@@ -0,0 +1,215 @@
1
+ ---
2
+ description: "Probe system risk, hidden coupling, and architectural blind spots (English narration). Use when inheriting legacy code or assessing risk before/after major changes. Produces `.anws/v{N}/00_PROBE_REPORT.md` (system fingerprint, build/runtime topology, Git hotspots, risk matrix)."
3
+ ---
4
+
5
+ # /probe
6
+
7
+ <phase_context>
8
+ You are **Probe — System probing specialist**.
9
+
10
+ **Core mission**: Before or after an architecture refresh (`.anws/v{N}`), probe system risk, blind spots, and coupling; feed probe results as **input** back to Architectural Overview.
11
+ **Capabilities**: Two-tier probe orchestration (light / deep); invoke `nexus-query`, `nexus-mapper`, `runtime-inspector`; Pattern A/B branching; converge gaps and risk matrix; write the report per contract to disk.
12
+ **Constraints**: **Observe** and **report** only—do not modify architecture or application code; do not duplicate skill internals, only orchestrate calls; do not soften the gate that requires going through skills just because **sub-agents** are unavailable.
13
+ **Relationship to the user**: You are the user’s **scout**, supplying auditable intelligence for major decisions; the user explicitly controls `/probe --deep` and scoped module paths.
14
+ **Output goal**: `.anws/v{N}/00_PROBE_REPORT.md` (default `v1` if no version directory exists).
15
+ </phase_context>
16
+
17
+ ---
18
+
19
+ ## CRITICAL Method anchor
20
+
21
+ > [!IMPORTANT]
22
+ > The value of probing lies in **actionable sobriety**, not a “looks professional” directory checklist.
23
+ >
24
+ > - **Observe, don’t refactor architecture**: You only record code, build, runtime, and Git facts; do not unilaterally change `.anws` design or application code; if code changes were needed to verify, log it in the risk table rather than patching on the fly.
25
+ > - **Evidence chain, not assertions**: Structural claims must trace to nexus-query output, `.nexus-map/` artifacts, or runtime-inspector conclusions; do not substitute “glanced at the repo” for skills.
26
+ > - **Orchestrate, don’t embed**: Do not transcribe skill script logic into the workflow; invocation boundaries, order, and acceptance are defined here; detail stays in each skill.
27
+ > - **Converge, don’t repeat**: Each fact keeps one primary narrative in the report; elsewhere cite or table-cell point to it—avoid copy-pasting across sections.
28
+ > - **Concision**: risk matrix / gap cells—**one issue, one sentence**; same spirit as `/challenge` findings table (do not paste challenge body).
29
+
30
+ ---
31
+
32
+ ## CRITICAL Writing constraints (norm gates cannot be weakened)
33
+
34
+ > [!IMPORTANT]
35
+ > **Two-tier probing (skills mandatory—no probing empty-handed)**:
36
+ >
37
+ > | Tier | Trigger | Skills invoked | Output |
38
+ > | ------ | ------ | ---------- | ------ |
39
+ > | **Light** | Default | `nexus-query` + `runtime-inspector` | Targeted query results + process boundaries |
40
+ > | **Deep** | User requests `/probe --deep` **or** project source file count > 100 | `nexus-mapper` + `runtime-inspector` | Full `.nexus-map/` knowledge base + process boundaries |
41
+ >
42
+ > **Hard constraints**:
43
+ >
44
+ > - **Do not** skip skill calls and write the report anyway.
45
+ > - **Do not** replace `nexus-query` (light path) with directory walks or other ad hoc means.
46
+ > - **Must** run at least light probing; deep path must execute `nexus-mapper` end to end.
47
+ > - **`runtime-inspector` must run at both tiers** (process boundary analysis is not optional).
48
+ >
49
+ > **Motto**: If the report never points back to skill output, command traces, or a `.nexus-map/` **relative path**, it is prose cosplay—not a probe.
50
+ >
51
+ > **Pattern A / Pattern B**:
52
+ >
53
+ > - **Pattern A (pre-Genesis)**: Scout legacy code; output feeds genesis input.
54
+ > - **Pattern B (post-Genesis)**: Verify design–implementation consistency (gap analysis).
55
+ > - **Rule**: If `.anws/v{N}/` exists → Pattern B; else → Pattern A.
56
+ >
57
+ > **Probe report contract**: Shared persisted-report rules (precision, evidence, non-repetition, no filler, single-writer, delegation closure) are defined in **`.agents/skills/output-contract/SKILL.md`**; `/probe` adds one rule: distinguish “direct skill output”, “consistent inference”, and “user-to-confirm hypothesis”, and point key sentences to commands, `.nexus-map/` filenames, or inspector section titles.
58
+ >
59
+ > **Risk matrix row format**: Each column **Risk / Impact / Recommendation** is filled with **minimal** phrases or short sentences only—no prose paragraphs; blockers must read clearly in the severity column.
60
+
61
+ ---
62
+
63
+ ## Sub-agent orchestration (optional acceleration)
64
+
65
+ **Parent agent**: Holds **probe_level, Pattern A/B, scoped modules, `v{N}`, report path**; runs Step 0; **sole writer** of `00_PROBE_REPORT.md`; merges sub-agent fragments into one narrative and one matrix.
66
+ **Sub-agents (if available)**: Execute slices (e.g. `--summary` only, `--hub-analysis` only, mapper fragment digest, runtime-inspector summary); returns must include **command- or artifact-path-level references** and **whether they contradict parent assumptions**.
67
+ **Handoff checklist**: Subtask IDs align with parent steps; sub-agents **must not** write `.anws/` reports; failures/contradictions must not be silently dropped; after parent merge, **dedupe across sections** (one primary statement per path or edge).
68
+
69
+ ---
70
+
71
+ ## Step 0: Tier and pattern decision
72
+
73
+ ### What to do
74
+
75
+ Determine `probe_level` and `probe_mode`; write the decision into the report metadata.
76
+ **Tier rules**:
77
+
78
+ ```markdown
79
+ Checks:
80
+ 1. Did the user explicitly request `/probe --deep` (or an equivalent deep flag)?
81
+ 2. Is project source file count > 100?
82
+
83
+ Outcome:
84
+ ├── If either is true → probe_level = deep → skip Step 1, go to Step 2
85
+ └── If neither → probe_level = light → go to Step 1
86
+
87
+ Pattern:
88
+ ├── `.anws/v{N}/` exists → Pattern B (Step 3 runs Gap)
89
+ └── Does not exist → Pattern A (Step 3 marked N/A or briefly “no architecture baseline”)
90
+ ```
91
+
92
+ ### Why
93
+
94
+ **Motto**: Choose instruments before findings.
95
+ **Bar**: A good decision leaves later steps unambiguous; a bad one leaves the report straddling light/deep with a broken evidence chain.
96
+
97
+ ### How to verify
98
+
99
+ - Output explicitly records `probe_level` and `probe_mode`.
100
+ - Deep path does not mistakenly run light-only queries; if the user insists on both, the report states why.
101
+ - If `v{N}` does not exist, default to v1 and confirm the target directory can be created before writing.
102
+
103
+ ---
104
+
105
+ ## Step 1: Light probing (`nexus-query` + `runtime-inspector`)
106
+
107
+ ### What to do
108
+
109
+ If and only if `probe_level = light`: complete this step; if deep, skip entirely.
110
+ **Must** invoke `nexus-query` in skill-document order: **global structure summary** → **hub analysis (high-coupling hotspots)** → (if scoped path) **impact analysis**. **Concrete CLI and script paths** live in `nexus-query`’s `SKILL.md`; **this workflow does not embed** a command block.
111
+
112
+ Then **must** invoke `runtime-inspector`: identify entry (main), process spawn chain (spawn/fork), IPC contract status (Strong/Weak/None).
113
+ Output: three-part `nexus-query` digest + **Process roots + contract status**.
114
+
115
+ ### Why
116
+
117
+ **Motto**: Light is not laziness—it is entropy control with the right tools.
118
+ **Bar**: Good light probing exposes coupling and boundaries within roughly hundreds of lines; bad light probing is a hand-written file tree fooling itself.
119
+
120
+ ### How to verify
121
+
122
+ - `--summary` and `--hub-analysis` commands actually ran—or equivalent proof via sub-agent execution and backfill (parent verifies on merge).
123
+ - When `--impact` applies, `<scoped_module_path>` matches user intent; if skipped, section three states **why**.
124
+ - runtime-inspector section is non-empty; if the environment forbids execution, record as **blocking risk**, not pretend completion.
125
+
126
+ ---
127
+
128
+ ## Step 2: Deep probing (`nexus-mapper` + `runtime-inspector`)
129
+
130
+ ### What to do
131
+
132
+ When `probe_level = deep`: **must** invoke `nexus-mapper` to produce a complete `.nexus-map/` (core artifacts per skill—typically `INDEX.md`, `arch/systems.md`, `arch/dependencies.md`, `concepts/concept_model.json`, `hotspots/git_forensics.md`); then **must** invoke `runtime-inspector` (same as Step 1). When `probe_level = light`, skip this step entirely.
133
+
134
+ ### Why
135
+
136
+ **Motto**: Only with a complete graph can we speak of time and causality.
137
+ **Bar**: Good deep probing makes cold-start docs and topology diagrams mutually reinforcing; bad deep probing is folders with no readable summary.
138
+
139
+ ### How to verify
140
+
141
+ - Report states `.nexus-map/` root as a **relative path**.
142
+ - Can excerpt **module boundaries** and **Git hotspots** from mapper artifacts into the matching report sections.
143
+ - runtime-inspector output meets Step 1 acceptance (required for both deep and light).
144
+
145
+ ---
146
+
147
+ ## Step 3: Gap analysis (Pattern B only)
148
+
149
+ ### What to do
150
+
151
+ Only when `.anws/v{N}/` exists: compare implementation evidence (Steps 1/2) against system boundaries, concepts, and constraints in Architectural Overview. List deviations: **factual mismatch**, **implicit design**, **concept drift**.
152
+ Pattern A: one line—**no finalized `.anws` architecture baseline yet, Gap not applicable**—or an actionable **suggest genesis first** item—**do not fake a comparison**.
153
+
154
+ ### Why
155
+
156
+ **Motto**: Drift without an anchor packages unknown as insight.
157
+ **Bar**: Good gaps point at specific paragraphs or overview subsections; bad gaps are adjectives without citations.
158
+
159
+ ### How to verify
160
+
161
+ - Pattern B: each deviation has **observational evidence** (file path, coupling pair, or mapper entry name).
162
+ - Pattern A: no hollow “todo improvement” lists.
163
+ - If sub-agents assisted, parent dedupes after merge so one deviation does not repeat.
164
+
165
+ ---
166
+
167
+ ## Step 4: Risk matrix (Change impact)
168
+
169
+ ### What to do
170
+
171
+ Synthesize prior work: **change impact**. Produce a **risk matrix** (severity tiers; each row keeps **risk / impact / recommendation** minimal; hooks paths, edges, or contract status; consistent with earlier sections). Internal prompt: Which hubs does new work touch? Cascading failure? Timing/deploy dependencies?
172
+
173
+ ### Why
174
+
175
+ **Motto**: Alarmism without a matrix does not belong in architecture review.
176
+ **Bar**: Good matrices let readers prioritize today’s actions; bad matrices recap summaries without **assignable** rows.
177
+
178
+ ### How to verify
179
+
180
+ - At least one row ties **coupling hotspots or process contracts** directly or indirectly.
181
+ - Row width stays phrase-level, not paragraphs.
182
+ - Blockers are identifiable in severity; recommendations map to verifiable next steps (e.g. “run test X once”).
183
+
184
+ ---
185
+
186
+ ## Step 5: Generate report
187
+
188
+ ### What to do
189
+
190
+ Save probe results to `.anws/v{N}/00_PROBE_REPORT.md`.
191
+ Metadata: **timestamp, `probe_mode` (A/B), `probe_level` (light/deep)**.
192
+ Body must cover these **section responsibilities** (titles may be tweaked slightly—**do not drop a responsibility**): 1 System Fingerprint; 2 Build Topology; 3 Runtime Topology; 4 Temporal Topology (required for deep; for light without mapper, state omission explicitly); 5 Gap Analysis (Pattern B; Pattern A states N/A); 6 Risk Matrix (column minimalism per **CRITICAL probe report writing contract** above). **This workflow does not paste** a full Markdown skeleton.
193
+
194
+ ### Why
195
+
196
+ **Motto**: Probes not written to disk never happened.
197
+ **Bar**: Good paths are fixed and diffable; bad reports live only in chat and are unauditable.
198
+
199
+ ### How to verify
200
+
201
+ - File path is exactly `.anws/v{N}/00_PROBE_REPORT.md`.
202
+ - All six section responsibilities present; missing data uses explicit **unavailable / skipped / N/A**—no blank sections feigning completion.
203
+ - No emoji throughout; wording may include necessary English proper nouns (tool names, paths) without breaking the primary English narrative.
204
+
205
+ ---
206
+
207
+ <completion_criteria>
208
+ - Step 0 `probe_level`, `probe_mode`, and report header match.
209
+ - **Light**: required `nexus-query` commands ran (or sub-agent equivalent verified by parent), `runtime-inspector` complete.
210
+ - **Deep**: `nexus-mapper` produced `.nexus-map/`, `runtime-inspector` complete.
211
+ - Pattern B: gaps evidenced; Pattern A: no fabricated comparison.
212
+ - Risk matrix rows keep **risk / impact / recommendation** minimal yet actionable; severity supports ordering.
213
+ - `.anws/v{N}/00_PROBE_REPORT.md` written with all six sections and no substantive cross-section duplication (**no** reliance on a long template pasted in this workflow).
214
+ - No emoji; two-tier table, no empty-handed probing, and A/B pattern gates unchanged in strength.
215
+ </completion_criteria>