arkgate 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/README.md +90 -67
- package/bin/ark-check.mjs +264 -51
- package/bin/ark-layer-match.mjs +29 -0
- package/bin/ark-mcp.mjs +102 -5
- package/bin/ark-shared.mjs +295 -6
- package/bin/ark.mjs +44 -34
- package/bin/lib/agent-gates.mjs +448 -15
- package/bin/lib/doctor-plan.mjs +11 -4
- package/bin/lib/presets.mjs +75 -4
- package/dist/eslint/index.cjs.map +1 -1
- package/dist/eslint/index.js.map +1 -1
- 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/docs/agent-guide.md +63 -0
- package/package.json +1 -1
- package/server.json +2 -2
- package/templates/skills/ark-adopt.md +43 -87
- package/templates/skills/ark-autopilot.md +39 -77
- package/templates/skills/ark-contract.md +43 -84
- package/templates/skills/ark-coverage.md +62 -83
- package/templates/skills/ark-fix.md +45 -90
- package/templates/skills/ark-loop.md +44 -66
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to ArkGate (`arkgate`; formerly `ark-runtime-kernel`) are documented here.
|
|
4
4
|
|
|
5
|
+
## 2.6.1 — 2026-07-09
|
|
6
|
+
|
|
7
|
+
Field-test release: Next/monorepo honesty (deer-flow-style hosts), simplified **one-flow** UX for
|
|
8
|
+
humans and autonomous agents, and skills that require real source remediation—not CLI paraphrase.
|
|
9
|
+
|
|
10
|
+
### Fixed — false greens & strict CI noise (Next / monorepo)
|
|
11
|
+
|
|
12
|
+
- **Next application bag:** framework overlay classifies `src/core/**` and `**/core/**` as
|
|
13
|
+
ApplicationOrchestration so monorepos like `frontend/src/core` are governed on day one
|
|
14
|
+
(not left as dark matter under a “clean” plan).
|
|
15
|
+
- **Nested Next detection:** `collectAggregatedDeps` + scan of `frontend/`/`web`/`client` so
|
|
16
|
+
`next` only under `frontend/package.json` (root arkgate-only) still enables the Next overlay
|
|
17
|
+
and `app/page.tsx` path matching (middle segment optional).
|
|
18
|
+
- **Next noise excludes:** public assets, tool configs, and scripts are excluded by default on
|
|
19
|
+
Next detection so demo JS does not pollute coverage.
|
|
20
|
+
- **Domain `**/types.ts` trap removed** from monorepo and ui-surface presets. Bare
|
|
21
|
+
`core/**/types.ts` no longer becomes Domain and invents Domain→Application edges.
|
|
22
|
+
- **`CONFIG_LAYER_PATTERN_NO_MATCHES` is advisory** (`failsStrict: false`). Dead preset globs
|
|
23
|
+
(`app/**`, `src/layouts/**` when `include` is `frontend`) no longer fail `--strict-config`
|
|
24
|
+
alone while architecture edges are clean.
|
|
25
|
+
- **Empty baseline policy:** `--update-baseline` with zero violations **deletes** an existing
|
|
26
|
+
empty `.ark-baseline.json` instead of leaving an orphan “is the ratchet on?” file.
|
|
27
|
+
- **Monorepo CI install:** generated workflow `npm install` also installs `frontend/` when
|
|
28
|
+
`frontend/package.json` exists (root-only arkgate + app under frontend).
|
|
29
|
+
|
|
30
|
+
### Changed — one-flow UX (humans + agents)
|
|
31
|
+
|
|
32
|
+
- **README:** leads with **The only flow** — `ark start` → `/ark-autopilot` → `doctor`. Skills
|
|
33
|
+
are escapes, not a flat curriculum. Operating modes documented as **status lights**, not
|
|
34
|
+
settings.
|
|
35
|
+
- **`ark start` wrap-up:** always ends with the three next steps (agent autopilot, doctor,
|
|
36
|
+
strict check) instead of a long mode-specific essay.
|
|
37
|
+
- **Generated `AGENTS.md`:** “Default agent flow (if unsure, do only this)” — autopilot first;
|
|
38
|
+
other `/ark-*` skills are optional escapes.
|
|
39
|
+
- **Doctor operating mode copy:** plain-language Setup / Align / Guard and “you do not pick
|
|
40
|
+
this mode”.
|
|
41
|
+
|
|
42
|
+
### Changed — skills (deep co-pilot, not CLI wrappers)
|
|
43
|
+
|
|
44
|
+
Templates under `templates/skills/` (and project `.grok/skills` copies) for at least:
|
|
45
|
+
|
|
46
|
+
`ark-coverage`, `ark-autopilot`, `ark-loop`, `ark-adopt`, `ark-fix`, `ark-contract`
|
|
47
|
+
|
|
48
|
+
- **Anti-wrapper rule:** must read real source; CLI is a sensor.
|
|
49
|
+
- **“Así te lo re-soluciono”** remediation deliverable (file-level plans).
|
|
50
|
+
- **Adopt / contract:** mine loose business rules into the Ark **manifest** (layers,
|
|
51
|
+
`intentPrefixes`, Domain placement, intent naming)—not config vibes only.
|
|
52
|
+
|
|
53
|
+
### Tests
|
|
54
|
+
|
|
55
|
+
- Fixture-style unit tests drive real `bin/ark-check.mjs`: Next core governance; deer-flow-like
|
|
56
|
+
monorepo (`frontend` + `core/**/types.ts` not Domain); strict-config with dead globs;
|
|
57
|
+
empty baseline removal.
|
|
58
|
+
|
|
59
|
+
### Also in 2.6.1 train (from Unreleased product priorities)
|
|
60
|
+
|
|
61
|
+
- Empty-scope honesty, auto-include TS packages, AGENTS non-clobber, `--adopt-contract`,
|
|
62
|
+
UI surface preset, MCP place/suggest-include, Codex multi-project, deploy-path adoption
|
|
63
|
+
gaps, soft cycle policy, Rush/Lerna monorepo roots, type-only cycle graph, default skip
|
|
64
|
+
`*.gen.ts` / `*.generated.ts`.
|
|
65
|
+
|
|
5
66
|
## 2.6.0 — 2026-07-09
|
|
6
67
|
|
|
7
68
|
### Changed — maintainability hygiene (#11 / #12)
|
package/README.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
# ArkGate — Architecture Co-pilot for AI TypeScript
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**One contract. One gate. One co-pilot.**
|
|
6
6
|
|
|
7
|
-
Your AI writes most of the code.
|
|
8
|
-
|
|
7
|
+
Your AI writes most of the code. ArkGate keeps that code inside an architecture you can trust —
|
|
8
|
+
and makes sure a “green” check means something real.
|
|
9
9
|
|
|
10
10
|
[](https://github.com/pedroknigge/arkgate/actions/workflows/ci.yml)
|
|
11
11
|
[](https://www.npmjs.com/package/arkgate)
|
|
@@ -17,21 +17,42 @@ trust — and makes sure a “green” check means something real.
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## The only flow (humans and agents)
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
If you remember nothing else:
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
```text
|
|
25
|
+
1. npx arkgate start ← install shape + gates + origin report
|
|
26
|
+
2. /ark-autopilot ← in your agent: adopt, fix, leave gates on
|
|
27
|
+
3. npx arkgate-check --doctor ← “where am I?” anytime (one status screen)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
| Stuck on… | Do this |
|
|
31
|
+
|-----------|---------|
|
|
32
|
+
| Gate failed after an edit | `/ark-fix` |
|
|
33
|
+
| “Where does this new file go?” | `/ark-place` |
|
|
34
|
+
| Contract globs / layers wrong | `/ark-contract` |
|
|
35
|
+
| New ArkGate version | `/ark-upgrade` |
|
|
36
|
+
|
|
37
|
+
**Everything else is optional.** You do not need to learn “modes”, 11 skills, or the runtime
|
|
38
|
+
kernel to get value. Agents that are unsure should **only** run `/ark-autopilot` (or the three
|
|
39
|
+
commands above).
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## What it is (30 seconds)
|
|
44
|
+
|
|
45
|
+
**ArkGate** = a machine-readable architecture file (`ark.config.json`) enforced in two places
|
|
46
|
+
you always care about:
|
|
47
|
+
|
|
48
|
+
| When | Tool |
|
|
49
|
+
|------|------|
|
|
50
|
+
| **While the AI writes** | `arkgate-mcp` write gate (blocks bad edits) |
|
|
51
|
+
| **Before merge** | `arkgate-check` CI |
|
|
29
52
|
|
|
30
|
-
|
|
53
|
+
Optional later: runtime kernel (`createArkKernel`) if you want event/intent governance.
|
|
31
54
|
|
|
32
|
-
It is **not** a web framework, ORM, or job runner
|
|
33
|
-
the product. The product is the **agent-native architecture gate** (write path + CI + plan/loop)
|
|
34
|
-
plus tools agents can read *before* generating code (`ark_place`, `ark://manifest`, …).
|
|
55
|
+
It is **not** a web framework, ORM, or job runner.
|
|
35
56
|
|
|
36
57
|

|
|
37
58
|
|
|
@@ -39,31 +60,30 @@ plus tools agents can read *before* generating code (`ark_place`, `ark://manifes
|
|
|
39
60
|
|
|
40
61
|
## Who it’s for
|
|
41
62
|
|
|
42
|
-
|
|
43
|
-
|----------|-----------|------------|
|
|
44
|
-
| **Builder with AI** (not necessarily an architect) | Order without learning “hexagonal” first | `npx arkgate start` → `/ark-autopilot` |
|
|
45
|
-
| **Engineer / tech lead** | A strict contract, CI, baselines, precise control | `ark init` + `ark-check` + write gate |
|
|
46
|
-
| **Team on a messy repo** | Truth about coverage + a cleanup path, not a false green | `ark-check --coverage` → `/ark-adopt` |
|
|
63
|
+
Same start for almost everyone: **`npx arkgate start` → `/ark-autopilot`**.
|
|
47
64
|
|
|
48
|
-
|
|
65
|
+
| You are… | Same start, then… |
|
|
66
|
+
|----------|-------------------|
|
|
67
|
+
| Builder with AI | Stay on autopilot until doctor is happy |
|
|
68
|
+
| Tech lead on a messy monorepo | Autopilot (or deeper `/ark-adopt` if you want a focused brownfield pass) |
|
|
69
|
+
| Power user | Same flow; use `ark-check --plan` / `--coverage` when you want the raw sensor |
|
|
70
|
+
|
|
71
|
+
**Not for:** no TypeScript, “just one lint rule”, or looking for an app framework.
|
|
49
72
|
|
|
50
73
|
---
|
|
51
74
|
|
|
52
|
-
##
|
|
75
|
+
## Status, not settings (“modes”)
|
|
53
76
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
3. **A plan** — what’s safe for an agent to fix vs what needs your decision (`mechanical-safe` vs judgment).
|
|
57
|
-
4. **Honesty** — if Ark only governs 10% of the tree, it says so. “Clean” with almost no coverage is not success.
|
|
58
|
-
5. **Adoption health** — `arkgate-check --doctor` checks co-pilot completeness (hosts, MCP argv, Codex home, core-layer optionality, origin report) **separately** from the 0–100 fitness score.
|
|
77
|
+
`ark-check --doctor` may say **Suggest / Adapt / Enforce**. That is a **status light**, not a
|
|
78
|
+
mode you configure:
|
|
59
79
|
|
|
60
|
-
|
|
80
|
+
| Light | Means | Your move |
|
|
81
|
+
|-------|--------|-----------|
|
|
82
|
+
| **Suggest** | New/thin project | Finish `start` + autopilot |
|
|
83
|
+
| **Adapt** | Not fully protected yet | Keep autopilot / adopt until clean |
|
|
84
|
+
| **Enforce** | Gates can honestly protect you | Build features; fix with `/ark-fix` if blocked |
|
|
61
85
|
|
|
62
|
-
|
|
63
|
-
|------|---------|
|
|
64
|
-
| **Suggest** | Install a starting shape |
|
|
65
|
-
| **Adapt** | Match the contract to real folders / raise coverage |
|
|
66
|
-
| **Enforce** | Gates actually protect you |
|
|
86
|
+
You **arrive** at Enforce. You never “turn on Enforce”.
|
|
67
87
|
|
|
68
88
|
---
|
|
69
89
|
|
|
@@ -85,58 +105,61 @@ Full checklist (CI, MCP, Codex, imports): **[docs/migrate-from-ark-runtime-kerne
|
|
|
85
105
|
|
|
86
106
|
```bash
|
|
87
107
|
npm install -D arkgate typescript
|
|
88
|
-
npx arkgate start
|
|
89
|
-
#
|
|
108
|
+
npx arkgate start # setup + origin report
|
|
109
|
+
# in agent:
|
|
110
|
+
# /ark-autopilot
|
|
111
|
+
npx arkgate-check --doctor # status light + next action
|
|
90
112
|
```
|
|
91
113
|
|
|
92
|
-
|
|
114
|
+
Aliases `ark` / `ark-check` / `ark-mcp` still work. **npm / pnpm / yarn**. No install lifecycle scripts.
|
|
93
115
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
116
|
+
<details>
|
|
117
|
+
<summary>What <code>/ark-autopilot</code> does under the hood (optional detail)</summary>
|
|
118
|
+
|
|
119
|
+
1. Setup if needed (`ark start`).
|
|
120
|
+
2. Origin architecture report (before picture in `.ark/reports/`).
|
|
121
|
+
3. Adoption: match contract to real folders, raise governed %.
|
|
122
|
+
4. Plan + safe auto-fixes; judgment when you ask for full apply.
|
|
123
|
+
5. Gates on + after report (evolution vs origin).
|
|
97
124
|
|
|
98
|
-
|
|
125
|
+
</details>
|
|
99
126
|
|
|
100
|
-
|
|
127
|
+
<details>
|
|
128
|
+
<summary>Manual / power-user CLI only</summary>
|
|
101
129
|
|
|
102
130
|
```bash
|
|
103
|
-
npx arkgate init
|
|
104
|
-
npx arkgate-check
|
|
105
|
-
npx arkgate-check --plan
|
|
131
|
+
npx arkgate init
|
|
132
|
+
npx arkgate-check
|
|
133
|
+
npx arkgate-check --plan
|
|
106
134
|
npx arkgate-check --coverage
|
|
107
135
|
```
|
|
108
136
|
|
|
109
|
-
|
|
137
|
+
</details>
|
|
110
138
|
|
|
111
139
|
---
|
|
112
140
|
|
|
113
|
-
##
|
|
114
|
-
|
|
115
|
-
Install with agent gates:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
npx arkgate-check --install-agent-gates
|
|
119
|
-
# or pick hosts: --tools claude,cursor,codex,grok
|
|
120
|
-
```
|
|
141
|
+
## Other skills (only when you need them)
|
|
121
142
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
| **`/ark-autopilot`** | End-to-end co-pilot: setup → plan → safe auto-fixes → propose the rest → leave gates on |
|
|
125
|
-
| **`/ark-loop`** | Drive the plan in a worktree; auto-apply only `mechanical-safe` (type-only move, pure-type file relocate, `import type` of pure-type modules) |
|
|
126
|
-
| **`/ark-architect`** | Greenfield: pick application shape, phase-1 layers, scaffold, verify honestly |
|
|
127
|
-
| **`/ark-adopt`** | Brownfield: match contract to reality, raise coverage, freeze only real debt |
|
|
128
|
-
| **`/ark-contract`** | Safely edit `ark.config.json` (smallest change, strict re-check) |
|
|
129
|
-
| **`/ark-place`** | Where does this new artifact go? Layer, path, naming — then scaffold |
|
|
130
|
-
| **`/ark-fix`** | Fix violations at the source (no disable comments, no gate weakening) |
|
|
131
|
-
| **`/ark-explain`** | Explain the current contract, coverage, and report in plain language |
|
|
132
|
-
| **`/ark-coverage`** | Audit which Ark capabilities you are not using yet |
|
|
133
|
-
| **`/ark-runtime`** | Opt-in: migrate hand-rolled bus/outbox/sagas onto the runtime kernel |
|
|
134
|
-
| **`/ark-upgrade`** | Bump the package and refresh gates + skills for every agent host (also normalizes MCP bins + Codex home) |
|
|
143
|
+
Install once: `npx arkgate-check --install-agent-gates`
|
|
144
|
+
(`--tools claude,cursor,codex,grok` to pick hosts.)
|
|
135
145
|
|
|
136
|
-
|
|
146
|
+
**Default is always `/ark-autopilot`.** The rest are escapes, not a second curriculum:
|
|
137
147
|
|
|
138
|
-
|
|
148
|
+
| Need | Skill |
|
|
149
|
+
|------|--------|
|
|
150
|
+
| Only the apply loop (plan already exists) | `/ark-loop` |
|
|
151
|
+
| Empty greenfield shape/scaffold | `/ark-architect` |
|
|
152
|
+
| Deep brownfield / manifest mining alone | `/ark-adopt` |
|
|
153
|
+
| New file placement | `/ark-place` |
|
|
154
|
+
| Gate violation on a change | `/ark-fix` |
|
|
155
|
+
| Edit `ark.config.json` safely | `/ark-contract` |
|
|
156
|
+
| Plain-language tour of the report | `/ark-explain` |
|
|
157
|
+
| Deep “what am I not using?” audit | `/ark-coverage` |
|
|
158
|
+
| Migrate hand-rolled bus/outbox (TS) | `/ark-runtime` |
|
|
159
|
+
| Bump ArkGate + refresh all agent hosts | `/ark-upgrade` |
|
|
139
160
|
|
|
161
|
+
Hosts with full MCP/hooks: **Claude Code**, **Cursor**, **Codex**, **Grok Build**.
|
|
162
|
+
More: [docs/ai-gates.md](docs/ai-gates.md). Health: **`npx arkgate-check --doctor`**.
|
|
140
163
|
---
|
|
141
164
|
|
|
142
165
|
## How it works (short)
|