arkgate 4.6.0 → 4.6.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 (75) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/README.md +9 -5
  3. package/bin/ark-check-runtime.mjs +98 -7
  4. package/bin/ark-mcp-runtime.mjs +17 -1
  5. package/bin/ark.mjs +5 -3
  6. package/bin/lib/agent-projection.mjs +1 -1
  7. package/bin/lib/analysis-engine.mjs +3 -3
  8. package/bin/lib/ci-and-commands.mjs +11 -11
  9. package/bin/lib/config-contract.mjs +2 -0
  10. package/bin/lib/contract-smells.mjs +5 -5
  11. package/bin/lib/design-smells.mjs +1 -1
  12. package/bin/lib/doctor-advisories.mjs +9 -0
  13. package/bin/lib/doctor-plan.mjs +4 -4
  14. package/bin/lib/field-install.mjs +1 -1
  15. package/bin/lib/html-report-advisories.mjs +20 -0
  16. package/bin/lib/improvement-compass-map.mjs +20 -20
  17. package/bin/lib/pilot-loop.mjs +1 -1
  18. package/bin/lib/post-green-path.mjs +2 -2
  19. package/bin/lib/prepare-change.mjs +9 -0
  20. package/bin/lib/product-copy.mjs +1 -1
  21. package/bin/lib/status-command.mjs +14 -0
  22. package/bin/lib/status-manifest.mjs +17 -0
  23. package/bin/lib/team-parliament-io.mjs +338 -0
  24. package/bin/lib/team-parliament.mjs +383 -0
  25. package/bin/lib/upgrade-whats-new.mjs +16 -0
  26. package/bin/lib/violations.mjs +8 -4
  27. package/dist/{configTypes-CC0FEXoF.d.ts → configTypes-B8uIcLaG.d.ts} +5 -0
  28. package/dist/eslint/index.cjs +2 -2
  29. package/dist/eslint/index.d.ts +1 -1
  30. package/dist/eslint/index.js +2 -2
  31. package/dist/index.cjs +19 -19
  32. package/dist/index.d.ts +61 -2
  33. package/dist/index.js +22 -22
  34. package/docs/README.md +5 -5
  35. package/docs/agent-guide.md +21 -17
  36. package/docs/configuration.md +36 -2
  37. package/docs/develop.md +13 -1
  38. package/docs/enthusiast/README.md +1 -1
  39. package/docs/enthusiast/how-to-agent-gates.md +3 -3
  40. package/docs/enthusiast/how-to-pick-shape.md +2 -2
  41. package/docs/enthusiast/tutorial-first-project.md +4 -3
  42. package/docs/package-surface.md +5 -3
  43. package/docs/product-voice.md +48 -10
  44. package/docs/use.md +6 -1
  45. package/package.json +2 -2
  46. package/schemas/ark.config.schema.json +9 -0
  47. package/schemas/ark.status-manifest.schema.json +51 -0
  48. package/server.json +3 -3
  49. package/templates/agent-skills/README.md +1 -1
  50. package/templates/agent-skills/ark-adopt/SKILL.md +46 -19
  51. package/templates/agent-skills/ark-architect/SKILL.md +24 -145
  52. package/templates/agent-skills/ark-autopilot/SKILL.md +40 -30
  53. package/templates/agent-skills/ark-contract/SKILL.md +21 -105
  54. package/templates/agent-skills/ark-coverage/SKILL.md +3 -0
  55. package/templates/agent-skills/ark-explain/SKILL.md +7 -4
  56. package/templates/agent-skills/ark-explore/SKILL.md +25 -17
  57. package/templates/agent-skills/ark-fix/SKILL.md +34 -157
  58. package/templates/agent-skills/ark-loop/SKILL.md +31 -153
  59. package/templates/agent-skills/ark-place/SKILL.md +25 -13
  60. package/templates/agent-skills/ark-runtime/SKILL.md +3 -3
  61. package/templates/agent-skills/ark-think/SKILL.md +5 -2
  62. package/templates/agent-skills/ark-upgrade/SKILL.md +11 -7
  63. package/templates/skills/ark-adopt.md +46 -19
  64. package/templates/skills/ark-architect.md +24 -145
  65. package/templates/skills/ark-autopilot.md +40 -30
  66. package/templates/skills/ark-contract.md +21 -105
  67. package/templates/skills/ark-coverage.md +3 -0
  68. package/templates/skills/ark-explain.md +7 -4
  69. package/templates/skills/ark-explore.md +25 -17
  70. package/templates/skills/ark-fix.md +34 -157
  71. package/templates/skills/ark-loop.md +31 -153
  72. package/templates/skills/ark-place.md +25 -13
  73. package/templates/skills/ark-runtime.md +3 -3
  74. package/templates/skills/ark-think.md +5 -2
  75. package/templates/skills/ark-upgrade.md +11 -7
@@ -1,40 +1,24 @@
1
1
  ---
2
2
  name: ark-contract
