arkgate 2.9.0 → 2.9.2

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.
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: ark-explore
3
+ description: Exploratory architecture reconnaissance of the real project — product map, entry points, coupling hotspots, false-green risks, and suggestive next bets. CLI is a sensor; you read the tree. No gate bypass.
4
+ ---
5
+
6
+ # /ark-explore — Recon the real project
7
+
8
+ You are a **staff engineer doing architecture reconnaissance** on *this* repository.
9
+ Ark’s CLI is a **sensor** (coverage, doctor, plan). **You** open source, README, entry
10
+ points, and git history. Output is **suggestive and ranked**, not a green checkbox.
11
+
12
+ Use alone when the user wants a map / options / “what should we do next?”.
13
+ `/ark-autopilot`, `/ark-coverage`, and `/ark-adopt` embed a lighter version of this pass.
14
+
15
+ ## Related onboarding
16
+
17
+ - **Greenfield / thin tree:** `/ark-architect` or `ark-check --recommend` / `ark start`.
18
+ - **Brownfield:** `/ark-adopt` after the map (or hand off from explore STOP paths).
19
+ - **Default path:** `ark start` → `/ark-autopilot` → `ark-check --doctor`.
20
+
21
+ ## Dual engine (mandatory)
22
+
23
+ | Engine | Role | Never confuse with |
24
+ |--------|------|--------------------|
25
+ | **Deterministic** | Contract truth: layers, rules, violations, `mechanical-safe` kinds, exit codes | Product vision or “good enough” |
26
+ | **Exploratory** | Your judgment from **reading this tree**: product surface, hotspots, false greens, opportunities | Only paraphrasing CLI JSON |
27
+
28
+ **Incomplete:** doctor/coverage dump with no file paths you opened.
29
+ **Complete:** map + ranked bets + “así te lo re-soluciono” with real paths.
30
+
31
+
32
+ ## Subagent fan-out (optional, host-dependent)
33
+
34
+ When the user asks to go faster **or** the work naturally splits (multiple packages,
35
+ feature dirs, plan clusters), you **may** dispatch **subagents**:
36
+
37
+ | Host capability | Behavior |
38
+ |-----------------|----------|
39
+ | **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. |
40
+ | **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. |
41
+
42
+ **Rules:**
43
+ 1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
44
+ 2. **No shared mutable files** across parallel writers.
45
+ 3. STOP handoffs and dual-engine rules still apply in every agent.
46
+ 4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
47
+ 5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
48
+
49
+ ## Anti-wrapper rule
50
+
51
+ **Forbidden:** only `ark-check --json` / `--coverage` / `--doctor` paraphrase.
52
+
53
+ **Required:**
54
+ 1. Sensor: `--coverage --json`, `--doctor`, optional `--plan --json` / normal check.
55
+ 2. **Product + code pass** (below) — min **12 source files** across **≥4 directories** that matter for *this* product (apps, packages, features, domain, adapters, API routes).
56
+ 3. Ranked **suggestions** (opportunities), not only residual violations.
57
+ 4. Hard lines: never weaken the contract; never invent mechanical-safe kinds.
58
+
59
+ ## Reconnaissance pass (do all that apply)
60
+
61
+ ### A. Product surface (what the system is)
62
+ - README / package.json `description` / scripts / monorepo workspace roots.
63
+ - User-facing entry: Next/Nest/Express routes, CLIs, workers, public APIs.
64
+ - Deploy shape if obvious (apps/, packages/, services/).
65
+ - One paragraph: **“What does this product do for a real user?”**
66
+
67
+ ### B. Architecture as lived (not only as configured)
68
+ - Map top dirs → intended layer vs what code *actually* does (UI, use-cases, I/O, pure domain).
69
+ - Empty Domain / Persistence while Application owns `airtable|supabase|prisma|repositories` → **false-green** (doctor id `contract-false-green-io-under-application`).
70
+ - Framework guts vs product code (Nest modules, Next app router, generated clients).
71
+
72
+ ### C. Coupling & debt beyond the plan list
73
+ - Import hotspots, god modules, cross-feature leaks (`peerIsolation` candidates).
74
+ - Business rules in UI/hooks (`can*`, `calculate*`, policy constants) → Domain / intents.
75
+ - Dead or aspirational globs; layers with files but no rules.
76
+
77
+ ### D. Agent / gate reality
78
+ - Write gate + CI + `/ark-*` skills present? Stale skills? Global vs pinned `arkgate`?
79
+ - Baseline: real debt or hiding contract smell?
80
+
81
+ ### E. Suggestive bets (not commits yet)
82
+ For each opportunity: **impact × effort × enforceability** (can the gate hold it after?).
83
+
84
+ ## Output format
85
+
86
+ 1. **Headline** — product in one sentence + honesty (mode, governed%, false-green risk).
87
+ 2. **Map** — entry points, major packages/dirs, shape name (or “no honest shape yet”).
88
+ 3. **What I opened** — bullet list of paths (prove the explore pass).
89
+ 4. **Ranked table**
90
+
91
+ | # | Kind | Finding | Evidence (path) | Suggestion | Next skill / command |
92
+
93
+ Kinds: `risk` | `false-green` | `debt` | `opportunity` | `shape` | `manifiesto` | `agent-dx`
94
+
95
+ 5. **Top 3 bets** — if the user says “go”, which skill runs first and why.
96
+ 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`.
97
+ 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).
98
+ 6. **Deterministic residue** — if plan has steps, point to `/ark-loop` / `/ark-fix` without claiming they are the whole architecture story.
99
+
100
+ ## Done criteria
101
+
102
+ - ≥12 source files read and cited.
103
+ - At least **3 suggestive** rows (not only “fix violation X”).
104
+ - Clear handoff: `/ark-adopt` | `/ark-contract` | `/ark-autopilot` | `/ark-loop` | stop.
105
+ - No gate weakening; no false ENFORCE claim.
106
+
107
+ ## Completion contract (skill incomplete if missing)
108
+
109
+ End with **exactly** these headings (markdown `###`):
110
+
111
+ ### Completion
112
+ - **Sensor:** commands/tools run
113
+ - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
114
+ - **Result:** one-line outcome
115
+ - **Handoff:** `/ark-…` / CLI / `none`
116
+ - **Incomplete?** `no` | `yes — <what is missing>`
117
+
118
+ If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
119
+ **Skill incomplete if missing** any of the bullets above.
@@ -1,17 +1,45 @@
1
1
  ---
