arkgate 4.3.0 → 4.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 (51) hide show
  1. package/CHANGELOG.md +36 -10
  2. package/README.md +10 -7
  3. package/bin/ark-check-runtime.mjs +16 -1
  4. package/bin/lib/agent-projection.mjs +1 -1
  5. package/bin/lib/ci-and-commands.mjs +11 -5
  6. package/bin/lib/doctor-plan.mjs +25 -0
  7. package/bin/lib/html-report-advisories.mjs +33 -0
  8. package/bin/lib/html-report-depth.mjs +24 -0
  9. package/bin/lib/improvement-compass-doctor.mjs +106 -0
  10. package/bin/lib/improvement-compass.mjs +630 -0
  11. package/bin/lib/status-manifest.mjs +38 -1
  12. package/dist/index.cjs +33 -33
  13. package/dist/index.d.ts +159 -2
  14. package/dist/index.js +33 -33
  15. package/docs/README.md +6 -5
  16. package/docs/agent-guide.md +20 -4
  17. package/docs/develop.md +6 -3
  18. package/docs/diagnostics.md +1 -1
  19. package/docs/package-surface.md +37 -34
  20. package/docs/product-voice.md +26 -0
  21. package/docs/use.md +37 -1
  22. package/package.json +1 -1
  23. package/schemas/ark.status-manifest.schema.json +26 -0
  24. package/server.json +2 -2
  25. package/templates/agent-skills/README.md +2 -2
  26. package/templates/agent-skills/ark-adopt/SKILL.md +20 -0
  27. package/templates/agent-skills/ark-architect/SKILL.md +21 -1
  28. package/templates/agent-skills/ark-autopilot/SKILL.md +25 -5
  29. package/templates/agent-skills/ark-contract/SKILL.md +20 -0
  30. package/templates/agent-skills/ark-coverage/SKILL.md +20 -0
  31. package/templates/agent-skills/ark-explain/SKILL.md +20 -0
  32. package/templates/agent-skills/ark-explore/SKILL.md +23 -3
  33. package/templates/agent-skills/ark-fix/SKILL.md +22 -2
  34. package/templates/agent-skills/ark-loop/SKILL.md +22 -2
  35. package/templates/agent-skills/ark-place/SKILL.md +20 -0
  36. package/templates/agent-skills/ark-runtime/SKILL.md +7 -0
  37. package/templates/agent-skills/ark-think/SKILL.md +20 -0
  38. package/templates/agent-skills/ark-upgrade/SKILL.md +20 -0
  39. package/templates/skills/ark-adopt.md +20 -0
  40. package/templates/skills/ark-architect.md +21 -1
  41. package/templates/skills/ark-autopilot.md +25 -5
  42. package/templates/skills/ark-contract.md +20 -0
  43. package/templates/skills/ark-coverage.md +20 -0
  44. package/templates/skills/ark-explain.md +20 -0
  45. package/templates/skills/ark-explore.md +23 -3
  46. package/templates/skills/ark-fix.md +22 -2
  47. package/templates/skills/ark-loop.md +22 -2
  48. package/templates/skills/ark-place.md +20 -0
  49. package/templates/skills/ark-runtime.md +7 -0
  50. package/templates/skills/ark-think.md +20 -0
  51. package/templates/skills/ark-upgrade.md +20 -0
@@ -5,6 +5,25 @@ description: Choose the application shape, adopt phase-1 layers, scaffold direct
5
5
 
6
6
  # /ark-architect — Choose your application shape and adopt Ark
7
7
 
8
+ ## Improvement compass (process preflight)
9
+
10
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
11
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
12
+ 0–10 scores or Excellent/Good ranks.
13
+
14
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
15
+
16
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
17
+ are not “architecture finished.”
18
+
19
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
20
+ new files; place before write (`/ark-place` / prepare-write).
21
+
22
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
23
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
24
+
25
+ **Greenfield that is AI-easy day one:** golden norm + thin layers so the next agent turn stays ordered.
26
+
8
27
  ## When / not when
9
28
 
10
29
  | Use `/ark-architect` when… | Do **not** use it when… |
@@ -144,7 +163,7 @@ the same files or weaken the gate.
144
163
  - Default to smallest viable phase 1; unlock phase 2 only when the user describes need.
145
164
  - All user-facing copy is **English**.
146
165
 