3
- description: Safely edit ark.config.json layers/rules and arkrules/* (structure + invariants); land business rules under the dual plane. Validated with strict ark-check. Deep source evidence required.
3
+ description: Shortcut to /ark-adopt (session 0) or /ark-autopilot (later config tighten). Deprecated as a first-class door.
4
4
  ---
5
5
 
6
- # /ark-contract — Change the architecture contract (safely)
6
+ # /ark-contract — Shortcut to adopt / autopilot
7
7
 
8
- ## Improvement compass (process preflight)
8
+ **Deprecated as a first-class door.** Writing `ark.config.json` / `arkrules/*` is
9
+ **`/ark-adopt`** at session 0 and **`/ark-autopilot`** afterward. Do that job now.
9
10
 
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.
11
+ ## Autonomy contract
13
12
 
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.
13
+ Invoking this leftover name **is** the approval to write an honest config. Do not
14
+ preview-only. Never weaken the architecture config.
26
15
 
27
16
  ## When / not when
28
17
 
29
- | Use `/ark-contract` when… | Do **not** use it when… |
30
- |---------------------------|-------------------------|
31
- | Edit layers/rules/includes/intents with source evidence | Move product code without config change → `/ark-fix` / `/ark-loop` |
32
- | Concentrated-edge / false-green STOP from other skills | Full map without config edit → `/ark-explore` |
33
-
34
- The **one sanctioned way** to change layers/rules/`intentPrefixes`/includes.
35
- Also used to **land mined business rules** into the executable manifest (`ark.config.json` +
36
- intent naming that the project-bound `ark_manifest` tool exposes authoritatively).
37
-
18
+ | Use this leftover name when… | Prefer instead |
19
+ |------------------------------|----------------|
20
+ | Layers / include / ArkRules need an edit | **`/ark-adopt`** (path) or **`/ark-autopilot`** (tighten) |
21
+ | False-green / concentrated edge | **`/ark-adopt`** write the honest config |
38
22
 
39
23
  ## Dual engine (mandatory)
40
24
 
@@ -45,8 +29,6 @@ intent naming that the project-bound `ark_manifest` tool exposes authoritatively
45
29
 
46
30
  The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
47
31
 
48
-
49
-
50
32
  ## MCP workspace binding (mandatory)
51
33
 
52
34
  Before any `ark_*` MCP tool, call `ark_identity` with `project.expectedRoot` set to the exact
@@ -58,90 +40,27 @@ restart/retargeting is required. `ark://manifest` never satisfies this preflight
58
40
 
59
41
  ## Dual plane — layers + ArkRules (mandatory, except /ark-runtime)
60
42
 
61
- ArkGate has **two opt-in planes**. The user chooses which to use; you **always label** findings so they never blur.
62
-
63
- | Plane | What it protects | Where it lives | Sensors / tools |
64
- |-------|------------------|----------------|-----------------|
65
- | **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
66
- | **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
67
-
68
- **Rules for every report / answer:**
69
- 1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
70
- 2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
71
- 3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
72
- 4. Editing `arkrules/*` or promoting modes is **`/ark-contract`**; fixing code under a structure sensor is **`/ark-fix`** / **`/ark-loop`** (judgment, never invent mechanical-safe).
73
- 5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
74
-
75
-
76
- ### Contract + ArkRules
77
- - You own **both** `layers/rules` and `arkRules`/`arkrules/*.json`.
78
- - Report diffs in two blocks: **[Layer] config** and **[ArkRules] files**.
79
- - Promotion ladder: advisory→enforced only with coverage; demote = hash-ack weakening.
43
+ Label findings **`[Layer]`** vs **`[ArkRules]`**. Absence of `arkRules` is valid.
80
44
 
81
45
  ## Subagent fan-out (optional, host-dependent)
82
46
 
83
- If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
84
- dirs to sample), fan out read-only scouts; otherwise **fall back to sequential**.
85
- Parent merges and still emits the **### Completion** contract. Never parallel-write
86
- the same files or weaken the gate.
47
+ If the host supports **parallel subagents**, fan out read-only scouts; otherwise
48
+ **fall back to sequential**. Never weaken the gate.
87
49
 
88
50
  ## Related onboarding
89
51
 
90
- - **Greenfield:** `/ark-architect` or `ark-check --recommend` / `ark start`.
91
- - **Brownfield:** `/ark-adopt` — match contract to reality; do not force a starter preset.
92
- - **Default path:** `ark start` → `/ark-autopilot` → `ark-check --doctor`.
93
-
94
- ## Anti-wrapper rule (mandatory)
95
-
96
- **Forbidden:** editing globs from vibes without reading the directories those globs claim to cover.
97
-
98
- **Required:**
99
- 1. Snapshot before using CLI as **sensor**: coverage + check JSON.
100
- 2. **Read source** in dirs you reclassify (sample files).
101
- 3. **“Así te lo re-soluciono”** — exact JSON fields + which files become governed/ungoverned.
102
- 4. After write: `ark-check --strict-config` must be the validation gate (dead pattern noise is advisory; unclassified + real violations still matter).
103
-
104
- ## What you may edit
105
-
106
- - `include` / `exclude`
107
- - `layers[]` (`name`, `patterns`, `optional`, `forbiddenGlobals`, `intentPrefixes`, layer `exclude`)
108
- - `rules[]` (from/to/allowed)
109
- - **`arkRules` map + `arkrules/<Layer>.json`** (ADR 0012/0014) — structure sensors + invariant catalog;
110
- promote advisory→enforced only with coverage evidence; demote/delete requires hash-bound policy ack
111
- - Never: disable the check, delete CI gates, or add blanket `allowed: true` for a bad edge without a facade design
52
+ - **Greenfield:** `/ark-adopt` or `ark-check --recommend` / `ark start`.
53
+ - **Brownfield:** `/ark-adopt` — match config to reality.
112
54
 
113
55
  ## Steps
114
56
 
115
- 1. **Snapshot** coverage governed%, unclassified samples, current violations.
116
- 2. **Smallest edit** for the user intent:
117
- - New layer + neighbor rules
118
- - Expand patterns for ungoverned dirs (`suggestions` from coverage)
119
- - Facade: public surface patterns more specific than internals
120
- - **Business rules → manifiesto:**
121
- - Add/adjust `intentPrefixes` (`Domain.`, `Application.`, …)
122
- - Point Domain patterns at real pure folders (`**/domain/**`, not bare `**/types.ts`)
123
- - Document proposed intent names for the app to register (kernel) or for agents to use
124
- 3. **Impact** — re-run coverage/check; report before/after governed% and violation delta.
125
- 4. **Rollback** if strict fails for reasons other than pre-existing debt the user accepted.
126
-
127
- ## Operating modes
128
-
129
- Contract edits are most common in **Align (Adapt)**. In **Guard (Enforce)**, treat edits as high-risk product decisions.
130
-
131
- ## Critical handoffs
132
-
133
- - After contract is honest but residual violations remain: **STOP — do not continue this skill as complete.** **STOP — bulk residual debt: invoke /ark-loop or /ark-autopilot** instead of ad-hoc multi-file grinding without a plan.
134
- - New artifact home after reclassify: **STOP — do not continue this skill as complete.** **STOP — new file placement: invoke /ark-place** when the user needs a new artifact home.
135
-
136
- ## Done
137
-
138
- - Diff of `ark.config.json` explained in plain language.
139
- - **Así te lo re-soluciono en el manifiesto** when intents/Domain were part of the request.
140
- - Strict check result captured.
57
+ 1. If the path is missing or lying → execute **`/ark-adopt`**.
58
+ 2. If the path is honest and you are tightening rules → execute **`/ark-autopilot`**.
59
+ 3. `ark-check --strict-config`.
141
60
 
142
61
  ## Completion contract (skill incomplete if missing)
143
62
 
144
- End with **exactly** these headings (markdown `###`):
63
+ Skill incomplete if missing any field below.
145
64
 
