Skip to content
Back to skills

Skill

ASecurity

Use when requirements are unclear, a change spans >3 files or multiple sessions, a cross-boundary contract is involved, the change touches auth/payment/deletion/privacy, destructive file or process operations, or untrusted input reaching an AI, or the work will feed an agon goal/conquer launch — produces a claim-tagged, refined spec before building; or `/spec init` to set up a repo

  • 2 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added October 8, 2026
developmentrustgogitapibackend

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add KERNlang/nero-spec --skill skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Skill?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kernlang-skill/badge)](https://www.skillsdirectory.com/skills/kernlang-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: spec
description: Use when requirements are unclear, a change spans >3 files or multiple sessions, a cross-boundary contract is involved, the change touches auth/payment/deletion/privacy, destructive file or process operations, or untrusted input reaching an AI, or the work will feed an agon goal/conquer launch — produces a claim-tagged, refined spec before building; or `/spec init` to set up a repo
argument-hint: "[feature or change description] | init [--machine] | view [path]"
---

Define WHAT before HOW. This file only routes: resolve config → load `core.md` + preset + the addons whose hooks fire → run. Plain markdown; any agent follows the same steps.

## `/spec init`

Argument `init` or `init --machine` → follow `init.md` and stop. Do not write a spec.

## `/spec view`

Argument `view` or `view [path]` → resolve config (Step 0), follow `addons/spec-view.md` and stop. Do not write or change a spec.

## Step 0 — Resolve config

### Machine (per computer)

Read `~/.config/spec/machine` (plain `key: value`):

| Key | Values | Missing / empty |
|---|---|---|
| `rules` | path to a rules-of-record file | built-in defaults in `core.md` |
| `agon` | `yes` \| `no` | `no` |
| `oracle_rules` | path to oracle design rules | `agon-oracle` rules only |
| `mutation` | `agon` \| `tool` \| `subagent` \| `manual` | first rung that works (`criteria-test-map`) |
| `default_paths` | `<dir>=<preset>, ...` e.g. `~/work=enterprise, ~/src=personal, ~/.ai=personal` | no default-path mapping |
| `policy_paths` | `<dir>=<absolute .md>, ...` e.g. `~/work/acme=~/policies/acme/policy.md` | no machine policy; a local company policy for repos that do not ship their own (longest dir match) |

- File missing → all defaults; mention `/spec init --machine` once.
- Path set but file unreadable → warn, use defaults.

### Repo (first hit wins)

Non-git target (no git root above it): the target directory plays the git root for the `.spec` lookup and the `default_paths` match.

1. **Vendored skill in the repo** — `.agents/skills/spec/`, `.claude/skills/spec/` or `.ai/skills/spec/` inside the git root (not a symlink back to this skill) → follow that one and stop here.
2. **`.spec` at the git root** → use it (format below).
3. **Default path** — no `.spec`, git root is under a dir in machine `default_paths` (`~` expanded, longest match wins) → use the mapped preset.
4. **Nothing matched** → do NOT assume personal. Repo `agon: off`, suggest `/spec init`, ask which preset to use for this run. Never send company code to an external AI by default.

Merge: preset frontmatter defaults ← `.spec` values. Unknown keys → warn once, ignore.

### Policy (company module)

A company's conventions live in one policy file, so the skill stays unchanged. Resolve: `.spec` `policy:` (repo-relative `.md` inside the git root, no symlinks) → else machine `policy_paths` → else none. Invalid or unreadable → stop and report; never run with half a policy.

Apply it: `## Constitution` is binding; `rules` files join the Rules of record; its formats (`ticket.*`, `branch.pattern`, `pr.title`, `pr.regex`) replace preset and `.spec` values; `agon.max`, `agon_engines`, `critic` can only tighten; `.spec` keeps operational keys (`stack`, `repos`, extra addons). `scripts/spec-check.sh` enforces the mechanical part (`POLICY-*`, `--pr-title`). Keys: this skill's `policy.md`.

**Repo skills** (`skills: <step>=<skill>[|<skill>]`): load the named skill at its step and announce `+skill <name> (policy: <step>)`; several names → the one matching the touched area, else the first. Steps: `understand` core 1 · `design` core 4 options · `critic` refine e (fresh context, still bound by agon/`critic`) · `build` after approval · `tests` the tests `criteria-test-map` names · `review` before core 9 · `tickets` splitting an approved spec · `retro` after core 9. The spec owns WHAT (ACs, evidence, gates, Status); the skill owns HOW and never lowers a gate.

### Effective agon

`on` only when ALL hold, else `off`:
- machine `agon: yes`;
- `command -v agon` succeeds;
- repo/preset `agon` is `full` or `restricted` (`ask` unanswered = off), capped by the policy `agon.max`.

### Spec line

Print exactly one line before anything else:

```
Spec: preset <name> + addons [<a>, ...] (via vendored|.spec|default path|asked) (agon: on|off[ → reason]) (rules: <file>|defaults) (policy: <path>|none)
```

Reasons: `not installed`, `machine: no`, `repo: off`, `ask unanswered`, `policy: off`. `addons [...]` lists only the addons loaded at that point, not the enabled set; later loads are announced per Step 1.

## `.spec` format

Plain `key: value`, one per line, lists comma-separated, `#` starts a comment.

| Key | Values | Notes |
|---|---|---|
| `preset` | `personal` \| `team` \| `enterprise` \| `operator-reviewed` | required |
| `addons` | `+name, -name, ...` | relative to preset defaults; bare name = `+` |
| `specs.path` | e.g. `.claude/specs/{slug}/spec.md` | Repo-relative; placeholders `{slug}`, `{TICKET}`. A leading `./` and spaces are allowed; absolute paths, leading `-`, `.`/`..` components, and symlink escapes are rejected by bundled scanners. |
| `ticket.regex` | e.g. `[A-Z][A-Z0-9]+-\d+` | only with `jira-ticket` |
| `ticket.prefixes` | e.g. `ABC, XYZ` | only with `jira-ticket` |
| `ticket.fallback` | e.g. `ABC-XXXX` or empty | only with `jira-ticket`; empty = never invent |
| `branch.pattern` | e.g. `{type}/{TICKET}-{slug}` | placeholders `{type}`, `{TICKET}`, `{slug}` |
| `policy` | repo-relative `.md`, e.g. `.nero-spec/policy.md` | company module (Step 0 Policy); wins over machine `policy_paths` |
| `agon` | `full` \| `restricted` \| `off` \| `ask` | what this repo allows |
| `agon_engines` | e.g. `claude, codex` | only with `agon: restricted` |
| `drift` | `record` \| `living` | only with `drift-guard`; default `record` |
| `repos` | e.g. `backend=../api-server, web=../web-client` | other repos named in `## Changes` as `name:path`; read by `scripts/spec-check.sh` and `refine`; proposed by init 0d |
| `stack` | path, default `stack.md` next to `.spec` | stack profile from init 0c; read at core step 1: Edges feed `Callers:` greps, Traps feed Tricky inputs, Gate feeds `Done when` |
| `mode` | `link` \| `vendored` | written by `init.md` |
| `hook` | `yes` \| `no` | advisory pre-commit hook asked once by `init.md` |
| `research.max_age` | days, default `90` | core step 1b: research sources older than this are re-fetched before release |
| `e2e.path` | e.g. `.claude/e2e.md` | only with `e2e-sweep`; default `e2e.md` beside the specs folder |

## Step 1 — Load

- Always: `core.md`, then `presets/<preset>.md` (its body is the constitution and binds for the whole task), then the policy body if one resolved, then the policy `rules` files and the machine `rules` file if set.
- Policy `addons.require` are enabled; `addons.deny` are blocked even on demand.
- Enabled addons = preset defaults ± `.spec`. Enabled is the **allowed set**, not the load set.
- **Depth:** load only the ONE depth addon core step 2 selects (`depth-light` or a single `tier-*`). Selected tier not enabled → load it on demand (team/enterprise; personal stays on `depth-light`).
- **Other addons:** load each only when its core hook fires. Missing file → warn, continue.
- `agon-oracle` and `agon-tasks` load only with effective agon `on`.
- On demand, even when not enabled (blocked only by an explicit `-name` in `.spec`): `contract-discovery` when a boundary is crossed; `release-contract` for client↔backend releases; `refine` at core step 8; `criteria-test-map` when core step 2 forces it.
- An addon line `Replaces core <rule>` wins over that core rule while the addon is loaded; the policy constitution, then the preset constitution, still win over both.
- Every addon loaded after the Spec line, enabled or not, is announced `+<name> (on demand)` before its hook runs.

## Step 2 — Run

Follow `core.md` step by step. Addons plug in where `core.md` names their hook.

## Addons

| Addon | Hook | One-line purpose |
|---|---|---|
| `jira-ticket` | 1 | Ticket key from branch, `**Ticket:**` header, folder named after key |
| `issue-link` | 1 | Optional issue/PR link in the header |
| `depth-light` | 2 | Two depths: Surgical (half a page) or Full |
| `tier-1-surgical` | 2 | 1–3 file fixes with a clear root cause |
| `tier-2-behavioral` | 2 | Multi-file, user-facing: truth tables, flow impact, dependency matrix |
| `tier-3-investigation` | 2 | Unknown scope: constraints, evidence chain, corrections log |
| `tier-4-migration` | 2 | Codebase-wide / multi-session: phases, satellite docs, handoff |
| `contract-discovery` | 3 | Cross-boundary/repo/team: clients live/dead, hop chain, deploy order, `repo@sha` |
| `release-contract` | 3 | Client↔backend releases: old clients in the wild, compat window |
| `contested-decision-scan` | 4 | Experimental, off by default: contested readings → Breaks tests, settled only by consumer evidence, else conservative pick |
| `user-stories` | 4 | P1–P3 stories, each independently testable |
| `success-metrics` | 4 | Measurable tech-agnostic targets, separate from acceptance criteria |
| `criteria-test-map` | 6, 9 | Every AC and tricky input ↔ test both ways; `Eval:` ACs for agent-behaviour artifacts; mutation ladder proves the tests |
| `refine` | 1 (resume), 8, release | Spec-check, contract compare both sides, re-verify claims, tricky-input/caller/real-usage check + blind spots → ACs, critique by risk, max 2 rounds, `## Refine` block with step coverage; re-fetches stale research |
| `drift-guard` | 1, 4, 9 | `Verified at` (git sha, or dir-hash for non-git targets) + `## Changes` as anchor, STALE detection, supersede/living; `scripts/spec-check.sh`, optional pre-commit hook |
| `agon-oracle` | 8 | Oracle fixtures for `agon goal`/`conquer`, holdouts, promotion rule |
| `agon-tasks` | 8 | Advisory `tasks.md` sidecar for `agon goal`/`conquer` specs: AC-linked tasks, `[P]` groups, checked by `scripts/tasks-check.mjs` |
| `spec-view` | 8, 9, view | Offline `spec.html` beside the spec (`scripts/spec-view.mjs`), automatic above 150 lines; optional `view-summary.md` AI summary flagged IN SYNC / STALE / MISSING |
| `e2e-sweep` | 9, release, on demand | Live personas × features sweep + visual audit before release/overnight; `Device check:` ACs become rows (`scripts/e2e-matrix.sh`); project file `e2e.md` |
| `visual-grid` | 4, 9 | One low-RAM screenshot grid (desktop + mobile × light + dark) per UI change (`scripts/shotgrid.mjs`); hard gate replacing `Device check:` for UI ACs; used by `operator-reviewed` |
| `ticket-interpretation` | 1, 4, 8 | Purpose and authority + Ticket interpretation (Accepted/Proposed/Open) replace `## Intent`; ticket re-read before approval and PR; used by `operator-reviewed` |
| `changed-things` | 4 | Changed things table (kind, contract change, used by, evidence) + Precedent replace `Callers:` / `Real usage:`; used by `operator-reviewed` |
| `completion-conditions` | 8, 9 | `## Completion conditions`, per-AC met/not met, `## What was not done` replace `Done when` / As-built delta; used by `operator-reviewed` |

Task: $ARGUMENTS

Files in this skill

  • SKILL.md12.1 KB
  • addons/agon-oracle.md2.7 KB
  • addons/changed-things.md1.1 KB
  • addons/completion-conditions.md761 B
  • addons/contested-decision-scan.md2.9 KB
  • addons/contract-discovery.md3.7 KB
  • addons/criteria-test-map.md4.3 KB
  • addons/depth-light.md1.7 KB
  • addons/drift-guard.md3.1 KB
  • addons/e2e-sweep.md9.6 KB
  • addons/issue-link.md866 B
  • addons/jira-ticket.md1.9 KB
  • addons/refine.md9.2 KB
  • addons/release-contract.md2.9 KB
  • addons/success-metrics.md1.6 KB
  • addons/ticket-interpretation.md1.1 KB
  • addons/tier-1-surgical.md4.7 KB
  • addons/tier-2-behavioral.md5.1 KB
  • addons/tier-3-investigation.md8 KB
  • addons/tier-4-migration.md6.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.