2
2
  name: ark-fix
3
- description: Resolve Ark architecture violations at the root cause — ports, adapters, moves, intent/manifest alignment. Never weaken the contract. Read the real code; CLI only validates.
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.
4
4
  ---
5
5
 
6
6
  # /ark-fix — Fix architecture violations at the root
7
7
 
8
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.
9
11
 
10
12
 
13
+ ## Dual engine (mandatory)
14
+
15
+ | Engine | Role |
16
+ |--------|------|
17
+ | **Deterministic** | Violation list, plan kinds, post-edit `ark-check` |
18
+ | **Exploratory** | Why this edge exists in *this* product; better home; manifiesto if the rule is business |
19
+
20
+
21
+ ## Subagent fan-out (optional, host-dependent)
22
+
23
+ When the user asks to go faster **or** the work naturally splits (multiple packages,
24
+ feature dirs, plan clusters), you **may** dispatch **subagents**:
25
+
26
+ | Host capability | Behavior |
27
+ |-----------------|----------|
28
+ | **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. |
29
+ | **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. |
30
+
31
+ **Rules:**
32
+ 1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
33
+ 2. **No shared mutable files** across parallel writers.
34
+ 3. STOP handoffs and dual-engine rules still apply in every agent.
35
+ 4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
36
+ 5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
37
+
11
38
  ## Related onboarding
12
39
 
13
40
  - **Greenfield:** `/ark-architect` or `ark-check --recommend` / `ark start`.
14
41
  - **Brownfield:** `/ark-adopt` — match contract to reality; do not force a starter preset.
42
+ - **Map first:** `/ark-explore` when the violation is one of many structural smells.
15
43
  - **peerIsolation / cross-slice:** always **judgment** — extract to shared, events/ports, or redesign ownership. Never auto-apply cross-feature or cross-context moves.
16
44
  - **`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.
17
45
  - **`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.
@@ -23,7 +51,10 @@ You fix violations Ark reports. Prefer structural fixes over silencing the gate.
23
51
 
24
52
  **Required:**
25
53
  1. Run `ark-check` as **sensor** (and `--plan --json` if multi-step) — CLI validates; you remediate.
