refactor(skills): cap every SKILL.md at 600 words and cut agent messages
Every loaded SKILL.md and every listed description is paid on every turn of every session, and every delivered message costs its recipient a full turn. scripts/budget.py gains SKILL_WORDS = 600, enforced by test_lock, and test_naming forbids a skill naming its own slash command; 53 descriptions and 10 body lines drop it. The 18 longest skills move details into 31 side files read only in their situation (organize's capacity, succession, peers, offices, relay and lineage; cleanup's docker, worktrees, execute and ask; code-tune, changelog, triage, dream, split and others), so all SKILL.md files shrink from 33866 to 26291 words without dropping a rule; an independent review of HEAD against the new text found no loss in 60 of 64 skills and three weakenings, now restored (WSJF re-estimates after an objective change, cleanup's volume checklist, essence's absolute dates). The kvb-org-organize Peer protocol sends status that asks nothing to the news board, answers nothing that asks nothing, keeps messages terse, and lets light runs admit themselves in the operator's wording; the skills follow it (operator reads the register, relax and wakeup reply through the news, evening collects them there, wsjf asks only for missing estimates, cleanup and triage batch their questions). Skills that explore code ask the codebase-memory-mcp graph first, subagent briefs scale with the stakes and cap their answers, and the skills that need the full register or council tables call show --wide or list --long. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
34b434a744
commit
3c2f6c44b5
99 files changed
+2110
-2086
No files matched your search
+53
-100
@@ -6,109 +6,62 @@ description: >
|
||||
failed jobs.
|
||||
---
|
||||
|
||||
Drive a red pipeline to green by root cause, not by guesswork. Treat every
|
||||
failing job as its own investigation, and do not declare a fix until that job's
|
||||
root cause is proven.
|
||||
Drive a red pipeline green by root cause. Every failing job is its own
|
||||
investigation; no fix before its root cause is proven. For GitHub Actions,
|
||||
the `kvb-ci-artifacts` skill's `ci_failures.py <run>` does the mechanics of
|
||||
steps 0 to 2 in one call; the judgement stays yours.
|
||||
|
||||
## Procedure
|
||||
|
||||
For a GitHub Actions run, the kvb-ci-artifacts skill's `ci_failures.py <run>`
|
||||
does the mechanics of steps 0 to 2 in one call: distance to HEAD, the failed
|
||||
jobs' logs, and a first clustering. The judgement in those steps stays yours.
|
||||
|
||||
0. **Check the run against HEAD before anything else.** A CI run is a snapshot
|
||||
of one commit, and the branch has moved since. Run
|
||||
`git log --oneline <run-sha>..HEAD | wc -l` as the first command of the
|
||||
triage. Zero means the run speaks for the current tree and you proceed.
|
||||
Non-zero means it does not, and you scope the job set down **before**
|
||||
enumerating, clustering, or spawning anything — every job you investigate
|
||||
against stale code is work thrown away, and a fix proposed there risks
|
||||
reverting someone else's. Two cheap discriminators do it without opening an
|
||||
artifact: `git diff --name-only <run-sha>..HEAD -- <source dir> | cut -d/ -f2 | sort -u`
|
||||
for which components already moved, and a grep of the saved job logs for the
|
||||
literal error signature of each cause already fixed in that range. What
|
||||
survives both is the job set the rest of this procedure applies to; say how
|
||||
many jobs you dropped and why.
|
||||
1. **Enumerate every failing job.** Pull the run's job list and isolate each job
|
||||
whose conclusion is failure, cancelled, or timed-out. A downstream aggregate
|
||||
job that fails only because an upstream job did is not a separate root cause —
|
||||
note it and move on.
|
||||
2. **Cluster the failures by error message.** Group the failing jobs by their
|
||||
actual failing line, not by job name. Jobs whose messages differ in anything
|
||||
but the interpolated identifiers (host, app, port, path) belong in separate
|
||||
clusters.
|
||||
3. **Coordinate every cluster.** Run the `kvb-org-organize` skill's Lineage and Peer
|
||||
protocol for each cluster before fixing it: claim it, ask the lineage
|
||||
whether someone already fixes it, and take their fix or keep yours. Keep
|
||||
investigating while you wait for answers. In the `kvb-org-rasci` register
|
||||
the cluster's objective is the root cause fixed, its key results are the
|
||||
failing jobs passing again, one per job.
|
||||
4. **Download artifacts per cluster.** Use the `kvb-ci-artifacts` skill for the
|
||||
mechanics — it covers per-job logs while a run is still in progress, which
|
||||
bundle to pull, and the grep hygiene that keeps a false positive from
|
||||
becoming a root cause. For each cluster, fetch every artifact of
|
||||
one representative job: reports, rescue diagnostics, inventories, container
|
||||
logs. Pull a second member's artifacts only when the representative's
|
||||
evidence does not explain the whole cluster. The job log usually names an
|
||||
artifact path and nothing more; the assertion text, the server-side
|
||||
exception and the state dumps are inside the artifact. Do this even when the
|
||||
log looks conclusive, because a log that explains the symptom rarely
|
||||
explains the cause.
|
||||
5. **One funnel per cluster.** Hand every cluster you claimed in step 3 to the
|
||||
`kvb-org-split` skill: one agent per cluster, working in its own worktree on its own
|
||||
branch created from the exact current HEAD, with that cluster as its only
|
||||
concern, the artifact paths of step 4 in its brief and a time cap for its
|
||||
interim report.
|
||||
Steps 6 to 8 run inside that sidetree, so no cluster's edits land under
|
||||
another cluster's work or under a running gate or deploy. Run clusters in
|
||||
parallel only when their fixes touch different files and the machine has
|
||||
room. A split cluster (step 7) gets a funnel of its own.
|
||||
6. **Dialectic per cluster.** For EACH cluster, invoke the `kvb-think-dialectic` skill:
|
||||
form a thesis about the root cause from evidence (the job log, its artifacts,
|
||||
the code at the run's commit, git history), attack it with independent
|
||||
skeptics, and iterate to a ~99% thesis.
|
||||
7. **Distinguish shared vs hidden causes.** A cluster is a hypothesis, not a
|
||||
proof: if the dialectic shows one cluster splitting into two causes, split it.
|
||||
When a job hides a second failure behind the first, keep going until the job
|
||||
is actually green, not just past the first error.
|
||||
8. **Fix at the root, through the funnel.** Apply the real fix for each proven
|
||||
root cause in the cluster's sidetree, with a test and a negative control as
|
||||
the `kvb-org-split` skill demands. The fix enters the main line only at the funnel's
|
||||
bar (at least 90 % fix confidence, under 5 % break risk) after its
|
||||
independent review; below the bar the cluster ends as a proposal for the
|
||||
operator, never as a merge. Never mask a failure: no retry-until-pass, no
|
||||
disabling the check, no soft-skip. If a failure is genuinely external
|
||||
(upstream outage, flaky infra), confirm that with evidence and surface it
|
||||
honestly instead of fixing around it. Report every fix, every proposal, and
|
||||
every abandoned attempt to the same agents through the `kvb-org-organize` Peer protocol,
|
||||
then remove the sidetree.
|
||||
9. **Tune what ran out of time.** Only for a cluster whose jobs died on their
|
||||
time budget (timed out, or cancelled by the runner's limit), or when the
|
||||
operator asks: hand the job log that ran furthest to the `kvb-code-tune` skill. Its
|
||||
candidates run through funnels of their own, separate from the cluster's fix
|
||||
sidetree, and never delay or block the fix.
|
||||
10. **Follow the run.** While the run is still in progress, re-check it
|
||||
periodically and triage each newly failed job as it appears. The run is done
|
||||
only when it has finished and every failure has a verified fix.
|
||||
0. **Run against HEAD, first**: `git log --oneline <run-sha>..HEAD | wc -l`.
|
||||
Zero: the run speaks for the current tree. Otherwise read `stale-run.md`
|
||||
next to this file before anything else.
|
||||
1. **Enumerate** every job that failed, was cancelled or timed out. An
|
||||
aggregate job failing only because an upstream one did is noted, not a
|
||||
root cause.
|
||||
2. **Cluster** by the actual failing line, not the job name; messages that
|
||||
differ beyond interpolated identifiers (host, app, port, path) are
|
||||
separate clusters.
|
||||
3. **Coordinate** each cluster via the `kvb-org-organize` Peer protocol,
|
||||
lineage included: claim it; read `council.py list`, the register, the news
|
||||
and `find_fix.py`; then ask every live peer for known fixes, one batched
|
||||
`SendMessage` per peer for all clusters nothing there answers. Investigate
|
||||
while waiting; take their fix or keep yours. Register (`kvb-org-rasci`):
|
||||
objective the root cause fixed, one key result per failing job passing.
|
||||
4. **Artifacts** per cluster (the `kvb-ci-artifacts` skill: in-progress
|
||||
logs, which bundle, grep hygiene): every artifact of one representative
|
||||
job (reports, rescue diagnostics, inventories, container logs); a second
|
||||
member's only when the first leaves part of the cluster unexplained. Pull
|
||||
them even when the log looks conclusive: it only names the artifact; the
|
||||
assertion, server-side exception and state dumps are inside.
|
||||
5. **One funnel per cluster** via the `kvb-org-split` skill: one agent per
|
||||
claimed cluster, its own worktree and branch from the exact current HEAD,
|
||||
that cluster its only concern, worked as `funnel.md` next to this file
|
||||
says (dialectic, shared vs hidden causes, root fix); read it before
|
||||
working one yourself. Spawn only as many as the stakes justify; each
|
||||
brief names that file, the failing line, artifact paths, files and the
|
||||
claim to prove or refute, a time cap for the interim report and an answer
|
||||
cap (verdict table, at most 15 lines). Parallel only when the fixes touch
|
||||
different files and the machine has room.
|
||||
6. **Timeouts**: only for a cluster whose jobs died on their time budget, or
|
||||
on operator request, hand the furthest-running job log to `kvb-code-tune`;
|
||||
its candidates get funnels of their own and never delay the fix.
|
||||
7. **Follow** a run still in progress and triage each newly failed job; done
|
||||
when the run finished and every failure has a verified fix.
|
||||
|
||||
## Rules
|
||||
|
||||
- Executed evidence beats reasoning: read the actual failing log line and the
|
||||
artifact, not the job title.
|
||||
- A derived source is not evidence. A conversation summary, your own earlier
|
||||
message, a cluster table you built ten minutes ago, or a subagent's report
|
||||
proves nothing on its own. Only the job log, the artifact, the code at the
|
||||
run's commit, and command output you just ran count. Quote them literally; if
|
||||
you cannot quote it, you do not know it.
|
||||
- Re-derive after a context compaction. A summary carried across a compaction
|
||||
boundary preserves your conclusions but not the evidence under them, and a
|
||||
cluster assignment that was wrong stays wrong while reading as settled fact.
|
||||
Before acting on any pre-compaction attribution, rebuild it from the job logs.
|
||||
- Classify each failure: a real defect (fix it), a flake or infra hiccup (prove
|
||||
it is transient before dismissing), or already-fixed-by-a-later-commit. For
|
||||
that last class the comparison is `<run-sha>..HEAD`, never the run's commit
|
||||
alone: the run cannot contain a fix that landed after it, so looking there
|
||||
can only ever confirm the failure. Name the commit that carries the fix.
|
||||
- Report a per-job verdict: root cause, the artifact path and line that prove
|
||||
it, the fix, the cluster's sidetree branch, and the funnel verdict (merged or
|
||||
proposal). A verdict that cites only the job log has not finished step 4.
|
||||
- Explore code through the codebase-memory-mcp graph first (`search_graph`,
|
||||
`trace_path`, `get_architecture`, `detect_changes`; the
|
||||
`kvb-agent-optimize` skill sets it up), grep and read after.
|
||||
- Only the job log, the artifact, the code at the run's commit and command
|
||||
output you just ran count as evidence, quoted literally; a summary, your
|
||||
earlier message, an old cluster table or a subagent's report proves
|
||||
nothing. After a context compaction, rebuild every attribution from the job
|
||||
logs before acting on it.
|
||||
- Classify each failure: real defect (fix), flake or infra (prove it
|
||||
transient first), or fixed by a later commit (compare `<run-sha>..HEAD`,
|
||||
never the run's commit alone; name the fixing commit).
|
||||
- Per job verdict: root cause, the proving artifact path and line, the fix,
|
||||
the sidetree branch, the funnel verdict (merged or proposal). A verdict
|
||||
citing only the job log has not finished step 4.
|
||||
@@ -0,0 +1,31 @@
|
||||
# Working one cluster in its sidetree
|
||||
|
||||
Run inside the cluster's own worktree, so no cluster's edits land under
|
||||
another cluster's work or under a running gate or deploy. The `kvb-ci-triage`
|
||||
skill's Rules apply here too.
|
||||
|
||||
1. **Dialectic**: invoke the `kvb-think-dialectic` skill for the cluster:
|
||||
form a thesis about the root cause from evidence (the job log, its
|
||||
artifacts, the code at the run's commit, git history), attack it with
|
||||
independent skeptics, and iterate to a ~99% thesis.
|
||||
2. **Shared vs hidden causes**: a cluster is a hypothesis, not a proof; if
|
||||
the dialectic shows it splitting into two causes, split it, and the new
|
||||
cluster gets a funnel of its own. When a job hides a second failure behind
|
||||
the first, keep going until the job is actually green, not just past the
|
||||
first error.
|
||||
3. **Fix at the root**: apply the real fix for each proven root cause in the
|
||||
sidetree, with a test and a negative control as the `kvb-org-split` skill
|
||||
demands. Light runs (no Docker, about a minute: targeted pytest or
|
||||
unittest, ruff, single lint files) self-admit with
|
||||
`${CLAUDE_SKILL_DIR}/../kvb-org-organize/scripts/watch.py admit --kind
|
||||
test-nostack`; `make test`, gates, deploys and anything with Docker keep
|
||||
the chair's request, grant and release. The fix enters the main line only
|
||||
at the funnel's bar (at least 90 % fix confidence, under 5 % break risk)
|
||||
after its independent review; below the bar the cluster ends as a
|
||||
proposal for the operator, never as a merge. Never mask a failure: no
|
||||
retry-until-pass, no disabling the check, no soft-skip. If a failure is
|
||||
genuinely external (upstream outage, flaky infra), confirm that with
|
||||
evidence and surface it honestly instead of fixing around it. Report every
|
||||
fix, proposal and abandoned attempt to the peers asked in step 3 of the
|
||||
skill with `${CLAUDE_SKILL_DIR}/../kvb-org-organize/scripts/news.py post
|
||||
"<text>"` (`--to <name>` per peer), then remove the sidetree.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Run behind HEAD
|
||||
|
||||
A CI run is a snapshot of one commit, and the branch has moved since. Scope
|
||||
the job set down **before** enumerating, clustering or spawning anything:
|
||||
every job investigated against stale code is work thrown away, and a fix
|
||||
proposed there risks reverting someone else's.
|
||||
|
||||
Two cheap discriminators, without opening an artifact:
|
||||
|
||||
- `git diff --name-only <run-sha>..HEAD -- <source dir> | cut -d/ -f2 | sort -u`
|
||||
shows which components already moved.
|
||||
- A grep of the saved job logs for the literal error signature of each cause
|
||||
already fixed in that range.
|
||||
|
||||
What survives both is the job set the procedure applies to; say how many jobs
|
||||
you dropped and why. The run cannot contain a fix that landed after it, so
|
||||
looking only at its commit can only ever confirm the failure.
|
||||
Reference in new issue
Block a user