146
65
  ### Completion
147
66
  - **Sensor:** commands/tools run
@@ -149,8 +68,5 @@ End with **exactly** these headings (markdown `###`):
149
68
  - **Result:** one-line outcome
150
69
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
151
70
  - **Compass:** top residual lenses | `n/a`
152
- - **Handoff:** `/ark-…` / CLI / `none`
71
+ - **Handoff:** `/ark-adopt` / `/ark-autopilot` / `none`
153
72
  - **Incomplete?** `no` | `yes — <what is missing>`
154
-
155
- If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
156
- **Skill incomplete if missing** any of the bullets above.
@@ -5,6 +5,9 @@ description: Ark adoption fitness audit — governed%, gates, baseline honesty,
5
5
 
6
6
  # /ark-coverage — Ark adoption fitness (not full recon)
7
7
 
8
+ **Shortcut.** Fitness numbers only. Full map / leftover design → **`/ark-explore`**.
9
+ Apply → **`/ark-autopilot`**. Session 0 → **`/ark-adopt`**. This is not `/ark-explore`.
10
+
8
11
  You audit **how this repo uses ArkGate** (coverage, gates, baseline, host write path) and
9
12
  what adoption gaps remain. Work autonomously. End with a ranked fitness report.
10
13
 
@@ -5,6 +5,9 @@ description: Explain this project's architecture in plain language and generate
5
5
 
6
6
  # /ark-explain — Understand this project's architecture
7
7
 
8
+ **Shortcut.** Teach / HTML tour only. Map → **`/ark-explore`**. Apply → **`/ark-autopilot`**.
9
+ Session 0 → **`/ark-adopt`**.
10
+
8
11
  The user wants to understand the architecture, a specific rule, or why the gate blocked them.
9
12
 
10
13
  ## Improvement compass (process preflight)
@@ -31,7 +34,7 @@ patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement f
31
34
  | Use `/ark-explain` when… | Do **not** use it when… |
32
35
  |--------------------------|-------------------------|
33
36
  | Plain-language tour of layers/rules/report | Decision-grade recon / dual-plan → `/ark-explore` |
34
- | “Why did the gate block me?” pedagogy | Apply fixes → `/ark-fix` / `/ark-autopilot` |
37
+ | “Why did the gate block me?” pedagogy | Apply fixes → `/ark-autopilot` |
35
38
  | Generate / walk HTML showcase report | Fitness numbers only → `/ark-coverage`; brownfield action → `/ark-adopt` |
36
39
  Your job is to **teach with this repo's real data** and leave a shareable visual artifact.
37
40
 
@@ -68,7 +71,7 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
68
71
  1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
