arkgate 4.7.1 → 4.7.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +31 -22
  3. package/bin/lib/agent-projection.mjs +1 -1
  4. package/bin/lib/ci-and-commands.mjs +3 -3
  5. package/bin/lib/enforcement-honesty.mjs +1 -1
  6. package/bin/lib/first-run-help.mjs +3 -3
  7. package/dist/index.cjs +2 -2
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.js +2 -2
  10. package/docs/README.md +8 -4
  11. package/docs/agent-guide.md +5 -4
  12. package/docs/ai-gates.md +2 -1
  13. package/docs/develop.md +4 -0
  14. package/docs/enthusiast/README.md +3 -0
  15. package/docs/package-surface.md +5 -2
  16. package/docs/product-voice.md +118 -5
  17. package/docs/use.md +15 -8
  18. package/package.json +2 -2
  19. package/server.json +4 -4
  20. package/templates/agent-skills/README.md +1 -1
  21. package/templates/agent-skills/ark-adopt/SKILL.md +2 -2
  22. package/templates/agent-skills/ark-architect/SKILL.md +1 -1
  23. package/templates/agent-skills/ark-autopilot/SKILL.md +2 -2
  24. package/templates/agent-skills/ark-contract/SKILL.md +1 -1
  25. package/templates/agent-skills/ark-coverage/SKILL.md +1 -1
  26. package/templates/agent-skills/ark-explain/SKILL.md +1 -1
  27. package/templates/agent-skills/ark-explore/SKILL.md +1 -1
  28. package/templates/agent-skills/ark-fix/SKILL.md +1 -1
  29. package/templates/agent-skills/ark-loop/SKILL.md +1 -1
  30. package/templates/agent-skills/ark-place/SKILL.md +1 -1
  31. package/templates/agent-skills/ark-runtime/SKILL.md +1 -1
  32. package/templates/agent-skills/ark-think/SKILL.md +1 -1
  33. package/templates/agent-skills/ark-upgrade/SKILL.md +1 -1
  34. package/templates/skills/ark-adopt.md +2 -2
  35. package/templates/skills/ark-architect.md +1 -1
  36. package/templates/skills/ark-autopilot.md +2 -2
  37. package/templates/skills/ark-contract.md +1 -1
  38. package/templates/skills/ark-coverage.md +1 -1
  39. package/templates/skills/ark-explain.md +1 -1
  40. package/templates/skills/ark-explore.md +1 -1
  41. package/templates/skills/ark-fix.md +1 -1
  42. package/templates/skills/ark-loop.md +1 -1
  43. package/templates/skills/ark-place.md +1 -1
  44. package/templates/skills/ark-runtime.md +1 -1
  45. package/templates/skills/ark-think.md +1 -1
  46. package/templates/skills/ark-upgrade.md +1 -1
package/docs/use.md CHANGED
@@ -2,7 +2,12 @@
2
2
 
3
3
  For **anyone** shipping TypeScript with an AI coding agent. You do not need to study clean architecture first.
4
4
 
5
- **One architecture config. One check. One coach.**
5
+ **If the AI writes an illegal import, the write is rejected. The same check fails the pull request.**
6
+
7
+ Not an API Gateway. Not a folder linter. If the check is not required on the PR, the rules
8
+ file is just documentation.
9
+
10
+ **One rules file. One check. One next step.**
6
11
 
7
12
  ---
8
13
 
@@ -11,12 +16,12 @@ For **anyone** shipping TypeScript with an AI coding agent. You do not need to s
11
16
  ```bash
12
17
  npm install -D arkgate typescript
13
18
  npx arkgate start # preview what will change
14
- npx arkgate start --apply # install compact contract + host router + CI plan
15
- npx arkgate-check --doctor # where am I? one status light, one next action
16
- npx arkgate-check --doctor --all # encyclopedia (Details)
19
+ npx arkgate start --apply # install compact config + host router + CI plan
20
+ npx arkgate-check --doctor # what's wrong, what to do first
21
+ npx arkgate-check --doctor --all # full details
17
22
  ```
18
23
 