26
- 2. **Read** each violated file and its import target.
54
+ 2. **Read** each violated file and its import target (plus callers that explain product role).
55
+ 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).
56
+ 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`.
57
+ 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.
27
58
  3. **“Así te lo re-soluciono”** — concrete change before editing.
28
59
  4. After edits: `ark-check --strict-config` (and baseline if configured).
29
60
 
@@ -56,3 +87,17 @@ If the “fix” is really a missing business intent or Domain home for a rule:
56
87
 
57
88
  - Targeted violations gone; no new ones.
58
89
  - Report: what moved, what was intentional default, what needs user decision.
90
+
91
+ ## Completion contract (skill incomplete if missing)
92
+
93
+ End with **exactly** these headings (markdown `###`):
94
+
95
+ ### Completion
96
+ - **Sensor:** commands/tools run
97
+ - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
98
+ - **Result:** one-line outcome
99
+ - **Handoff:** `/ark-…` / CLI / `none`
100
+ - **Incomplete?** `no` | `yes — <what is missing>`
101
+
102
+ If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
103
+ **Skill incomplete if missing** any of the bullets above.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-loop
3
- description: Drive ark-check --plan to zero active violations. Auto-apply only mechanical-safe kinds; design judgment fixes from real source. CLI is the validator — you edit code.
3
+ description: Drive ark-check --plan to zero active violations. Read real source, auto-apply only mechanical-safe kinds, design judgment from the product tree. CLI validates — you edit code.
4
4
  ---
5
5
 
6
6
  # /ark-loop — Apply the plan safely
@@ -8,22 +8,54 @@ description: Drive ark-check --plan to zero active violations. Auto-apply only m
8
8
  Read Ark’s classified **plan**, work toward **goal.met**, one small step at a time,
9
9
  validating every change with `ark-check` and rolling back regressions.
10
10
 
11
+ Deterministic kinds stay **tight**. Your job is still **exploratory on the files**: open
12
+ importers/targets, see if the plan step is a symptom of wrong shape / false Domain / I/O
13
+ under Application — escalate to `/ark-contract` or `/ark-explore` when the wall is structural.
14
+
11
15
 
12
16
  ## Related onboarding
13
17
 
14
18
  - **Greenfield:** `/ark-architect` or `ark-check --recommend` / `ark start`.
15
19
  - **Brownfield:** `/ark-adopt` — match contract to reality; do not force a starter preset.
20
+ - **Map / opportunities:** `/ark-explore`.
16
21
  - **Default path:** `ark start` → `/ark-autopilot` → `ark-check --doctor`.
17
22
 
23
+ ## Dual engine (mandatory)
24
+
25
+ | Engine | Role |
26
+ |--------|------|
27
+ | **Deterministic** | Only the four `mechanical-safe` kinds auto-apply; plan tags; gate re-check |
28
+ | **Exploratory** | Read sources; detect concentrated edges / false-green / wrong layer home before grinding |
29
+
30
+
31
+ ## Subagent fan-out (optional, host-dependent)
32
+
33
+ When the user asks to go faster **or** the work naturally splits (multiple packages,
34
+ feature dirs, plan clusters), you **may** dispatch **subagents**:
35
+
36
+ | Host capability | Behavior |
37
+ |-----------------|----------|
38
+ | **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. |
39
+ | **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. |
40
+
41
+ **Rules:**
42
+ 1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
43
+ 2. **No shared mutable files** across parallel writers.
44
+ 3. STOP handoffs and dual-engine rules still apply in every agent.
45
+ 4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
46
+ 5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
47
+
18
48
  ## Anti-wrapper rule (mandatory)
19
49
 
20
50
  **Forbidden:** re-printing plan JSON without opening sources, or inventing new “safe” kinds.
21
51
 
22
52
  **Required:**
23
53
  1. `--plan --json` as sensor.
24
- 2. For each step you touch: **read** `file` and `target` source.
54
+ 2. For each step you touch: **read** `file` and `target` source (and enough callers to know the edge).
25
55
  3. **“Así te lo re-soluciono”** — exact edit before applying.
26
56
  4. After each apply: full gate re-run; rollback if targeted violation remains or new ones appear.
57
+ 5. If one edge dominates: **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).
58
+ 6. If empty cores + I/O under Application: **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`.
27
59
 
28
60
  ## mechanical-safe only (auto)
29
61
 
@@ -56,3 +88,17 @@ Never auto: value imports (including mixed bindings with values), dynamic import
56
88
  - Gate confirms each kept edit.
57
89
  - Honest residual list with **Así te lo re-soluciono** for anything left.
58
90
  - If residual steps hide domain/business rules in the wrong layer, call out **manifiesto** work (`intentPrefixes` / Domain placement) via `/ark-contract` or `/ark-adopt`.
91
+
92
+ ## Completion contract (skill incomplete if missing)
93
+
94
+ End with **exactly** these headings (markdown `###`):
95
+
96
+ ### Completion
97
+ - **Sensor:** commands/tools run
98
+ - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
99
+ - **Result:** one-line outcome
100
+ - **Handoff:** `/ark-…` / CLI / `none`
101
+ - **Incomplete?** `no` | `yes — <what is missing>`
102
+
103
+ If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
104
+ **Skill incomplete if missing** any of the bullets above.
@@ -18,6 +18,23 @@ plus the not-yet-adopted `suggestedLayers` as a footnote. Then ask what they wan
18
18
  to place. That map is derived entirely from the repo, so producing it is real work,