69
72
  2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
70
73
  3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
71
- 4. Editing `arkrules/*` or promoting modes is **`/ark-contract`**; fixing code under a structure sensor is **`/ark-fix`** / **`/ark-loop`** (judgment, never invent mechanical-safe).
74
+ 4. Editing `arkrules/*` or applying structure fixes is **`/ark-adopt`** / **`/ark-autopilot`** (never invent `mechanical-safe`).
72
75
  5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
73
76
 
74
77
 
@@ -186,7 +189,7 @@ when residual signals remain.
186
189
  - If a DI/kernel framework border exists, explain public surface vs internals.
187
190
  3. **If asked about a specific rule or block**, answer with: the rule, the consequence it
188
191
  prevents, and the sanctioned fix (usually a port). If they want it fixed now:
189
- **STOP — do not continue this skill as complete.** **STOP — fix requested: invoke /ark-fix.**
192
+ **STOP — do not continue this skill as complete.** **STOP — fix requested:** invoke `/ark-autopilot`.
190
193
  This skill stays read-only.
191
194
  4. **If asked "what's a port/adapter/saga…"**, two sentences + this-repo example or conventional path.
192
195
 
@@ -206,7 +209,7 @@ when residual signals remain.
206
209
 
207
210
  ## Related
208
211
 
209
- - Onboarding: `/ark-architect`, `ark-check --recommend`, `docs/enthusiast/README.md`
212
+ - Onboarding: `/ark-adopt` (or leftover `/ark-architect`), `ark-check --recommend`, `docs/enthusiast/README.md`
210
213
  - Brownfield: `/ark-adopt`, `docs/brownfield-adoption.md`
211
214
  - Autopilot: `/ark-autopilot` after the user understands the contract
212
215
 
@@ -1,13 +1,21 @@
1
1
  ---
2
2
  name: ark-explore
3
- description: Specialized map skill — decision-grade recon of layers + ArkRules opportunities + dual-plan seed (no apply). Primary post-green door when leftover design work remains. Not the default day-to-day path (use doctor + place/gate; guided apply is /ark-autopilot). CLI is a sensor; you read the tree. No gate bypass.
3
+ description: Map skill — decision-grade recon of layers + ArkRules opportunities + dual-plan seed (no apply). Primary post-green door when leftover design work remains. CLI is a sensor; you read the tree. No gate bypass.
4
4
  ---
5
5
 
6
6
  # /ark-explore — Recon the real project (map only)
7
7
 
8
- **Specialized escape**, not the default curriculum. Use when you need a decision-grade map
9
- or the post-green Shape door; hand off to `/ark-autopilot` to apply. Day-to-day place + gate
10
- work does not require this skill.
8
+ ## Autonomy contract
9
+
10
+ Invoking this skill **is** the approval to **map**. Open the real tree. CLI JSON alone is
11
+ incomplete. **Do not write** config or product code (that is `/ark-adopt` / `/ark-autopilot`).
12
+ **CLI budget:** one doctor / coverage; then open ≥12 files across ≥4 dirs; then the map.
13
+
14
+ **Still never:** weaken the config; invent `mechanical-safe` kinds; claim healthy because
15
+ plan A is empty while leftover design work remains.
16
+
17
+ Use when you need a decision-grade map or the **Primary post-green door**; hand off to
18
+ `/ark-autopilot` to apply. Day-to-day place + gate work does not require this skill.
11
19
 
12
20
  You are a **staff engineer doing architecture reconnaissance** on *this* repository.
13
21
  Ark’s CLI is a **sensor** (coverage, doctor, plan). **You** open source, entry points,
@@ -58,15 +66,15 @@ If the consumer tree has a **domain glossary**, prefer its terms for layer/slice
58
66
 
59
67
  | Use `/ark-explore` when… | Do **not** use it when… |
60
68
  |--------------------------|-------------------------|
61
- | Map / “what next?” / residual after ENFORCE | User wants edits applied → `/ark-autopilot` or `/ark-fix` |
69
+ | Map / “what next?” / residual after ENFORCE | User wants edits applied → `/ark-autopilot` |
62
70
  | **Primary post-green door:** messy / leftover design work / “clarify for AI” | Skill-shopping coverage or think for the same leftover work |
63
71
  | Spaghetti brownfield: patterns concurrent, design-weak under green check | Only “governed% + gates installed?” numbers → `/ark-coverage` |
64
72
  | Dual-plan **seed** (A remediation + B pattern bets) without applying | One design trade-off between 2–3 options already mapped → `/ark-think` |
65
73
  | Path-correct vs design-correct honesty | Plain-language tour / HTML report → `/ark-explain` |
66
74
 
67
75
  **Post-green single path:** when doctor `postGreenPath` / ENFORCE · leftover design work is active, **this skill
68
- (shape-focus / dual-plan seed) is the map half of the one door** — then `/ark-autopilot` only
69
- to apply B with user OK. Do not send the user to coverage or think as equal first choices.
76
+ (shape-focus / dual-plan seed) is the map half of the one door** — then `/ark-autopilot`
77
+ applies one B pilot. Do not send the user to coverage or think as equal first choices.
70
78
 
