Skip to content

The meta-skill that builds and improves all your skills, including itself. Watches your work sessions (autonomous or human-led), captures patterns, corrections and judgement calls, and turns them into skill improvements and new skill candidates for your review. Practical application of the Augmented Expertise methodology. Open source: CC BY 4.0.

Fold the review rounds since the branch cut

Eoghan Henn4410a40d7dea
diff --git a/SKILL.md b/SKILL.md
index d164ac8..0507abe 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -2,7 +2,7 @@
name: "task-observer"
core_max_lines: 715
version: "3.5.0"
-description: "Monitors task execution for skill improvement opportunities. Use during ANY multi-step task, agentic workflow, or work session. Captures patterns, user corrections and methodology worth preserving as reusable skills. Also triggers in post-task feedback discussions and when the user mentions skill observations, the observation log, or skill taxonomy. Also known as \"One Skill to Rule Them All\" — trigger on this phrase too. IMPORTANT: invoke this skill before the FIRST tool call of any session and before writing or proposing a plan — any turn that will involve a tool call counts. This sentence is the session-start trigger and the only activation layer that survives an unreachable config file; pair it with a CLAUDE.md instruction or a harness session-start hook (references/environments.md) — description matching alone is not enforceable. A subagent dispatched by a session already running it does not run it: it writes nothing and puts its findings in its report."
+description: "Monitors task execution for skill improvement opportunities. Use during ANY multi-step task, agentic workflow, or work session. Captures patterns, user corrections and methodology worth preserving as reusable skills. It writes observation files to the workspace. Also triggers in post-task feedback discussions and when the user mentions skill observations, the observation log, or skill taxonomy. Also known as \"One Skill to Rule Them All\" — trigger on this phrase too. IMPORTANT: invoke this skill before the FIRST tool call of any session and before writing or proposing a plan — any turn that will involve a tool call counts. This sentence is the session-start trigger and the only activation layer that survives an unreachable config file; pair it with a CLAUDE.md instruction or a harness session-start hook (references/environments.md) — description matching alone is not enforceable. A subagent dispatched by a session already running it does not run it: it writes nothing and puts its findings in its report."
license: CC-BY-4.0
metadata:
author: Eoghan Henn and contributors
@@ -222,11 +222,8 @@ was handled without its reference loaded, log an observation.
(see `references/environments.md`). Skip if already configured. Be clear
about what this step is: it runs only after the skill has been invoked,
so it verifies a working setup and structurally cannot detect the
- missing one — it is not the safety net for a never-activated install.
- That case is caught only from outside the runtime: the install-time
- verification and external diagnostic in `references/environments.md` (no
- observation-log directory after sessions of real work), and the review's
- regression check for a tier now gone.
+ missing one — it is not the safety net for a never-activated install;
+ the checks from outside the runtime are in `references/environments.md`.
5. **Concurrency.** There is no shared log file to guard: each observation
is its own file, so creating one never collides with another session's
entry; re-read one before changing its *status* (How to Log).
@@ -343,9 +340,9 @@ rewording") before proposing either.
## How to Log
-Write the observation file **silently, within the same turn or the next** —
-never batch mentally for later; the act of writing is the enforcement
-mechanism.
+Write the observation file **within the same turn or the next, without
+interrupting the user's task** — never batch mentally for later; the act
+of writing is the enforcement mechanism.
**Mandatory checkpoint after every 3rd completed todo item.** After marking
the 3rd, 6th, 9th (etc.) item complete you must **write to disk** — not
@@ -613,7 +610,7 @@ version: it installs a copy rather than parking one, possibly over what a
parallel review has staged. See "Acting on Observations".
**Self-check before surfacing:** observations were logged throughout the
-whole session (including discussion phases); logged silently; each follows
+whole session (including discussion phases) without interrupting the task; each follows
Issue → Improvement → Principle; each is typed; existing-skill items name
the section; no open-source Principle contains client-identifying info;
every observation file carries `status:` (`status: open` at write time) and
@@ -705,7 +702,7 @@ agent not following the skill's rules, acknowledge and correct it instead.
| Question | Answer |
|----------|--------|
| When do I observe? | The whole session, including feedback and reflection phases |
-| How do I log? | Silently, immediately, as one file per observation named `NNNN-slug.md`; id = max(active, archive, `.id-floor`) + 1, derived by running the snippet immediately before each write — an earlier read of the log for any other purpose is not a substitute; where a helper can run, `scripts/new-observation.sh <slug>` is the only write path |
+| How do I log? | Immediately, without interrupting the user's task, as one file per observation named `NNNN-slug.md`; id = max(active, archive, `.id-floor`) + 1, derived by running the snippet immediately before each write — an earlier read of the log for any other purpose is not a substitute; where a helper can run, `scripts/new-observation.sh <slug>` is the only write path |
| Status field? | Mandatory `status: open` frontmatter on every new observation; reviews treat a missing status as OPEN, never as nonexistent. Five values: `open`, `actioned`, `declined`, `superseded`, `parked` — `parked` = decided but blocked on an external precondition, so it leaves the queue, requires `parked_until:`, and never archives |
| Does the target skill have siblings? | Resolve it against `skill-observations/skill-families.md` BEFORE writing; add every sibling the insight applies to to `skill:`, and record the verdict in the mandatory `siblings_checked:` field — including "checked, no propagation" |
| A scan or query came back empty? | Two possibilities, only one is a finding: guard every retrieval meant to prevent duplicate work with an independent existence check, and treat empty output over known content as a broken command |
diff --git a/references/environments.md b/references/environments.md
index 4025311..75318fd 100644
--- a/references/environments.md
+++ b/references/environments.md
@@ -54,8 +54,8 @@ knowingly; do not assume any of the middle ones is a guarantee.
Cowork, the personal-preferences field in the app settings; other
agents' equivalents). This is the right home for a one-line
probe-then-request trigger — "the session's first tool call is one
- batched call that contains an `ls` of the workspace path, with any
- session-start skill loads in that same batch; if the `ls` fails, call
+ batched call that contains an `ls` of the workspace path AND the loads
+ of <the session-start skills, by name: task-observer, …>; if the `ls` fails, call
the folder-picker tool; never state whether the folder is connected
without that probe" (why the wording is about the call's content, not
its order: "The probe rides inside the first batched call" below) —
@@ -157,6 +157,14 @@ in one session. The session-start scan does not cover it: that is a
frontmatter sweep over every observation at session start, this is a
body-level lookup for one skill at the moment its rules are applied.
+The converse holds too: the grep, and any checkpoint line recording the
+load, run only in the same batch as the Skill invocation, and take the
+skill name from a load that has actually happened — never from a list of
+skills you built to load. A checkpoint line written without the load is a
+false record. Before writing to any file a skill reads at run time (a
+state file), load that skill: a state file that describes itself is not a
+substitute for the skill that owns it.
+
The task-observer workspace for this project is:
[ABSOLUTE PATH]
Every path the skill uses derives from that root and nothing else:
@@ -580,7 +588,7 @@ block, which is where the line
> then read the workspace config and follow it before any other work
-goes. See the activation tiers above: that channel is tier 0, and the step-1
+goes. See the activation tiers above: that channel is tier 2 (user-level preferences), and the step-1
guard is the backup for turns 2+ and for sessions where the skill happens to
be loaded directly.
@@ -626,6 +634,20 @@ actions is not). SKILL.md step 1 states it that way; the tier-2 preferences
line above is worded to match; the activation block's "before the first
tool call" is satisfied by the load riding *in* that call.
+**The pre-skill tier's line names the complete batch, not only the
+probe.** Whatever the harness reads before any skill — Cowork's
+user-preferences block, a Claude Code user-level (global) CLAUDE.md, a
+session-start hook's injected text — carries the whole first batch: the
+workspace probe AND the session-start skill loads, named, in one batched
+call; the tier-2 line above is the template. A rule that must fire on the
+first tool call cannot live only inside a skill, because on turn 1 that
+skill has not been read yet; the skill-side copy (SKILL.md step 1) is the
+backup guard for turn 2. The failure shape: a line naming only the probe
+fires the probe and leaves the loads to a project config that arrives late
+or intermittently, so the first batch carries the probe alone and the
+skills load a batch later. The review's activation regression pass checks
+for it (`weekly-review.md`, Step 1).
+
### Install-layout hazards — three ways a skill silently stops existing
Each of these leaves no error. The skill simply stops being offered, or an
@@ -875,6 +897,20 @@ session — treat that as a one-line precondition on those steps, and when
reporting a mode-conditional limit, name the mode and the switch in the
same breath.
+**A cloud session bridged to the user's machine writes observations
+through the device shell, at write time.** In a bridged session the agent
+runs in a container while the log lives on the device, reached through a
+remote shell (`device_bash`) and a file-commit tool
+(`device_commit_files`). An observation is created on the device by that
+shell running the id snippet (SKILL.md, How to Log) — or
+`scripts/new-observation.sh`, where the script is reachable on the device
+— at the moment of writing, and its body goes into the created path
+through the same shell with a quoted heredoc. It is never composed in the
+container and committed afterwards. The failure shape: a committed file
+carries an id derived from a listing taken earlier, and the prefix guard
+never ran because it lives in the command the commit bypassed; the lagging
+`.id-floor` appears first and the duplicate id at the next review.
+
| Capability | Claude Cowork | Claude Code | Web chat / no filesystem |
|---|---|---|---|
| Persistent workspace | the shared folder | pinned absolute path (see activation block) | none — handoff-doc mode below |
diff --git a/references/skill-authoring.md b/references/skill-authoring.md
index 1e0d94c..8c143e9 100644
--- a/references/skill-authoring.md
+++ b/references/skill-authoring.md
@@ -150,7 +150,14 @@ frontmatter, or a `.core-ceiling` file beside it. `validate-skill-bundle.py`
then fails when the core exceeds it, with the instruction to move content to
a reference file rather than raise the number. Seed it at whatever the core
measures today: the point is not that every skill reaches some ideal size,
-it is that no skill silently grows past where it already is.
+it is that no skill silently grows past where it already is. **The ceiling
+follows trims down.** The validator also fails when the declared ceiling
+sits more than 3 lines above the core's count; the fix is to lower
+`core_max_lines` (or `.core-ceiling`) to the current count in the same
+commit as the trim. Every run reports `core N / ceiling M / slack S`. The
+failure shape: a check that only blocks growth leaves each trim as open
+headroom, and the next ordinary additions spend it without anyone
+deciding to.
A skill that declares neither has not opted in. The count and the distance to
the 500-line target are still reported; nothing is gated. That is deliberate,
@@ -596,6 +603,20 @@ in layers so any one catches what others miss:
layer 3 reads examples first, not last, and the pre-publication read
includes a human pass over every example, usage string and fixture in
the tree — the one check no script can do for the author.
+9. **Justifications are failure shapes, and examples span verticals
+ (skills published or queued for publication)** — a rule's
+ justification is stated as a present-tense failure shape ("the failure
+ shape: …"), never as the case it came from: no "observed once", no "in
+ the case that produced this", no client complaint, no count from one
+ project. Examples come from at least two unrelated verticals or from a
+ neutral stock vertical, never from the vertical of the session that
+ produced the rule. The failure shape this layer closes: a skill update
+ written from an internal log carries the log's engagement narrative
+ and its client's vertical into published text, and each example passes
+ every term scan on its own while the set identifies the client. No
+ script sees either class, so it is a named human read in the
+ pre-delivery gate (`weekly-review.md`, Delivery) over every section
+ added since the last published tree.
## Timelessness — shared skills must not capture current state
@@ -755,8 +776,10 @@ re-check exists, do not record the value — record how to obtain it.
silently (the install succeeds, the skill loads, and the missing
pieces only surface when a reference load or script call fails
mid-task), and a convention that switches on file count leaves that
- boundary to be re-derived every time. **Pre-delivery gate — three items, checked at the moment of
- delivery, not just at drafting time:** (1) every UNQUALIFIED
+ boundary to be re-derived every time. **Pre-delivery gate — checked at the moment of
+ delivery, not just at drafting time.** The item list is the gate in
+ `weekly-review.md`, "Delivering updated skills"; what follows is the
+ authoring detail for the items numbered the same there: (1) every UNQUALIFIED
`references/`, `scripts/`, `assets/` path in the staged SKILL.md body
has its file in the staged set — a path qualified with an owning skill
name (`<skill-name>/references/<file>`) is a cross-reference, exempt by
@@ -787,9 +810,10 @@ re-check exists, do not record the value — record how to obtain it.
RAW central-directory bytes, because CPython's `zipfile` normalises
`0x5C` to `/` on read and reports a malformed archive as clean; Windows
`Compress-Archive` produces exactly this defect for any skill with a
- subdirectory. `scripts/validate-skill-bundle.py` implements all seven as
+ subdirectory. `scripts/validate-skill-bundle.py` implements that gate's mechanical items as
assertions and packs a well-formed bundle on any platform; run it where
- Python is available. Generally: any hard limit the consuming platform
+ Python is available. The gate's one human read, for a published skill,
+ is confidentiality layer 9 above — named, not asserted. Generally: any hard limit the consuming platform
imposes belongs in this gate as a measurement compared to a bound in
the same step, not as a rule the author is expected to remember — an
unasserted metric does not merely miss defects, it manufactures
@@ -1084,7 +1108,7 @@ now carry their own agent skill in-repo — commonly under `agent-skill/`,
beside it duplicates work, drifts from the maintainers' version and misses
their updates. One search of the upstream repository (those paths, plus
"skill" in the README and release notes) settles it — one of the two
-network uses the skill allows, and only once the user has asked for the
+network uses this skill permits, and only once the user has asked for the
skill. If an official skill
exists, install it and put only the local delta into a companion, exactly
as for any other upstream-maintained skill (weekly-review.md, Step 2);
diff --git a/references/starter-principles.md b/references/starter-principles.md
index 2c55e5b..7ccad63 100644
--- a/references/starter-principles.md
+++ b/references/starter-principles.md
@@ -90,6 +90,8 @@ prevent.
- 25. One verified reason beats two, where the second is unchecked
- 26. A companion skill must declare its coverage boundary
- 27. Every skill ships as a bundle and is structured for progressive disclosure, regardless of size
+- 28. Absence is never established by a summarising instrument
+- 29. A skill holds method; dated values live in a workspace file the skill names
---
@@ -405,3 +407,38 @@ new or substantially revised work. Rationale: a rule that switches on
artefact size creates two formats for one thing and a boundary every
consumer must re-derive, and one format removes the bare-SKILL.md
truncation class of install failures outright.
+
+### 28. Absence is never established by a summarising instrument
+**Applies to:** all skills that make claims about the contents of an
+artefact — a sheet, a page, a listing file, a repository, a report, a
+tool surface
+**Requirement:** No statement of the form "X is not in Y" may rest on an
+instrument that summarises, samples, renders or answers a question about
+Y — a document connector's table view, a fetch tool's answer, a search
+result, a rendered summary. Presence can be established by such an
+instrument (it found the thing); absence cannot, because "the thing is
+absent" and "the instrument did not look" produce identical output and
+read as equally confident prose. Absence needs the raw artefact — the full
+sheet, the raw HTML or listing file, the complete export — and a literal
+match run over it; the claim names the instrument that produced it or
+does not ship, and a claim whose instrument is a summariser is removed,
+never softened. Where an instrument returns both a declared size and a
+rendering (a table range and its rows, a count and a page), compare the
+two before reading anything out of it; a mismatch means a sample, not the
+population. Prefer the interface that returns the artefact to the one
+that returns a summary of it, because only the latter can silently
+shorten.
+
+### 29. A skill holds method; dated values live in a workspace file the skill names
+**Applies to:** all skills, open-source and internal
+**Requirement:** A skill holds method, rules and workflow — what is as
+true next year as today. Anything with a date or a current value —
+goals, figures, rates, schedules, client and source mappings, logs —
+lives in a workspace file the skill names (in its reference index,
+entry 13). The skill is the single owner of the method; the file is
+the single owner of the values. When two skills need the same value,
+both point at the file and neither copies it. Rationale: a dated value
+inside a skill goes stale silently — the skill is loaded as if it were
+current, changing a number takes a skill review, and copies held by two
+skills diverge. A value in a workspace file is updated without a review
+and lives in one place.
diff --git a/references/weekly-review.md b/references/weekly-review.md
index f30550a..2bf280d 100644
--- a/references/weekly-review.md
+++ b/references/weekly-review.md
@@ -2,11 +2,13 @@
Cross-checks all OPEN observations against all skills, propagates
cross-cutting principles, and applies improvements that don't need user
-input. Two modes:
+input to staged copies — never to live skills. Two modes:
- **Scheduled autonomous review (preferred):** a recurring task (e.g.
Mon/Wed/Fri mornings) via the platform's scheduler. Runs without the user
- present and applies non-escalated observations autonomously.
+ present and applies non-escalated observations to staged copies only;
+ nothing goes live until the user installs the bundle (Approval policy,
+ Delivering updated skills).
- **In-session 7-day fallback:** pending at session start when BOTH are
true: no scheduled review is registered (or none has written
`last-review-date.txt` in 7+ days — a scheduler's "succeeded" says the
@@ -347,7 +349,30 @@ re-suggest the block; record the tiers found in
`skill-observations/activation-tiers.txt` so the next review has a
baseline to compare against — in an aggregate run over several logs,
one such file per participating workspace, describing that workspace's
-own config, never a single copy at the anchor workspace. Then archive observation files resolved in
+own config, never a single copy at the anchor workspace.
+
+Two more reads belong to the same pass. **Does the pre-skill tier's line
+name the batch content, or only the probe?** Where a tier read before any
+skill is in place — a preferences block, a user-level instruction file, a
+session-start hook's injected text — its line must name the complete
+first batch: the workspace probe AND the session-start skill loads, in one
+batched call (`references/environments.md`, "The probe rides inside the
+first batched call"). Flag a line that names only the probe; it fires the
+probe and leaves the loads to a config that may arrive late. **Does a
+scheduled prompt restate the procedure?** Read the registered review
+prompt where the platform exposes it (the scheduler's list or read call),
+else `skill-observations/scheduled-task-draft.md`, and flag every line
+that restates a review step, a staging path, a status format or an
+escalation criterion. The prompt names the skill, the mode, the workspace
+and the offline policy, plus the probe-then-invoke line and the started
+marker `references/environments.md` requires of every scheduled prompt —
+nothing else. The failure shape: a stored prompt is read by every run and
+edited by nobody, so a restated step drifts behind this file and the run
+follows the copy. Record the verdict in `activation-tiers.txt` beside the
+scheduled-task tier (`prompt restates: none`, or the flagged lines), and
+run the same read over every other scheduled prompt that invokes a skill.
+
+Then archive observation files resolved in
*previous* sessions — with the sweep as shipped (the sweep block of the id
snippet, run on its own; see Archival on Write in SKILL.md), never an
improvised bulk move; where one is unavoidable, read the set once and
@@ -408,8 +433,16 @@ merged count against a file count.
d="[ABSOLUTE PATH]/skill-observations/observation-log"
find "$d" "$d/archive" -maxdepth 1 -name '*.md' | sed 's|.*/||' \
| grep -oE '^[0-9]+' | sed 's/^0*\([0-9]\)/\1/' | sort -n | uniq -d
+top=$(find "$d" "$d/archive" -maxdepth 1 -name '[0-9]*.md' | sed 's|.*/||' | grep -oE '^[0-9]+' | sort -n | tail -1); floor=$(sed '1!d; s/[^0-9]//g' "$d/archive/.id-floor" 2>/dev/null); [ "$((10#${floor:-0}))" -ge "$((10#${top:-0}))" ] || echo "FLOOR LAGS — .id-floor ${floor:-absent} < highest prefix $top: a writer bypassed the snippet"
```
+The last line asserts `.id-floor >= highest prefix` across active and
+archive. Every run of the snippet or `scripts/new-observation.sh` leaves
+the floor at the id it issued, so a lagging floor means some writer
+created files without running either — the earlier and cheaper signal of
+the bypass, visible before any collision (`observation-log.md`, "Floor
+staleness").
+
`grep -oE '^[0-9]+'`, not `sed 's/-.*//'`: the archive may hold legacy
`log-YYYY-MM-DD.md` files from a pre-3.0 migration, and stripping at the
first hyphen turns every one of them into `log`, which then reports as a
@@ -424,6 +457,11 @@ entry (by `date`, then by the lower `.id-floor` era), renumber the later
one to a fresh id from the snippet, update its filename and its `id:`
field together, and note the renumber in its body so a citation of the old
number can still be traced. Then re-run the check until it prints nothing.
+For each collision, and for the files above a lagging floor, record the
+writing sessions — each file's `session_context` and `date` — in the Step 8
+summary: the pair traces the bypass to an environment or write path, which
+is where the fix goes, while a bare count blames a rule every writer that
+ran the snippet obeyed.
**Per-entry header conformance — a count, not a gate.** The scan's
suspect count catches YAML that will not parse; it cannot see a header
@@ -541,6 +579,30 @@ legitimately moves on, so a bare "differs" is not a verdict:
result and none is duplicated; the merged copy then takes (c)'s
bookkeeping (surface it, list its observations, count its reviews).
+**Compare with the installer's frontmatter quoting normalised.** The
+installer writes the frontmatter `name:` line back quoted on some installs
+and unquoted on others, and on some skills re-quotes `description:` too, so
+a raw `diff -rq` reports a freshly installed copy as differing. Normalise
+both sides before classifying — frontmatter only, `name:` and
+`description:` only: surrounding double quotes stripped with `\"` and `\\`
+resolved, surrounding single quotes stripped with `''` resolved; every
+other file is compared literally:
+
+```bash
+fm=$'1,/^---$/{/^(name|description):[[:space:]]*".*"[[:space:]]*$/{s/:[[:space:]]*"/: /;s/"[[:space:]]*$//;s/\\\\"/"/g;s/\\\\\\\\/\\\\/g;};/^(name|description):[[:space:]]*\'.*\'[[:space:]]*$/{s/:[[:space:]]*\'/: /;s/\'[[:space:]]*$//;s/\'\'/\'/g;};}'
+diff <(sed -E "$fm" "$live/SKILL.md") <(sed -E "$fm" "$staged/SKILL.md") && diff -rq -x SKILL.md "$live" "$staged" # bash; both silent = (a)
+```
+
+This skill owns that command: any other skill that compares installed
+against staged copies quotes it verbatim and names this section as its
+owner, so the shape cannot drift twice. A multi-line description the
+installer re-wrapped is not normalised and surfaces. A diff consisting
+only of quoting on those two lines is state (a), never a reason to
+re-stage. Any other change on those lines still surfaces; waving the known
+diff through by eye is the habit that would hide it. The validator's pack
+step emits the quoted `name:`, so most installs come back byte-identical and
+the normalisation is the backstop.
+
**(b) against (c) is decided per differing hunk, never per file.**
`diff -rq` settles only (a). For every line present only in the staged
copy, ask whether live *supersedes* it — carries a line that contains
@@ -743,8 +805,8 @@ Link the full list and say how many decisions remain. Group duplicates
and exclude already-fixed items before choosing the three. Await
approval: the user may approve the three, the whole list in the record
in one step, or a selection from it; a short list does not authorize the
-rest of the backlog. Autonomous: apply the approval policy above and
-continue, and save the same record.
+rest of the backlog. Autonomous: apply the approval policy above to
+staged copies and continue, and save the same record.
**Cluster by decision BEFORE the escalation list is written.** An
append-only log accumulates convergent entries by construction: the same
@@ -851,7 +913,7 @@ A command the entry quotes is a claim of this kind; its `commands_verified:`
clause (`observation-log.md`) says whether anyone has run it.
Where an approved item's destination is an upstream report — an issue or
-PR against a skill someone else maintains — drafting that report IS the
+PR against a skill maintained by someone else — drafting that report IS the
apply step for it, so the feedback pre-flight in
`references/skill-authoring.md` runs here, before the draft is written:
duplicate search across the upstream's issues and pull requests, the
@@ -935,7 +997,12 @@ the summary carries.
counts, not the open ones; months or years in use = from the date of
the earliest observation in the log (the oldest file in
`observation-log/archive/`), not from the install date or the repo's
- first commit — and update them in the same staging. Carry the new
+ first commit; installs = the figure a skills directory's listing
+ reports, refreshed in every release together with the other README
+ figures, and stated as a lower bound where the directory's install
+ telemetry is opt-out — and update them in the same staging. An install
+ line names the installer tool, not the site that counts its installs.
+ Carry the new
values into the review summary so the maintainer sees what changed.
Anything of the same class the maintainer alone would notice (a
"recommended by" list, a supported-platform list) is checked in the
@@ -959,7 +1026,14 @@ restructures. Where the skill carries a `version:` in its frontmatter,
the bump goes into the staged frontmatter; where the version lives only
in the repo's manifest (a `plugin.json` or equivalent), the review
records the intended bump in the staging manifest entry (`PENDING.md`)
-so the publishing sync applies it. Either way the manifest entry states
+so the publishing sync applies it. Where a published skill carries no
+`version:` and no repo manifest holds one, the review adds the field and
+the bump in the same staging — `1.0.0`, or the next minor above what the
+README or the release history implies — never deferring either to the
+publishing run, which cannot bump a version nobody has set: the failure
+shape is a hold that tests "version unchanged", finds it absent both
+times, and stalls the sync while each side expects the other to pick the
+number. Either way the manifest entry states
the bump. Whoever changes the content owns the bump; the publisher only
checks that it happened — the sync may not edit skill content, and a
review that grows a published skill by a hundred lines at an unchanged
@@ -1199,10 +1273,17 @@ open-source skills, the rule **never introduce `: ` into an unquoted
frontmatter value** (a subagent extending a `description:` is the
common way a staged skill's frontmatter stops parsing — see
`references/skill-authoring.md`, pre-delivery gate item 4), the rule
-that any Python check run inside the staged tree runs with
-`PYTHONDONTWRITEBYTECODE=1` (a `py_compile` there leaves a `__pycache__/`
-the pre-delivery gate rejects, on a mount that cannot unlink it without
-the delete grant), whether the pass is a content pass or a reformat —
+that no Python check leaves bytecode in the staged tree (a `__pycache__/`
+there is one the pre-delivery gate rejects, on a mount that cannot unlink it
+without the delete grant): a compile check runs as
+`PYTHONPYCACHEPREFIX=<scratch dir outside the staged tree> python3 -m py_compile <file>`
+(or `compile()` via `python3 -c`), because `py_compile` writes its `.pyc`
+whatever `PYTHONDONTWRITEBYTECODE` says — that variable governs only the
+import machinery — so `PYTHONDONTWRITEBYTECODE=1` is for scripts that are
+executed, and the Delivery sweep stays the backstop; an explicit delete
+scope — the subagent may remove only files it created, by path, under its
+own directories, and never runs a recursive delete on a directory it did
+not create; whether the pass is a content pass or a reformat —
never both in one edit, and a snapshot of the staged directory taken
before it (Delivery) — and an explicit rule that subagents do not change
any observation's status and do not write observations: a finding worth
@@ -1211,7 +1292,20 @@ because two writers watching one task from two vantages log one finding
twice, and merging two entries about one fact is not the renumbering the
duplicate-id check performs (Cross-slice duplicates, below). Reserve
status marking, archival and observation writes for the parent
-session. The
+session. Before the first subagent returns, the parent snapshots the
+output tree (a listing with sizes), so a sibling's work deleted by
+another writer is detectable rather than silently absent from the merge;
+where the harness offers per-agent sandboxes or worktrees, parallel
+writers use them. **A phase that will write is briefed as a write phase from the
+start**, with the user's authorisation for the writes quoted verbatim in
+the brief — one brief covering triage and apply, or a fresh subagent for
+the apply phase — never a read-only brief later widened by a message from
+the parent. The failure shape: a permission classifier reads an
+agent-to-agent widening of a brief that forbade writes as laundering and
+refuses the write, and the same edit retried by another agent is refused
+as a bypass. Where the user's instruction is outcome-level ("include
+everything that needs no testing"), get their explicit go for the writes
+before fanning out, and quote it in every brief. The
parent runs `scripts/validate-skill-bundle.py` on EVERY staged skill
BEFORE any status bookkeeping — a subagent's "done" is a claim about its
own edits, and the validator is the one check that sees the file the
@@ -1368,7 +1462,15 @@ template below. In chat, report what changed and its verification, followed
by at most three remaining next steps in the Step 3 format. Link the record
for the full accounting. Distinguish proposed, staged and installed changes;
an observation count alone is not an outcome. Records are kept: no step
-prunes `reviews/`, and old ones are the user's to delete. The template:
+prunes `reviews/`, and old ones are the user's to delete.
+
+Step 8 ends with the line **"N bundles staged, N bundles presented"**, and
+the run does not finish while the two numbers differ. Both are measured:
+staged from the bundles this run packed, presented from the delivered-file
+list the presentation call returns (where the environment has no such
+call, from the staged paths listed in chat) — never from memory of having
+presented them. A difference is closed by presenting the missing bundles
+in one call and counting again. The template:
```markdown
## Weekly Skill Review Complete — [date]
@@ -1403,15 +1505,22 @@ whose condition has been met and was returned to the queue this review]
[from the Step 6 re-scan: #id — title — folded into [skill] / left OPEN
for the next review; or "none" — the line is never omitted]
+### Log integrity
+[duplicate ids renumbered and any floor lag (Step 1), each with the
+writing sessions' session_context and date; or "none"]
+
### Skipped (needs manual review)
[items with reasons]
+
+[N] bundles staged, [N] bundles presented
```
**Interactive mode only:** wait for the user to acknowledge before other
work. **In scheduled autonomous mode, do not wait** — there is no user to
acknowledge, and this is the step a scheduled run must always reach, since
it is where the run stages its output and records its summary. Finish after
-staging the updated skills and recording the summary. A step that blocks on
+staging the updated skills, recording the summary and reconciling the
+staged/presented count. A step that blocks on
an event that cannot occur turns the run's one deliverable into a hang.
## Constraints
@@ -1493,7 +1602,10 @@ cited as `<skill-name>/references/<file>` and passes untouched; that
qualification is the convention, and re-wording a genuine cross-reference
until the backtick no longer starts with the prefix is disguising a
reference to satisfy a linter, not fixing a defect; (2) the artefact presented is the
-bundle — bare file links fail this gate; (3) measure each staged skill's frontmatter
+bundle — bare file links fail this gate — and every staged bundle is
+presented (Step 8's staged/presented count); the number of cards is never
+a reason to present fewer, since one call carries them all and each card
+is an install decision the user makes either way; (3) measure each staged skill's frontmatter
description (the folded value, not the raw YAML block) and fail the
delivery above 1024 characters, with a soft warning above ~900 —
measure every skill in the set, not just the one that failed; (4) `name`
@@ -1503,7 +1615,8 @@ bundle's member paths use `/`, checked on raw bytes (Windows packers write
— a second `---` block or stray `name:`/`description:` lines directly
after the first is a duplicated header that every field check passes by
construction; (7) no edit residue in any text file of the bundle,
-outside code: a literal regex backreference (`\1`) on its own line or in
+outside code (fenced blocks at any indentation, including one nested
+under a list item, and inline spans): a literal regex backreference (`\1`) on its own line or in
prose, merge-conflict markers, unresolved `{{slot}}` placeholders — the
gate checks the form of a delivery, and this is the one content assertion,
because a failed replacement once passed apply, gate and install as a
@@ -1513,7 +1626,12 @@ first line is the marker `<!-- template: slots intentional -->`: in a
reference file that IS a template for a delegate author, the slots are
the deliverable, not residue. Every other residue rule and every other
gate item still runs on such a file, so the exemption never becomes the
-hand-zip that skips the checks nobody was questioning.
+hand-zip that skips the checks nobody was questioning. One further item is
+a named human read, not an assertion: for a skill that is published or
+queued for publication, confidentiality layer 9 in
+`references/skill-authoring.md` over every section added since the last
+published tree — justifications stated as failure shapes, examples across
+verticals.
`scripts/validate-skill-bundle.py`
asserts all seven and packs a well-formed bundle — run it where Python is
available. It also enforces each skill's OWN declared core ceiling
@@ -1521,7 +1639,8 @@ available. It also enforces each skill's OWN declared core ceiling
`references/skill-authoring.md`, Lean Content), and **the pack step is
never bypassed for a ceiling failure**: a skill that fails its own declared
ceiling is trimmed back under it, moving content to a reference file, and
-re-validated; a skill with no declared ceiling cannot fail it and is only
+re-validated — or, where the ceiling sits more than the tolerance above a
+trimmed core, the ceiling is lowered to the count; a skill with no declared ceiling cannot fail it and is only
reported. Hand-packing a bundle to skirt the validator is the exact failure
the gate exists to prevent (observed: three skills packed by hand with a
mirror of `pack()` when a ceiling that was then a constant in the script
@@ -1544,7 +1663,8 @@ originally counted rounds regardless, so a user who received three staged
updates for one skill and installed none of them — a plausible run when
staging keeps happening and installation waits — lost the oldest, and the
reviewable work in it, to a rule that reads as tidying. Classify each
-copy with the reconciliation gate's `diff -rq` first: prune only copies
+copy with the reconciliation gate's comparison first ("Compare with the
+installer's frontmatter quoting normalised" — a copy differing only in that quoting is (a)): prune only copies
that came back **(a) identical** or **(b) superseded**; a copy in state
(c) or (d) is uninstalled work and is kept whatever its age, and named
in the summary so it does not accumulate invisibly. For the prunable
diff --git a/scripts/validate-skill-bundle.py b/scripts/validate-skill-bundle.py
index 571858a..84769d2 100644
--- a/scripts/validate-skill-bundle.py
+++ b/scripts/validate-skill-bundle.py
@@ -11,9 +11,12 @@ Usage
-----
python3 validate-skill-bundle.py <staged-skill-dir> [--bundle file.skill] [--pack out.skill]
python3 validate-skill-bundle.py --repo-only <repo-dir>
+ python3 validate-skill-bundle.py --selftest # residue-check fixtures; exit 1 on any mismatch
--pack writes a well-formed bundle (POSIX separators on any platform)
- after the directory checks pass, then validates it.
+ after the directory checks pass, then validates it. An
+ unquoted frontmatter `name:` is rewritten to the quoted form
+ in the staged SKILL.md first, so the packed copy carries it.
--repo additionally check the repo's manifests against the skill.
--repo-only check ONLY the repo's manifests, skipping the skill checks.
Also runs the markdown shape check over the repo-root .md
@@ -69,8 +72,15 @@ SEMVER_RE = re.compile(r"^\d+\.\d+\.\d+$")
# neither has not opted in: the count is reported and nothing is gated. This
# script ships inside task-observer but is run against every skill in a
# library, and a constant that describes one skill must never bound another.
+#
+# The ceiling also FOLLOWS the core down. A check that only blocks growth
+# leaves every trim as open headroom, and the next ordinary additions spend it
+# without anyone deciding to. So a declared ceiling more than
+# CEILING_SLACK_TOLERANCE lines above the core fails too; the fix is to lower
+# the declared number to the current count in the same commit as the trim.
CORE_CEILING_FILE = ".core-ceiling"
CORE_CEILING_KEY = "core_max_lines"
+CEILING_SLACK_TOLERANCE = 3
TARGET_CORE_LINES = 500
PATH_RE = re.compile(r"`((?:references|scripts|assets)/[^`\s*?]+\.[A-Za-z0-9]+)`")
BUILD_JUNK = {"__pycache__", ".DS_Store"}
@@ -205,24 +215,25 @@ def check_core_size(skill_md, fails):
"""
lines = len(skill_md.read_text(encoding="utf-8").splitlines())
over_target = lines - TARGET_CORE_LINES
+ target_note = (f" ({over_target} over the {TARGET_CORE_LINES}-line target)"
+ if over_target > 0 else "")
ceiling = read_core_ceiling(skill_md)
if ceiling is None:
- note = f"core SKILL.md {lines} lines (no ceiling declared — not gated"
- if over_target > 0:
- note += f"; {over_target} over the {TARGET_CORE_LINES}-line target"
- print(note + ")")
+ print(f"core {lines} / ceiling none / slack n/a — not gated{target_note}")
return
+ slack = ceiling - lines
+ print(f"core {lines} / ceiling {ceiling} / slack {slack}{target_note}")
if lines > ceiling:
fails.append(
f"core SKILL.md {lines} lines > this skill's declared ceiling "
f"{ceiling}. Move content to a reference file — do not raise the "
f"ceiling.")
- else:
- headroom = ceiling - lines
- note = f"core SKILL.md {lines} lines (ceiling {ceiling}, {headroom} to spare"
- if over_target > 0:
- note += f"; {over_target} over the {TARGET_CORE_LINES}-line target"
- print(note + ")")
+ elif slack > CEILING_SLACK_TOLERANCE:
+ fails.append(
+ f"core SKILL.md {lines} lines, declared ceiling {ceiling}: slack "
+ f"{slack} > tolerance {CEILING_SLACK_TOLERANCE}. Lower "
+ f"{CORE_CEILING_KEY} (or {CORE_CEILING_FILE}) to {lines} in this "
+ f"commit — a trim is locked in, not left as headroom.")
def check_reference_indexes(skill_dir, fails):
@@ -247,8 +258,7 @@ def check_reference_indexes(skill_dir, fails):
template (a summary skeleton, a principles entry, a registry stanza)
is not mistaken for a section of the file. Every early failure this
check reported was of exactly that kind."""
- return re.sub(r"(?ms)^```.*?^```[ \t]*$",
- lambda m: re.sub(r"[^\n]", " ", m.group(0)), text)
+ return blank_fenced_code(text)
refs = skill_dir / "references"
if not refs.is_dir():
@@ -441,19 +451,92 @@ def check_dir(skill_dir, fails):
# content residue in every text file of the bundle, not only SKILL.md
if p.is_file() and p.suffix.lower() in (".md", ".txt", ".yml", ".yaml", ".json"):
body = p.read_text(encoding="utf-8", errors="replace")
- # code is where backreferences legitimately live: blank out
- # fenced blocks and inline spans, keeping line numbers intact
- prose = re.sub(r"(?ms)^```.*?^```[ \t]*$", lambda m: re.sub(r"[^\n]", " ", m.group(0)), body)
- prose = re.sub(r"`[^`\n]*`", lambda m: " " * len(m.group(0)), prose)
rel = p.relative_to(skill_dir)
- exempt_slots = slots_are_intentional(rel, body)
- for rx, why in RESIDUE_RES:
- if why == SLOT_WHY and exempt_slots:
- continue
- m = rx.search(prose)
- if m:
- line = body.count("\n", 0, m.start()) + 1
- fails.append(f"edit residue in {p.relative_to(skill_dir)}:{line}: {why} ({m.group(0).strip()!r})")
+ for line, why, hit in residue_hits(rel, body):
+ fails.append(f"edit residue in {rel}:{line}: {why} ({hit!r})")
+
+
+FENCE_OPEN_RE = re.compile(r"^[ \t]*(`{3,}|~{3,})")
+
+
+def blank_fenced_code(text, fill=lambda h: re.sub(r"[^\n]", " ", h)):
+ """Blank every fenced code block, at ANY indentation, keeping line count.
+
+ A fence is ``` or ~~~ (three or more) after any leading whitespace, and it
+ is closed only by a line of the same character, at least as long, with
+ nothing after it. Detecting fences at column zero only read a block
+ indented under a list item — the usual shape for a command inside a
+ numbered step — as prose, so a correct `sed` with a backreference failed
+ the residue check and was rewritten worse to pass it. A fence that never
+ closes is left as prose: the gate errs toward reporting. Every check that
+ must not read code as prose calls this one function (`fill` sets what a
+ blanked line becomes), so the fence model cannot drift between checks.
+ """
+ out, held, fence = [], [], None
+ for line in text.splitlines(keepends=True):
+ if fence is None:
+ m = FENCE_OPEN_RE.match(line)
+ if m:
+ fence, held = m.group(1), [line]
+ else:
+ out.append(line)
+ continue
+ held.append(line)
+ if re.match(r"^[ \t]*%s{%d,}[ \t]*$" % (re.escape(fence[0]), len(fence)), line):
+ out.extend(fill(h) for h in held)
+ fence, held = None, []
+ out.extend(held) # unclosed fence: prose
+ return "".join(out)
+
+
+def residue_hits(rel, body):
+ """Gate item 7 on one file: [(line, why, matched text)], first hit per rule.
+
+ Code is where backreferences legitimately live: fenced blocks (at any
+ indentation) and inline spans are blanked first, keeping line numbers.
+ """
+ prose = blank_fenced_code(body)
+ prose = re.sub(r"`[^`\n]*`", lambda m: " " * len(m.group(0)), prose)
+ exempt_slots = slots_are_intentional(rel, body)
+ hits = []
+ for rx, why in RESIDUE_RES:
+ if why == SLOT_WHY and exempt_slots:
+ continue
+ m = rx.search(prose)
+ if m:
+ hits.append((body.count("\n", 0, m.start()) + 1, why, m.group(0).strip()))
+ return hits
+
+
+# (name, text, must_fail): each fixture pins one boundary of the residue
+# check. Run with --selftest; exit 1 if any case disagrees.
+RESIDUE_FIXTURES = [
+ ("indented ``` block holding \\1 passes",
+ "1. Normalise:\n\n ```bash\n sed -E 's/x(y)/\\1/' f\n ```\n", False),
+ ("indented ~~~ block holding \\1 passes",
+ "- step\n ~~~\n sed -E 's/(a)/\\1/'\n ~~~\n", False),
+ ("column-0 ``` block holding \\1 passes",
+ "```\ns/(a)/\\1/\n```\n", False),
+ ("indented prose line holding \\1 fails",
+ "1. Step\n\n Replace it with \\1 here.\n", True),
+ ("prose after a closed indented fence fails",
+ " ```\n ok\n ```\n then \\1 leaked\n", True),
+ ("a shorter or other-char line does not close the fence",
+ "````\n```\n~~~\ns/(a)/\\1/\n````\n", False),
+ ("unclosed fence stays prose and fails",
+ " ```\n s/(a)/\\1/\n", True),
+]
+
+
+def selftest():
+ bad = 0
+ for name, text, must_fail in RESIDUE_FIXTURES:
+ failed = bool(residue_hits(pathlib.Path("fixture.md"), text))
+ ok = failed == must_fail
+ bad += not ok
+ print(f"{'ok ' if ok else 'FAIL'} {name}")
+ print(f"selftest: {len(RESIDUE_FIXTURES) - bad}/{len(RESIDUE_FIXTURES)} passed")
+ return 1 if bad else 0
def check_repo_versions(repo_dir, fails):
@@ -560,8 +643,7 @@ def check_markdown_shape(repo_dir, fails):
repo_dir = pathlib.Path(repo_dir)
for p in sorted(repo_dir.glob("*.md")):
body = p.read_text(encoding="utf-8", errors="replace")
- prose = re.sub(r"(?ms)^```.*?^```[ \t]*$",
- lambda m: re.sub(r"[^\n]+", "~", m.group(0)), body)
+ prose = blank_fenced_code(body, fill=lambda h: re.sub(r"[^\n]+", "~", h))
lines = prose.splitlines()
items = [kind(LIST_ITEM_RE.match(l)) for l in lines]
for i, line in enumerate(lines):
@@ -578,6 +660,35 @@ def check_markdown_shape(repo_dir, fails):
f"(same-kind items at the same indent on both sides)")
+def quote_frontmatter_name(skill_md):
+ """Rewrite an unquoted frontmatter `name: x` to `name: "x"`, in place.
+
+ Provenance: the skill installer writes `name:` back quoted on some installs
+ and unquoted on others, with no visible pattern, but has never been seen
+ REMOVING quotes that were present. Emitting the quoted form here therefore
+ makes most installed copies byte-identical to the staged one, and every
+ installed-vs-staged comparison (the reconciliation gate, keep-two) stops
+ reporting a one-line diff that reviewers learn to wave through. Those
+ comparisons still normalise the line as the backstop. Runs only on the
+ pack path, after every check passed, so the value is known kebab-case.
+ """
+ text = skill_md.read_text(encoding="utf-8")
+ m = re.match(r"^---\n(.*?)\n---\n", text, re.S)
+ if not m:
+ return False
+ nm = re.search(r"(?m)^name:[ \t]*([^\s\"'][^\n]*?)[ \t]*$", m.group(1))
+ if not nm or not NAME_RE.match(nm.group(1)):
+ return False # already quoted, absent, or carrying a comment: leave it
+ start = m.start(1) + nm.start()
+ end = m.start(1) + nm.end()
+ old = text[start:end]
+ new = f'name: "{nm.group(1)}"'
+ skill_md.write_text(text[:start] + new + text[end:], encoding="utf-8")
+ print(f"pack: quoted the frontmatter name in {skill_md} ({old!r} -> {new!r}); "
+ f"the packed copy carries the quoted form")
+ return True
+
+
def pack(src, out):
"""Always writes POSIX separators, on any platform."""
src = pathlib.Path(src)
@@ -617,6 +728,8 @@ def check_bundle(path, fails):
def main(argv):
if len(argv) < 2:
print(__doc__); return 2
+ if argv[1] == "--selftest":
+ return selftest()
if "--repo-only" in argv:
fails = []
repo = argv[argv.index("--repo-only") + 1]
@@ -641,6 +754,7 @@ def main(argv):
if repo:
check_repo_versions(repo, fails)
if pack_to and not fails:
+ quote_frontmatter_name(pathlib.Path(skill_dir).resolve() / "SKILL.md")
pack(skill_dir, pack_to); bundle = pack_to
print(f"packed {pack_to}")
if bundle: