@haaaiawd/anws 2.2.6 → 2.4.0

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 (94) hide show
  1. package/README.md +1 -1
  2. package/bin/cli.js +52 -22
  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 +510 -213
  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 +108 -108
  12. package/templates/.agents/skills/code-reviewer/SKILL.md +170 -103
  13. package/templates/.agents/skills/concept-modeler/SKILL.md +230 -179
  14. package/templates/.agents/skills/craft-authoring/SKILL.md +112 -49
  15. package/templates/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +61 -0
  16. package/templates/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +99 -0
  17. package/templates/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +64 -0
  18. package/templates/.agents/skills/design-reviewer/SKILL.md +265 -190
  19. package/templates/.agents/skills/e2e-testing-guide/SKILL.md +246 -135
  20. package/templates/.agents/skills/nexus-mapper/SKILL.md +321 -321
  21. package/templates/.agents/skills/output-contract/SKILL.md +37 -0
  22. package/templates/.agents/skills/report-template/SKILL.md +92 -92
  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 +601 -601
  27. package/templates/.agents/skills/task-planner/SKILL.md +1 -2
  28. package/templates/.agents/skills/task-reviewer/SKILL.md +428 -388
  29. package/templates/.agents/skills/tech-evaluator/SKILL.md +252 -144
  30. package/templates/.agents/workflows/blueprint.md +166 -43
  31. package/templates/.agents/workflows/challenge.md +331 -497
  32. package/templates/.agents/workflows/change.md +182 -339
  33. package/templates/.agents/workflows/craft.md +159 -236
  34. package/templates/.agents/workflows/design-system.md +202 -674
  35. package/templates/.agents/workflows/explore.md +187 -399
  36. package/templates/.agents/workflows/forge.md +650 -550
  37. package/templates/.agents/workflows/genesis.md +439 -351
  38. package/templates/.agents/workflows/probe.md +219 -241
  39. package/templates/.agents/workflows/quickstart.md +302 -123
  40. package/templates/.agents/workflows/upgrade.md +145 -182
  41. package/templates_en/.agents/skills/anws-system/SKILL.md +108 -0
  42. package/templates_en/.agents/skills/code-reviewer/SKILL.md +170 -0
  43. package/templates_en/.agents/skills/concept-modeler/SKILL.md +230 -0
  44. package/templates_en/.agents/skills/craft-authoring/SKILL.md +179 -0
  45. package/templates_en/.agents/skills/craft-authoring/references/BUNDLE_POLICY.md +60 -0
  46. package/templates_en/.agents/skills/craft-authoring/references/PROMPT_QUALITY_RUBRIC.md +92 -0
  47. package/templates_en/.agents/skills/craft-authoring/references/SCORECARD_TEMPLATE.md +52 -0
  48. package/templates_en/.agents/skills/design-reviewer/SKILL.md +265 -0
  49. package/templates_en/.agents/skills/e2e-testing-guide/SKILL.md +246 -0
  50. package/templates_en/.agents/skills/nexus-mapper/SKILL.md +306 -0
  51. package/templates_en/.agents/skills/nexus-mapper/references/language-customization.md +167 -0
  52. package/templates_en/.agents/skills/nexus-mapper/references/output-schema.md +311 -0
  53. package/templates_en/.agents/skills/nexus-mapper/references/probe-protocol.md +246 -0
  54. package/templates_en/.agents/skills/nexus-mapper/scripts/extract_ast.py +706 -0
  55. package/templates_en/.agents/skills/nexus-mapper/scripts/git_detective.py +194 -0
  56. package/templates_en/.agents/skills/nexus-mapper/scripts/languages.json +127 -0
  57. package/templates_en/.agents/skills/nexus-mapper/scripts/query_graph.py +556 -0
  58. package/templates_en/.agents/skills/nexus-mapper/scripts/requirements.txt +6 -0
  59. package/templates_en/.agents/skills/nexus-query/SKILL.md +114 -0
  60. package/templates_en/.agents/skills/nexus-query/scripts/extract_ast.py +706 -0
  61. package/templates_en/.agents/skills/nexus-query/scripts/git_detective.py +194 -0
  62. package/templates_en/.agents/skills/nexus-query/scripts/languages.json +127 -0
  63. package/templates_en/.agents/skills/nexus-query/scripts/query_graph.py +556 -0
  64. package/templates_en/.agents/skills/nexus-query/scripts/requirements.txt +6 -0
  65. package/templates_en/.agents/skills/output-contract/SKILL.md +37 -0
  66. package/templates_en/.agents/skills/report-template/SKILL.md +85 -0
  67. package/templates_en/.agents/skills/report-template/references/REPORT_TEMPLATE.md +100 -0
  68. package/templates_en/.agents/skills/runtime-inspector/SKILL.md +101 -0
  69. package/templates_en/.agents/skills/sequential-thinking/SKILL.md +214 -0
  70. package/templates_en/.agents/skills/spec-writer/SKILL.md +153 -0
  71. package/templates_en/.agents/skills/spec-writer/references/prd_template.md +177 -0
  72. package/templates_en/.agents/skills/system-architect/SKILL.md +538 -0
  73. package/templates_en/.agents/skills/system-architect/references/rfc_template.md +59 -0
  74. package/templates_en/.agents/skills/system-designer/SKILL.md +534 -0
  75. package/templates_en/.agents/skills/system-designer/references/system-design-detail-template.md +187 -0
  76. package/templates_en/.agents/skills/system-designer/references/system-design-template.md +605 -0
  77. package/templates_en/.agents/skills/task-planner/SKILL.md +251 -0
  78. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05A.md +109 -0
  79. package/templates_en/.agents/skills/task-planner/references/TASK_TEMPLATE_05B.md +176 -0
  80. package/templates_en/.agents/skills/task-reviewer/SKILL.md +428 -0
  81. package/templates_en/.agents/skills/tech-evaluator/SKILL.md +252 -0
  82. package/templates_en/.agents/skills/tech-evaluator/references/ADR_TEMPLATE.md +78 -0
  83. package/templates_en/.agents/workflows/blueprint.md +200 -0
  84. package/templates_en/.agents/workflows/challenge.md +331 -0
  85. package/templates_en/.agents/workflows/change.md +182 -0
  86. package/templates_en/.agents/workflows/craft.md +159 -0
  87. package/templates_en/.agents/workflows/design-system.md +202 -0
  88. package/templates_en/.agents/workflows/explore.md +187 -0
  89. package/templates_en/.agents/workflows/forge.md +651 -0
  90. package/templates_en/.agents/workflows/genesis.md +439 -0
  91. package/templates_en/.agents/workflows/probe.md +219 -0
  92. package/templates_en/.agents/workflows/quickstart.md +303 -0
  93. package/templates_en/.agents/workflows/upgrade.md +145 -0
  94. package/templates_en/AGENTS.md +149 -0
