Skill1 estrellas del repoactualizado 3d ago
ark-explain
Explain the rules file in plain language and generate the HTML report.
Instalar en Claude Code
Copiargit clone --depth 1 https://github.com/pedroknigge/arkgate /tmp/ark-explain && cp -r /tmp/ark-explain/templates/agent-skills/ark-explain ~/.claude/skills/ark-explainDespués abre una sesión nueva de Claude Code; el skill carga automáticamente.
Definición
SKILL.md
# /ark-explain — Understand this project's architecture
**Not a first-run door.** Teach / HTML tour only. Session 0 → **`/ark-adopt`**.
Map → **`/ark-explore`**. Apply → **`/ark-autopilot`**.
Do not send the user to leftover `/ark-contract` or `/ark-fix`.
The user wants to understand the architecture, a specific rule, or why the gate blocked them.
## Improvement compass (process preflight)
When doctor is available, read `doctor.improvementCompass` (or the human **Improvement compass** section).
Name 1–3 **residual** lenses in plain language before skill-shopping. Always `notAScore` — never invent
0–10 scores or Excellent/Good ranks.
**What the user should feel next:** fewer blocked AI writes, clearer folders, safer domain — then jargon.
**Anti false-done:** empty plan A + residual lenses / design-weak → **Incomplete? yes**. Green edges alone
are not “architecture finished.”
**AI-easy architecture:** ports over concrete I/O in domain; one concern per module; golden pattern for
new files; place before write (`/ark-place` / prepare-write).
**Out of scope (honest):** scalability/performance, full app-security tooling (SAST), and full resilience
patterns are **out-of-scope** lenses — say so; do not invent Ark enforcement for them.
**Tour by lenses** (teach, not score). Prefer showcase HTML + doctor compass section when explaining residual.
## When / not when
| Use `/ark-explain` when… | Do **not** use it when… |
|--------------------------|-------------------------|
| Plain-language tour of layers/rules/report | Decision-grade recon / dual-plan → `/ark-explore` |
| “Why did the gate block me?” pedagogy | Apply fixes → `/ark-autopilot` |
| Generate / walk HTML showcase report | Fitness numbers only → `/ark-coverage`; brownfield action → `/ark-adopt` |
Your job is to **teach with this repo's real data** and leave a shareable visual artifact.
## Dual engine (mandatory)
| Engine | Role |
|--------|------|
| **Deterministic** | CLI / MCP / contract sensors — exit codes, plan kinds, coverage numbers, install status |
| **Exploratory** | You open **this** repo's real files and product surface before concluding |
The CLI is a **sensor**, never the whole job. Claiming done without the exploratory bar for this skill is **incomplete**.
## MCP workspace binding (mandatory)
Before any `ark_*` MCP tool, call `ark_identity` with `project.expectedRoot` set to the exact
workspace root. Continue only when `binding.status === "matched"` and `authoritative === true`;
retain `projectIdentity.projectId`, then pass both `expectedRoot` and `expectedProjectId` under
`project` on every later MCP call. If identity is missing, mismatched, unverified, or the root is
uncertain, do not consume MCP analysis: use the workspace-local CLI and report that MCP
restart/retargeting is required. `ark://manifest` never satisfies this preflight.
## Dual plane — layers + extras (mandatory, except /ark-runtime)
ArkGate has **always-on Layers** plus opt-in extras. The user chooses extras; you **always label** findings so they never blur. Absence of an extra is silent and valid. Skills never enforce. ArkOrder is an extra **inside** the `arkgate` package (`arkgate/order`), not a second install.
| Plane | What it protects | Where it lives | Sensors / tools |
|-------|------------------|----------------|-----------------|
| **Layers** (inter-layer) | Who may import whom, capabilities, pure/forbiddenGlobals, peerIsolation | `ark.config.json` → `layers[]`, `rules[]` | graph check, baseline edges, doctor coverage % |
| **ArkRules** (intra-layer) | Structure inside a layer + domain invariants as data | `arkRules` map + `arkrules/<ExactLayerName>.json` | structure sensors, invariant coverage, `--rules-inventory`, doctor `rulesUnderContract` |
| **ArkRun** (extra) | Kernel usage + complete declarations; information package `decisionTape` `{ xiHash, event, residual }` | `arkRun` on `ark.config.json` (schema `1.2+`); factory `arkgate/runtime`; **`kernelRoots` preferred**, `compositionRoots` alias | `ARKRUN_*`, doctor `arkRun` (`notAScore`) |
| **ArkOrder** (extra) | Operational pattern (ξ vs s). Valve: first `release()`, later ξ is `proposeRelease` then `apply`; `refreshSigma`; ingest residual `absorb \| escalate_up \| hold` + `reasonCode`; capacity pack as data; in-memory `ReleaseStore` | `arkOrder` on `ark.config.json` (schema `1.3+`); factory `arkgate/order` | `ARKORDER_*` |
**Rules for every report / answer:**
1. Prefix each finding or next step with **`[Layer]`** or **`[ArkRules]`** or **`[ArkRun]`** or **`[ArkOrder]`** (or a table with those headers).
2. Never call an import-edge violation an “invariant” or an aggregate sensor a “layer deny.”
3. Absence of `arkRules` is **valid** — do not force ArkRules unless the user wants them or residual inventory clearly wants a pilot.
4. Editing `arkrules/*` or applying structure fixes is **`/ark-adopt`** / **`/ark-autopilot`** (never invent `mechanical-safe`).
5. CLI helpers: `ark-check --rules-inventory --json`, doctor JSON `rulesUnderContract`, sensors emit `ARKRULE_*` / `INVARIANT_UNCOVERED` with `evidence.arkruleId`.
6. Extras silent when off. Doctor `arkRun` is `notAScore`. Do not force extras. Do not invent `/ark-run` or `/ark-order`.
### Explain + ArkRules
- HTML/plain tour: section **Layers** and section **Rules under contract (ArkRules)** —
when `arkRules` is active the showcase lists **per-layer counts**, **structure sensors**
(id / sensor / mode), **uncovered** invariants (call them out), and a **covered sample**.
Inactive map stays a short opt-in note. Counts are never a score.
- Spoken tour: name 2–4 real invariant IDs and one structure sensor from this repo’s
`arkrules/*` (open the files — do not invent). Residual candidates → `--rules-inventory`.
- **Teach the product model (required when arkRules is active):**
- **[Layer]** = dependency direction / purity / capabilities.
- **[ArkRules] structure** = module-shape **heuristics** (orchestration-only, thDel mismo repositorio
ark-adoptSkill
Session 0 — write the rules file (ark.config.json) to match the real folders. Optional extra rules inside a layer. CLI validates.
ark-architectSkill
Shortcut to /ark-adopt for a new tree. Deprecated as a first-class door.
ark-autopilotSkill
Fix illegal imports and one leftover-design refactor. CLI is a sensor; you edit files.
ark-contractSkill
Shortcut — edit the rules file or extra rules. Use /ark-adopt or /ark-autopilot.
ark-coverageSkill
How much of the tree the rules file covers. CLI is a sensor; read the source.
ark-exploreSkill
Map import rules and leftover design. No apply. CLI is a sensor; you read the tree.
ark-fixSkill
Shortcut to /ark-autopilot for a small illegal-import cluster.
ark-loopSkill
Shortcut to /ark-autopilot for illegal-import fixes. CLI validates — you edit code.