Pārlūkot izejas kodu

docs: Review, refresh, and reorganise docs/

- Land docs/SKILL-CREATION-PROTOCOL.md (from the spawned review): the canonical
  skill-build sequencing doc that cites rather than restates the layer docs, with
  a precedence table; skill-agent-updates.md routes here first.
- Refresh: WORKFLOWS.md gets a v3.0 orientation banner (skills-first, subagents
  isolation-only); naming-conventions.md frontmatter example corrected to the
  metadata block; RESERVED-COMMANDS.md re-dated; anthropic-skills-guide.md marked
  as a vendored reference.
- Reorganise: archive completed-migration docs to docs/archive/
  (AGENT-SKILLS-COMPLIANCE-BRIEF — spec migration done; COMMAND-SKILL-PATTERN —
  command→skill conversion done). docs/ top level is now 8 load-bearing docs.
- README: fix stale '89 skills' -> 91; repoint the archived COMMAND-SKILL-PATTERN
  link to ARCHITECTURE + SKILL-CREATION-PROTOCOL.

doc-drift clean, validate 101/0, no ghost links.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0xDarkMatter 11 stundas atpakaļ
vecāks
revīzija
82de5ff603

+ 1 - 1
AGENTS.md

@@ -38,7 +38,7 @@ cd claude-mods && ./scripts/install.sh  # or .\scripts\install.ps1 on Windows
 | `tools/` | Modern CLI toolkit documentation |
 | `tests/` | Validation scripts + justfile |
 | `scripts/` | Install scripts |
-| `docs/` | ARCHITECTURE.md, WORKFLOWS.md, PLAN.md, SKILL-SUBAGENT-REFERENCE.md, SKILL-RESOURCE-PROTOCOL.md, TERMINAL-DESIGN.md |
+| `docs/` | ARCHITECTURE.md, SKILL-CREATION-PROTOCOL.md (start here to build a skill), SKILL-SUBAGENT-REFERENCE.md, SKILL-RESOURCE-PROTOCOL.md, WORKFLOWS.md, PLAN.md, RESERVED-COMMANDS.md, TERMINAL-DESIGN.md; `archive/` (completed-migration records), `references/` (vendored guides) |
 
 ## Session Init
 

+ 16 - 0
CHANGELOG.md

@@ -7,6 +7,22 @@ feature releases live in the README "Recent Updates" section.
 
 ## [Unreleased]
 
+### Added
+- **`docs/SKILL-CREATION-PROTOCOL.md`** - the canonical "how to build a claude-mods
+  skill" sequencing doc (warranted? → frontmatter → body → resources → tests → repo
+  wiring → ship). Cites rather than restates the layer-owning docs (skill-creator,
+  SKILL-SUBAGENT-REFERENCE, naming-conventions, SKILL-RESOURCE-PROTOCOL) and carries a
+  precedence table for when they disagree. `skill-agent-updates.md` now routes here first.
+
+### Changed (docs review)
+- Refreshed `WORKFLOWS.md` with a v3.0 orientation banner (skills-first; subagents are
+  isolation/worker-only); fixed `naming-conventions.md` frontmatter example (metadata
+  block, not top-level arrays); dated `RESERVED-COMMANDS.md`; noted `anthropic-skills-guide.md`
+  as a vendored reference pointing at the creation protocol.
+- Archived completed-migration docs to `docs/archive/`: `AGENT-SKILLS-COMPLIANCE-BRIEF.md`
+  (spec migration done, CI-enforced) and `COMMAND-SKILL-PATTERN.md` (command→skill
+  conversion done). docs/ top level is now 8 load-bearing docs + `archive/` + `references/`.
+
 ### Added
 - **github-ops open-issue awareness** - `scripts/check-issues.sh` surfaces open
   issues you may not have seen (externally-authored + stale), read-only via

+ 2 - 2
README.md

@@ -65,7 +65,7 @@ Claude Code is powerful out of the box, but it has gaps. This toolkit fills them
 
 - **Session continuity** — Tasks vanish when sessions end. We fix that with `/save` and `/sync`, implementing Anthropic's [recommended pattern](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents) for long-running agents.
 