19
- Then keep working with your agent. The doctor is the **control plane**: when stuck, run doctor and do action **#1**. Compact first; `--all` for Details.
24
+ Then keep working with your agent. Stuck? Run `--doctor` and do action **#1**. Compact first; `--all` for details.
20
25
 
21
26
  | Stuck on… | Do this |
22
27
  |-----------|---------|
@@ -36,7 +41,8 @@ Skip ArkGate (or treat it as overkill) when:
36
41
  - The project has **no AI coding agents** and **no multi-layer integration boundaries** worth pinning.
37
42
  - It is a **single-developer hobby CRUD** with no pressure to keep layers honest over time.
38
43
  - The team will **not** maintain `ark.config.json` layers or make `arkgate-check --strict-merge` a
39
- **required** GitHub status context — without that, local advisory write stays avoidable.
44
+ **required** GitHub status context — without that, the rules file is just documentation and a
45
+ warning at write time can be ignored.
40
46
 
41
47
  In those cases a boundary linter or editor rules may be enough; see [README — Why not only ESLint / Nx / cruiser?](../README.md#why-not-only-eslint--nx--cruiser). When you *do* adopt, day-to-day honesty is still: advisory write on soft hosts → required merge status. Surface that with `npx arkgate-check --doctor` or `npx arkgate status --json` ([agent guide — Write-path honesty](agent-guide.md#write-path-honesty)).
42
48
 
@@ -46,7 +52,7 @@ In those cases a boundary linter or editor rules may be enough; see [README —
46
52
 
47
53
  | When | What happens |
48
54
  |------|----------------|
49
- | While the AI writes | Host write gate or advisory MCP (depends on host) |
55
+ | While the AI writes | The write is rejected, or you get a warning (depends on the host) |
50
56
  | Before merge | Make the Ark job a **required GitHub status context** running `arkgate-check --strict-merge` (alias `ark-check`). Until that status is required — or you write `.ark/adoption-stance.json` with `stance: "advisory-only"` — doctor will not call the tree adopted. |
51
57
  | Anytime | Doctor: Suggest / Adapt / Enforce (+ leftover design work if the design is still messy) |
52
58
 
@@ -57,7 +63,8 @@ shell/direct writes, and incomplete patches still rely on CI. **OpenCode:** loca
57
63
  advisory (warning only, not blocked). An unverified host hook is environment evidence, not
58
64
  unfinished architecture; **Not finished** is reserved for real project/config debt.
59
65
 
60
- ArkGate is **not** a web framework, ORM, or app runtime. It is architecture enforcement + a coach for AI TypeScript.
66
+ ArkGate is **not** an API Gateway, a folder linter, a web framework, ORM, or app runtime.
67
+ The rules file only binds when the write is rejected and CI is required.
61
68
 
62
69
  ### Planes (you choose)
63
70
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arkgate",
3
- "version": "4.7.1",
4
- "description": "One architecture config. One check. One coach.",
3
+ "version": "4.7.2",
4
+ "description": "If the AI writes an illegal import, the write is rejected. The same check fails the pull request.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
package/server.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
3
  "name": "io.github.pedroknigge/arkgate",
4
- "description": "When your agent writes TypeScript, ArkGate stops it from breaking the layers.",
4
+ "description": "If the AI writes an illegal import, the write is rejected. The same check fails the pull request.",
5
5
  "repository": {
6
6
  "url": "https://github.com/pedroknigge/arkgate",
7
7
  "source": "github"
8
8
  },
9
- "version": "4.7.1",
9
+ "version": "4.7.2",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "identifier": "arkgate",
14
- "version": "4.7.1",
14
+ "version": "4.7.2",
15
15
  "runtimeHint": "npx",
16
16
  "transport": {
17
17
  "type": "stdio"
@@ -31,7 +31,7 @@
31
31
  "type": "named",
32
32
  "name": "--config",
33
33
  "value": "ark.config.json",
34
- "description": "Path to the ArkGate architecture config"
34
+ "description": "Path to the rules file (ark.config.json)"
35
35
  }
36
36
  ]
37
37
  }