71
79
  ### Status lights (rank residual; not settings)
72
80
 
@@ -82,8 +90,8 @@ to apply B with user OK. Do not send the user to coverage or think as equal firs
82
90
 
83
91
  ## Related onboarding
84
92
 
85
- - **Greenfield / thin tree:** `/ark-architect` or `ark-check --recommend` / `ark start`.
86
- - **Brownfield action (write contract/baseline):** `/ark-adopt` after the map.
93
+ - **Greenfield / thin tree:** `/ark-adopt` or `ark-check --recommend` / `ark start`.
94
+ - **Brownfield action (write config/baseline):** `/ark-adopt` after the map.
87
95
  - **Execute dual plan:** `/ark-autopilot` (explore seeds; autopilot applies A, proposes B).
88
96
  - **Default path:** `ark start` → `ark-check --doctor` → `/ark-autopilot` for guided apply; use this skill for map-only or post-green Shape residual.
89
97
 
@@ -129,7 +137,7 @@ ArkGate has **two opt-in planes**. The user chooses which to use; you **always l
129
137
  1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
130
138
  2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
131
139
  3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
132
- 4. Editing `arkrules/*` or promoting modes is **`/ark-contract`**; fixing code under a structure sensor is **`/ark-fix`** / **`/ark-loop`** (judgment, never invent mechanical-safe).
140
+ 4. Editing `arkrules/*` or applying structure fixes is **`/ark-adopt`** / **`/ark-autopilot`** — explore does not write (never invent `mechanical-safe`).
133
141
  5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
134
142
 
135
143
 
@@ -333,8 +341,8 @@ Empty plan A + design-weak is **not** architecture finished. Plan B is judgment
333
341
  | 1. Confirm residual | `designFitness.designWeak` **or** non-empty `patternBets` / `designSmells` | You would claim healthy finished because plan A is empty |
334
342
  | 2. Pick **one** pilot | `pilotLoop.nextPilot` (preferred) **or** one ranked B bet with a path scope | Multi-pilot batch / “fix all smells this PR” |
335
343
  | 3. Write extraction card | Pilot · Smell · Move · Do not · Success · **Kill-switch** · Next | Missing kill-switch or success signal |
336
- | 4. User OK | Explicit approval before edit (or stay map-only) | Silent auto-apply of plan B |
337
- | 5. Apply **only** that pilot | Via `/ark-autopilot` (apply B) or `/ark-fix` (one cluster) | Opening a second pilot before re-doctor |
344
+ | 4. Stay map-only here | Explore does not edit | Silent auto-apply of plan B |
345
+ | 5. Apply **only** that pilot | Via `/ark-autopilot` (one cluster) | Opening a second pilot before re-doctor |
338
346
  | 6. Re-doctor | Success = reduced evidence on pilot paths; residual outside pilot may remain | Declaring whole-tree done from one pilot |
339
347
 
340
348
  **Hard lines (never break):**
@@ -356,7 +364,7 @@ Do not:
356
364
  - open a second pilot before re-doctor
357
365
  Success: <observable / falsifiable — re-doctor>
358
366
  Kill-switch: <stop condition — e.g. if pilot does not clear smell evidence in 1 PR → stop / re-map>
