arkgate 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -0
- package/README.md +14 -2
- package/bin/ark-mcp.mjs +282 -102
- package/bin/lib/agent-gates.mjs +181 -6
- package/bin/lib/architecture-scan.mjs +19 -0
- package/bin/lib/auto-patch.mjs +264 -0
- package/bin/lib/doctor-plan.mjs +54 -0
- package/bin/lib/port-proof.mjs +309 -0
- package/bin/lib/prepare-write.mjs +130 -0
- package/bin/lib/remediation.mjs +21 -0
- package/dist/index.cjs +13 -4
- 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 +13 -4
- 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 +13 -4
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.js +13 -4
- package/dist/runtime/index.js.map +1 -1
- package/docs/agent-guide.md +14 -0
- package/docs/ai-gates.md +43 -3
- package/docs/enthusiast/how-to-agent-gates.md +8 -0
- package/docs/enthusiast/reference-commands.md +1 -1
- package/package.json +2 -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 +35 -2
- package/templates/skills/ark-explore.md +119 -0
- package/templates/skills/ark-fix.md +47 -2
- package/templates/skills/ark-loop.md +50 -3
- 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
|
@@ -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):
|
|
@@ -49,7 +66,7 @@ forensics, baseline taxonomy) for tech leads.
|
|
|
49
66
|
|
|
50
67
|
When explaining the **plan**, name the four `mechanical-safe` remediation kinds only
|
|
51
68
|
(type-only move, pure-type file relocate, `import type` of pure-type modules,
|
|
52
|
-
`import-type-of-type-exports` for named type exports from mixed modules) — everything
|
|
69
|
+
`import-type-of-type-exports` for named type exports from mixed modules; W6 port-proof inject is judgment when proof holds) — everything
|
|
53
70
|
else is judgment/deferred and must not be auto-applied.
|
|
54
71
|
|
|
55
72
|
## Spoken / written explanation
|
|
@@ -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.
|
|
@@ -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 —
|
|
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.
|
|
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
|
|
|
@@ -33,8 +65,9 @@ validating every change with `ark-check` and rolling back regressions.
|
|
|
33
65
|
| `pure-type-file-relocate` | Relocate pure-type file to owning layer (or rename out of false Domain globs) |
|
|
34
66
|
| `import-type-from-pure-type-module` | Convert value import of pure-type module to `import type` |
|
|
35
67
|
| `import-type-of-type-exports` | Convert value-syntax named import/export of type-only exports from a mixed module to `import type` / `export type` |
|
|
68
|
+
| *(none for port-proof)* | **W6** `port-proof-inject-binding` is **judgment** (arity change) — propose inject; do not auto-apply |
|
|
36
69
|
|
|
37
|
-
Never auto: value
|
|
70
|
+
Never auto: free value uses of imports, multi-import files, dynamic import/require, forbidden globals, cycles, port-proof inject, multi-file adapter scaffolding without proof.
|
|
38
71
|
|
|
39
72
|
## Steps
|
|
40
73
|
|
|
@@ -56,3 +89,17 @@ Never auto: value imports (including mixed bindings with values), dynamic import
|
|
|
56
89
|
- Gate confirms each kept edit.
|
|
57
90
|
- Honest residual list with **Así te lo re-soluciono** for anything left.
|
|
58
91
|
- If residual steps hide domain/business rules in the wrong layer, call out **manifiesto** work (`intentPrefixes` / Domain placement) via `/ark-contract` or `/ark-adopt`.
|
|
92
|
+
|
|
93
|
+
## Completion contract (skill incomplete if missing)
|
|
94
|
+
|
|
95
|
+
End with **exactly** these headings (markdown `###`):
|
|
96
|
+
|
|
97
|
+
### Completion
|
|
98
|
+
- **Sensor:** commands/tools run
|
|
99
|
+
- **Opened:** real paths read (or `n/a` only if pure install/upgrade with no source analysis)
|
|
100
|
+
- **Result:** one-line outcome
|
|
101
|
+
- **Handoff:** `/ark-…` / CLI / `none`
|
|
102
|
+
- **Incomplete?** `no` | `yes — <what is missing>`
|
|
103
|
+
|
|
104
|
+
If a **STOP** handoff applies and you continued as if done, set **Incomplete?** to `yes`.
|
|
105
|
+
**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.
|