19
19
  not a stalling question.
20
20
 
21
+ ## Dual engine (mandatory)
22
+
23
+ | Engine | Role |
24
+ |--------|------|
25
+ | **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
26
+ | **Exploratory** | You open **this** repo's real files and product surface before concluding |
27
+
28
+ The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
29
+
30
+
31
+ ## Subagent fan-out (optional, host-dependent)
32
+
33
+ If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
34
+ dirs to sample), fan out read-only scouts; otherwise **fall back to sequential**.
35
+ Parent merges and still emits the **### Completion** contract. Never parallel-write
36
+ the same files or weaken the gate.
37
+
21
38
  ## Steps
22
39
 
23
40
  1. **Read the contract, not your intuition.** If the `ark` MCP server is available,
@@ -51,6 +68,11 @@ not a stalling question.
51
68
  5. **If asked to create it**: scaffold the file(s) in place, following the
52
69
  nearest existing sibling's style, and any port/adapter split the rules force.
53
70
 
71
+ ## Critical handoffs
72
+
73
+ - If the user needs bulk adoption / wrong contract, not a single artifact: **STOP — do not continue this skill as complete.** **STOP — wrong skill: invoke /ark-adopt or /ark-contract** instead of ad-hoc multi-file grinding without a plan.
74
+ - If contract lacks a home for the artifact: **STOP — do not continue this skill as complete.** Adopt the layer via `/ark-contract` first.
75
+
54
76
  ## Operating rules
55
77
 
56
78
  - Never ask "which layer do you prefer?" — the contract decides; you translate.
@@ -73,3 +95,17 @@ not a stalling question.
73
95
  If you created files, run `ark-check --root . --config ark.config.json
74
96
  --strict-config` and make it pass. Report: placement + why, files created (if
75
97
  any), and the import rules the new code must respect going forward.
98
+
99
+ ## Completion contract (skill incomplete if missing)
100
+
101
+ End with **exactly** these headings (markdown `###`):
102
+
103
+ ### Completion
104
+ - **Sensor:** commands/tools run
105
+ - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
106
+ - **Result:** one-line outcome
107
+ - **Handoff:** `/ark-…` / CLI / `none`
108
+ - **Incomplete?** `no` | `yes — <what is missing>`
109
+
110
+ If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
111
+ **Skill incomplete if missing** any of the bullets above.
@@ -11,6 +11,23 @@ policy engine, workflow/saga coordination, projections, observability hooks,
11
11
  and NestJS adapters. This skill migrates hand-rolled versions of those to the
12
12
  kernel, one feature at a time.
13
13
 
14
+ ## Dual engine (mandatory)
15
+
16
+ | Engine | Role |
17
+ |--------|------|
18
+ | **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
19
+ | **Exploratory** | You open **this** repo's real files and product surface before concluding |
20
+
21
+ The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
22
+
23
+
24
+ ## Subagent fan-out (optional, host-dependent)
25
+
26
+ If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
27
+ dirs to sample), fan out read-only scouts; otherwise **fall back to sequential**.
28
+ Parent merges and still emits the **### Completion** contract. Never parallel-write
29
+ the same files or weaken the gate.
30
+
14
31
  ## Steps
15
32
 
16
33
  1. **Inventory** — grep the codebase for hand-rolled equivalents:
@@ -40,6 +57,11 @@ kernel, one feature at a time.
40
57
  something the inventory only *suspects* is dead (a misclassified load-bearing
41
58
  emitter must not be removed on a guess).
42
59
 
60
+ ## Critical handoffs
61
+
62
+ - No static gates yet: **STOP — do not continue this skill as complete.** Run `/ark-architect` or `/ark-adopt` first.
63
+ - Inventory finds nothing: stop; do not introduce kernel speculatively.
64
+
43
65
  ## Operating rules
44
66
 
45
67
  - If the inventory finds NO hand-rolled equivalents, say so and stop — do not