-- **Expert-level knowledge on demand** — 89 on-demand skills covering React, TypeScript, Python, Go, Rust, PostgreSQL, and more, plus 3 specialized agents reserved for genuine context-isolation/worker roles (git operations, web scraping, project reorganization). Skills-first: knowledge loads when relevant instead of living in heavyweight agent prompts.
+- **Expert-level knowledge on demand** — 91 on-demand skills covering React, TypeScript, Python, Go, Rust, PostgreSQL, and more, plus 3 specialized agents reserved for genuine context-isolation/worker roles (git operations, web scraping, project reorganization). Skills-first: knowledge loads when relevant instead of living in heavyweight agent prompts.
 
 - **Modern CLI tools** — Stop using `grep`, `find`, and `cat`. Our rules automatically prefer `ripgrep`, `fd`, `eza`, and `bat` — 10-100x faster and token-efficient.
 
@@ -558,7 +558,7 @@ With 80+ skills installed (this plugin alone ships 81), skill descriptions can o
 
 Most functionality lives in skills rather than commands. Skills get slash-hint discovery via trigger keywords and load on-demand, reducing context overhead. Only session management (`/sync`, `/save`) remains as commands.
 
-See `docs/COMMAND-SKILL-PATTERN.md` for details.
+See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the component model, and [docs/SKILL-CREATION-PROTOCOL.md](docs/SKILL-CREATION-PROTOCOL.md) for how to build a new skill.
 
 ## Resources
 

+ 1 - 1
docs/RESERVED-COMMANDS.md

@@ -60,4 +60,4 @@ Current claude-mods skills/commands (verified no conflicts):
 
 ## Last Updated
 
-2025-01-23
+2026-06-16 — verified against https://code.claude.com/docs/en/interactive-mode#built-in-commands

+ 133 - 0
docs/SKILL-CREATION-PROTOCOL.md