147
- ## Merge cards (X04 reshape — judgment only)
166
+ ## Merge cards (physical cohesion reshape — judgment only)
148
167
 
149
168
  When `doctor.physicalCohesion` reports a mirrored concept and the user asks whether files
150
169
  should be **merged**, treat it as domain modeling, never deduplication (field fact: zero
@@ -168,6 +187,7 @@ End with **exactly** these headings (markdown `###`):
168
187
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
169
188
  - **Result:** one-line outcome
170
189
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
190
+ - **Compass:** top residual lenses | `n/a`
171
191
  - **Handoff:** `/ark-…` / CLI / `none`
172
192
  - **Incomplete?** `no` | `yes — <what is missing>`
173
193
 
@@ -16,6 +16,25 @@ fixes you design from reading source (still validate with ark-check, never weake
16
16
  **Not a plan grinder.** Empty `--plan` does **not** mean “architecture is healthy” without
17
17
  the explore pass and dual-plan section B (pattern / Shape bets).
18
18
 
19
+ ## Improvement compass (process preflight)
20
+
21
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
22
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
23
+ 0–10 scores or Excellent/Good ranks.
24
+
25
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
26
+
27
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
28
+ are not “architecture finished.”
29
+
30
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
31
+ new files; place before write (`/ark-place` / prepare-write).
32
+
33
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
34
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
35
+
36
+ **Guided vibe path:** phase 0 = doctor + compass residual. Shape only with user OK. Never script “done” while residual lenses remain.
37
+
19
38
  ## When / not when
20
39
 
21
40
  | Use `/ark-autopilot` when… | Do **not** use it when… |
@@ -23,10 +42,10 @@ the explore pass and dual-plan section B (pattern / Shape bets).
23
42
  | “Make architecture sound” end-to-end | Map only, no apply → `/ark-explore` |
24
43
  | Brownfield or greenfield with apply | Only fitness numbers → `/ark-coverage` |
25
44
  | User wants A + B planned and A executed | Single edge fix → `/ark-fix`; plan A only → `/ark-loop` |
26
- | **Apply half of Q01 post-green path** (after explore map / when user wants full apply) | Skipping explore when doctor primary is Shape map-first |
45
+ | **Apply half of post-green Shape path** (after explore map / when user wants full apply) | Skipping explore when doctor primary is Shape map-first |
27
46
  | Spaghetti under ENFORCE: Shape work with user ok on B | Contract false-green first → `/ark-adopt` / `/ark-contract` STOP paths |
28
47
 
29
- **Q01:** doctor’s single door is `/ark-explore` shape-focus → dual-plan B, **then** this skill only
48
+ **Post-green door:** doctor’s single door is `/ark-explore` shape-focus → dual-plan B, **then** this skill only
30
49
  to apply B with OK. Prefer that order when `postGreenPath` / design-weak is the primary residual.
31
50
 
32
51
  ## Related onboarding
@@ -54,10 +73,10 @@ decision-grade explore pass **and** without opening violating files.
54
73
  4. **Open every file** in plan A `steps[]` (and `target` if present) before classifying a fix.
55
74
  5. **“Así te lo re-soluciono”** for each A cluster and each B pattern bet.
56
75
  6. Apply A → re-run ark-check → rollback on regression. **Never auto-apply B** as mechanical-safe.
57
- 7. **Q04 pilot loop for B:** when design-weak, take **`pilotLoop.nextPilot`** (one extraction card)
76
+ 7. **One-pilot loop for B:** when design-weak, take **`pilotLoop.nextPilot`** (one extraction card)
58
77
  → apply **only** that pilot with user OK → **re-doctor**. Never multi-pilot batch B; residual
59
78
  outside the pilot may remain and must not be called “healthy finished.”
60
- 8. **Y01 reshape verdicts:** read `doctor.physicalCohesion.reshapeDecisions` before acting on
79
+ 8. **Reshape decision memory:** read `doctor.physicalCohesion.reshapeDecisions` before acting on
61
80
  mirror facts. Outcome first: a current rejected/deferred verdict means “intentional/deferred
62
81
  layout — no pilot”; never reconstruct that dead card from `findings`. When the user accepts,
63
82
  defers, or rejects a live card, persist its exact `decisionTarget` with a non-empty reason and
@@ -199,7 +218,7 @@ Status lights from doctor — not settings you choose. Rank residual honestly:
199
218
  populated cores are `optional: true`, run `ark-check --ratchet-cores` then `--doctor`.
200
219
  Never ratchet while active violations remain or false-green gap is open.
201
220
 
202
- ## Mechanical-edit hygiene (Y04 — outcome gate)
221
+ ## Mechanical-edit hygiene (outcome gate)
203
222
 
204
223
  - Header injection must **merge into the existing doc comment**; the kept result has one `/**`, not stacked headers.
205
224
  - Route completion or movement must **preserve the original typed `defineRoute<…>(opts, handler)` call**; reconstruct that call instead of extracting untyped opts/handler constants that drop generics or contextual typing.
@@ -235,6 +254,7 @@ End with **exactly** these headings (markdown `###`):
235
254
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
236
255
  - **Result:** one-line outcome
237
256
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
257
+ - **Compass:** top residual lenses | `n/a`
238
258
  - **Handoff:** `/ark-…` / CLI / `none`
239
259
  - **Incomplete?** `no` | `yes — <what is missing>`
240
260
 
@@ -5,6 +5,25 @@ description: Safely edit ark.config.json layers/rules and arkrules/* (structure
5
5
 
6
6
  # /ark-contract — Change the architecture contract (safely)
7
7
 
8
+ ## Improvement compass (process preflight)
9
+
10
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
11
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
12
+ 0–10 scores or Excellent/Good ranks.
13
+
14
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
15
+
16
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
17
+ are not “architecture finished.”
18
+
19
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
20
+ new files; place before write (`/ark-place` / prepare-write).
21
+
22
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
23
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
24
+
25
+ **Contract edits are last resort.** Policy-delta honesty; do not weaken rules to clear compass residual.
26
+
8
27
  ## When / not when
9
28
 
10
29
  | Use `/ark-contract` when… | Do **not** use it when… |
@@ -129,6 +148,7 @@ End with **exactly** these headings (markdown `###`):
129
148
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
130
149
  - **Result:** one-line outcome
131
150
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
151
+ - **Compass:** top residual lenses | `n/a`
132
152
  - **Handoff:** `/ark-…` / CLI / `none`
133
153
  - **Incomplete?** `no` | `yes — <what is missing>`
134
154
 
@@ -11,6 +11,25 @@ what adoption gaps remain. Work autonomously. End with a ranked fitness report.
11
11
  **This is not `/ark-explore`.** You do **not** produce a multi-pattern dual-plan or spaghetti
12
12
  Shape ladder by default. If the tree is design-weak under ENFORCE, **handoff** to explore.
13
13
 
14
+ ## Improvement compass (process preflight)
15
+
16
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
17
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
18
+ 0–10 scores or Excellent/Good ranks.
19
+
20
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
21
+
22
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
23
+ are not “architecture finished.”
24
+
25
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
26
+ new files; place before write (`/ark-place` / prepare-write).
27
+
28
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
29
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
30
+
31
+ **Fitness numbers + handoff** when residual lenses are non-empty — never call coverage “done architecture.”
32
+
14
33
  ## When / not when
15
34
 
16
35
  | Use `/ark-coverage` when… | Do **not** use it when… |
@@ -160,6 +179,7 @@ End with **exactly** these headings (markdown `###`):
160
179
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
161
180
  - **Result:** one-line outcome
162
181
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
182
+ - **Compass:** top residual lenses | `n/a`
163
183
  - **Handoff:** `/ark-…` / CLI / `none`
164
184
  - **Incomplete?** `no` | `yes — <what is missing>`
165
185
 
@@ -7,6 +7,25 @@ description: Explain this project's architecture in plain language and generate
7
7
 
8
8
  The user wants to understand the architecture, a specific rule, or why the gate blocked them.
9
9
 
10
+ ## Improvement compass (process preflight)
11
+
12
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
13
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
14
+ 0–10 scores or Excellent/Good ranks.
15
+
16
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
17
+
18
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
19
+ are not “architecture finished.”
20
+
21
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
22
+ new files; place before write (`/ark-place` / prepare-write).
23
+
24
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
25
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
26
+
27
+ **Tour by lenses** (teach, not score). Prefer showcase HTML + doctor compass section when explaining residual.
28
+
10
29
  ## When / not when
11
30
 
12
31
  | Use `/ark-explain` when… | Do **not** use it when… |
@@ -200,6 +219,7 @@ End with **exactly** these headings (markdown `###`):
200
219
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
201
220
  - **Result:** one-line outcome (include `ark-report.html` path; note if browser open was attempted)
202
221
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
222
+ - **Compass:** top residual lenses | `n/a`
203
223
  - **Handoff:** `/ark-…` / CLI / `none`
204
224
  - **Incomplete?** `no` | `yes — <what is missing>`
205
225
 
@@ -15,17 +15,36 @@ install hooks, examples/starters, and coupling evidence. Output is **decision-gr
15
15
  ranked residual that changes the next command — **not** a celebration of ENFORCE and
16
16
  **not** a paraphrase of README/ROADMAP.
17
17
 
18
+ ## Improvement compass (process preflight)
19
+
20
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
21
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
22
+ 0–10 scores or Excellent/Good ranks.
23
+
24
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
25
+
26
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
27
+ are not “architecture finished.”
28
+
29
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
30
+ new files; place before write (`/ark-place` / prepare-write).
31
+
32
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
33
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
34
+
35
+ **Map residual lenses → dual-plan B seeds.** Plain Align / Stabilize / Shape from compass + design-weak — not a scorecard.
36
+
18
37
  ## When / not when
19
38
 
20
39
  | Use `/ark-explore` when… | Do **not** use it when… |
21
40
  |--------------------------|-------------------------|
22
41
  | Map / “what next?” / residual after ENFORCE | User wants edits applied → `/ark-autopilot` or `/ark-fix` |
23
- | **Primary post-green door (Q01):** messy / spaghetti / design-weak / “clarify for AI” | Skill-shopping coverage or think for the same residual |
42
+ | **Primary post-green door:** messy / spaghetti / design-weak / “clarify for AI” | Skill-shopping coverage or think for the same residual |
24
43
  | Spaghetti brownfield: patterns concurrent, design-weak under green check | Only “governed% + gates installed?” numbers → `/ark-coverage` |
25
44
  | Dual-plan **seed** (A remediation + B pattern bets) without applying | One design trade-off between 2–3 options already mapped → `/ark-think` |
26
45
  | Path-correct vs design-correct honesty | Plain-language tour / HTML report → `/ark-explain` |
27
46
 
28
- **Q01 single path:** when doctor `postGreenPath` / ENFORCE · design-weak is active, **this skill
47
+ **Post-green single path:** when doctor `postGreenPath` / ENFORCE · design-weak is active, **this skill
29
48
  (shape-focus / dual-plan seed) is the map half of the one door** — then `/ark-autopilot` only
30
49
  to apply B with user OK. Do not send the user to coverage or think as equal first choices.
31
50
 
@@ -278,7 +297,7 @@ ENFORCE without Shape progress is **`ENFORCE · design-weak`** — say that out
278
297
  **Extraction card** (for each I/O / god-module B bet — judgment, never mechanical-safe).
279
298
  Canonical productized template also in `docs/brownfield-adoption.md` §6.
280
299
 
281
- **Q04 pilot loop:** when doctor/plan JSON is available, use **`pilotLoop.nextPilot`** as the
300
+ **One-pilot loop:** when doctor/plan JSON is available, use **`pilotLoop.nextPilot`** as the
282
301
  **single** next extraction card (one pilot at a time → re-doctor). Do not open five B bets
283
302
  in parallel. When `pilotLoop.queuedBets > 0`, those bets stay **queued**, not concurrent.
284
303
  `multiPilotBatchForbidden` / `autoApplyForbidden` (alias `autoApplyPlanBForbidden`) are hard
@@ -370,6 +389,7 @@ End with **exactly** these headings (markdown `###`):
370
389
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
371
390
  - **Result:** one-line outcome
372
391
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
392
+ - **Compass:** top residual lenses | `n/a`
373
393
  - **Handoff:** `/ark-…` / CLI / `none`
374
394
  - **Incomplete?** `no` | `yes — <what is missing>`
375
395
 
@@ -9,6 +9,25 @@ You fix violations Ark reports. Prefer structural fixes over silencing the gate.
9
9
  **Read the surrounding product code** (callers, package role, feature ownership) — not only
10
10
  the two files on the violation edge.
11
11
 
12
+ ## Improvement compass (process preflight)
13
+
14
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
15
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
16
+ 0–10 scores or Excellent/Good ranks.
17
+
18
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
19
+
20
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
21
+ are not “architecture finished.”
22
+
23
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
24
+ new files; place before write (`/ark-place` / prepare-write).
25
+
26
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
27
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
28
+
29
+ **Name residual lenses** on each cluster (SoC, DIP, coupling, …). Still no weaken-gate to clear a lens.
30
+
12
31
  ## When / not when
13
32
 
14
33
  | Use `/ark-fix` when… | Do **not** use it when… |
@@ -147,14 +166,14 @@ If the “fix” is really a missing business intent or Domain home for a rule:
147
166
  - Prefer mechanical-safe kinds when the plan tags them; otherwise design judgment carefully.
148
167
  - Code only — no DB migrations unless user asked.
149
168
 
150
- ## Mechanical-edit hygiene (Y04 — outcome gate)
169
+ ## Mechanical-edit hygiene (outcome gate)
151
170
 
152
171
  - Header injection must **merge into the existing doc comment**; the kept result has one `/**`, not stacked headers.
153
172
  - Route completion or movement must **preserve the original typed `defineRoute<…>(opts, handler)` call**; reconstruct that call instead of extracting untyped opts/handler constants that drop generics or contextual typing.
154
173
  - A convention-only `*-data.ts` stub is not a fix: move the real code or **leave the placeholder file uncreated**; never write `import "server-only"; export {}` as an empty naming token.
155
174
  - Keep the edit only when the **previously clean file stays typecheck-clean**. Otherwise roll it back and treat the change as judgment.
156
175
 
157
- ## Reshape findings (X04 — never mechanical)
176
+ ## Reshape findings (physical cohesion — never mechanical)
158
177
 
159
178
  If `doctor.physicalCohesion` fires while you fix: do **not** fold reshape moves into your fix
160
179
  batch. Physical moves run only through `/ark-loop`'s one-pilot loop; merge decisions only as
@@ -178,6 +197,7 @@ End with **exactly** these headings (markdown `###`):
178
197
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
179
198
  - **Result:** one-line outcome
180
199
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
200
+ - **Compass:** top residual lenses | `n/a`
181
201
  - **Handoff:** `/ark-…` / CLI / `none`
182
202
  - **Incomplete?** `no` | `yes — <what is missing>`
183
203
 
@@ -12,6 +12,25 @@ Deterministic kinds stay **tight**. Your job is still **exploratory on the files
12
12
  importers/targets, see if the plan step is a symptom of wrong shape / false Domain / I/O
13
13
  under Application — escalate to `/ark-contract` or `/ark-explore` when the wall is structural.
14
14
 
15
+ ## Improvement compass (process preflight)
16
+
17
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
18
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
19
+ 0–10 scores or Excellent/Good ranks.
20
+
21
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
22
+
23
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
24
+ are not “architecture finished.”
25
+
26
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
27
+ new files; place before write (`/ark-place` / prepare-write).
28
+
29
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
30
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
31
+
32
+ **Lens language on each cluster** while looping edges; residual shape lenses hand off to explore/autopilot.
33
+
15
34
  ## When / not when
16
35
 
17
36
  | Use `/ark-loop` when… | Do **not** use it when… |
@@ -113,14 +132,14 @@ feature dirs, plan clusters), you **may** dispatch **subagents**:
113
132
 
114
133
  Never auto: free value uses of imports, multi-import files, dynamic import/require, forbidden globals, cycles, port-proof inject, multi-file adapter scaffolding without proof.
115
134
 
116
- ## Mechanical-edit hygiene (Y04 — outcome gate)
135
+ ## Mechanical-edit hygiene (outcome gate)
117
136
 
118
137
  - Header injection must **merge into the existing doc comment**; the kept result has one `/**`, not stacked headers.
119
138
  - Route completion or movement must **preserve the original typed `defineRoute<…>(opts, handler)` call**; reconstruct that call instead of extracting untyped opts/handler constants that drop generics or contextual typing.
120
139
  - A convention-only `*-data.ts` stub is not a fix: move the real code or **leave the placeholder file uncreated**; never write `import "server-only"; export {}` as an empty naming token.
121
140
  - Keep the edit only when the **previously clean file stays typecheck-clean**. Otherwise roll it back and treat the change as judgment.
122
141
 
123
- ## Reshape pilots (X04 — physical cohesion, advisory)
142
+ ## Reshape pilots (physical cohesion — physical cohesion, advisory)
124
143
 
125
144
  When `ark-check --doctor --json` carries `doctor.physicalCohesion.reshapePilot.nextPilot`,
126
145
  you may run **that one pilot** — never more:
@@ -173,6 +192,7 @@ End with **exactly** these headings (markdown `###`):
173
192
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
174
193
  - **Result:** one-line outcome
175
194
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
195
+ - **Compass:** top residual lenses | `n/a`
176
196
  - **Handoff:** `/ark-…` / CLI / `none`
177
197
  - **Incomplete?** `no` | `yes — <what is missing>`
178
198
 
@@ -5,6 +5,25 @@ description: "Where does new code go? Names the layer, directory, and naming for
5
5
 
6
6
  # /ark-place — Where does this code go?
7
7
 
8
+ ## Improvement compass (process preflight)
9
+
10
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
11
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
12
+ 0–10 scores or Excellent/Good ranks.
13
+
14
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
15
+
16
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
17
+ are not “architecture finished.”
18
+
19
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
20
+ new files; place before write (`/ark-place` / prepare-write).
21
+
22
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
23
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
24
+
25
+ **Where so the AI doesn’t mess up next time** — golden pattern + layer home before the write.
26
+
8
27
  ## When / not when
9
28
 
10
29
  | Use `/ark-place` when… | Do **not** use it when… |
@@ -155,6 +174,7 @@ End with **exactly** these headings (markdown `###`):
155
174
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
156
175
  - **Result:** one-line outcome
157
176
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
177
+ - **Compass:** top residual lenses | `n/a`
158
178
  - **Handoff:** `/ark-…` / CLI / `none`
159
179
  - **Incomplete?** `no` | `yes — <what is missing>`
160
180
 
@@ -15,6 +15,12 @@ and NestJS adapters. The stable `arkgate` package is the architecture gate; it d
15
15
  the runtime implementation. This skill migrates hand-rolled versions of those to the kernel,
16
16
  one feature at a time.
17
17
 
18
+ ## Improvement compass note
19
+
20
+ This skill is **experimental runtime** only. Do **not** treat runtime adoption as residual on the
21
+ resilience lens unless the user explicitly opts into the experimental kernel. Prefer doctor compass
22
+ for static architecture residual; hand static residual to `/ark-explore` / `/ark-fix`.
23
+
18
24
  ## Dual engine (mandatory)
19
25
 
20
26
  | Engine | Role |
@@ -113,6 +119,7 @@ End with **exactly** these headings (markdown `###`):
113
119
  - **Sensor:** commands/tools run
114
120
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
115
121
  - **Result:** one-line outcome
122
+ - **Compass:** `n/a` (runtime skill; static residual → explore/fix) | top residual if doctor was run
116
123
  - **Handoff:** `/ark-…` / CLI / `none`
117
124
  - **Incomplete?** `no` | `yes — <what is missing>`
118
125
 
@@ -9,6 +9,25 @@ You are the user's architecture thinking partner **inside** the project's Ark co
9
9
  This skill does **not** call any LLM API from the arkgate package. **You** (the host agent)
10
10
  reason; the write-gate and CI remain deterministic.
11
11
 
12
+ ## Improvement compass (process preflight)
13
+
14
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
15
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
16
+ 0–10 scores or Excellent/Good ranks.
17
+
18
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
19
+
20
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
21
+ are not “architecture finished.”
22
+
23
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
24
+ new files; place before write (`/ark-place` / prepare-write).
25
+
26
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
27
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
28
+
29
+ **2–3 options labeled by lens impact** (what residual improves / what stays out-of-scope).
30
+
12
31
  ## When / not when
13
32
 
14
33
  | Use `/ark-think` when… | Do **not** use it when… |
@@ -126,6 +145,7 @@ End with **exactly** these headings (markdown `###`):
126
145
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
127
146
  - **Result:** one-line outcome
128
147
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
148
+ - **Compass:** top residual lenses | `n/a`
129
149
  - **Handoff:** `/ark-…` / CLI / `none`
130
150
  - **Incomplete?** `no` | `yes — <what is missing>`
131
151
 
@@ -13,6 +13,25 @@ For greenfield onboarding, start with `/ark-architect` (or
13
13
  `ark-check --recommend`); for a brownfield repository, use `/ark-adopt` before
14
14
  this upgrade flow.
15
15
 
16
+ ## Improvement compass (process preflight)
17
+
18
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
19
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
20
+ 0–10 scores or Excellent/Good ranks.
21
+
22
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
23
+
24
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
25
+ are not “architecture finished.”
26
+
27
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
28
+ new files; place before write (`/ark-place` / prepare-write).
29
+
30
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
31
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
32
+
33
+ **After upgrade:** refresh projection; re-doctor; compass residual still drives process, not scores.
34
+
16
35
  ## Dual engine (mandatory)
17
36
 
18
37
  Use the semantic sensor (`ark-check --doctor --json` plus the strict contract
@@ -211,6 +230,7 @@ End with exactly this structure:
211
230
  - **Deferred hosts:** `none` or host plus future action
212
231
  - **Result:** old → new version and managed-upgrade outcome
213
232
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
233
+ - **Compass:** top residual lenses | `n/a`
214
234
  - **Handoff:** `/ark-…`, CLI action, or `none`
215
235
  - **Incomplete?** `no` or `yes — <missing work>`
216
236
 
@@ -12,6 +12,25 @@ with a burn-down. A green check over a wrong contract is a **false green**.
12
12
  spaghetti “ENFORCE · design-weak”. Always end with dual-plan **B** seeds (or handoff explore)
13
13
  when design smells remain after the contract is honest.
14
14
 
15
+ ## Improvement compass (process preflight)
16
+
17
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
18
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
19
+ 0–10 scores or Excellent/Good ranks.
20
+
21
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
22
+
23
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
24
+ are not “architecture finished.”
25
+
26
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
27
+ new files; place before write (`/ark-place` / prepare-write).
28
+
29
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
30
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
31
+
32
+ **Spaghetti → honest contract.** SoC/DIP false-green STOP paths in plain language; residual lenses stay Incomplete until mapped.
33
+
15
34
  ## When / not when
16
35
 
17
36
  | Use `/ark-adopt` when… | Do **not** use it when… |
@@ -164,6 +183,7 @@ End with **exactly** these headings (markdown `###`):
164
183
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
165
184
  - **Result:** one-line outcome
166
185
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
186
+ - **Compass:** top residual lenses | `n/a`
167
187
  - **Handoff:** `/ark-…` / CLI / `none`
168
188
  - **Incomplete?** `no` | `yes — <what is missing>`
169
189
 
@@ -5,6 +5,25 @@ description: Choose the application shape, adopt phase-1 layers, scaffold direct
5
5
 
6
6
  # /ark-architect — Choose your application shape and adopt Ark
7
7
 
8
+ ## Improvement compass (process preflight)
9
+
10
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
11
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
12
+ 0–10 scores or Excellent/Good ranks.
13
+
14
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
15
+
16
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
17
+ are not “architecture finished.”
18
+
19
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
20
+ new files; place before write (`/ark-place` / prepare-write).
21
+
22
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
23
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
24
+
25
+ **Greenfield that is AI-easy day one:** golden norm + thin layers so the next agent turn stays ordered.
26
+
8
27
  ## When / not when
9
28
 
10
29
  | Use `/ark-architect` when… | Do **not** use it when… |
@@ -144,7 +163,7 @@ the same files or weaken the gate.
144
163
  - Default to smallest viable phase 1; unlock phase 2 only when the user describes need.
145
164
  - All user-facing copy is **English**.
146
165
 
147
- ## Merge cards (X04 reshape — judgment only)
166
+ ## Merge cards (physical cohesion reshape — judgment only)
148
167
 
149
168
  When `doctor.physicalCohesion` reports a mirrored concept and the user asks whether files
150
169
  should be **merged**, treat it as domain modeling, never deduplication (field fact: zero
@@ -168,6 +187,7 @@ End with **exactly** these headings (markdown `###`):
168
187
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
169
188
  - **Result:** one-line outcome
170
189
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
190
+ - **Compass:** top residual lenses | `n/a`
171
191
  - **Handoff:** `/ark-…` / CLI / `none`
172
192
  - **Incomplete?** `no` | `yes — <what is missing>`
173
193
 
@@ -16,6 +16,25 @@ fixes you design from reading source (still validate with ark-check, never weake
16
16
  **Not a plan grinder.** Empty `--plan` does **not** mean “architecture is healthy” without
17
17
  the explore pass and dual-plan section B (pattern / Shape bets).
18
18
 
19
+ ## Improvement compass (process preflight)
20
+
21
+ When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
22
+ Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
23
+ 0–10 scores or Excellent/Good ranks.
24
+
25
+ **What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
26
+
27
+ **Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
28
+ are not “architecture finished.”
29
+
30
+ **AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
31
+ new files; place before write (`/ark-place` / prepare-write).
32
+
33
+ **Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
34
+ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
35
+
36
+ **Guided vibe path:** phase 0 = doctor + compass residual. Shape only with user OK. Never script “done” while residual lenses remain.
37
+
19
38
  ## When / not when
20
39
 
21
40
  | Use `/ark-autopilot` when… | Do **not** use it when… |
@@ -23,10 +42,10 @@ the explore pass and dual-plan section B (pattern / Shape bets).
23
42
  | “Make architecture sound” end-to-end | Map only, no apply → `/ark-explore` |
24
43
  | Brownfield or greenfield with apply | Only fitness numbers → `/ark-coverage` |
25
44
  | User wants A + B planned and A executed | Single edge fix → `/ark-fix`; plan A only → `/ark-loop` |
26
- | **Apply half of Q01 post-green path** (after explore map / when user wants full apply) | Skipping explore when doctor primary is Shape map-first |
45
+ | **Apply half of post-green Shape path** (after explore map / when user wants full apply) | Skipping explore when doctor primary is Shape map-first |
27
46
  | Spaghetti under ENFORCE: Shape work with user ok on B | Contract false-green first → `/ark-adopt` / `/ark-contract` STOP paths |
28
47
 
29
- **Q01:** doctor’s single door is `/ark-explore` shape-focus → dual-plan B, **then** this skill only
48
+ **Post-green door:** doctor’s single door is `/ark-explore` shape-focus → dual-plan B, **then** this skill only
30
49
  to apply B with OK. Prefer that order when `postGreenPath` / design-weak is the primary residual.
31
50
 
32
51
  ## Related onboarding
@@ -54,10 +73,10 @@ decision-grade explore pass **and** without opening violating files.
54
73
  4. **Open every file** in plan A `steps[]` (and `target` if present) before classifying a fix.
55
74
  5. **“Así te lo re-soluciono”** for each A cluster and each B pattern bet.
56
75
  6. Apply A → re-run ark-check → rollback on regression. **Never auto-apply B** as mechanical-safe.
57
- 7. **Q04 pilot loop for B:** when design-weak, take **`pilotLoop.nextPilot`** (one extraction card)
76
+ 7. **One-pilot loop for B:** when design-weak, take **`pilotLoop.nextPilot`** (one extraction card)
58
77
  → apply **only** that pilot with user OK → **re-doctor**. Never multi-pilot batch B; residual
59
78
  outside the pilot may remain and must not be called “healthy finished.”
60
- 8. **Y01 reshape verdicts:** read `doctor.physicalCohesion.reshapeDecisions` before acting on
79
+ 8. **Reshape decision memory:** read `doctor.physicalCohesion.reshapeDecisions` before acting on
61
80
  mirror facts. Outcome first: a current rejected/deferred verdict means “intentional/deferred
62
81
  layout — no pilot”; never reconstruct that dead card from `findings`. When the user accepts,
63
82
  defers, or rejects a live card, persist its exact `decisionTarget` with a non-empty reason and
@@ -199,7 +218,7 @@ Status lights from doctor — not settings you choose. Rank residual honestly:
199
218
  populated cores are `optional: true`, run `ark-check --ratchet-cores` then `--doctor`.
200
219
  Never ratchet while active violations remain or false-green gap is open.
201
220
 
202
- ## Mechanical-edit hygiene (Y04 — outcome gate)
221
+ ## Mechanical-edit hygiene (outcome gate)
203
222
 
204
223
  - Header injection must **merge into the existing doc comment**; the kept result has one `/**`, not stacked headers.
205
224
  - Route completion or movement must **preserve the original typed `defineRoute<…>(opts, handler)` call**; reconstruct that call instead of extracting untyped opts/handler constants that drop generics or contextual typing.
@@ -235,6 +254,7 @@ End with **exactly** these headings (markdown `###`):
235
254
  - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
236
255
  - **Result:** one-line outcome
237
256
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
257
+ - **Compass:** top residual lenses | `n/a`
238
258
  - **Handoff:** `/ark-…` / CLI / `none`
239
259
  - **Incomplete?** `no` | `yes — <what is missing>`
240
260