@@ -7,7 +7,7 @@
7
7
  This directory is the **Agent Skills–compatible** packaging of the same **13**
8
8
  `/ark-*` skills shipped as flat templates for Ark install. **No new skill names.**
9
9
 
10
- Package version when last generated context: **arkgate@4.7.1**
10
+ Package version when last generated context: **arkgate@4.7.2**
11
11
  Schema: agent-skills package contract `1.0`
12
12
 
13
13
  ## Skills (frozen catalog)
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: ark-adopt
3
- description: Session 0 — mark the Ark path. Greenfield scaffold or brownfield honesty. Write ark.config, optional advisory ArkRules, baseline, and gates in this turn. CLI validates.
3
+ description: Session 0 — write the rules file (ark.config.json) to match the real folders. Optional extra rules inside a layer. CLI validates.
4
4
  ---
5
5
 
6
6
  # /ark-adopt — Mark the path (session 0)
7
7
 
8
- **When:** empty tree, or the architecture config does not match the real folders (session 0).
8
+ **When:** empty tree, or the rules file does not match the real folders (session 0).
9
9
  **Not when:** a single new file (`/ark-place`) or leftover design after the path is honest (`/ark-explore` then `/ark-autopilot`).
10
10
 
11
11
  ## Steps
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-architect
3
- description: Shortcut to /ark-adopt for greenfield shape. Deprecated as a first-class door. Do adopt’s job.
3
+ description: Shortcut to /ark-adopt for a new tree. Deprecated as a first-class door.
4
4
  ---
5
5
 
6
6
  # /ark-architect — Shortcut to /ark-adopt
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-autopilot
3
- description: Apply Ark end-to-end — explore first; dual plan A (edges) + B (shape); write mechanical-safe and judgment in this turn; one Shape refactor. Empty plan A is not healthy if leftover design remains. CLI is a sensor; you edit files.
3
+ description: Fix illegal imports and one leftover-design refactor. CLI is a sensor; you edit files.
4
4
  ---
5
5
 
6
6
  # /ark-autopilot — Apply the path