359
- Next: /ark-autopilot (apply with user ok) | /ark-fix (one cluster) | re-doctor
367
+ Next: /ark-autopilot (apply one pilot) | re-doctor
360
368
  ```
361
369
 
362
370
  When doctor JSON is available, prefer smell `id`s from `designSmells` / `patternBets[].smellId`
@@ -380,10 +388,10 @@ Kinds: `risk` | `false-green` | `debt` | `opportunity` | `shape` | `manifiesto`
380
388
 
381
389
  5. **Field path summary**.
382
390
  6. **Top 3 bets** — first bet = highest leverage residual, even when plan A is empty (design-correct / agent-dx / field honesty — **not** “run loop on zero steps”).
383
- On false-green dominant: **STOP — do not continue this skill as complete.** **STOP — false-green: invoke /ark-adopt or /ark-contract before claiming ENFORCE.** Do not claim goal.met / ENFORCE from type-only cleanup while doctor reports `contract-false-green-io-under-application`.
384
- On concentrated edge dominant: **STOP — do not continue this skill as complete.** **STOP — concentrated edge: invoke /ark-contract with source evidence** (do not freeze a wrong contract or grind N freezes).
391
+ On false-green dominant: **STOP — do not continue this skill as complete.** **STOP — false-green:** name the honesty gap; next door is `/ark-adopt` (write). Do not claim goal.met / ENFORCE from type-only cleanup while doctor reports `contract-false-green-io-under-application`.
392
+ On concentrated edge dominant: **STOP — do not continue this skill as complete.** **STOP — concentrated edge:** name the config smell with source evidence; next door is `/ark-adopt` (do not freeze a wrong config or grind N freezes).
385
393
  7. **Dual-plan seed** — required in dual-plan seed / shape-focus (and when §G auto-upgrades); A + B cap 3–5; extraction cards for I/O bets.
386
- 8. **Deterministic residue** — plan completeness, steps, violations, doctor top action. Point to `/ark-loop` / `/ark-fix` **only when A steps exist**; never call a `partial`/`unavailable` plan met, and never pretend loop is the architecture story when a complete goal is already met.
394
+ 8. **Deterministic residue** — plan completeness, steps, violations, doctor top action. Point to `/ark-autopilot` **when A steps exist**; never call a `partial`/`unavailable` plan met, and never pretend an empty plan is the architecture story when leftover design remains.
387
395
 
388
396
  Optional: **Diff vs naive sensor-only read** (what reading the tree changed).
389
397
 
@@ -397,7 +405,7 @@ Optional: **Diff vs naive sensor-only read** (what reading the tree changed).
397
405
  - When §G fires: phase named, design smells listed with paths, dual-plan B or shape-focus B present.
398
406
  - Every Top-3 / B bet has a **success signal**; new-layer bets have a **kill-switch** + pilot.
399
407
  - Mode respected: no multi-week roadmap in recon mode; dual-plan seed capped at 3–5 B bets.
400
- - Clear handoff: `/ark-adopt` | `/ark-contract` | `/ark-autopilot` | `/ark-loop` | `/ark-fix` | CLI | `stop`.
408
+ - Clear handoff: `/ark-adopt` | `/ark-autopilot` | `/ark-place` | CLI | `stop`.
401
409
  - No gate weakening; no false ENFORCE claim; no README echo as primary content.
402
410
 
403
411
  ## Completion contract (skill incomplete if missing)
@@ -1,81 +1,41 @@
1
1
  ---
2
2
  name: ark-fix
3
- description: Resolve Ark architecture violations at the root cause — read importers and product context, design ports/adapters/moves/intent alignment. Never weaken the contract. CLI only validates.
3
+ description: Shortcut to /ark-autopilot for a small violation cluster. Deprecated as a first-class door.
4
4
  ---
5
5
 
6
- # /ark-fix — Fix architecture violations at the root
6
+ # /ark-fix — Shortcut to /ark-autopilot
7
7
 
8
- You fix violations Ark reports. Prefer structural fixes over silencing the gate.
9
- **Read the surrounding product code** (callers, package role, feature ownership) — not only
10
- the two files on the violation edge.
8
+ **Deprecated as a first-class door.** Gate violations and judgment remediations are
9
+ **`/ark-autopilot`**. Do that job now. CLI only validates.
11
10
 
12
- ## Improvement compass (process preflight)
11
+ ## Autonomy contract
13
12
 
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.
13
+ Invoking this leftover name **is** the approval to write the fix. Open importers,
14
+ design the port/move, apply, `ark-check`. Never weaken the config. Never invent
15
+ `mechanical-safe` kinds.
17
16
 
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
-
31
- ## Deep modules (process)
17
+ ## When / not when
32
18
 
33
- - Prefer fixes that leave a **deep module** at a named **seam** (port in the owning layer; adapter outside).
34
- - Apply the **deletion test** before extracting a layer “just so tests can mock it.”
35
- - After a port/inject fix, **test at the public interface** of the seam (match remediation `nextAction` language), not only private internals.
19
+ | Use this leftover name when… | Prefer instead |
20
+ |------------------------------|----------------|
21
+ | One change / small cluster just failed the gate | **`/ark-autopilot`** |
22
+ | Judgment design for a known violation | Session 0 / false-green → **`/ark-adopt`** |
36
23
 
37
- ## When / not when
24
+ ## Plan B one-pilot checklist (when leftover design, not a single edge)
38
25
 
39
- | Use `/ark-fix` when… | Do **not** use it when… |
40
- |----------------------|-------------------------|
41
- | One change / small cluster just failed the gate | Bulk residual / many edges → `/ark-loop` or `/ark-autopilot` |
42
- | Need a structural fix (port, move, intent rename) | Map residual / pattern Shape plan → `/ark-explore` |
43
- | Judgment design for a known violation | Contract wrong / false-green → STOP to `/ark-contract` / `/ark-adopt` |
44
-
45
- When the fix is really a **Shape** extraction (I/O out of routes, god module split), write an
46
- **extraction card** before editing — same template as `docs/brownfield-adoption.md`
47
- §6 and explore §G. Fixed fields (never mechanical-safe, never silent B apply).
48
-
49
- ### Plan B one-pilot checklist (when Shape residual, not a single edge fix)
50
-
51
- Empty plan A + `designWeak` is **not** architecture finished. One pilot only:
52
-
53
- 1. **Confirm** doctor `designFitness.designWeak` / non-empty `patternBets` (or agent-detected smell).
54
- 2. **One pilot** — prefer `pilotLoop.nextPilot`; never multi-batch concurrent Shape extractions.
55
- 3. **Extraction card** with **Kill-switch** + falsifiable Success (required).
56
- 4. **User OK** before apply — `autoApplyPlanBForbidden` / never mechanical-safe.
57
- 5. **Edit only that pilot scope** — then `ark-check` / re-doctor; residual outside pilot may remain.
58
- 6. **Stop** if kill-switch fires; do not open pilot #2 in the same batch.
59
-
60
- ```text
61
- ### Extraction card
62
- Pilot: <one directory or feature path — or pilotLoop.nextPilot.pilotTarget>
63
- Smell: <doctor designSmells id if present>
64
- Move: <verbatim relocate / split>
65
- Do not: rewrite queries; weaken ark.config; invent mechanical-safe kinds; big-bang; multi-pilot batch
66
- Success: <falsifiable — re-doctor on pilot paths>
67
- Kill-switch: <stop condition — required>
68
- Next: re-run ark-check; shrink baseline if applicable
69
- ```
26
+ Empty plan A + leftover design work is **not** architecture finished. One pilot only.
27
+ Write an **extraction card** (`docs/brownfield-adoption.md` §6) — never mechanical-safe,
28
+ never silent B apply. **Kill-switch** required. `multiPilotBatchForbidden` never
29
+ multi-pilot batch.
70
30
 
71
31
  ## Dual engine (mandatory)
72
32
 
73
33
  | Engine | Role |
74
34
  |--------|------|
75
- | **Deterministic** | Violation list, plan kinds, post-edit `ark-check` |
76
- | **Exploratory** | Why this edge exists in *this* product; better home; manifiesto if the rule is business |
77
-
35
+ | **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
36
+ | **Exploratory** | You open **this** repo's real files and product surface before concluding |
78
37
 
38
+ The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
79
39
 
80
40
  ## MCP workspace binding (mandatory)
81
41
 
@@ -88,89 +48,25 @@ restart/retargeting is required. `ark://manifest` never satisfies this preflight
88
48
 
