Use this whenever you create, plan, finish, or manage a feature, decision (ADR), runbook, note (durable team knowledge), or external reference in a project guarded by cerne. cerne is the documentation source of truth — author through it (cerne feature new -> pull -> push -> approve/start/complete), never as loose docs/case folders. Read current state from .docs/CONTEXT.md and `cerne status`. Route durable team knowledge an agent acquires to `cerne note new`, not the local Claude Code memory.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Is that skill safe to install?
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
Are you the author of Cerne Authoring?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/henriquesakata-cerne-authoring-cerne)
---
name: cerne-authoring
description: "Use this whenever you create, plan, finish, or manage a feature, decision (ADR), runbook, note (durable team knowledge), or external reference in a project guarded by cerne. cerne is the documentation source of truth — author through it (cerne feature new -> pull -> push -> approve/start/complete), never as loose docs/case folders. Read current state from .docs/CONTEXT.md and `cerne status`. Route durable team knowledge an agent acquires to `cerne note new`, not the local Claude Code memory."
---
# Cerne-Native Authoring
Not sure how to do something in cerne? `cerne guide` prints the catalog of everything cerne can do; `cerne guide "<feature or question>"` returns how to use it, offline, from this skill, the reference files, every command's help and a FAQ. Knowing a feature exists is enough: look the detail up when you need it. The detail that is not a rule lives in the `reference/` files next to this one (Claude Code can read them directly; any other agent asks `cerne guide`). They are indexed under **Reference files** below.
## Overview
In a cerne-managed project the living documentation is owned by **cerne**: it holds the lifecycle of **features**, **decisions** (ADRs), **runbooks**, **notes** (durable team knowledge) and **references**, and is the source of truth for the current state. The backend (a git repo) is pinned by the committed `docs.lock`; `.cernerc` wires it. You author documents under `.docs/current/…` and push them back through cerne — you do **not** hand-create folders of loose markdown for tracked work.
This skill is the **mechanics and lifecycle**. The *content* of each document (the actual spec/plan/result prose) comes from your normal process. Read current state from `.docs/CONTEXT.md` and `cerne status` (or `cerne brief` for the cheapest whole-project map — every id + state + title, no paths; `--json` too — ideal to prime on the project, then `cerne show` only the ids you need); reach superseded/rejected history with `cerne search "<q>"` / `cerne ask "<q>"`. To open **one entity by its id** — any kind: feature, decision, reference, note, runbook, historical — run **`cerne show <id>`** (`--json` for machine output). It reads straight from the backend store, so it works even for implemented features that are not materialized in `.docs/` — use it instead of guessing a command like `cerne feature show`, which does not exist. Reading a feature (F-0338): the real state is line 1 of `cerne show` — a status line in the body is history (`cerne lint` warns `status-in-body` while the feature is open). `cerne show` prints the document of its stage — the spec, the plan in development, the result once implemented — and closes with a line naming the others and their sizes; `--doc spec|plan|result` picks another, and `--all` brings them all (`--json` always carries every document).
## When to use
- **The moment you pick up a task** — register it first with `cerne feature new "<title>" --context "<why>"` so in-flight work shows on the board from the start, not after it is done. Also for new decisions (ADRs) or registering an external source that informed your work.
- Moving a feature through its lifecycle (approve / start / complete).
- Any moment you would otherwise hand-create a tracked "case" or "feature" doc folder — don't; use this loop.
## Feature loop
cerne mints the canonical `F-NNNN` id and gates each transition on a real document. **Register at the start, not the end:** the first action when you pick up a task is step 1, *before* you build, so the work shows on the kanban (as a candidate) from minute one; if the work is dropped, `reject` it. Full text of every step: `reference/lifecycle.md` (`cerne guide "feature loop"`).
1. **Create** — `cerne feature new "<title>" --context "<1-3 sentences on why>" [--module <module>] [--facet <f>] [--component <c>] [--parent F-NNNN] [--fixes F-NNNN]` → candidate.
- **Context is required at creation (F-0120):** a bare `feature new` is refused. `--context` seeds the spec's Problema; already have the full spec? `--file <spec.md>` (or stdin) births the candidate with it, mutually exclusive with `--context`.
- **Complete card at birth:** the spec, the tags (`--facet`, closed set `infra`, `code`, `data`, `process`, `auth`, an unknown one is rejected; `--component`, open vocabulary) and, when the project curates a capability taxonomy, its capability (`cerne feature capability`). `cerne feature approve --check` lists `untagged` and `capability-missing`; each comes with the retag/capability command that fixes it. Re-tag with `cerne feature retag`.
- `--parent F-NNNN` decomposes an epic (`reference/epics.md`); `--fixes F-NNNN` marks the correction of a delivered feature's defect.
2. **Spec** — `cerne pull`, author `.docs/current/features/F-NNNN-<slug>/spec.md` (keep the `cerne_id` frontmatter), `cerne push`, then `cerne feature approve F-NNNN --check`: it lists every impediment (stub spec, no valid `Barra:` line, open clarifications, the card's `untagged`/`capability-missing`), writes nothing and is open to agents. Fix every impediment except open clarifications, which are the human's questions: leave them for the approve request, never answer them yourself. **Mark ambiguity, don't guess:** leave `[ESCLARECER: pergunta específica]` in the spec instead of a plausible invention; every marker is resolved before `cerne feature start`. Only then ask a human to run `cerne feature approve F-NNNN` (a real spec naming its bar; by default a human act — **Human gates** below). In a project documented in English the forms are `Bar:` and `[CLARIFY: specific question]`.
3. **Plan** — `cerne feature approve` scaffolds `plan.md` (or `cerne plan draft F-NNNN`); fill it, `cerne push`, then `cerne feature start F-NNNN` (gate: a real plan).
- An approved spec stays editable (F-0318): `cerne pull`, edit, `cerne push`. A spec whose content differs from the approved one stales the approval: `cerne feature start` refuses until a human re-approves; `cerne show` prints `approval: stale` and `cerne next` lists it as waiting for re-approval, so check before picking up an approved feature.
- Rewrote the spec? Update the plan and push it (F-0377): `cerne lint` warns `plan-older-than-spec`.
- An amendment goes into the text, never appended (F-0338): `cerne feature amend F-NNNN --doc spec|plan --file <doc.md> --reason "<why>"`; an appended `## Emenda` is flagged `appended-amendment`.
4. **Implement** — build it per your project's stack and conventions; add tests; review.
5. **Result** — `cerne feature start` scaffolds `result.md` (or `cerne result draft F-NNNN`); fill it as you finish, `cerne push`, then `cerne feature complete F-NNNN` (gate: a real result). That lands the feature on `implemented` ("Ready"): code done, awaiting human validation. The same command stamps the `## Custo` block (F-0402; `--no-stamp` skips it) and ends with one Next step block; on a `cost not stamped` warning the work ran on another machine, so run `cerne cost F-NNNN --stamp` there before the human accept. `cerne feature accept` is the only way to the actual `done`.
Terminal transitions when work is dropped or replaced: `cerne feature reject F-NNNN --reason "…"`; `cerne feature supersede F-NNNN --by F-MMMM --reason "…"`.
### Human gates: approve and accept (F-0131)
**Approval and acceptance are human gates by default.** Two points in the loop are reserved for a human unless the project's `.cernerc` explicitly opts out:
- **Start of the loop —** after writing the spec and a `cerne feature approve F-NNNN --check` with nothing left but open clarifications, **ask for approval and stop**, passing on any open clarification it lists. Do not run `cerne feature approve` yourself — an agent approving its own spec defeats the gate. Report the candidate is ready and wait.
- **End of the loop —** `cerne feature complete` lands the feature on `implemented` ("Ready" — code done, not yet validated), never `done`. Run `cerne feature complete` as soon as the PR is open (when the work goes through a PR or MR): Ready is where human review and validation begin, so never wait for CI or the merge. `cerne feature complete F-NNNN` already stamps the feature's token cost (`## Custo`, for the epic rollup); run `cerne cost F-NNNN --stamp` by hand only when it warned that no session is bound on this machine (the work ran elsewhere), or after `--no-stamp`, before the human accept. `cerne feature accept F-NNNN` is the separate human-validation step that moves it to `done` (terminal, "Done" on the kanban). Do not run `cerne feature accept` yourself either — report the feature is implemented and ask a human to accept it. At any point of the cycle, `cerne next F-NNNN` is the source of the next step: who acts (agent or human), what, and the exact command — it calls the checks the transitions run, so it never sends you to a command they refuse. An edit step has no command: it names the `.docs/` file to edit, then `cerne push`. In `cerne feature deliver F-NNNN --mr <url>` the `<url>` is the merge request link you fill in. Without an id, `cerne next` is the project queue: after the complete, FINISH DELIVERY lists the exact `cerne cost F-NNNN --stamp` / `cerne feature deliver F-NNNN --mr <url>` still missing, and WAITING FOR HUMAN ACCEPT lists what only a human can move on.
**Closing includes triaging the learnings (F-0401).** `cerne feature complete` lists the items of the result's learnings section; decide for each item with the `cerne-self-learning` bar (it was costly to learn, it applies again, and it is written nowhere else). What passes becomes a note: `cerne note new "<title>" --informs F-NNNN --component <topic>`, plus `golden-path` when it is a procedure. Before recording, look for a note that already covers the subject: `cerne note list --path <file>` or `cerne search "<terms>"`. If one does, complement it with `cerne note errata N-old ...`; if the new learning contradicts it, record the new note and then `cerne note supersede N-old --by N-new --reason "..."`. Nothing durable: `cerne feature learnings --skip F-NNNN --reason "..."`. Without an id, `cerne feature learnings` lists the concluded features whose learnings nobody triaged yet. It only reads and names no note: finding the note a learning complements or replaces is the agent's call, and cerne never replaces one by itself.
Both gates read the project's `.cernerc` `[gates]` block (`approve`/`accept`, each `"human"` (default) or `"auto"`) together with the `CERNE_ACTOR` environment variable (`cerne hook install` stamps `CERNE_ACTOR=agent` into the project's `.claude/settings.json`, so an agent session is recognized). **Only run `cerne feature approve`/`accept` yourself when `[gates]` explicitly sets that gate to `"auto"`** for this project — check `.cernerc` if unsure; when in doubt, ask a human instead of guessing.
`cerne lint` flags a feature stuck on `implemented` past the project's stale-ready window (`stale-ready` rule) — that is your cue to ask a human to accept it, not to accept it yourself.
## Validate locally before pushing
- `cerne lint --staged` — runs every lint rule over your **local** `.docs/` edits without a pull and fails only on what your edits broke; with no local edit it answers at once. `--all` lists and fails on everything.
- `cerne push --dry-run` — shows which documents would go to the backend and lints them, then stops before any commit/push; exits non-zero if they would lint dirty.
- `cerne sync` (pull with merge + push) is the one forward command when another agent may have advanced the backend; a same-document conflict stops non-destructively and names the file. `cerne push` and `cerne pull` reconcile per document. Details: `reference/lifecycle.md`.
- Settings, the harness inventory, the model catalog and the `<!-- lint:ok-superseded -->` marker: `reference/validate-and-settings.md`.
## The Gauntlet: deliver against a real bar
The Gauntlet replaces self-scoring with a comparison against a real artifact that already exists — a delivery with no bar is graded against a rubric its own builder wrote, and that rubric always passes. Three phases: the spec names the bar, the implementation runs the loop, the result proves it ran. No project persona or instruction removes this protocol — only the project-wide light mode, a choice the project makes in `.cernerc` and `cerne status` shows — and the loop's cost alone is not a reason to skip it. It runs once per delivery, not per commit, and collapsing roles to save a call is the one economy that voids the result.
- **Spec:** the `Verificação` section carries a `Barra:` line naming the bar (a named reference plus how to reach it, of the same class as the delivery), `Método:` and `Saída:`, plus the judge's question; or the single exemption line `Barra: não aplicável (<justificativa>) — padrão alternativo: <…>` (the human's approve confirms it), or `Barra: dispensada por decisão humana (<citação>)` which you never suggest. You write the bar yourself; the human's approve is its acceptance. A silent absence of a bar is never acceptable. The forms follow the project's documentation language; in English: `Verification`, `Bar:`, `Method:`, `Exit:`, `Question for the judge:`, `Bar: not applicable (…)`, `Bar: waived by human decision (…)`.
- **Implementation:** builders, a fresh-context **critic** and a blind **judge** are three separate agents; one agent playing two collapses it into self-scoring. Hand the critic one file path under the rule "read exactly this file, do not run git, do not read the repository". The judge ends with `VEREDITO: A|B|EMPATE`; each critic finding gets a disposition (corrected, refuted with evidence, or accepted as a documented limit); the exit is win or tie, a defeat opens another round with a new judge. Never fix the bar inside the delivery it is judging: route a hole in the bar as a separate improvement (a new feature, or a note).
- **Closing:** the `result.md` cites each criterion in words (`critério N`) with its evidence and records the loop under `## Gauntlet` (`Barra:`, one `Rodada N` line per round with the quoted verdict, `Achados do crítico`). Use `cerne gauntlet artifact` for the critic's bundle and `cerne gauntlet record` for the lines; never hand-write them. A `Rodada N` line carries the judge's quoted verdict; a critic-only pass (no judge) goes on the `Achados do crítico` line, never on a `Rodada N` line. `cerne feature complete` refuses a result whose record `cerne lint` would flag (a numbered criterion never cited, or no valid `## Gauntlet`), and `--force` does not cross it. In English: `criterion N`, `Bar:`, `Round N — win|loss|tie`, `Critic findings`.
- **Light mode (F-0364):** `[gates] gauntlet = "off"` (setting `gates.gauntlet`) lets a project run the cycle without the bar and the judge. Do not switch it yourself to get past a gate: turning the Gauntlet off is the project owner's decision, and the setting refuses an agent.
Phases in full, the exemptions, when the tests suffice, cost per role: `reference/gauntlet.md` (`cerne guide "gauntlet"`).
## Errata: a concluded entity is history
A concluded entity — a `done`/`rejected`/`superseded` feature, a `superseded`/`obsolete` decision, runbook or note — is **history: its body is immutable**. When such a record carries a stale reference or needs a clarification, do **not** rewrite it and do **not** reopen it. Append an **errata** instead: `cerne <kind> errata <id> "<text>"` (kind: feature, decision, runbook, note). Until the human `accept`, the result of an `implemented` feature is corrected in place with `cerne feature amend F-NNNN --file result.md --reason "<why>"`. The marker for an intentional mention of a superseded entity, the runbook errata and the rest: `reference/errata.md`.
## Knowledge routing: cerne note vs. local memory
When you acquire knowledge worth keeping, route it by **who it belongs to**, not by reflex:
- **Durable, team-relevant project knowledge → `cerne note new`.** Gotchas, invariants, hard-won conventions, "why X and not Y" — anything a teammate or your own agent on another machine would need. It belongs in the guardian, where it is shared across machines and members, versioned, indexed, and governed (so it can be superseded instead of rotting). This is the gap notes exist to close: such knowledge otherwise dies in one person's local `~/.claude/.../memory/`.
- **Personal or machine-specific knowledge → stays in local Claude Code memory, never pushed.** Who you are and how you like to work (`user`/`feedback`-class) is personal — sharing it imposes one person's style on the team. **Machine-specific** facts are worse: a memory like "Go lives at `C:\…\go\bin`" is correct on one box and **wrong** on another, so pushing it is an actively harmful asset. Leave these where they are.
- **When in doubt, ask:** would this still be true and useful for a different person on a different machine? If yes, it is a note. If it only holds for *you* or *this box*, keep it local. Never bulk-sync memory into cerne — the boundary requires this per-item judgment.
## External sources (provenance)
The moment an external source (article, RFC, vendor/API doc, spec) **shapes** a feature, decision, or fix, register it — as you use it, **without waiting to be asked** — instead of leaving a bare URL in prose: `cerne reference new "<title>" --url <url> --informs F-NNNN,D-NNNN [--facet <f>] [--component <c>] [--file <summary> | stdin]`. Register **only the sources that actually informed the outcome**. Listing, retagging, retiring and linking references: `reference/external-sources.md`.
## Rules that apply when you do these things
- **Language** (`reference/language.md`): Write every document in the project's language: check the headings of the stub you are filling.
- **Non-feature work:** The moment you pick up a non-feature task, register it with `cerne work start "<description>" [--ref F-NNNN]`, and run `cerne work list` before delegating an investigation so nobody duplicates it (`reference/work-and-handoffs.md`).
- **Ideas** (`reference/ideas-pendings.md`): Ideas are on demand only: never pull ideas in unasked.
- **Pendings:** `cerne feature complete` refuses a result that does not cite every pending the feature pays, and a promoted pending is never closed by hand: its feature's accept resolves it (`reference/ideas-pendings.md`).
## Hard rules
- **Register the task at the start.** The first action when you pick up a task is `cerne feature new "<title>" --context "<1-3 sentences on why>"` (it lands as a candidate, visible on the kanban, with its creation context captured — bare creation is refused) — not something you do after the work is finished. Advance it as you go (spec → `approve`, plan → `start`, result → `complete`); if it is abandoned, `cerne feature reject <id> --reason "…"` so the board stays honest. Candidates left without a real spec past the grace window are flagged by `cerne lint` (`stale-candidate`).
- **Register the sources that shaped a decision.** When an external source (article, RFC, vendor/API doc, spec) informs a feature/decision/fix, register it as you use it — `cerne reference new "<title>" --url <url> --informs <ids>` — not only when a human asks for it. Register **only the useful ones**: the sources that actually moved the outcome, never a dead-end you opened and discarded. A source worth citing in the doc is worth a reference; a bare URL left in prose is lost provenance. `cerne lint` backs this up — a **decision or feature** doc that cites an external URL with no backing registered reference is flagged **`unregistered-source`** (register the source, or drop the bare URL); internal/local hosts and any `unregistered_source_ignore` substrings in `.cernerc` are skipped. Install the proactive gate reminder with `cerne hook install`.
- **Author through cerne**, not as loose markdown folders for tracked features/decisions — loose markdown is authoring input, not authority.
- **Never hand-edit generated outputs:** `.docs/CONTEXT.md` and the compiled wiki regenerate (`cerne pull` / `cerne compile`).
- **Review pending automatic updates.** When `cerne next` reports drift updates awaiting review, handle them (`cerne drift pending` → `ack` or correct) as part of the session's work — apply-then-notify (D-0005) only stays honest if someone actually reviews.
- After a `cerne push` that changes the backend, commit the updated `docs.lock` (the code↔docs pin) alongside your code change — **unless the project sets `pin_branch` in `.cernerc` and you are on another branch** (F-0102): there cerne leaves `docs.lock` untouched on purpose (the live snapshot lives in the gitignored `.docs/.snapshot`), the pin advances on the first cerne operation on the pin branch after merge, and MRs stop conflicting on it. Don't "fix" an unchanged `docs.lock` by hand.
- `.docs/` is gitignored; commit `.cernerc`, `docs.lock` **and `.gitattributes`** in your project repo. The `.gitattributes` wires the `docs.lock` merge driver that `cerne init`/`cerne pull` register, so parallel branches/worktrees stop conflicting on the snapshot pin — a fresh clone just runs `cerne pull` once to self-heal its local git config. Server-side merges (GitLab/GitHub MRs) can't run that driver; setting `pin_branch = "main"` removes the conflict at the source instead.
- **Bulk-importing an existing doc tree** (bootstrap only, not for registering a single new case): `cerne import` with no flags uses the deterministic case-folder convention (`docs/process/cases/NNNN_slug/`); `--agent` does an AI-assisted generic import for any structure (emits a mapping prompt, then `cerne import --agent --ingest [--yes]` validates and applies it). It already guards against re-minting a candidate whose title matches an existing feature.
## What cerne can do
One line per functionality; `cerne guide "<name>"` returns how to use it, and `cerne guide` alone prints this catalog from the command tree. Every command below also answers `--help`.
- **Read state:** cerne status, cerne brief, cerne next, cerne show, cerne search, cerne ask, cerne graph, cerne stats, cerne savings, cerne cost, cerne harness. `.docs/CONTEXT.md` is the generated roster; reading a feature prints the document of its stage.
- **Feature lifecycle:** cerne feature new, cerne feature spec, cerne feature approve, cerne feature start, cerne feature complete, cerne feature accept, cerne feature reject, cerne feature supersede, cerne feature revert, cerne feature amend, cerne feature errata, cerne feature deliver, cerne feature learnings (reference/lifecycle.md).
- **Feature card:** cerne feature list, cerne feature set, cerne feature rename, cerne feature retag, cerne feature capability, cerne feature reparent, cerne epic new, cerne task new, cerne bug new, cerne capability list, cerne capability new, cerne capability retire, cerne capability bootstrap, cerne classify (reference/epics.md).
- **Docs sync:** cerne pull, cerne push, cerne sync, cerne lint, cerne init, cerne import, cerne hook install, cerne mcp, cerne demo, cerne guide (reference/validate-and-settings.md, reference/mcp-and-demo.md).
- **Authoring aids (LLM layer):** cerne spec draft, cerne spec diagram, cerne spec check (lint a draft body from --file/stdin before registering it; exit 1 on an error), cerne plan draft, cerne result draft, cerne decision draft, cerne runbook draft, cerne compile, cerne clarify list, cerne clarify answer, cerne clarify correct — resolve `[ESCLARECER]` markers from the terminal (reference/templates.md). Same for `[CLARIFY]` markers.
- **Gauntlet:** cerne gauntlet artifact, cerne gauntlet record, cerne cost attribute, cerne cost backfill-roles (reference/gauntlet.md).
- **Decisions (ADRs):** cerne decision new, cerne decision list, cerne decision keep, cerne decision retag, cerne decision retire, cerne decision supersede, cerne decision errata (reference/decisions-runbooks.md).
- **Runbooks:** cerne runbook new, cerne runbook errata, cerne runbook retag, cerne runbook retire, cerne runbook supersede, cerne runbook decide, cerne runbook merge, cerne runbook run, cerne runbook step, cerne runbook preflight, cerne runbook report, cerne runbook migrate.
- **Notes (durable knowledge):** cerne note new, cerne note list, cerne note show, cerne note keep, cerne note retag, cerne note tags, cerne note retire, cerne note supersede, cerne note errata (reference/notes-and-knowledge.md).
- **External references:** cerne reference new, cerne reference list, cerne reference link, cerne reference retag, cerne reference retire (reference/external-sources.md).
- **Errata of the concluded:** cerne accept queue (the human's queue), cerne retire and cerne forget-alias (legacy entities), cerne cost backfill-effort (measured effort of old cost anchors), cerne drift, cerne drift pending, cerne drift ack (reference/errata.md, reference/drift.md, reference/housekeeping.md).
- **Agent activity and handoffs:** cerne work start, cerne work list, cerne work log, cerne work done, cerne work abandon, cerne work handoff, cerne handoff list, cerne handoff take, cerne handoff cancel (reference/work-and-handoffs.md).
- **Pendings and ideas:** cerne pending new, cerne pending list, cerne pending show, cerne pending promote, cerne pending link, cerne pending unlink, cerne pending resolve, cerne pending drop, cerne idea new, cerne idea list, cerne idea show, cerne idea promote, cerne idea resolve, cerne idea link, cerne idea unlink, cerne idea migrate, cerne idea drop (reference/ideas-pendings.md).
- **Channel and war room:** cerne msg send, cerne msg read, cerne msg ack, cerne room open, cerne room join, cerne room say, cerne room read, cerne room watch, cerne room list, cerne room close, cerne room propose, cerne room request-decision, cerne room pending, cerne room resolve, cerne room facilitator handoff, cerne room minutes register, cerne room minutes show, cerne room minutes template (reference/war-room-channel.md).
- **Settings and models:** cerne settings list, cerne settings get, cerne settings set, cerne settings unset, cerne models refresh (reference/validate-and-settings.md).
## Reference files
The detail behind each rule and feature, next to this file in `reference/`: `lifecycle.md` (feature loop, syncing), `templates.md` (spec, plan, result, ADR and runbook structure, clarifications), `gauntlet.md`, `errata.md`, `epics.md`, `decisions-runbooks.md`, `notes-and-knowledge.md`, `external-sources.md`, `work-and-handoffs.md`, `ideas-pendings.md`, `war-room-channel.md`, `drift.md`, `language.md` (documentation language), `housekeeping.md` (classify, import, retire, graph, stats, cost, savings), `validate-and-settings.md`, `mcp-and-demo.md`. Without file access: `cerne guide "<topic>"`.