Skip to content

/self-audit

Self-audit this skills repo against CLAUDE.md invariants, the artifact contract, and README/CLAUDE.md/docs sync via three parallel read-only subagents. Local meta-skill — independent of the /task:* pipeline.

From plugin
78 skills8 agents
shell
$ npx -y skills add SpaiR/task-pipeline --skill self-audit --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/self-audit
How auto-invocation works

Context preview

The summary Claude sees to decide when to auto-load this skill.

Self-audit this skills repo against CLAUDE.md invariants, the artifact contract, and README/CLAUDE.md/docs sync via three parallel read-only subagents. Local meta-skill — independent of the /task:* pipeline.

SKILL.md

self-audit.SKILL.md
name: self-audit
description: Self-audit this skills repo against CLAUDE.md invariants, the artifact contract, and README/CLAUDE.md/docs sync via three parallel read-only subagents. Local meta-skill — independent of the /task:* pipeline.
disable-model-invocation: true
user-invocable: true

Audit **this repository** (the task-pipeline skills repo itself) for drift between skills, the artifact contract, and the user-facing docs. Three lenses run in parallel as named subagents: **Invariants**, **Contract**, **Docs-sync**.

This is a **meta-skill**. It operates on the repo's own files (`skills/*/SKILL.md`, `skills/_lib/*.sh`, `skills/validate/validate.sh`, `CLAUDE.md`, `README.md`, `docs/contract.md`), not on `.task/*` artifacts. The pipeline it audits is the chat-first capture protocol — `grill` in chat, then `to-task` / `to-plan` / `to-roadmap` / `to-spec` fix the discussion into a `.task/` artifact that a plain session (or `roadmap-to-workflow`) executes directly, handing the diff to `task:code-reviewer`. The repo-level `agents/` directory holds exactly one file, `agents/code-reviewer.md`. The skill can be invoked at any time.

**Input:** Optional scope hint: $ARGUMENTS (e.g. a single skill name to focus on; default: full repo).

**Precondition (hard-stop):** This skill is local to the task-pipeline repo. Verify the working directory contains `skills/to-task/`, `skills/validate/`, and `CLAUDE.md` at the repo root. If not, stop with: "This skill is local and only works inside the task-pipeline repository."

**Communication language:** Russian (per global user instructions). Findings text stays in English (it grounds in English source files and matches the existing auditor convention).

**Why a separate set of agents?** The global `audit-{reuse,simplicity,clarity}-auditor` are tuned for code diffs (DRY, dead code, naming). This repo's content is markdown-as-prompt plus a thin `skills/_lib/` bash layer. The meaningful failure modes here are different — invariant drift, producer↔consumer mismatch, README↔code drift. Hence three repo-specific lenses.

Architecture

| Lens | Local agent | What it checks | |------|-------------|---------------| | Invariants | `self-invariants-auditor` | Skills don't violate any bullet in `CLAUDE.md` § "Invariants — don't break these when editing skills". | | Contract | `self-contract-auditor` | Producer↔consumer artifact protocol is symmetric (templates ↔ `validate.sh`/`roadmap.sh` parsers ↔ consumer rules), per `docs/contract.md`. | | Docs-sync | `self-docs-sync-auditor` | `README.md`, `CLAUDE.md`, and `docs/contract.md` reflect the actual `skills/` directory (six user skills + `validate`), plus `CONTRIBUTING.md` and the `website/` pages. |

All three are **read-only** named agents at `.claude/agents/self-{invariants,contract,docs-sync}-auditor.md`, with `tools: Read, Grep, Glob, Bash` (no `Edit`/`Write` — read-only is runtime-enforced). Fixes happen only in the main thread (Step 4).

Instructions

Step 1: Gather context

In one parallel batch, run:

  • `ls skills/` — full skill list (folder names = canonical slugs; expect `to-task`, `to-plan`, `to-roadmap`, `to-spec`, `roadmap-to-workflow`, `validate`, `_lib`).
  • `ls .claude/agents/` — local self-* agents (sanity check before fan-out).
  • `git status --porcelain` — flag a dirty tree to the user before starting (audit findings against working state may diverge from `HEAD`).
  • Read `.claude/.audit-baseline.json` if it exists (prior ratchet metrics; absent on first run — treat as no baseline).
  • Read `CLAUDE.md`, `README.md`, and `docs/contract.md` in full.
  • Read every `skills/*/SKILL.md` (one batched call).
  • Read every bash helper `skills/_lib/*.sh` plus `skills/validate/validate.sh` (one batched call).

The repo-level `agents/` directory holds **exactly one** file, `agents/code-reviewer.md` (the `task:code-reviewer` review pass) — read it alongside the skills. There is **no `docs/spec/`** — do not attempt to read it. If `$ARGUMENTS` names a single skill (e.g. `to-plan`), still load the full `CLAUDE.md` + `README.md` + `docs/contract.md` (lenses cross-reference), but you may narrow the SKILL.md reads to that skill plus any skill it explicitly produces/consumes for.

Step 2: Run three agents in parallel

Send **one tool message** with three `Agent` calls, `subagent_type` set to:

  • `self-invariants-auditor`
  • `self-contract-auditor`
  • `self-docs-sync-auditor`

If any of those agent files is missing under `.claude/agents/`, stop and tell the user which agent file is missing — do not fall back to inline prompts (it would lose the read-only allowlist guarantee).

Per-call prompt template

Use this skeleton; fill in the lens-specific bundle below.

Audit this repo against your lens. Return findings in the format defined
in your agent prompt.

--- Repo root ---
{absolute path to repo root}

--- Scope hint ---
{$ARGUMENTS or "full repo"}

--- Skill list ---
{ls skills/}

--- CLAUDE.md ---
{full file contents}

{lens-specific block — see table}

--- SKILL.md bundle ---
{concatenated skills/*/SKILL.md, each preceded by `=== <relative path> ===`}

--- Bash helpers ---
{lens-specific — see table}

Lens-specific blocks:

| Block | Invariants | Contract | Docs-sync | |-------|-----------|----------|-----------| | `--- README.md ---` | — | — | full file | | `--- docs/contract.md ---` | — | **full file** (the contract source of truth) | full file | | `--- Bash helpers ---` | paths + first-line description | **full text of every `skills/_lib/*.sh` + `validate.sh`** (parsers live there) | paths only |

Step 3: Merge and report

1. Parse each agent's reply into a list of findings using its declared schema. 2. **Deduplicate** cross-lens overlap: same `(file, anchor)` with overlapping `problem` text → keep the more specific lens (Contract beats Docs-sync beats Invariants when they collide on the same anchor). 3. **Sort**: high → med → low; within severity by file, then line. 4. Render to c

Read more
Read it on GitHub ↗

Showing the first part of this file.

Ships withtask

Docs & guides → spair.github.io/task-pipeline A plan file is only as good as the argument that produced it. That second line is where projects quietly go wrong: the model agrees and starts building before the plan was ever argued.

Get the whole plugin, auto-invoked
Stats
7
Stars
0
Views
0
Forks
Active
Maintenance
Shell
Language
MIT
License
8h ago
Last commit
1mo ago
Created

Repo: SpaiR/task-pipeline