@@ -0,0 +1,133 @@
+# Skill Creation Protocol
+
+> **The one doc to read before building a claude-mods skill.** It sequences the whole
+> lifecycle — is-it-warranted → frontmatter → body → resources → tests → repo wiring →
+> ship — and points to the adjacent docs that own each layer. It **restates none of
+> them**: each step cites its authority and adds only the repo-specific fact that lives
+> nowhere else.
+
+**How to use this.** Read top to bottom once. Follow the steps in order; skip a step only
+when there's a clear reason it doesn't apply. Where a step says "→ see X", X is the
+single source of truth for that layer — go there for detail, come back here for sequence.
+
+**Adjacent docs this protocol orchestrates:**
+
+| Layer | Authority | Owns |
+|---|---|---|
+| Authoring method | `skill-creator` skill (`Skill` tool) | concrete-examples → plan → init → edit → package → iterate; description-as-trigger; progressive disclosure |
+| Frontmatter fields | [SKILL-SUBAGENT-REFERENCE.md](SKILL-SUBAGENT-REFERENCE.md) | allowed top-level keys, `metadata` block, license/author rules |
+| Naming & layout | [naming-conventions.md](../rules/naming-conventions.md) | `-ops` suffix, kebab-case, the three subdirs |
+| Resource contract | [SKILL-RESOURCE-PROTOCOL.md](SKILL-RESOURCE-PROTOCOL.md) | scripts/assets/references: streams, exit codes, `--help`, `--json`, staleness verifier |
+| Terminal output | [TERMINAL-DESIGN.md](TERMINAL-DESIGN.md) | TTY glyphs/panels via `skills/_lib/term.sh` |
+
+When two sources disagree, **this table decides** which one wins for that layer. The
+notable case: the bundled `skill-creator` says "name + description only, no other
+frontmatter fields" — that is Anthropic's portable default. **In this repo,
+SKILL-SUBAGENT-REFERENCE overrides it** (we require `license` + `metadata.author`).
+
+---
+
+## Step 0 — Is a skill warranted?
+
+→ method: `skill-creator` Steps 1–2 (work concrete usage examples first, then plan the
+reusable contents).
+
+Repo-specific gates before you scaffold anything:
+
+- **A skill is comprehensive operational knowledge.** If the thing is a one-line
+  behavioural directive ("always prefer `uv`"), it's a **rule** (`rules/`), not a skill.
+  If it's context-isolation/worker behaviour, it may be an **agent** (`agents/`). See
+  [ARCHITECTURE.md](ARCHITECTURE.md) for the skill-vs-rule-vs-agent split.
+- **Don't duplicate an existing skill.** Search `skills/` first; prefer extending one.
+- If it is a skill, it almost certainly takes the **`-ops` suffix** (→ naming-conventions).
+
+## Step 1 — Scaffold
+
+→ method: `skill-creator` Step 3 (`init_skill.py`).
+
+The skill directory MUST contain `scripts/`, `references/`, and `assets/` — create them
+even if empty, with a `.gitkeep` (→ naming-conventions, "Directory Structure"). The
+directory name is kebab-case and matches the frontmatter `name` exactly.
+
+## Step 2 — Frontmatter to spec
+
+→ authority: [SKILL-SUBAGENT-REFERENCE.md](SKILL-SUBAGENT-REFERENCE.md) — read its
+"Allowed Top-Level Fields" table; it is the only legal field list.
+
+claude-mods house rules layered on top (checklist, not a restatement):
+
+- [ ] `license: MIT` (exception: `skill-creator` keeps its custom license)
+- [ ] `metadata.author: claude-mods`
+- [ ] `depends-on` / `related-skills` live **under `metadata`** as **comma-separated
+      strings** — never arrays, never top-level. Omit entirely if empty.
+- [ ] `name` matches the directory.
+
+## Step 3 — Body (progressive disclosure)
+
+→ authority: `skill-creator` ("Progressive Disclosure", "What to Not Include").
+
+The load-bearing rules it owns: the **`description` is the trigger** (put every "when to
+use" cue there, never in the body); keep the **body under 500 lines**; split detail into
+`references/*.md` (one concept per file, linked from SKILL.md); **don't ship**
+README/CHANGELOG/INSTALL files inside a skill.
+
+## Step 4 — Resources (scripts / assets / references)
+
+→ authority: [SKILL-RESOURCE-PROTOCOL.md](SKILL-RESOURCE-PROTOCOL.md) — its §10
+compliance checklist is the gate for anything executable.
+
+In one line: stdout is data-only, semantic exit codes, `--help` with an EXAMPLES section,
+the first-comment-block contract, validate agent-supplied input. Every reference/asset
+must be **cited from SKILL.md** or it's dead weight the router never finds. If the skill
+encodes fast-moving external facts (model IDs, API params, action versions), ship the
+`--offline`/`--live` **staleness verifier** (§7) so drift trips a tripwire instead of
+rotting. TTY output → [TERMINAL-DESIGN.md](TERMINAL-DESIGN.md).
+
+## Step 5 — Tests
+
+Add `tests/run.sh` — an **offline, self-contained** behavioural suite that exits nonzero
+on any failure and prints a skip message (exit 0) on unsupported platforms. Pattern after
+[`skills/supply-chain-defense/tests/run.sh`](../skills/supply-chain-defense/tests/run.sh).
+
+No registration needed: [`tests/run-skill-tests.sh`](../tests/run-skill-tests.sh) globs
+`skills/*/tests/run.sh` and runs them all in CI. If the skill ships a verifier script,
+also add an offline-mode assertion to [`tests/check-resources.sh`](../tests/check-resources.sh)
+(PR CI, may block); its `--live` mode runs in the scheduled
+[`freshness.yml`](../.github/workflows/freshness.yml), never blocking a PR.
+
+## Step 6 — Repo integration (the doc-drift gate)
+
+[`tests/doc-drift.sh`](../tests/doc-drift.sh) blocks CI unless docs match disk. Before you
+commit:
+
+- [ ] Add a **README skill-table row** — `skills/<name>/` must appear in `README.md` (the
+      gate requires one row per skill).
+- [ ] Bump the **count headers** in `README.md`, `AGENTS.md`, and `docs/PLAN.md` (skills
+      total).
+- [ ] Any new repo-relative markdown link must resolve (no ghost references).
+
+## Step 7 — Validate & ship
+
+- [ ] [`tests/validate.sh`](../tests/validate.sh) passes (frontmatter + naming).
+- [ ] `claude plugin validate` passes — gate on the **official** validator, never a
+      hand-rolled reimplementation.
+- [ ] `skill-creator` Step 5 `package_skill.py` if a distributable `.skill` is needed.
+- [ ] Commit per [commit-style.md](../rules/commit-style.md) (`feat(skills): …`).
+
+---
+
+## At a glance
+
+```
+0 warranted?  → skill-creator §1-2 + ARCHITECTURE (skill vs rule vs agent)
+1 scaffold    → skill-creator init_skill.py; 3 subdirs (naming-conventions)
+2 frontmatter → SKILL-SUBAGENT-REFERENCE (+ license:MIT, metadata.author)
+3 body        → skill-creator (description=trigger, <500 lines, progressive disclosure)
+4 resources   → SKILL-RESOURCE-PROTOCOL (§10 gate; staleness verifier if external facts)
+5 tests       → tests/run.sh → run-skill-tests.sh; verifier → check-resources.sh
+6 integrate   → doc-drift.sh: README row + count bumps + no ghost links
+7 ship        → validate.sh + claude plugin validate + package + commit
+```
+
+This doc owns the **sequence and the test/CI/counts bookend**. Everything else is owned by
+the adjacent doc named at each step — read that doc for depth, this one for order.

+ 7 - 6
docs/SKILL-RESOURCE-PROTOCOL.md

@@ -5,17 +5,18 @@
 > script in `mac-ops` behaves like a script in `supply-chain-defense` — predictable
 > streams, predictable exit codes, predictable help.
 
-**Scope.** This document governs skill *resources*. Frontmatter, naming, and body
-structure live elsewhere — see [naming-conventions.md](../rules/naming-conventions.md),
+**Scope.** This document governs skill *resources* — the resource layer of the
+[Skill Creation Protocol](SKILL-CREATION-PROTOCOL.md) (Step 4). Frontmatter, naming, and
+body structure live elsewhere — see [naming-conventions.md](../rules/naming-conventions.md),
 [SKILL-SUBAGENT-REFERENCE.md](SKILL-SUBAGENT-REFERENCE.md), and the
 [Agent Skills spec](https://agentskills.io/specification). Terminal/TTY output is
 [TERMINAL-DESIGN.md](TERMINAL-DESIGN.md) (`skills/_lib/term.sh`).
 
 **Why it exists.** Claude executes these scripts mid-task and parses their output.
 Inconsistent interfaces mean wasted tokens (the agent re-derives usage), broken pipes
-(status text pollutes `| jq`), and silent failures (exit 0 on bad input). The repo has
-56 skill scripts; the strong ones already follow this — `supply-chain-defense/scripts/preinstall-check.sh`
-is the canonical exemplar.
+(status text pollutes `| jq`), and silent failures (exit 0 on bad input). Of the many
+skill scripts in this repo, the strong ones already follow this —
+`supply-chain-defense/scripts/preinstall-check.sh` is the canonical exemplar.
 
 ---
 
@@ -248,6 +249,6 @@ Recommended (the bar for a world-class skill):
 
 - `skills/supply-chain-defense/scripts/preinstall-check.sh` — the canonical script:
   ecosystem flags, `--json`, exit-10 domain signal, `command -v` guards, registry-unavailable→7.
-- `skills/supply-chain-defense/tests/run.sh` — offline self-test peer suite (67 assertions).
+- `skills/supply-chain-defense/tests/run.sh` — offline self-test peer suite.
 - `skills/_lib/term.sh` + [TERMINAL-DESIGN.md](TERMINAL-DESIGN.md) — for any script that
   prints a panel to a TTY.

+ 11 - 0
docs/WORKFLOWS.md

@@ -2,6 +2,17 @@
 
 Recommended patterns for common development tasks.
 
+> **Orientation (v3.0+).** The core loops below — Explore→Plan→Code→Commit, TDD — are
+> timeless Anthropic best practice and unchanged. Two repo specifics to read them by:
+> (1) claude-mods is **skills-first** — domain knowledge lives in `-ops` skills loaded
+> on demand, not in agents; **subagents are reserved for context-isolation/worker roles
+> only** (git-agent, firecrawl-expert, project-organizer). Dispatching skills (review,
+> testgen, perf-ops, …) route `general-purpose` agents that preload the relevant skill.
+> (2) To **build** a skill, follow [SKILL-CREATION-PROTOCOL.md](SKILL-CREATION-PROTOCOL.md);
+> for what's shipping/next, see [PLAN.md](PLAN.md). Treat any specific skill/agent named
+> in older examples below as illustrative — [ARCHITECTURE.md](ARCHITECTURE.md) is the
+> current component authority.
+
 ## Core Workflow: Explore → Plan → Code → Commit
 
 The fundamental Claude Code workflow from [Anthropic's best practices](https://www.anthropic.com/engineering/claude-code-best-practices):

+ 3 - 0
docs/AGENT-SKILLS-COMPLIANCE-BRIEF.md → docs/archive/AGENT-SKILLS-COMPLIANCE-BRIEF.md

@@ -1,5 +1,8 @@
 # Agent Skills Spec Compliance Brief
 
+> **ARCHIVED — completed.** The Agent Skills spec migration this brief describes finished in v3.0 (June 2026): all skills carry spec-compliant frontmatter, enforced by `tests/validate.sh`. New skills inherit the format via the `skill-creator` skill + [SKILL-CREATION-PROTOCOL.md](../SKILL-CREATION-PROTOCOL.md). Kept as a historical record.
+
+
 > Bring all 66 skills in claude-mods into compliance with the Agent Skills specification at https://agentskills.io/specification
 
 ## Background

+ 3 - 0
docs/COMMAND-SKILL-PATTERN.md → docs/archive/COMMAND-SKILL-PATTERN.md

@@ -1,5 +1,8 @@
 # Command-Skill Pattern
 
+> **ARCHIVED — completed.** The command→skill conversion this doc describes is done: only `/sync` and `/save` remain commands; all domain knowledge lives in skills. For the current component model see [ARCHITECTURE.md](../ARCHITECTURE.md); to build a skill see [SKILL-CREATION-PROTOCOL.md](../SKILL-CREATION-PROTOCOL.md). Kept as a historical record.
+
+
 ## Overview
 
 Claude Code has two extension concepts:

+ 5 - 0
docs/references/anthropic-skills-guide.md

@@ -1,5 +1,10 @@
 # The Complete Guide to Building Skills for Claude
 
+> **Vendored reference** — Anthropic's general guide to building skills, kept for
+> background reading. For claude-mods-specific skill creation, start with
+> [SKILL-CREATION-PROTOCOL.md](../SKILL-CREATION-PROTOCOL.md) (it sequences the repo's
+> workflow and cites the layer-owning docs); this guide is the upstream theory behind it.
+
 ## Contents
 
 - [Introduction](#introduction)

+ 10 - 4
rules/naming-conventions.md

@@ -59,16 +59,22 @@ All skills follow the official Anthropic pattern with bundled resources:
 
 **Naming guidance:** Use `-ops` for all skills providing domain knowledge. The `-ops` suffix signals comprehensive operational expertise - design, implementation, and operations.
 
-**Frontmatter:**
+**Frontmatter:** field placement is owned by
+[SKILL-SUBAGENT-REFERENCE.md](../docs/SKILL-SUBAGENT-REFERENCE.md) (the Agent Skills
+spec). Only `name`, `description`, `license`, `compatibility`, `allowed-tools`, and
+`metadata` are legal at the top level; `depends-on` / `related-skills` go **inside
+`metadata` as comma-separated strings, not arrays**.
 
 ```yaml
 ---
 name: python-async-ops  # Match directory name
 description: "<trigger phrases>"
-compatibility: "<version requirements>"
+license: MIT
 allowed-tools: "<tool list>"
-depends-on: [<skill-names>]
-related-skills: [<skill-names>]
+metadata:
+  author: claude-mods
+  related-skills: "skill-a, skill-b"
+  depends-on: "skill-c"
 ---
 ```
 

+ 9 - 2
rules/skill-agent-updates.md

@@ -1,13 +1,20 @@
 # Skill and Agent Updates
 
-**BEFORE creating or updating any skill or agent**, check the official docs:
+**BEFORE creating a new skill**, follow `docs/SKILL-CREATION-PROTOCOL.md` — the single
+canonical lifecycle doc (warranted? → frontmatter → body → resources → tests → repo
+wiring → ship). It sequences the steps and points to the layer-owning docs below; read
+it first, then drill into whichever adjacent doc a step cites.
+
+**BEFORE creating or updating any skill or agent**, also check the official docs:
 
 | Resource | URL |
 |----------|-----|
 | Skills | https://code.claude.com/docs/en/skills |
 | Sub-agents | https://code.claude.com/docs/en/sub-agents |
 
-These APIs change frequently. For detailed reference (frontmatter fields, decision frameworks), see `docs/SKILL-SUBAGENT-REFERENCE.md`.
+These APIs change frequently. The protocol's adjacent docs: `docs/SKILL-SUBAGENT-REFERENCE.md`
+(frontmatter fields, subagent decision frameworks), `rules/naming-conventions.md` (naming +
+layout), and `docs/SKILL-RESOURCE-PROTOCOL.md` (the resource contract, below).
 
 ## Skill resources (scripts / assets / references)