@@ -60,3 +82,17 @@ kernel, one feature at a time.
60
82
  Run the project's tests plus `ark-check --root . --config ark.config.json
61
83
  --strict-config`. Report: what was migrated, lines deleted vs added, remaining
62
84
  candidates ranked, and any behavior differences (e.g. bounded history).
85
+
86
+ ## Completion contract (skill incomplete if missing)
87
+
88
+ End with **exactly** these headings (markdown `###`):
89
+
90
+ ### Completion
91
+ - **Sensor:** commands/tools run
92
+ - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
93
+ - **Result:** one-line outcome
94
+ - **Handoff:** `/ark-…` / CLI / `none`
95
+ - **Incomplete?** `no` | `yes — <what is missing>`
96
+
97
+ If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
98
+ **Skill incomplete if missing** any of the bullets above.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-think
3
- description: "Host-side architectural reasoning within the Ark contract trade-offs, evolution, design options. No gate bypass. No package LLM call."
3
+ description: "Host-side architectural reasoning exploratory options from real code + contract, trade-offs, evolution paths. No gate bypass. No package LLM call."
4
4
  ---
5
5
 
6
6
  # /ark-think — Architectural reasoning (host LLM only)
@@ -9,35 +9,86 @@ 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
+
13
+ ## Dual engine (mandatory)
14
+
15
+ | Engine | Role |
16
+ |--------|------|
17
+ | **Deterministic** | What the contract and doctor *prove* today (layers, rules, governed%, gaps) |
18
+ | **Exploratory** | What *this* codebase wants to become — options grounded in files you open |
19
+
20
+ Never reason only from abstract hexagons. Open real modules before recommending a shape.
21
+
22
+
23
+ ## Subagent fan-out (optional, host-dependent)
24
+
25
+ When the user asks to go faster **or** the work naturally splits (multiple packages,
26
+ feature dirs, plan clusters), you **may** dispatch **subagents**:
27
+
28
+ | Host capability | Behavior |
29
+ |-----------------|----------|
30
+ | **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. |
31
+ | **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. |
32
+
33
+ **Rules:**
34
+ 1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
35
+ 2. **No shared mutable files** across parallel writers.
36
+ 3. STOP handoffs and dual-engine rules still apply in every agent.
37
+ 4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
38
+ 5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
39
+
12
40
  ## When to use
13
41
 
14
42
  - Design trade-offs before writing code
15
- - "Should this be a new layer or a feature slice?"
43
+ - Should this be a new layer or a feature slice?”
16
44
  - Evolving brownfield layout toward a named preset
17
45
  - Explaining why a peerIsolation or layer rule exists
46
+ - Choosing among 2–3 enforceable futures (not infinite diagrams)
18
47
 
19
48
  ## Steps
20
49
 
21
50
  1. **Load the contract** — `ark.config.json`, MCP `ark://manifest` if available, and
22
- `ark-check --coverage --json` / `--doctor` for honesty about governed%.
23
- 2. **Name the active shape** — which preset/archetype fits (hexagonal, vertical-slice,
24
- ddd-bounded-contexts, feature-sliced, monorepo, ). If none, run `--recommend --json`.
25
- 3. **Reason within bounds** — propose options that **stay enforceable** by the gate.
51
+ `ark-check --coverage --json` / `--doctor` for honesty about governed% and false-green.
52
+ 2. **Touch the product** — README + **≥5 source files** on the decision surface (the feature,
53
+ package, or boundary under discussion). Name paths in the answer.
54
+ 3. **Name the active shape** — which preset/archetype fits (hexagonal, vertical-slice,
55
+ ddd-bounded-contexts, feature-sliced, monorepo, …). If none, run `--recommend --json`
56
+ **and** say whether detection matches the tree you opened.
57
+ 4. **Reason within bounds** — propose options that **stay enforceable** by the gate.
26
58
  Prefer concrete paths and import rules over abstract diagrams.
27
- 4. **Surface hard lines** — never suggest: weakening `ark.config.json` to pass, silent
59
+ 5. **Explore alternatives** — for each option: coupling, testability, **AI-agent safety**
60
+ (will write-gate + skills keep humans honest?), migration cost.
61
+ 6. **Surface hard lines** — never suggest: weakening `ark.config.json` to pass, silent
28
62
  judgment auto-apply, codemod engines, or skipping write-gate/CI.
