arkgate 2.9.1 → 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.
- package/CHANGELOG.md +28 -0
- package/README.md +8 -2
- package/bin/lib/agent-gates.mjs +29 -3
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.cjs +1 -1
- package/dist/nestjs/index.cjs.map +1 -1
- package/dist/nestjs/index.js +1 -1
- package/dist/nestjs/index.js.map +1 -1
- package/dist/runtime/index.cjs +1 -1
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/templates/skills/ark-adopt.md +57 -10
- package/templates/skills/ark-architect.md +33 -2
- package/templates/skills/ark-autopilot.md +75 -20
- package/templates/skills/ark-contract.md +36 -0
- package/templates/skills/ark-coverage.md +81 -27
- package/templates/skills/ark-explain.md +34 -1
- package/templates/skills/ark-explore.md +119 -0
- package/templates/skills/ark-fix.md +47 -2
- package/templates/skills/ark-loop.md +48 -2
- package/templates/skills/ark-place.md +36 -0
- package/templates/skills/ark-runtime.md +36 -0
- package/templates/skills/ark-think.md +63 -12
- package/templates/skills/ark-upgrade.md +33 -1
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/pedroknigge/arkgate",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.9.
|
|
9
|
+
"version": "2.9.2",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "arkgate",
|
|
14
|
-
"version": "2.9.
|
|
14
|
+
"version": "2.9.2",
|
|
15
15
|
"runtimeHint": "npx",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ark-adopt
|
|
3
|
-
description: Brownfield onboarding — match contract to real code, classify ungoverned dirs, mine
|
|
3
|
+
description: Brownfield onboarding — exploratory match of contract to real product code, classify ungoverned dirs, mine business rules into the manifest, freeze only real debt. Deep source analysis required.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /ark-adopt — Bring Ark into an existing codebase
|
|
7
7
|
|
|
8
|
-
Goal: contract reflects reality
|
|
9
|
-
A green check over a wrong contract is a **false green**.
|
|
8
|
+
Goal: contract reflects **product reality**, most code governed, only genuine debt frozen
|
|
9
|
+
with a burn-down. A green check over a wrong contract is a **false green**.
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
## Dual engine (mandatory)
|
|
13
|
+
|
|
14
|
+
| Engine | Role |
|
|
15
|
+
|--------|------|
|
|
16
|
+
| **Deterministic** | coverage, doctor, baseline, strict-config after edits |
|
|
17
|
+
| **Exploratory** | walk the real monorepo/app layout; reclassify; mine rules; suggest shape |
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Subagent fan-out (optional, host-dependent)
|
|
21
|
+
|
|
22
|
+
When the user asks to go faster **or** the work naturally splits (multiple packages,
|
|
23
|
+
feature dirs, plan clusters), you **may** dispatch **subagents**:
|
|
24
|
+
|
|
25
|
+
| Host capability | Behavior |
|
|
26
|
+
|-----------------|----------|
|
|
27
|
+
| **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. |
|
|
28
|
+
| **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. |
|
|
29
|
+
|
|
30
|
+
**Rules:**
|
|
31
|
+
1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
|
|
32
|
+
2. **No shared mutable files** across parallel writers.
|
|
33
|
+
3. STOP handoffs and dual-engine rules still apply in every agent.
|
|
34
|
+
4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
|
|
35
|
+
5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
|
|
36
|
+
|
|
12
37
|
## Related onboarding
|
|
13
38
|
|
|
14
39
|
- **Greenfield:** `/ark-architect` or `ark-check --recommend` / `ark start`.
|
|
15
40
|
- **Brownfield:** `/ark-adopt` — match contract to reality; do not force a starter preset.
|
|
41
|
+
- **Deep map only:** `/ark-explore`.
|
|
16
42
|
- **Default path:** `ark start` → `/ark-autopilot` → `ark-check --doctor`.
|
|
17
43
|
|
|
18
44
|
## Anti-wrapper rule (mandatory)
|
|
@@ -21,9 +47,12 @@ A green check over a wrong contract is a **false green**.
|
|
|
21
47
|
|
|
22
48
|
**Required:**
|
|
23
49
|
1. CLI sensor: `--coverage --json`, check `--json` (`summary`), doctor.
|
|
24
|
-
2. **
|
|
25
|
-
3.
|
|
26
|
-
4
|
|
50
|
+
2. **Product map** — what ships, which apps/packages, entry routes/CLIs.
|
|
51
|
+
3. **Read real source** in largest ungoverned dirs and top import edges (min **12 files**
|
|
52
|
+
across **≥4 dirs**).
|
|
53
|
+
4. **“Así te lo re-soluciono”** — concrete layer globs, file moves, manifest/intent proposals.
|
|
54
|
+
5. **Suggestive burn-down** — ranked next steps after adopt (not only “baseline done”).
|
|
55
|
+
6. Never freeze a concentrated edge without investigating contract smell / false-green.
|
|
27
56
|
|
|
28
57
|
## Guiding principle
|
|
29
58
|
|
|
@@ -37,7 +66,11 @@ Ark protects the **boundary around** a framework, not its internals. Nest/DI pub
|
|
|
37
66
|
If `src/contexts` or `src/bounded-contexts` exists, prefer `ddd-bounded-contexts`.
|
|
38
67
|
2. **Check + diagnose** — `summary.concentrated` / dominant edge → fix contract first, don’t freeze.
|
|
39
68
|
Cross-slice / cross-context `peerIsolation` hits are judgment: extract shared or events.
|
|
40
|
-
|
|
69
|
+
If one edge dominates residual debt: **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).
|
|
70
|
+
Empty Domain/Persistence + I/O under Application → false-green.
|
|
71
|
+
**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`.
|
|
72
|
+
3. **Classify ungoverned** — use coverage `suggestions` **plus** dirs you discovered by reading;
|
|
73
|
+
add layers/patterns via `/ark-contract`.
|
|
41
74
|
4. **Mine business rules → manifiesto** (model job — this is why the skill exists):
|
|
42
75
|
- Scan for loose domain: validators, pricing/policy functions, `can*`/`calculate*`, magic business constants, publish/intent strings, logic in UI/hooks that belongs in Domain.
|
|
43
76
|
- Propose: Domain files, `intentPrefixes`, intent names (`Domain.*` / `Application.*`), kernel `defineIntent` stubs if runtime is used.
|
|
@@ -45,7 +78,7 @@ Ark protects the **boundary around** a framework, not its internals. Nest/DI pub
|
|
|
45
78
|
- Deliver section **“Así te lo re-soluciono en el manifiesto”** with before/after contract snippets.
|
|
46
79
|
5. **Freeze only real debt** — `--update-baseline` (zero debt → **no empty baseline file** left behind).
|
|
47
80
|
6. **Gates + skills** — `--install-agent-gates` (CI monorepo-aware when `frontend/package.json` exists).
|
|
48
|
-
7. **Ratchet plan** — ranked edges +
|
|
81
|
+
7. **Ratchet + opportunity plan** — ranked residual edges + **explore-style bets** (what to improve next week).
|
|
49
82
|
|
|
50
83
|
## Operating modes
|
|
51
84
|
|
|
@@ -54,10 +87,24 @@ Explain modes as **detected stages** (Setup / Align / Guard), not user settings.
|
|
|
54
87
|
## Verify
|
|
55
88
|
|
|
56
89
|
`ark-check --root . --config ark.config.json --strict-config` (+ baseline only if non-empty file retained).
|
|
57
|
-
Report: governed% before/after, files written, frozen count, false positives avoided, manifest/intent proposals applied or deferred
|
|
90
|
+
Report: governed% before/after, files written, frozen count, false positives avoided, manifest/intent proposals applied or deferred, **top opportunities still open**.
|
|
58
91
|
|
|
59
92
|
## Never
|
|
60
93
|
|
|
61
94
|
- Freeze false positives to get green.
|
|
62
95
|
- Force runtime kernel over existing Nest/DI.
|
|
63
|
-
- Claim Enforce while governed% is low or core bags ungoverned.
|
|
96
|
+
- Claim Enforce while governed% is low, cores empty with I/O in Application, or core bags ungoverned.
|
|
97
|
+
|
|
98
|
+
## Completion contract (skill incomplete if missing)
|
|
99
|
+
|
|
100
|
+
End with **exactly** these headings (markdown `###`):
|
|
101
|
+
|
|
102
|
+
### Completion
|
|
103
|
+
- **Sensor:** commands/tools run
|
|
104
|
+
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
105
|
+
- **Result:** one-line outcome
|
|
106
|
+
- **Handoff:** `/ark-…` / CLI / `none`
|
|
107
|
+
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
108
|
+
|
|
109
|
+
If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
|
|
110
|
+
**Skill incomplete if missing** any of the bullets above.
|
|
@@ -13,6 +13,23 @@ conventional directories, and a passing honest check — without weakening the g
|
|
|
13
13
|
Commands below are written as `ark-check` / `ark`; run each through the project's
|
|
14
14
|
package manager (`pnpm exec`, `yarn`, `npx`) — match the lockfile.
|
|
15
15
|
|
|
16
|
+
## Dual engine (mandatory)
|
|
17
|
+
|
|
18
|
+
| Engine | Role |
|
|
19
|
+
|--------|------|
|
|
20
|
+
| **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
|
|
21
|
+
| **Exploratory** | You open **this** repo's real files and product surface before concluding |
|
|
22
|
+
|
|
23
|
+
The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Subagent fan-out (optional, host-dependent)
|
|
27
|
+
|
|
28
|
+
If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
|
|
29
|
+
dirs to sample), fan out read-only scouts; otherwise **fall back to sequential**.
|
|
30
|
+
Parent merges and still emits the **### Completion** contract. Never parallel-write
|
|
31
|
+
the same files or weaken the gate.
|
|
32
|
+
|
|
16
33
|
## Relationship to other skills
|
|
17
34
|
|
|
18
35
|
| Skill | When |
|
|
@@ -40,7 +57,7 @@ package manager (`pnpm exec`, `yarn`, `npx`) — match the lockfile.
|
|
|
40
57
|
or `ark-check --apply-policy-pack enthusiast-<preset>` for the enthusiast variant.
|
|
41
58
|
Optional team record: `ark-check --recommend --write-plan` → `ark-adoption-plan.json`.
|
|
42
59
|
If a config already exists, use `/ark-contract` to align it — do not regenerate
|
|
43
|
-
unasked.
|
|
60
|
+
unasked. On a messy brownfield tree: **STOP — do not continue this skill as complete.** Invoke **/ark-adopt** instead of forcing greenfield shape.
|
|
44
61
|
|
|
45
62
|
4. **Scaffold phase 1** — create conventional directories from the preset/playbook
|
|
46
63
|
(`src/domain`, `src/application`, …). Add a one-line README per folder explaining
|
|
@@ -91,4 +108,18 @@ package manager (`pnpm exec`, `yarn`, `npx`) — match the lockfile.
|
|
|
91
108
|
|
|
92
109
|
End with `ark-check --root . --config ark.config.json --strict-config` when the
|
|
93
110
|
tree is ready. Report: archetype + preset, directories created, governed %, and
|
|
94
|
-
the next command if anything remains ungoverned.
|
|
111
|
+
the next command if anything remains ungoverned.
|
|
112
|
+
|
|
113
|
+
## Completion contract (skill incomplete if missing)
|
|
114
|
+
|
|
115
|
+
End with **exactly** these headings (markdown `###`):
|
|
116
|
+
|
|
117
|
+
### Completion
|
|
118
|
+
- **Sensor:** commands/tools run
|
|
119
|
+
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
120
|
+
- **Result:** one-line outcome
|
|
121
|
+
- **Handoff:** `/ark-…` / CLI / `none`
|
|
122
|
+
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
123
|
+
|
|
124
|
+
If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
|
|
125
|
+
**Skill incomplete if missing** any of the bullets above.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ark-autopilot
|
|
3
|
-
description: End-to-end architecture co-pilot — setup, deep plan from
|
|
3
|
+
description: End-to-end architecture co-pilot — exploratory map of the real project, then setup, deep plan from source, mechanical-safe fixes, and judgment design. CLI is a sensor; you read and remediate files.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /ark-autopilot — Get to a sound architecture, end to end
|
|
7
7
|
|
|
8
|
-
Composes **setup + plan + loop**. Safe default: auto-apply only `mechanical-safe`;
|
|
8
|
+
Composes **explore + setup + plan + loop**. Safe default: auto-apply only `mechanical-safe`;
|
|
9
9
|
when the user says full apply / “al mango” / apply everything, also execute
|
|
10
10
|
**judgment** fixes you design from reading source (still validate with ark-check,
|
|
11
11
|
never weaken the gate).
|
|
@@ -15,47 +15,86 @@ never weaken the gate).
|
|
|
15
15
|
|
|
16
16
|
- **Greenfield:** `/ark-architect` or `ark-check --recommend` / `ark start`.
|
|
17
17
|
- **Brownfield:** `/ark-adopt` — match contract to reality; do not force a starter preset.
|
|
18
|
+
- **Deep map only:** `/ark-explore` — reconnaissance without applying fixes.
|
|
18
19
|
- **Default path:** `ark start` → `/ark-autopilot` → `ark-check --doctor`.
|
|
19
20
|
|
|
20
|
-
##
|
|
21
|
+
## Dual engine (mandatory)
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
| Engine | Role |
|
|
24
|
+
|--------|------|
|
|
25
|
+
| **Deterministic** | `ark-check` plan/coverage/doctor, mechanical-safe kinds, write/CI gates, exit codes |
|
|
26
|
+
| **Exploratory** | You map **this** product’s real tree: entry points, packages, coupling, false greens, opportunities |
|
|
27
|
+
|
|
28
|
+
**Forbidden:** only printing `--plan` JSON or “4 safe / 4 judgment — approve?” without reading the violating files **and** without a short product map.
|
|
23
29
|
|
|
24
30
|
**Required:**
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4.
|
|
31
|
+
1. **Explore pass** (below) before claiming a loop strategy.
|
|
32
|
+
2. CLI sensor: `ark-check --plan --json`, coverage/doctor as needed.
|
|
33
|
+
3. **Open every file** in the plan’s `steps[]` (and its `target` if present) before classifying a fix.
|
|
34
|
+
4. **“Así te lo re-soluciono”** for each cluster: exact moves (extract type, relocate file, invert dependency).
|
|
35
|
+
5. Apply → re-run ark-check → rollback on regression.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## Subagent fan-out (optional, host-dependent)
|
|
39
|
+
|
|
40
|
+
When the user asks to go faster **or** the work naturally splits (multiple packages,
|
|
41
|
+
feature dirs, plan clusters), you **may** dispatch **subagents**:
|
|
42
|
+
|
|
43
|
+
| Host capability | Behavior |
|
|
44
|
+
|-----------------|----------|
|
|
45
|
+
| **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. |
|
|
46
|
+
| **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. |
|
|
47
|
+
|
|
48
|
+
**Rules:**
|
|
49
|
+
1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
|
|
50
|
+
2. **No shared mutable files** across parallel writers.
|
|
51
|
+
3. STOP handoffs and dual-engine rules still apply in every agent.
|
|
52
|
+
4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
|
|
53
|
+
5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
|
|
54
|
+
|
|
55
|
+
## Explore pass (before grinding the plan)
|
|
56
|
+
|
|
57
|
+
Do this even if the plan is non-empty — plan lists *violations*, not *product reality*.
|
|
58
|
+
|
|
59
|
+
1. **Product one-liner** — README + main package(s) + what the user gets.
|
|
60
|
+
2. **Entry points** — apps, APIs, CLIs, workers (min paths named).
|
|
61
|
+
3. **Lived layout** — which dirs are really Domain / Application / I/O / UI vs what globs claim.
|
|
62
|
+
4. **False-green soft block** — doctor / coverage: empty Domain/Persistence while Application
|
|
63
|
+
globs still cover I/O (`airtable`, `supabase`, `prisma`, `drizzle`, `repositories`, …).
|
|
64
|
+
Doctor gap id: `contract-false-green-io-under-application`. If so:
|
|
65
|
+
**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`.
|
|
66
|
+
5. **Suggestive top bets** — 2–5 opportunities ranked (shape, extract, manifiesto, gates/DX),
|
|
67
|
+
separate from mechanical-safe steps. User may defer; still list them.
|
|
68
|
+
|
|
69
|
+
Min bar: **≥8 source files** across **≥3 meaningful directories** (not only files in `steps[]`).
|
|
70
|
+
|
|
71
|
+
For a full reconnaissance report, run or fold in `/ark-explore`.
|
|
29
72
|
|
|
30
73
|
## Operating modes (detected, not picked)
|
|
31
74
|
|
|
32
75
|
- **Setup (Suggest):** no config → `ark start` / recommend shape.
|
|
33
|
-
- **Align (Adapt):** open debt
|
|
34
|
-
- **Guard (Enforce):** `goal.met
|
|
76
|
+
- **Align (Adapt):** open debt, low honesty, or false-green → explore + adopt/loop; do not claim “guarded”.
|
|
77
|
+
- **Guard (Enforce):** `goal.met`, solid governed%, no false-green → install/confirm gates and stop.
|
|
35
78
|
|
|
36
79
|
## Flow
|
|
37
80
|
|
|
38
|
-
0. **
|
|
39
|
-
If Domain/Persistence (or similar cores) are **empty** while Application-class globs still cover
|
|
40
|
-
I/O dirs (`airtable`, `supabase`, `prisma`, `drizzle`, `repositories`, …), **do not** claim
|
|
41
|
-
ENFORCE / `goal.met` from type-only cleanup alone. Route to **`/ark-adopt`** or **`/ark-contract`**
|
|
42
|
-
first: reclassify real persistence/auth out of Application. Doctor gap id:
|
|
43
|
-
`contract-false-green-io-under-application`.
|
|
81
|
+
0. **Explore pass** — product map + false-green check + suggestive bets (see above).
|
|
44
82
|
1. **Setup if needed** — `ark start` if no `ark.config.json`. Trust `--recommend` / playbook:
|
|
45
83
|
`vertical-slice-product` and `ddd-bounded-contexts` are first-class shapes (not hexagonal by default).
|
|
46
84
|
2. **Origin report** — `ark-check --report ark-report.html` (do not `--reset-origin` unless asked).
|
|
47
85
|
3. **Plan + code read** — `--plan --json`; read each step’s source/target; group by edge.
|
|
48
86
|
Treat `peerIsolation` / cross-slice steps as **judgment** (never mechanical-safe).
|
|
49
|
-
4. **Concentrated edge?** — if one edge dominates
|
|
87
|
+
4. **Concentrated edge?** — if one edge dominates:
|
|
88
|
+
**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).
|
|
50
89
|
5. **Worktree preferred** — discardable git worktree when possible.
|
|
51
90
|
6. **Mechanical-safe** — only kinds from `/ark-loop` table; one step, validate, rollback.
|
|
52
91
|
7. **Judgment** — default: propose with full “así te lo re-soluciono”. If user authorized full apply: implement the designed fix, validate, rollback on fail.
|
|
53
92
|
8. **Manifiesto** — if loose business rules surface (domain logic in UI/core), propose Domain placement + `intentPrefixes` / intents; apply config only via `/ark-contract` discipline (strict check after).
|
|
54
|
-
9. **Final report** —
|
|
93
|
+
9. **Final report** — re-`--report`; evolution vs origin; **explore bets** still open vs auto vs judgment applied vs deferred.
|
|
55
94
|
10. **Strict check** — `ark-check --strict-config` (dead preset globs are advisory; real violations still fail).
|
|
56
95
|
11. **Core ratchet (when green)** — if plan `goal.met` and doctor still **ADAPT** only because
|
|
57
96
|
populated cores are `optional: true`, run `ark-check --ratchet-cores` then `--doctor`.
|
|
58
|
-
Never ratchet while active violations remain.
|
|
97
|
+
Never ratchet while active violations remain or false-green gap is open.
|
|
59
98
|
|
|
60
99
|
## Never
|
|
61
100
|
|
|
@@ -63,9 +102,25 @@ never weaken the gate).
|
|
|
63
102
|
- Claim clean while judgment steps were skipped without user decision.
|
|
64
103
|
- Claim ENFORCE / “done” when doctor reports `contract-false-green-io-under-application` (adopt first).
|
|
65
104
|
- Replace host Nest/DI with the runtime kernel unasked.
|
|
105
|
+
- Treat “plan empty” as “architecture is healthy” without the explore pass.
|
|
66
106
|
|
|
67
107
|
## Done criteria
|
|
68
108
|
|
|
109
|
+
- Explore pass completed (product map + paths read + bets listed).
|
|
69
110
|
- Every applied step validated by real `ark-check`.
|
|
70
111
|
- Final plan `goal.met` true **or** remaining steps listed with file-level proposals and why blocked.
|
|
71
|
-
- Report cites paths you changed and
|
|
112
|
+
- Report cites paths you changed, open **opportunities**, and report HTML paths.
|
|
113
|
+
|
|
114
|
+
## Completion contract (skill incomplete if missing)
|
|
115
|
+
|
|
116
|
+
End with **exactly** these headings (markdown `###`):
|
|
117
|
+
|
|
118
|
+
### Completion
|
|
119
|
+
- **Sensor:** commands/tools run
|
|
120
|
+
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
121
|
+
- **Result:** one-line outcome
|
|
122
|
+
- **Handoff:** `/ark-…` / CLI / `none`
|
|
123
|
+
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
124
|
+
|
|
125
|
+
If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
|
|
126
|
+
**Skill incomplete if missing** any of the bullets above.
|
|
@@ -9,6 +9,23 @@ The **one sanctioned way** to change layers/rules/`intentPrefixes`/includes.
|
|
|
9
9
|
Also used to **land mined business rules** into the executable manifest (`ark.config.json` + intent naming that `ark://manifest` exposes).
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
## Dual engine (mandatory)
|
|
13
|
+
|
|
14
|
+
| Engine | Role |
|
|
15
|
+
|--------|------|
|
|
16
|
+
| **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
|
|
17
|
+
| **Exploratory** | You open **this** repo's real files and product surface before concluding |
|
|
18
|
+
|
|
19
|
+
The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Subagent fan-out (optional, host-dependent)
|
|
23
|
+
|
|
24
|
+
If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
|
|
25
|
+
dirs to sample), fan out read-only scouts; otherwise **fall back to sequential**.
|
|
26
|
+
Parent merges and still emits the **### Completion** contract. Never parallel-write
|
|
27
|
+
the same files or weaken the gate.
|
|
28
|
+
|
|
12
29
|
## Related onboarding
|
|
13
30
|
|
|
14
31
|
- **Greenfield:** `/ark-architect` or `ark-check --recommend` / `ark start`.
|
|
@@ -50,8 +67,27 @@ Also used to **land mined business rules** into the executable manifest (`ark.co
|
|
|
50
67
|
|
|
51
68
|
Contract edits are most common in **Align (Adapt)**. In **Guard (Enforce)**, treat edits as high-risk product decisions.
|
|
52
69
|
|
|
70
|
+
## Critical handoffs
|
|
71
|
+
|
|
72
|
+
- 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.
|
|
73
|
+
- 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.
|
|
74
|
+
|
|
53
75
|
## Done
|
|
54
76
|
|
|
55
77
|
- Diff of `ark.config.json` explained in plain language.
|
|
56
78
|
- **Así te lo re-soluciono en el manifiesto** when intents/Domain were part of the request.
|
|
57
79
|
- Strict check result captured.
|
|
80
|
+
|
|
81
|
+
## Completion contract (skill incomplete if missing)
|
|
82
|
+
|
|
83
|
+
End with **exactly** these headings (markdown `###`):
|
|
84
|
+
|
|
85
|
+
### Completion
|
|
86
|
+
- **Sensor:** commands/tools run
|
|
87
|
+
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
88
|
+
- **Result:** one-line outcome
|
|
89
|
+
- **Handoff:** `/ark-…` / CLI / `none`
|
|
90
|
+
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
91
|
+
|
|
92
|
+
If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
|
|
93
|
+
**Skill incomplete if missing** any of the bullets above.
|
|
@@ -1,23 +1,54 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ark-coverage
|
|
3
|
-
description:
|
|
3
|
+
description: Exploratory deep-audit of real code + Ark adoption gaps. CLI is a sensor only — map the product, read source, propose concrete remediations and ranked opportunities with "así te lo re-soluciono".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /ark-coverage — Deep coverage + capability gaps
|
|
7
7
|
|
|
8
|
-
You audit how this repo uses ArkGate **and** what the **real
|
|
9
|
-
Work autonomously. End with a ranked report that
|
|
8
|
+
You audit how this repo uses ArkGate **and** what the **real product tree** needs next.
|
|
9
|
+
Work autonomously. End with a ranked report that is both **deterministic** (numbers) and
|
|
10
|
+
**exploratory** (source-backed suggestions).
|
|
10
11
|
|
|
11
|
-
## Anti-wrapper rule (mandatory)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Dual engine (mandatory)
|
|
14
|
+
|
|
15
|
+
| Engine | Deliverable |
|
|
16
|
+
|--------|-------------|
|
|
17
|
+
| **Deterministic** | governed%, layers, gates, baseline, doctor gaps, summary edges |
|
|
18
|
+
| **Exploratory** | product map, clusters opened, opportunities beyond “fix violation X” |
|
|
19
|
+
|
|
20
|
+
**Forbidden:** only `ark-check --coverage/--doctor/--json` paraphrase or gate checklists with no source evidence.
|
|
14
21
|
|
|
15
22
|
**Required before you finish:**
|
|
16
|
-
1.
|
|
17
|
-
2. **
|
|
18
|
-
3.
|
|
23
|
+
1. CLI sensor: `--coverage --json`, `--doctor`, normal `--json` for `summary`.
|
|
24
|
+
2. **Product surface** — README, workspaces, entry apps/APIs (name them).
|
|
25
|
+
3. **Read real source** in the top ungoverned / high-coupling clusters (minimum **10 files**
|
|
26
|
+
across at least **4 directories** that matter for this product). Prefer domain, features,
|
|
27
|
+
adapters, app routes — not only config.
|
|
28
|
+
4. **“Así te lo re-soluciono”** — file-level moves, contract globs, intent/manifest proposals.
|
|
29
|
+
5. **Suggestive section** — opportunities (shape, extract, peerIsolation, manifiesto, DX)
|
|
30
|
+
ranked by impact × enforceability, even if the check is already green.
|
|
31
|
+
|
|
32
|
+
If you did not open source files, the skill is **not complete**.
|
|
33
|
+
Full recon-only mode: `/ark-explore`.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Subagent fan-out (optional, host-dependent)
|
|
37
|
+
|
|
38
|
+
When the user asks to go faster **or** the work naturally splits (multiple packages,
|
|
39
|
+
feature dirs, plan clusters), you **may** dispatch **subagents**:
|
|
19
40
|
|
|
20
|
-
|
|
41
|
+
| Host capability | Behavior |
|
|
42
|
+
|-----------------|----------|
|
|
43
|
+
| **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. |
|
|
44
|
+
| **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. |
|
|
45
|
+
|
|
46
|
+
**Rules:**
|
|
47
|
+
1. Give each subagent a **tight brief**: paths in scope, sensor commands allowed, deliverable shape (paths opened + findings JSON or bullets).
|
|
48
|
+
2. **No shared mutable files** across parallel writers.
|
|
49
|
+
3. STOP handoffs and dual-engine rules still apply in every agent.
|
|
50
|
+
4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
|
|
51
|
+
5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
|
|
21
52
|
|
|
22
53
|
## Operating modes (detected — not user-picked)
|
|
23
54
|
|
|
@@ -25,51 +56,74 @@ If you did not open source files, the skill is **not complete**.
|
|
|
25
56
|
|------|----------------|--------------------|
|
|
26
57
|
| **Suggest / Setup** | Thin or new tree | “Ark will propose a starting shape — you don’t switch a mode.” |
|
|
27
58
|
| **Adapt / Align** | Contract ≠ folders or open debt | “Gates don’t fully protect you yet — classify + fix plan.” |
|
|
28
|
-
| **Enforce / Guard** | Coverage + clean edges | “You arrived here — keep CI/write gates on.” |
|
|
59
|
+
| **Enforce / Guard** | Coverage + clean edges + honest cores | “You arrived here — keep CI/write gates on.” |
|
|
29
60
|
|
|
30
|
-
Never say “your architecture is guarded” while `goal.met` is false
|
|
61
|
+
Never say “your architecture is guarded” while `goal.met` is false, governed% is low,
|
|
62
|
+
or false-green doctor gaps are open.
|
|
31
63
|
|
|
32
64
|
## Related onboarding
|
|
33
65
|
|
|
34
66
|
- **Greenfield:** low governed% → `/ark-architect` or `ark-check --recommend`.
|
|
35
67
|
- **Brownfield:** `/ark-adopt` + this skill’s deep map — **not** `/ark-architect`.
|
|
36
|
-
- **Business rules / intents loose in the tree:** also cover in **Así te lo re-soluciono**
|
|
68
|
+
- **Business rules / intents loose in the tree:** also cover in **Así te lo re-soluciono**
|
|
69
|
+
(mine → `intentPrefixes` / Domain placement / kernel `defineIntent` stubs).
|
|
70
|
+
- **Explore-only report:** `/ark-explore`.
|
|
37
71
|
|
|
38
|
-
## Checklist (sensor
|
|
72
|
+
## Checklist (sensor)
|
|
39
73
|
|
|
40
|
-
1. Config + `ark-check --strict-config` (
|
|
74
|
+
1. Config + `ark-check --strict-config` (dead preset globs advisory; unclassified files still fail strict).
|
|
41
75
|
2. Baseline policy (orphan empty file? wire or delete).
|
|
42
76
|
3. Write gates + `/ark-*` skills per detected agent.
|
|
43
77
|
4. CI workflow + monorepo install reality (`frontend/package.json`?).
|
|
44
78
|
5. ESLint `arkgate/eslint` if ESLint exists.
|
|
45
79
|
6. Domain `forbiddenGlobals`.
|
|
46
|
-
7. **Governed%** +
|
|
80
|
+
7. **Governed%** + unclassified + `suggestions` from `--coverage --json`.
|
|
47
81
|
8. Concentrated edges in check `summary` → contract smell, not N freezes.
|
|
48
|
-
9. `layersWithoutRules
|
|
82
|
+
9. `layersWithoutRules` + empty cores with I/O under Application (false-green).
|
|
83
|
+
On false-green: **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`.
|
|
84
|
+
On one-edge wall: **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).
|
|
49
85
|
10. Runtime kernel / Nest only if deps prove it — never force-fit Next+Python.
|
|
50
86
|
|
|
51
|
-
## Deep code pass (the model job)
|
|
87
|
+
## Deep code pass (exploratory — the model job)
|
|
52
88
|
|
|
53
|
-
For each top cluster (e.g. `
|
|
89
|
+
For each top cluster (e.g. `src/features/*`, `src/lib/*`, `apps/*/src`):
|
|
54
90
|
|
|
55
|
-
- Who imports whom (App→Presentation? Domain→App?).
|
|
56
|
-
- Is “core” really application, UI, or mixed?
|
|
91
|
+
- Who imports whom (App→Presentation? Domain→App? cross-feature?).
|
|
92
|
+
- Is “core” / “lib” really application, UI, I/O, or mixed?
|
|
57
93
|
- Loose business logic: `calculate*`, `can*`, `validate*`, policy numbers, publish/intent strings without registry.
|
|
58
|
-
- Propose: layer home, `ark.config.json` patterns,
|
|
94
|
+
- Propose: layer home, `ark.config.json` patterns, Domain extract, intent names (`Domain.*` / `Application.*`).
|
|
95
|
+
- **Opportunity**, not only residual debt: what would make agents safer next week?
|
|
59
96
|
|
|
60
97
|
## Output format
|
|
61
98
|
|
|
62
|
-
1. **Headline honesty** — governed%, mode, violations, false-green risk
|
|
99
|
+
1. **Headline honesty** — product one-liner, governed%, mode, violations, false-green risk.
|
|
63
100
|
2. **Code map** — clusters you read + what you found (paths).
|
|
64
|
-
3. **Ranked table**
|
|
101
|
+
3. **Ranked table** (mix residual gaps + opportunities)
|
|
102
|
+
|
|
103
|
+
| # | Kind | Gap / opportunity | Evidence (path or CLI) | Así te lo re-soluciono (concrete) |
|
|
65
104
|
|
|
66
|
-
|
|
105
|
+
Kinds: `debt` | `false-green` | `shape` | `manifiesto` | `gates` | `opportunity`
|
|
67
106
|
|
|
68
|
-
4. **Manifiesto / reglas de negocio** (if any
|
|
69
|
-
5. Offer: “Apply top N?” — apply only if user agrees; then re-run strict check.
|
|
107
|
+
4. **Manifiesto / reglas de negocio** (if any): proposed intents / Domain files / config edits.
|
|
108
|
+
5. Offer: “Apply top N?” / “Run /ark-adopt?” — apply only if user agrees; then re-run strict check.
|
|
70
109
|
|
|
71
110
|
## Done criteria
|
|
72
111
|
|
|
73
|
-
- ≥
|
|
112
|
+
- ≥10 source files read and cited; product surface named.
|
|
74
113
|
- At least one **Así te lo re-soluciono** block with real paths.
|
|
114
|
+
- At least **two** exploratory suggestions (not only CLI residual debt).
|
|
75
115
|
- CLI numbers used as evidence, not as the whole report.
|
|
116
|
+
|
|
117
|
+
## Completion contract (skill incomplete if missing)
|
|
118
|
+
|
|
119
|
+
End with **exactly** these headings (markdown `###`):
|
|
120
|
+
|
|
121
|
+
### Completion
|
|
122
|
+
- **Sensor:** commands/tools run
|
|
123
|
+
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
124
|
+
- **Result:** one-line outcome
|
|
125
|
+
- **Handoff:** `/ark-…` / CLI / `none`
|
|
126
|
+
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
127
|
+
|
|
128
|
+
If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
|
|
129
|
+
**Skill incomplete if missing** any of the bullets above.
|
|
@@ -8,6 +8,23 @@ description: Explain this project's architecture in plain language and generate
|
|
|
8
8
|
The user wants to understand the architecture, a specific rule, or why the gate blocked them.
|
|
9
9
|
Your job is to **teach with this repo's real data** and leave a shareable visual artifact.
|
|
10
10
|
|
|
11
|
+
## Dual engine (mandatory)
|
|
12
|
+
|
|
13
|
+
| Engine | Role |
|
|
14
|
+
|--------|------|
|
|
15
|
+
| **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
|
|
16
|
+
| **Exploratory** | You open **this** repo's real files and product surface before concluding |
|
|
17
|
+
|
|
18
|
+
The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Subagent fan-out (optional, host-dependent)
|
|
22
|
+
|
|
23
|
+
If the host supports **parallel subagents** and the task splits cleanly (e.g. multiple
|
|
24
|
+
dirs to sample), fan out read-only scouts; otherwise **fall back to sequential**.
|
|
25
|
+
Parent merges and still emits the **### Completion** contract. Never parallel-write
|
|
26
|
+
the same files or weaken the gate.
|
|
27
|
+
|
|
11
28
|
## Always do this first (showcase report)
|
|
12
29
|
|
|
13
30
|
1. Run the full HTML report (uses the real contract + coverage + gates):
|
|
@@ -62,7 +79,9 @@ else is judgment/deferred and must not be auto-applied.
|
|
|
62
79
|
- Enforcement points that are actually on: write gate, CI, ESLint, baseline.
|
|
63
80
|
- If a DI/kernel framework border exists, explain public surface vs internals.
|
|
64
81
|
3. **If asked about a specific rule or block**, answer with: the rule, the consequence it
|
|
65
|
-
prevents, and the sanctioned fix (usually a port)
|
|
82
|
+
prevents, and the sanctioned fix (usually a port). If they want it fixed now:
|
|
83
|
+
**STOP — do not continue this skill as complete.** **STOP — fix requested: invoke /ark-fix.**
|
|
84
|
+
This skill stays read-only.
|
|
66
85
|
4. **If asked "what's a port/adapter/saga…"**, two sentences + this-repo example or conventional path.
|
|
67
86
|
|
|
68
87
|
## Operating rules
|
|
@@ -82,3 +101,17 @@ else is judgment/deferred and must not be auto-applied.
|
|
|
82
101
|
- Onboarding: `/ark-architect`, `ark-check --recommend`, `docs/enthusiast/README.md`
|
|
83
102
|
- Brownfield: `/ark-adopt`, `docs/brownfield-adoption.md`
|
|
84
103
|
- Autopilot: `/ark-autopilot` after the user understands the contract
|
|
104
|
+
|
|
105
|
+
## Completion contract (skill incomplete if missing)
|
|
106
|
+
|
|
107
|
+
End with **exactly** these headings (markdown `###`):
|
|
108
|
+
|
|
109
|
+
### Completion
|
|
110
|
+
- **Sensor:** commands/tools run
|
|
111
|
+
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
112
|
+
- **Result:** one-line outcome
|
|
113
|
+
- **Handoff:** `/ark-…` / CLI / `none`
|
|
114
|
+
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
115
|
+
|
|
116
|
+
If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
|
|
117
|
+
**Skill incomplete if missing** any of the bullets above.
|