89
49
  ## Dual plane — layers + ArkRules (mandatory, except /ark-runtime)
90
50
 
91
- ArkGate has **two opt-in planes**. The user chooses which to use; you **always label** findings so they never blur.
92
-
93
- | Plane | What it protects | Where it lives | Sensors / tools |
94
- |-------|------------------|----------------|-----------------|
95
- | **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
96
- | **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
97
-
98
- **Rules for every report / answer:**
99
- 1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** (or a two-column table with those headers).
100
- 2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
101
- 3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
102
- 4. Editing `arkrules/*` or promoting modes is **`/ark-contract`**; fixing code under a structure sensor is **`/ark-fix`** / **`/ark-loop`** (judgment, never invent mechanical-safe).
103
- 5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
104
-
105
-
106
- ### Fix + ArkRules
107
- - Classify each violation: `LAYER_*` / capability → **[Layer]**; `ARKRULE_*` / `INVARIANT_*` → **[ArkRules]**.
108
- - Structure sensor fixes are judgment (ports, factories, private state) — not mechanical-safe.
51
+ Label findings **`[Layer]`** vs **`[ArkRules]`**. Structure sensor fixes are judgment.
109
52
 
110
53
  ## Subagent fan-out (optional, host-dependent)
111
54
 
112
- When the user asks to go faster **or** the work naturally splits (multiple packages,
113
- feature dirs, plan clusters), you **may** dispatch **subagents**:
114
-
115
- | Host capability | Behavior |
116
- |-----------------|----------|
117
- | **Parallel subagents supported** (e.g. multi-agent / `spawn_subagent` / concurrent Agent tools) | Launch **2–N** agents in **one wave** with **disjoint path scopes**. Prefer **read-only** explore agents for mapping; at most **one writer** unless the host gives isolated worktrees. Parent merges findings, then runs `ark-check` once. |
118
- | **Not supported** (single agent only) | **Fall back to sequential** — same checklist, one cluster/step at a time. Never claim parallel work you did not run. |
119
-
120
- **Rules:**
121
- 1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
122
- 2. **No shared mutable files** across parallel writers.
123
- 3. STOP handoffs and dual-engine rules still apply in every agent.
124
- 4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
125
- 5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
55
+ If the host supports **parallel subagents**, fan out read-only scouts; otherwise
56
+ **fall back to sequential**. Never weaken the gate.
126
57
 
127
58
  ## Related onboarding
128
59
 
129
- - **Greenfield:** `/ark-architect` or `ark-check --recommend` / `ark start`.
130
- - **Brownfield:** `/ark-adopt` — match contract to reality; do not force a starter preset.
131
- - **Map first:** `/ark-explore` when the violation is one of many structural smells.
132
- - **peerIsolation / cross-slice:** always **judgment** — extract to shared, events/ports, or redesign ownership. Never auto-apply cross-feature or cross-context moves.
133
- - **`vertical-slice` ownership:** feature code stays under `src/features/<slice>/…` (no sibling-slice imports); shared primitives in `src/shared/`; infra in `src/lib/`; shell in `src/app/`. Cross-feature edges are peerIsolation — extract shared or use events/ports.
134
- - **`ddd-bounded-contexts` ownership:** code under `src/contexts/<context>/{domain,application,infrastructure,presentation}/`; shared kernel only under `src/shared/kernel/`. Cross-context imports (same or cross technical layer) are peerIsolation — integrate via application APIs/events, not peer technical layers.
135
- - **Default path:** `ark start` → `/ark-autopilot` → `ark-check --doctor`.
60
+ - **Greenfield:** `/ark-adopt` or `ark-check --recommend` / `ark start`.
61
+ - **Brownfield:** `/ark-adopt`.
136
62
 
137
- ## Anti-wrapper rule (mandatory)
63
+ ## Steps
138
64
 