@@ -14,7 +14,7 @@ description: Apply Ark end-to-end — explore first; dual plan A (edges) + B (sh
14
14
  2. Fix import-rule debt; if leftover design remains, apply **one** small refactor.
15
15
  3. Re-run doctor. Never weaken `ark.config.json`.
16
16
 
17
- **This is the apply door.** Invoking it **is** the approval. Doctor remains the control plane.
17
+ **This is the apply door.** Invoking it **is** the approval. Run `arkgate-check --doctor` for the next step.
18
18
 
19
19
  ## Autonomy contract
20
20
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-contract
3
- description: Shortcut to /ark-adopt (session 0) or /ark-autopilot (later config tighten). Edit layers, ArkRules, or the ArkRun extra. Deprecated as a first-class door.
3
+ description: Shortcut edit the rules file or extra rules. Use /ark-adopt or /ark-autopilot.
4
4
  ---
5
5
 
6
6
  # /ark-contract — Shortcut to adopt / autopilot
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-coverage
3
- description: Ark adoption fitness audit governed%, gates, baseline honesty, capability gaps. CLI is a sensor; read enough source to prove gaps. Full product recon and pattern dual-plan belong to /ark-explore.
3
+ description: How much of the tree the rules file covers. CLI is a sensor; read the source.
4
4
  ---
5
5
 
6
6
  # /ark-coverage — Ark adoption fitness (not full recon)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-explain
3
- description: Explain this project's architecture in plain language and generate the showcase HTML report — layers, rules, coverage, gates, and why the contract exists.
3
+ description: Explain the rules file in plain language and generate the HTML report.
4
4
  ---
5
5
 
6
6
  # /ark-explain — Understand this project's architecture
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-explore
3
- description: Map skill decision-grade recon of layers + ArkRules opportunities + dual-plan seed (no apply). Primary post-green door when leftover design work remains. CLI is a sensor; you read the tree. No gate bypass.
3
+ description: Map import rules and leftover design. No apply. CLI is a sensor; you read the tree.
4
4
  ---
5
5
 
6
6
  # /ark-explore — Recon the real project (map only)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-fix
3
- description: Shortcut to /ark-autopilot for a small violation cluster. Deprecated as a first-class door.
3
+ description: Shortcut to /ark-autopilot for a small illegal-import cluster.
4
4
  ---
5
5
 
6
6
  # /ark-fix — Shortcut to /ark-autopilot
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-loop
3
- description: Shortcut to /ark-autopilot for driving plan A to zero. Deprecated as a first-class door. CLI validates — you edit code.
3
+ description: Shortcut to /ark-autopilot for illegal-import fixes. CLI validates — you edit code.
4
4
  ---
5
5
 
6
6
  # /ark-loop — Shortcut to /ark-autopilot
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-place
3
- description: "Where does new code go? Names the layer, directory, and naming for a new artifact from the contract, and writes it there. Autonomous."
3
+ description: "Where does new code go? Names the folder from the rules file and writes the file there."
4
4
  ---
5
5
 
6
6
  # /ark-place — Where does this code go?
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-runtime
3
- description: Evaluate and wire the experimental ArkRun companion (@arkgate/runtime) against hand-rolled event bus, outbox, saga, projection, policy, or NestJS code. One candidate. Extra on via /ark-adopt; new files via /ark-place. Skills never enforce.
3
+ description: Wire the optional ArkRun extra (@arkgate/runtime). One candidate. Extra on via /ark-adopt.
4
4
  ---
5
5
 
6
6
  # /ark-runtime — Evaluate and wire ArkRun (experimental opt-in)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-think
3
- description: Host-side architectural reasoning — 2–3 enforceable options on layer and/or ArkRules planes for ONE decision. Not full recon (use /ark-explore). No gate bypass. No package LLM call.
3
+ description: 2–3 options for one import-rule or ArkRules decision. Not a full map (use /ark-explore).
4
4
  ---
5
5
 
6
6
  # /ark-think — Architectural reasoning (host LLM only)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-upgrade
3
- description: Upgrade ArkGate through a content-identity preview, preserve customized files, and verify the active host and architecture contract.
3
+ description: Upgrade ArkGate. Preview first, keep customized files, then apply.
4
4
  ---
5
5
 
6
6
  # /ark-upgrade — managed ArkGate upgrade
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: ark-adopt
3
- description: Session 0 — mark the Ark path. Greenfield scaffold or brownfield honesty. Write ark.config, optional advisory ArkRules, baseline, and gates in this turn. CLI validates.
3
+ description: Session 0 — write the rules file (ark.config.json) to match the real folders. Optional extra rules inside a layer. CLI validates.
4
4
  ---
5
5
 
6
6
  # /ark-adopt — Mark the path (session 0)
7
7
 
8
- **When:** empty tree, or the architecture config does not match the real folders (session 0).
8
+ **When:** empty tree, or the rules file does not match the real folders (session 0).
9
9
  **Not when:** a single new file (`/ark-place`) or leftover design after the path is honest (`/ark-explore` then `/ark-autopilot`).
10
10
 
11
11
  ## Steps
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-architect
3
- description: Shortcut to /ark-adopt for greenfield shape. Deprecated as a first-class door. Do adopt’s job.
3
+ description: Shortcut to /ark-adopt for a new tree. Deprecated as a first-class door.
4
4
  ---
5
5
 
6
6
  # /ark-architect — Shortcut to /ark-adopt
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-autopilot
3
- description: Apply Ark end-to-end — explore first; dual plan A (edges) + B (shape); write mechanical-safe and judgment in this turn; one Shape refactor. Empty plan A is not healthy if leftover design remains. CLI is a sensor; you edit files.
3
+ description: Fix illegal imports and one leftover-design refactor. CLI is a sensor; you edit files.
4
4
  ---
5
5
 
6
6
  # /ark-autopilot — Apply the path
@@ -14,7 +14,7 @@ description: Apply Ark end-to-end — explore first; dual plan A (edges) + B (sh
14
14
  2. Fix import-rule debt; if leftover design remains, apply **one** small refactor.
15
15
  3. Re-run doctor. Never weaken `ark.config.json`.
16
16
 
17
- **This is the apply door.** Invoking it **is** the approval. Doctor remains the control plane.
17
+ **This is the apply door.** Invoking it **is** the approval. Run `arkgate-check --doctor` for the next step.
18
18
 
19
19
  ## Autonomy contract
20
20
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-contract
3
- description: Shortcut to /ark-adopt (session 0) or /ark-autopilot (later config tighten). Edit layers, ArkRules, or the ArkRun extra. Deprecated as a first-class door.
3
+ description: Shortcut edit the rules file or extra rules. Use /ark-adopt or /ark-autopilot.
4
4
  ---
5
5
 
6
6
  # /ark-contract — Shortcut to adopt / autopilot
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-coverage
3
- description: Ark adoption fitness audit governed%, gates, baseline honesty, capability gaps. CLI is a sensor; read enough source to prove gaps. Full product recon and pattern dual-plan belong to /ark-explore.
3
+ description: How much of the tree the rules file covers. CLI is a sensor; read the source.
4
4
  ---
5
5
 
6
6
  # /ark-coverage — Ark adoption fitness (not full recon)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-explain
3
- description: Explain this project's architecture in plain language and generate the showcase HTML report — layers, rules, coverage, gates, and why the contract exists.
3
+ description: Explain the rules file in plain language and generate the HTML report.
4
4
  ---
5
5
 
6
6
  # /ark-explain — Understand this project's architecture
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-explore
3
- description: Map skill decision-grade recon of layers + ArkRules opportunities + dual-plan seed (no apply). Primary post-green door when leftover design work remains. CLI is a sensor; you read the tree. No gate bypass.
3
+ description: Map import rules and leftover design. No apply. CLI is a sensor; you read the tree.
4
4
  ---
5
5
 
6
6
  # /ark-explore — Recon the real project (map only)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-fix
3
- description: Shortcut to /ark-autopilot for a small violation cluster. Deprecated as a first-class door.
3
+ description: Shortcut to /ark-autopilot for a small illegal-import cluster.
4
4
  ---
5
5
 
6
6
  # /ark-fix — Shortcut to /ark-autopilot
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-loop
3
- description: Shortcut to /ark-autopilot for driving plan A to zero. Deprecated as a first-class door. CLI validates — you edit code.
3
+ description: Shortcut to /ark-autopilot for illegal-import fixes. CLI validates — you edit code.
4
4
  ---
5
5
 
6
6
  # /ark-loop — Shortcut to /ark-autopilot
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-place
3
- description: "Where does new code go? Names the layer, directory, and naming for a new artifact from the contract, and writes it there. Autonomous."
3
+ description: "Where does new code go? Names the folder from the rules file and writes the file there."
4
4
  ---
5
5
 
6
6
  # /ark-place — Where does this code go?
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-runtime
3
- description: Evaluate and wire the experimental ArkRun companion (@arkgate/runtime) against hand-rolled event bus, outbox, saga, projection, policy, or NestJS code. One candidate. Extra on via /ark-adopt; new files via /ark-place. Skills never enforce.
3
+ description: Wire the optional ArkRun extra (@arkgate/runtime). One candidate. Extra on via /ark-adopt.
4
4
  ---
5
5
 
6
6
  # /ark-runtime — Evaluate and wire ArkRun (experimental opt-in)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-think
3
- description: Host-side architectural reasoning — 2–3 enforceable options on layer and/or ArkRules planes for ONE decision. Not full recon (use /ark-explore). No gate bypass. No package LLM call.
3
+ description: 2–3 options for one import-rule or ArkRules decision. Not a full map (use /ark-explore).
4
4
  ---
5
5
 
6
6
  # /ark-think — Architectural reasoning (host LLM only)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ark-upgrade
3
- description: Upgrade ArkGate through a content-identity preview, preserve customized files, and verify the active host and architecture contract.
3
+ description: Upgrade ArkGate. Preview first, keep customized files, then apply.
4
4
  ---
5
5
 
6
6
  # /ark-upgrade — managed ArkGate upgrade