arkgate 3.0.0 → 3.0.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 +29 -1
- package/README.md +16 -14
- package/bin/ark-check.mjs +10 -2
- package/bin/lib/ci-and-commands.mjs +20 -15
- package/bin/lib/design-smells.mjs +434 -0
- package/bin/lib/doctor-plan.mjs +149 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/agent-guide.md +22 -1
- package/docs/ai-gates.md +7 -0
- package/docs/brownfield-adoption.md +52 -1
- package/docs/demos/03-copilot-autopilot.md +14 -7
- package/docs/package-surface.md +3 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/templates/skills/ark-adopt.md +26 -3
- package/templates/skills/ark-architect.md +7 -0
- package/templates/skills/ark-autopilot.md +37 -20
- package/templates/skills/ark-contract.md +7 -0
- package/templates/skills/ark-coverage.md +44 -45
- package/templates/skills/ark-explain.md +8 -0
- package/templates/skills/ark-explore.md +117 -47
- package/templates/skills/ark-fix.md +22 -0
- package/templates/skills/ark-loop.md +15 -1
- package/templates/skills/ark-place.md +7 -0
- package/templates/skills/ark-think.md +24 -20
|
@@ -12,6 +12,19 @@ Deterministic kinds stay **tight**. Your job is still **exploratory on the files
|
|
|
12
12
|
importers/targets, see if the plan step is a symptom of wrong shape / false Domain / I/O
|
|
13
13
|
under Application — escalate to `/ark-contract` or `/ark-explore` when the wall is structural.
|
|
14
14
|
|
|
15
|
+
## When / not when
|
|
16
|
+
|
|
17
|
+
| Use `/ark-loop` when… | Do **not** use it when… |
|
|
18
|
+
|-----------------------|-------------------------|
|
|
19
|
+
| Plan A has steps; drive to `goal.met` | Plan A empty — **stop**; residual Shape → `/ark-explore` / `/ark-autopilot` B |
|
|
20
|
+
| Mechanical-safe + approved judgment only | Full product recon first → explore inside `/ark-autopilot` |
|
|
21
|
+
| User already has a plan and wants the apply loop | Brownfield contract false-green → `/ark-adopt` |
|
|
22
|
+
|
|
23
|
+
**Empty plan is not success for the product** — only for *edge remediation*. If `goal.met` and
|
|
24
|
+
(`goal.designWeak` or non-empty `patternBets` from `--plan --json`): do **not** invent
|
|
25
|
+
mechanical-safe kinds; hand off `/ark-explore` shape-focus or `/ark-autopilot` for dual-plan B.
|
|
26
|
+
Pattern bets always have `neverMechanicalSafe: true` — extraction cards only
|
|
27
|
+
(`docs/brownfield-adoption.md` §6).
|
|
15
28
|
|
|
16
29
|
## Related onboarding
|
|
17
30
|
|
|
@@ -71,7 +84,8 @@ Never auto: free value uses of imports, multi-import files, dynamic import/requi
|
|
|
71
84
|
|
|
72
85
|
## Steps
|
|
73
86
|
|
|
74
|
-
1. **Plan** — `ark-check --plan --json` (+ `--baseline` if used). If `goal.met
|
|
87
|
+
1. **Plan** — `ark-check --plan --json` (+ `--baseline` if used). If `goal.met`: stop **A**;
|
|
88
|
+
if design-weak residual is visible, hand off explore/autopilot B — do not claim architecture done.
|
|
75
89
|
2. **Worktree** — prefer discardable git worktree.
|
|
76
90
|
3. **Apply mechanical-safe** one-by-one with validate/rollback.
|
|
77
91
|
4. **Judgment** — propose with source-based design; apply only if user approved (or parent autopilot said full apply).
|
|
@@ -5,6 +5,13 @@ description: "Where does new code go? Names the layer, directory, and naming for
|
|
|
5
5
|
|
|
6
6
|
# /ark-place — Where does this code go?
|
|
7
7
|
|
|
8
|
+
## When / not when
|
|
9
|
+
|
|
10
|
+
| Use `/ark-place` when… | Do **not** use it when… |
|
|
11
|
+
|------------------------|-------------------------|
|
|
12
|
+
| New artifact: where + scaffold under contract | Existing violation fix → `/ark-fix` |
|
|
13
|
+
| Naming / directory for a known kind | Contract layers wrong → `/ark-contract`; full shape choice greenfield → `/ark-architect` |
|
|
14
|
+
|
|
8
15
|
The user describes something they need to build (a saga, a background job, an
|
|
9
16
|
event handler, a repository, an HTTP client, a use case, a projection, …).
|
|
10
17
|
Your job: name the layer it belongs to, the directory, the naming convention,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ark-think
|
|
3
|
-
description:
|
|
3
|
+
description: Host-side architectural reasoning — 2–3 enforceable options from real code + contract for ONE decision. Not full recon (use /ark-explore). No gate bypass. No package LLM call.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# /ark-think — Architectural reasoning (host LLM only)
|
|
@@ -9,17 +9,27 @@ 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
|
+
## When / not when
|
|
13
|
+
|
|
14
|
+
| Use `/ark-think` when… | Do **not** use it when… |
|
|
15
|
+
|------------------------|-------------------------|
|
|
16
|
+
| One decision: new layer vs slice, port vs shared, peerIsolation choice | Full map / ranked residual / dual-plan seed → `/ark-explore` |
|
|
17
|
+
| 2–3 options already bounded by a known surface | Apply remediation → `/ark-fix` / `/ark-loop` / `/ark-autopilot` |
|
|
18
|
+
| Trade-offs before writing a **new** feature | Brownfield contract wrong / false-green → `/ark-adopt` then `/ark-contract` |
|
|
19
|
+
| Explain *why* a rule exists in *this* tree | HTML tour → `/ark-explain`; fitness numbers → `/ark-coverage` |
|
|
20
|
+
|
|
21
|
+
If you lack a product map and the tree is messy: run a **compressed** explore pass first
|
|
22
|
+
(≥8 files) **or** **STOP** and invoke `/ark-explore` — do not invent options from diagrams alone.
|
|
12
23
|
|
|
13
24
|
## Dual engine (mandatory)
|
|
14
25
|
|
|
15
26
|
| Engine | Role |
|
|
16
27
|
|--------|------|
|
|
17
28
|
| **Deterministic** | What the contract and doctor *prove* today (layers, rules, governed%, gaps) |
|
|
18
|
-
| **Exploratory** | What *this*
|
|
29
|
+
| **Exploratory** | What *this* decision surface wants — options grounded in files you open |
|
|
19
30
|
|
|
20
31
|
Never reason only from abstract hexagons. Open real modules before recommending a shape.
|
|
21
32
|
|
|
22
|
-
|
|
23
33
|
## Subagent fan-out (optional, host-dependent)
|
|
24
34
|
|
|
25
35
|
When the user asks to go faster **or** the work naturally splits (multiple packages,
|
|
@@ -37,38 +47,32 @@ feature dirs, plan clusters), you **may** dispatch **subagents**:
|
|
|
37
47
|
4. Parent owns the **### Completion** block (union of **Opened**, single **Handoff**).
|
|
38
48
|
5. Do **not** use subagents to weaken the gate or invent `mechanical-safe` kinds.
|
|
39
49
|
|
|
40
|
-
## When to use
|
|
41
|
-
|
|
42
|
-
- Design trade-offs before writing code
|
|
43
|
-
- “Should this be a new layer or a feature slice?”
|
|
44
|
-
- Evolving brownfield layout toward a named preset
|
|
45
|
-
- Explaining why a peerIsolation or layer rule exists
|
|
46
|
-
- Choosing among 2–3 enforceable futures (not infinite diagrams)
|
|
47
|
-
|
|
48
50
|
## Steps
|
|
49
51
|
|
|
50
52
|
1. **Load the contract** — `ark.config.json`, MCP `ark://manifest` if available, and
|
|
51
53
|
`ark-check --coverage --json` / `--doctor` for honesty about governed% and false-green.
|
|
52
|
-
2. **Touch the
|
|
53
|
-
|
|
54
|
+
2. **Touch the decision surface** — README skim + **≥5 source files** on the feature/package/boundary
|
|
55
|
+
under discussion. Name paths in the answer.
|
|
54
56
|
3. **Name the active shape** — which preset/archetype fits (hexagonal, vertical-slice,
|
|
55
57
|
ddd-bounded-contexts, feature-sliced, monorepo, …). If none, run `--recommend --json`
|
|
56
58
|
**and** say whether detection matches the tree you opened.
|
|
57
|
-
4. **
|
|
59
|
+
4. **Name concurrent patterns** on the decision surface (if ≥2): which is **golden** vs legacy.
|
|
60
|
+
5. **Reason within bounds** — propose **2–3 options** that **stay enforceable** by the gate.
|
|
58
61
|
Prefer concrete paths and import rules over abstract diagrams.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
6. **Explore alternatives** — for each option: coupling, testability, **AI-agent safety**,
|
|
63
|
+
migration cost, **pilot + kill-switch** if the option adds a layer or wall.
|
|
64
|
+
7. **Surface hard lines** — never suggest: weakening `ark.config.json` to pass, silent
|
|
62
65
|
judgment auto-apply, codemod engines, or skipping write-gate/CI.
|
|
63
|
-
|
|
66
|
+
8. **Hand off** — placement `/ark-place`; config `/ark-contract`; bulk debt `/ark-loop` /
|
|
64
67
|
`/ark-autopilot`; map-only `/ark-explore`; violations `/ark-fix`.
|
|
65
68
|
When the user needs action not advice: **STOP — do not continue this skill as complete** — invoke the handoff skill.
|
|
66
69
|
|
|
67
70
|
## Output format
|
|
68
71
|
|
|
69
|
-
- **Context:** product + contract + what you opened (paths)
|
|
72
|
+
- **Context:** product + contract + what you opened (paths) + phase if known (Align/Stabilize/Shape)
|
|
70
73
|
- **Options:** 2–3 alternatives with trade-offs (coupling, testability, agent safety, enforceability)
|
|
71
74
|
- **Recommendation:** one option + why it is enforceable **today**
|
|
75
|
+
- **Pilot / kill-switch:** if the choice changes shape or adds a layer
|
|
72
76
|
- **Risks if we pick wrong:** one sentence user-visible impact
|
|
73
77
|
- **Next command:** exact `ark-check` / skill to run next
|
|
74
78
|
|
|
@@ -76,7 +80,7 @@ feature dirs, plan clusters), you **may** dispatch **subagents**:
|
|
|
76
80
|
|
|
77
81
|
- Greenfield shape: `/ark-architect`
|
|
78
82
|
- Brownfield: `/ark-adopt`
|
|
79
|
-
- Full recon: `/ark-explore`
|
|
83
|
+
- Full recon / dual-plan seed: `/ark-explore`
|
|
80
84
|
- Explain existing: `/ark-explain`
|
|
81
85
|
|
|
82
86
|
## Completion contract (skill incomplete if missing)
|