139
- **Forbidden:** only listing violations from JSON without reading importers/targets.
140
-
141
- **Required:**
142
- 1. Run `ark-check` as **sensor** (and `--plan --json` if multi-step) — CLI validates; you remediate.
143
- 2. **Read** each violated file and its import target (plus callers that explain product role).
144
- If the wall is a concentrated contract smell: **STOP — do not continue this skill as complete.** **STOP — concentrated edge: invoke /ark-contract with source evidence** (do not freeze a wrong contract or grind N freezes).
145
- If false-green cores: **STOP — do not continue this skill as complete.** **STOP — false-green: invoke /ark-adopt or /ark-contract before claiming ENFORCE.** Do not claim goal.met / ENFORCE from type-only cleanup while doctor reports `contract-false-green-io-under-application`.
146
- If many residuals: **STOP — do not continue this skill as complete.** **STOP — bulk residual debt: invoke /ark-loop or /ark-autopilot** instead of ad-hoc multi-file grinding without a plan.
147
- 3. **“Así te lo re-soluciono”** — concrete change before editing.
148
- 4. After edits: `ark-check --strict-config` (and baseline if configured).
149
-
150
- ## Common fix patterns
151
-
152
- | Symptom | Fix |
153
- |---------|-----|
154
- | App → Presentation type-only | Extract type to application/core; re-export from UI |
155
- | App → Presentation value (UI in core) | Move component wrappers to presentation |
156
- | Domain → outer layer | Port/interface in Domain; adapter outside; or relocate false Domain file (`**/types.ts` trap) |
157
- | Intent prefix mismatch | Rename intent to layer’s `intentPrefixes` or fix prefix in config via `/ark-contract` |
158
- | Forbidden global in Domain | Inject a port (Clock, Id, Http) — don’t allow `Date.now` in Domain |
159
- | Concentrated edge wall | Stop grinding; `/ark-contract` facade/surface split |
160
-
161
- ## Manifiesto
162
-
163
- If the “fix” is really a missing business intent or Domain home for a rule:
164
-
165
- - Propose intent name + layer placement.
166
- - Register / place code so `ark_manifest` / config can enforce it.
167
- - Do not only delete the import.
168
-
169
- ## Rules
170
-
171
- - No `ark-*-disable`, no allowing a bad edge “to finish”, no baselining a **new** violation you introduced.
172
- - Prefer mechanical-safe kinds when the plan tags them; otherwise design judgment carefully.
173
- - Code only — no DB migrations unless user asked.
65
+ 1. Sensor: `ark-check` / `--plan --json`.
66
+ 2. If false-green or concentrated edge: **STOP — do not continue this skill as complete.**
67
+ **STOP — false-green:** / **STOP — concentrated edge:** execute **`/ark-adopt`** in this turn.
68
+ 3. Otherwise execute **`/ark-autopilot`** for the cluster (extraction card if Shape).
69
+ 4. Re-check.
174
70
 
175
71
  ## Mechanical-edit hygiene (outcome gate)
176
72
 
@@ -179,24 +75,9 @@ If the “fix” is really a missing business intent or Domain home for a rule:
179
75
  - 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.
180
76
  - Keep the edit only when the **previously clean file stays typecheck-clean**. Otherwise roll it back and treat the change as judgment.
181
77
 
182
- ## Reshape findings (physical cohesion — never mechanical)
183
-
184
- If `doctor.physicalCohesion` fires while you fix: do **not** fold reshape moves into your fix
185
- batch. Physical moves run only through `/ark-loop`'s one-pilot loop; merge decisions only as
186
- `/ark-architect` merge cards. A cohesion finding is context for your fix, never a license to
187
- reorganize. Respect `physicalCohesion.reshapeDecisions`: never revive a current rejected/deferred
188
- target from the still-visible facts. If the user makes a verdict while reviewing the finding,
189
- record its exact `decisionTarget` + reason in `.ark/reshape-decisions.json`; never infer one from
190
- golden-pattern prose.
191
-
192
- ## Done
193
-
194
- - Targeted violations gone; no new ones.
195
- - Report: what moved, what was intentional default, what needs user decision.
196
-
197
78
  ## Completion contract (skill incomplete if missing)
198
79
 
199
- End with **exactly** these headings (markdown `###`):
80
+ Skill incomplete if missing any field below.
200
81
 
201
82
  ### Completion
202
83
  - **Sensor:** commands/tools run
@@ -204,9 +85,5 @@ End with **exactly** these headings (markdown `###`):
204
85
  - **Result:** one-line outcome
205
86
  - **Planes:** one-line split of residual **[Layer]** vs **[ArkRules]** (or `n/a` if unused)
206
87
  - **Compass:** top residual lenses | `n/a`
207
- - **Done axes:** architecture residual (status/doctor/compass) | feature/ticket residual (outside package). Enforce green ≠ feature done
208
- - **Handoff:** `/ark-…` / CLI / `none`
88
+ - **Handoff:** `/ark-autopilot` / `/ark-adopt` / `none`
209
89
  - **Incomplete?** `no` | `yes — <what is missing>`
210
-
211
- If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
212
- **Skill incomplete if missing** any of the bullets above.