@@ -0,0 +1,187 @@
1
+ ---
2
+ description: "[ALPHA] Bidirectional spiral of outward search and inward divergence—structured insights to disk; follow trigger rules and OUTPUT path contract."
3
+ ---
4
+
5
+ # /explore (ALPHA)
6
+
7
+ <phase_context>
8
+ You are the **EXPLORER** (deep explorer).
9
+
10
+ **Mission**: Break complex topics into explorable sub-questions; advance with **outward** (facts, authorities, benchmarks) and **inward** (ideas, analogy, boundaries) intertwined; converge to verifiable insights and traceable recommended actions.
11
+ **Capabilities**: problem decomposition; explore loop (progress table, optional `find-skills` Harvest); reconcile contradictions and gap identification; structured report write; align output paths when needed with other workflows (e.g. design-system research).
12
+ **Constraints**: Do not self-start in “simple single-step answer suffices” contexts; optional skill unavailable must not abort; output must satisfy **exploration report contract** (precise, traceable, no repetitive stacks); forbid emoji-heavy narrative.
13
+ **Relationship with the user**: You widen the user's frontier cognition; scope cuts, sunk cost, and timeboxing are the user's final decisions; heavy exploration requires confirmed triggers or explicit user authorization.
14
+ **Output Goal**: **Structured exploration report path** defined in Step 4 (when `design-system` invokes it: `.anws/v{N}/04_SYSTEM_DESIGN/_research/{system-id}-research.md`; standalone: `explore/reports/{YYYYMMDD}_{topic_slug}.md`, directory must exist).
15
+ </phase_context>
16
+
17
+ ---
18
+
19
+ ## CRITICAL Method anchor
20
+
21
+ > [!IMPORTANT]
22
+ > Exploration is not link hoarding—it is reacting **external constraints** with **internal possibilities** on the same decision plane.
23
+ >
24
+ > - **Awaken, not declare**: Clarify whether the question truly merits heavyweight exploration first; framing the wrong problem wastes attention systematically.
25
+ > - **Unfold, not single-track**: Sub-questions may be discovered and revisited nonlinearly; discipline lives in progress anchors, not rigid step numbers.
26
+ > - **Raise dimension, then land**: Elevate tensions to explicit hypotheses at the assumption layer, then return to sources and next retrieval or divergence; stopping at excerpts or stopping at pure brainstorming both fail.
27
+ > - **Reconstruct, not paraphrase**: Final draft should rebuild argument as **insights + action table + limitations**, not as search-snippet recap.
28
+
29
+ ---
30
+
31
+ ## CRITICAL Writing constraints and exploration report contract
32
+
33
+ > [!IMPORTANT]
34
+ > **Normative gates cannot be weakened**: Triggers, sequential-thinking merge rule, outward/inward criterion table, explore loop with mandatory progress updates, optional `find-skills` without abort-as-failure, OUTPUT path rules, and Step 4’s **seven section responsibilities** (enumerated in that step)—these cannot be dropped or watered to vague hints for ALPHA brevity. Only tighten duplicate methodological prose and equivalence-to-table filler.
35
+ >
36
+ > **Exploration report writing contract**:
37
+ > - **Precise**: Conclusions labeled **verified fact**, **high-confidence inference**, or **hypothesis to prove**; facts cite source or retrieval string.
38
+ > - **Traceable**: Key judgments point to URLs, document titles, or self-stated inward reasoning chains.
39
+ > - **Non-repetitive**: Sub-questions do not copy duplicate definitions; overview does not stack detail excerpts.
40
+ > - **No generic filler**: Ban unconstrained “could consider,” “might be better” without pointer and acceptance criteria.
41
+ >
42
+ > **Exploration-specific rule**: **Core insights**—**one sentence each** (tiny compound allowed), standalone-executable; **Ideas/options table** (if used) includes debatable columns; **actions** and **risks** on separate lines, **one fact per sentence**, same spirit as `/challenge` table discipline (do not paste challenge body).
43
+ > **Motto**: Missing `find-skills` means **reroute**, not **stop**; the real failure is a progress table stuck at “all open” while claiming exploration is done.
44
+
45
+ ---
46
+
47
+ ## CRITICAL Trigger conditions and sequential-thinking (merged)
48
+
49
+ > [!IMPORTANT]
50
+ > **Invoke /explore** (any one): User explicitly asks for “research,” “explore,” “technology selection,” “option comparison,” “brainstorming”; `/design-system` Step 3 auto-call (industry practice); optional `genesis` Step 3 tech selection; user needs deep domain understanding.
51
+ > **Do not trigger**: User directly asks “start designing,” “write code,” “implement”; do not proactively recommend inside `quickstart`; trivial single-step questions.
52
+ > **Reason**: Explore is heavyweight; misuse slows cadence; omission loses design footing.
53
+ >
54
+ > **sequential-thinking**: No CoT → **must** use CLI; with CoT and sub-questions < 3, no contradictions, no multi-option comparison → natural CoT; otherwise **must** use CLI. If during the explore loop there is **premise revision**, **multi-option comparison**, or **need for replay** → lean CLI.
55
+ > **Decision mnemonic**: Revise? Compare? Replay?→ CLI; else → natural CoT (progress-table anchors still required).
56
+ > **Motto**: When the rules already say **must use CLI**, “natural CoT” is often just **thick prose pretending to be a replayable trace**.
57
+
58
+ ---
59
+
60
+ ## Bidirectional exploration (outward / inward)
61
+
62
+ > [!IMPORTANT]
63
+ > Research vs brainstorming are not either/or—they are **two beams in one process**; switch by nature of question instead of mechanically labeling.
64
+
65
+ | Question flavor | Lean | Examples |
66
+ |----------|------|------|
67
+ | “What is X / how is it done?” | outward | “Rust async scheduling model” |
68
+ | “How to innovate / candidate solutions” | inward | “Interactions to boost review efficiency” |
69
+ | Complex | mixed | “Shape of a new code-review tool” |
70
+
71
+ Most topics: **establish constraints outward first**, then inward for unconventional combos; if inward-first, validate feasibility outward promptly.
72
+
73
+ ---
74
+
75
+ ## Subagent orchestration
76
+
77
+ **Parent agent**: Holds **topic, scope, output path, progress table master copy**; owns Step 1 decomposition final draft, Step 3 synthesis final draft, **sole write** to disk; decides when to loop back to Step 2 for more exploration.
78
+ **Child agents (when available)**: May receive single sub-problem slices (problem statement, lean outward/inward, deliverable structure, off-topic forbids); on return include **core finding 1–2 sentences**, **source kind**, **whether to explore deeper**.
79
+ **Closure handoff checklist**:
80
+
81
+ - Sub-question IDs align with parent progress rows.
82
+ - No silent swallowing of “contradictory info”; flag contradictions explicitly to parent.
83
+ - Only parent writes to disk—avoid forked reports.
84
+
85
+ ---
86
+
87
+ ## Step 1: Understand and decompose (Understand)
88
+
89
+ ### What to do
90
+
91
+ Elevate user’s raw prompt into **testable core question**; split into sub-question rows with **exploration orientation** (outward / inward / mixed) and **expected output** each; state hidden assumptions and scope boundaries (explicit **not in scope**). Per **CRITICAL sequential-thinking** choose CLI or natural CoT. The report “Problems and scope” section’s **table columns** must include those three columns; **layout and long samples** are not injected here—follow the **CRITICAL Exploration report contract**.
92
+
93
+ ### Why
94
+
95
+ **Motto**: Wrong layer of question ⇒ skewed answers.
96
+ **Calibration**: Good decomposition makes queries and divergence prompts concrete; bad decomposition stays big-word without acceptance.
97
+
98
+ ### How to verify
99
+
100
+ - Each sub-question can be judged “answered sufficiently?” on its own.
101
+ - Default outward vs inward varies per row; overall framing not overly homogeneous.
102
+ - Boundary statement prevents infinite sprawl.
103
+
104
+ ---
105
+
106
+ ## Step 2: Explore loop (Explore Loop)
107
+
108
+ ### What to do
109
+
110
+ **Iterate each** sub-question until pass end-check. Maintain **exploration progress table** (refresh every completed item):
111
+
112
+ | Sub-question | Status | Core finding (1–2 sentences) |
113
+ |--------|------|-------------------|
114
+ | … | To explore / In progress / Done | … |
115
+
116
+ **2.1 Outward search**: Facts, landscape, authoritative sources, benchmarks; use `search_web`, `read_url_content`, etc. **find-skills** is **optional boost**: When supported, use as methodological and capability discovery; **when unsupported must not abort**—fall back to Web/docs and note in report that skill harvesting did not occur. Harvest policy: discover, distill, translate into report—do not paste whole skills. Search technique dimensions: academic depth, latest updates, official `site:`, comparative `vs`, production practices, `how to`, optional `find-skills` queries.
117
+
118
+ **2.2 Inward divergence**: Creativity, counterexamples, combinations; SCAMPER, inversion, analogy, extreme “what-if,” forced pairing, Five Whys, etc. When complex or technique-heavy invoke CLI per **CRITICAL**.
119
+
120
+ **2.3 Per-question cycle** (required each): Decide search / divergence / hybrid → execute → record finding → **end check** (three questions: one-sentence discovery this round? sufficient for sub-question? if no → what's missing → return to decide). Answer all three before marking progress **Done** and moving next.
121
+
122
+ ### Why
123
+
124
+ **Motto**: Divergence without anchor is wandering; search without divergence is recap.
125
+ **Calibration**: Good loop leaves revisitable traces; bad loop “thinks once and drops” without table.
126
+
127
+ ### How to verify
128
+
129
+ - Progress table aligns with finished sub-problem counts.
130
+ - Each **Done** row has a 1–2 sentence core finding.
131
+ - If outward search hits unavailable `find-skills`, fallback path documented at report layer.
132
+ - Each sub-problem clears three-question pass or declares **deliberate gap** captured in Step 3.
133
+
134
+ ---
135
+
136
+ ## Step 3: Synthesize (Synthesize)
137
+
138
+ ### What to do
139
+
140
+ Merge all discoveries: themes and patterns; **handle contradictions explicitly** (which evidence stronger, whether to lower confidence); distill 3–5 **core insights**; log surprises and remaining gaps. If a gap blocks decision, **return to Step 2** on named sub-problems for more exploration. Per **CRITICAL** choose CLI. Internal pass gate: closed sub-problems?, multi-angle sources?, expose “still open” to user?
141
+
142
+ ### Why
143
+
144
+ **Motto**: Fragments don’t certify—structure certifies.
145
+ **Calibration**: Good synthesis states “what we can decide now”; bad synthesis is summary without choices.
146
+
147
+ ### How to verify
148
+
149
+ - Each insight survives “where is the evidence?”
150
+ - Contradictions named, not buried.
151
+ - When gap list non-empty, pairing action exists (loop Step 2 or tag user-needed data).
152
+
153
+ ---
154
+
155
+ ## Step 4: Structured output (Output)
156
+
157
+ ### What to do
158
+
159
+ **Ensure directories exist**, then write by scenario:
160
+ - If invoked by `/design-system`: `.anws/v{N}/04_SYSTEM_DESIGN/_research/{system-id}-research.md`
161
+ - Standalone: `explore/reports/{YYYYMMDD}_{topic_slug}.md`
162
+
163
+ Disk output must cover these **section responsibilities** (titles may be tweaked slightly—**do not drop a responsibility**): 1 Problems and scope; 2 Core insights; 3 Detailed findings (by sub-question); 4 Idea/option table (if applicable); 5 Recommended actions; 6 Limitations and further exploration; 7 References. When `find-skills` is used, separate Web/doc, harvesting, and items worth persisting to ADR / SYSTEM_DESIGN / TASKS / Workflow. Paragraph density and tables follow the **CRITICAL Exploration report contract** (**this workflow does not paste** a full Markdown sample).
164
+
165
+ ### Why
166
+
167
+ **Motto**: Non-deliverable exploration never happened.
168
+ **Calibration**: Good output lets readers act next step; bad output is raw pile only.
169
+
170
+ ### How to verify
171
+
172
+ - Paths and naming follow this step.
173
+ - All seven responsibility types have material content or explicit `N/A` with reason.
174
+ - References clickable or retrievable.
175
+ - If no skill harvesting occurred, declare it.
176
+
177
+ ---
178
+
179
+ <completion_criteria>
180
+ - [ ] **CRITICAL Method anchor**, **Writing constraints and exploration report contract**, **Triggers + sequential-thinking** followed during execution
181
+ - [ ] Triggers self-checked: question truly warrants explore, or user/design-system/genesis authorized
182
+ - [ ] Outward/inward table applied to sub-problem tagging and loop strategy
183
+ - [ ] Step 2 progress table complete; each sub-question cleared three-check; `find-skills` unavailable did not halt and note exists in report
184
+ - [ ] Step 3 contradiction and gap handling; necessary loops documented
185
+ - [ ] Step 4 report at correct path, seven section responsibilities satisfied, sources traceable (**no** reliance on a long template pasted in this workflow)
186
+ - [ ] No emoji anywhere in document
187
+ </completion_criteria>