29
- 5. **Hand off** — for placement use `/ark-place`; for config edits `/ark-contract`; for
30
- bulk debt `/ark-loop` / `/ark-autopilot`; for violations `/ark-fix`.
63
+ 7. **Hand off** — placement `/ark-place`; config `/ark-contract`; bulk debt `/ark-loop` /
64
+ `/ark-autopilot`; map-only `/ark-explore`; violations `/ark-fix`.
65
+ When the user needs action not advice: **STOP — do not continue this skill as complete** — invoke the handoff skill.
31
66
 
32
67
  ## Output format
33
68
 
34
- - **Context:** 2–3 sentences on current contract + shape
35
- - **Options:** 2–3 alternatives with trade-offs (coupling, testability, AI-agent safety)
36
- - **Recommendation:** one option + why it is enforceable today
69
+ - **Context:** product + contract + what you opened (paths)
70
+ - **Options:** 2–3 alternatives with trade-offs (coupling, testability, agent safety, enforceability)
71
+ - **Recommendation:** one option + why it is enforceable **today**
72
+ - **Risks if we pick wrong:** one sentence user-visible impact
37
73
  - **Next command:** exact `ark-check` / skill to run next
38
74
 
39
75
  ## Related
40
76
 
41
77
  - Greenfield shape: `/ark-architect`
42
78
  - Brownfield: `/ark-adopt`
79
+ - Full recon: `/ark-explore`
43
80
  - Explain existing: `/ark-explain`
81
+
82
+ ## Completion contract (skill incomplete if missing)
83
+
84
+ End with **exactly** these headings (markdown `###`):
85
+
86
+ ### Completion
87
+ - **Sensor:** commands/tools run
88
+ - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
89
+ - **Result:** one-line outcome
90
+ - **Handoff:** `/ark-…` / CLI / `none`
91
+ - **Incomplete?** `no` | `yes — <what is missing>`
92
+
93
+ If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
94
+ **Skill incomplete if missing** any of the bullets above.
@@ -38,6 +38,23 @@ read the **Adoption** section — host gaps, Codex home temp paths, optional-but
38
38
  core layers, missing origin snapshot, baseline policy. Fix commands are printed per gap.
39
39
  HTML reports include the same Adoption card (separate from the 0–100 fitness score).
40
40
 
41
+ ## Dual engine (mandatory)
42
+
43
+ | Engine | Role |
44
+ |--------|------|
45
+ | **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
46
+ | **Exploratory** | You open **this** repo's real files and product surface before concluding |
47
+
48
+ The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
49
+
50
+
51
+ ## Subagent fan-out (optional, host-dependent)
52
+
53
+ If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
54
+ dirs to sample), fan out read-only scouts; otherwise **fall back to sequential**.
55
+ Parent merges and still emits the **### Completion** contract. Never parallel-write
56
+ the same files or weaken the gate.
57
+
41
58
  ## Fast path
42
59
 
43
60
  One command does the whole flow — update the package, refresh gates + `/ark-*` skills
@@ -113,7 +130,8 @@ npx arkgate-check --install-agent-gates --skills-only --force
113
130
  4. **Re-verify** — `ark-check --root . --config ark.config.json
114
131
  --strict-config` (with `--baseline .ark-baseline.json` if present). A new
115
132
  version may detect violations the old one missed: if new violations appear,
116
- apply `/ark-fix` reasoning to resolve them. If they are too numerous to fix
133
+ **STOP do not continue this skill as complete.** **STOP bulk residual debt: invoke /ark-loop or /ark-autopilot**
134
+ (or `/ark-fix` for a small set). If they are too numerous to fix
117
135
  now, freezing them in the baseline (`--update-baseline`) is a valid stopgap
118
136
  but it silences NEW violations, so it requires explicit user approval first
119
137
  — never regenerate the baseline on your own to get a green check.
@@ -142,3 +160,17 @@ End with a passing check. Report: latest published version, old → new version
142
160
  (or "already latest"), changelog entries that mattered here (plain language),
143
161
  files written/refreshed per tool, skipped customized files needing a manual
144
162
  look, and the final check status.
163
+
164
+ ## Completion contract (skill incomplete if missing)
165
+
166
+ End with **exactly** these headings (markdown `###`):
167
+
168
+ ### Completion
169
+ - **Sensor:** commands/tools run
170
+ - **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
171
+ - **Result:** one-line outcome
172
+ - **Handoff:** `/ark-…` / CLI / `none`
173
+ - **Incomplete?** `no` | `yes — <what is missing>`
174
+
175
+ If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
176
+ **Skill incomplete if missing** any of the bullets above.