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.

Maintenance: batched probe, write-path helper, review and publication rules

Eoghan Henn241ae531d3d0
diff --git a/SKILL.md b/SKILL.md
index ead443b..3ed28e5 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -58,13 +58,12 @@ no snippet may feed it through word splitting (`for f in $(find …)`): a
sweep that splits its own path at the space examines zero files, prints
errors nobody reads, and lets the command it rides inside succeed.
**Every snippet here is bash, not POSIX `sh`** — the archival sweep's
-`read -r -d ''` is a bash extension that `dash` and `ash` do not have, so
-under `sh` it fails as a usage error or, worse, as a loop that reads
-nothing and exits zero, which is the same silent success as the word
-split. A `bash` code fence states that to a human reader and to nothing
-else, so invoke the snippets with bash explicitly; where a loop happens to
-be POSIX-safe as well (the session-start scan), that is incidental and not
-a promise about the rest.
+`read -r -d ''` is a bash extension `dash` and `ash` lack, so under `sh` it
+fails as a usage error or, worse, as a loop that reads nothing and exits
+zero: the same silent success as the word split. A `bash` code fence
+states that to a human reader and to nothing else, so invoke the snippets
+with bash explicitly; a loop that happens to be POSIX-safe too (the
+session-start scan) is incidental, not a promise about the rest.
## Reference files — load on demand, not up front
@@ -96,8 +95,8 @@ was handled without its reference loaded, log an observation.
session, and before writing any "later" into a recommendation.
- `references/environments.md` — activation and config setup, compaction
behaviour, bundle manifest, handoff-doc mode for storage-less
- environments. **Load for setup questions, after compaction, or when
- there is no filesystem.**
+ environments. **Load for setup questions, after a compaction or resume
+ (the Session Start Protocol re-runs then), or when there is no filesystem.**
- `references/migration.md` — the one-time scripted conversion of a
pre-3.0 single-file `log.md`. **Load only when the Session Start
Protocol detects a legacy log.** Fresh installs never read it.
@@ -110,55 +109,54 @@ was handled without its reference loaded, log an observation.
## Session Start Protocol
1. **Storage.** The existence check for `skill-observations/` is also
- the workspace-mount probe — one `ls` of the pinned path, run in this
- turn. If it fails, the first response is the environment's folder-picker
- tool (in Cowork, `request_cowork_directory`; elsewhere, its equivalent),
- not the "no filesystem" branch: handoff-doc mode
- (`references/environments.md`) is for environments that have no
- filesystem at all, and it is reached too easily when a missing mount is
- read as one — and that request can itself come back refused by the
- harness's permission classifier rather than by the user (a classifier
- denial names the classifier and carries a bracketed reason; a user
- decline does not), so retry it once with an identical call before the
- folder-picker path is treated as having failed and before the "no
- filesystem" branch is even considered; the rule under **How to Log** —
- consecutive denials from a probabilistic gatekeeper are noise, not a
- wall — is stated there about log writes but governs every gated call,
- this one included. Never assert the mount's state — connected or not —
- from an environment flag, a config file's presence in context, or memory
- of an earlier turn: a claim about mount state needs a probe in the same
- turn. **A successful probe does not mean the activation config fired.**
- On turn 1 a config that is merely late is indistinguishable from an
- absent one, so load the session-start skills directly rather than
- assuming the config did, and read the config file yourself if the mount
- resolves but its content is not in context. Why this guard is only the
- backup, and which channel the primary one belongs in, is in
- `references/environments.md` ("Activation config — late, intermittent,
- and why the guard cannot live inside it"); load it when setting up or
- diagnosing activation. Once the path resolves: if
+ the workspace-mount probe — one `ls` of the pinned path, carried INSIDE
+ the session's first batched tool call; session-start skill loads ride in
+ that same batch, never in an earlier one (`references/environments.md`,
+ "The probe rides inside the first batched call"). If it fails, the first
+ response is the environment's folder-picker tool (in Cowork,
+ `request_cowork_directory`; elsewhere, its equivalent), not the "no
+ filesystem" branch: handoff-doc mode (`references/environments.md`) is
+ for environments with no filesystem at all, and it is reached too easily
+ when a missing mount is read as one. That request can itself come back
+ refused by the harness's permission classifier rather than by the user
+ (a classifier denial names the classifier and carries a bracketed
+ reason; a user decline does not), so retry it once identically before
+ treating the folder-picker path as failed or even considering the "no
+ filesystem" branch: the **How to Log** rule — consecutive denials from a
+ probabilistic gatekeeper are noise, not a wall — governs every gated
+ call, this one included. Never assert the mount's state, connected or
+ not, from an environment flag, a config file's presence in context, or
+ memory of an earlier turn: that claim needs a probe in the same turn.
+ **A successful probe does not mean the activation config fired.**
+ On turn 1 a merely late config is indistinguishable from an absent one:
+ load the session-start skills directly rather than assuming it did, and
+ read the config file yourself if the mount resolves but its content is
+ not in context. Why this guard is only the backup, and where the primary
+ one belongs, is in `references/environments.md` ("Activation config —
+ late, intermittent, and why the guard cannot live inside it") — load it
+ when setting up or diagnosing activation. Once the path resolves: if
`skill-observations/observation-log/` (with its `archive/`
subdirectory) or `skill-observations/cross-cutting-principles.md`
don't exist, create them (principles template:
- `references/skill-authoring.md`). Then the **starter-set
- reconciliation**, due whenever
- `skill-observations/starter-principles-reviewed.txt` is absent or holds a
- starter-set version older than the one in
+ `references/skill-authoring.md`). Then the **starter-set reconciliation**,
+ due whenever `skill-observations/starter-principles-reviewed.txt` is
+ absent or holds a starter-set version older than the one in
`references/starter-principles.md` — a fresh install, an upgrade to a
bundle that ships the file, and every later growth of the set. Load that
file and follow its **Reconciliation** section: match by substance, offer
once in one line, import only what the adopter picks, then write the
- shipped version into the marker file so the offer never repeats until the
- set changes. Never pre-populate silently.
- Create `skill-observations/last-review-date.txt` containing the literal
- value `never` if it doesn't exist — never write a date into it at setup;
- a date means a review actually ran. If a legacy single-file
- `skill-observations/log.md` exists and `observation-log/` does not, this
- is an upgrade from a pre-3.0 install: load `references/migration.md` and
- run the scripted conversion before writing anything else. Before
- creating or writing anything: if the resolved workspace folder sits
- under an ephemeral path (e.g. `.claude/worktrees/`, a temporary clone),
- warn the user and re-anchor on the stable project path first — state
- written to an ephemeral checkout is lost at teardown.
+ shipped version into the marker file so the offer never repeats until
+ the set changes. Never pre-populate silently.
+ Create `skill-observations/last-review-date.txt` holding the literal
+ `never` if it doesn't exist — never write a date at setup; a date means
+ a review actually ran. If a legacy `skill-observations/log.md` exists
+ and `observation-log/` does not, this is a pre-3.0 upgrade: load
+ `references/migration.md` and run the scripted conversion before writing
+ anything else. Before creating or writing anything: if the resolved
+ workspace sits under an ephemeral path (`.claude/worktrees/`, a temporary
+ clone), warn and re-anchor on the stable project path — state written
+ there is lost at teardown; where none resolves (a disposable worker), use
+ report-back mode: `references/environments.md` ("Claude Code Projects").
2. **Scan.** Read only the frontmatter of each file in `observation-log/`
— the header block between the first two `---` lines, never the bodies
— and build awareness from `status`, `skill`, `proposes_skill` and
@@ -218,13 +216,12 @@ was handled without its reference loaded, log an observation.
carry on?"); above that, offer a bounded slice whose unit of work stays
constant as the backlog grows — "review the 10 oldest", "review just
the ones targeting <the skill most named>" — and state both numbers,
- how many are open and roughly how many distinct findings they
- represent (cluster on the `title` and `skill` fields you just scanned).
- A backlog that is never drained does not fail loudly; it fails by
- becoming too expensive to drain, so the per-session behaviour that is
- correct (never block the user) sums to a review nobody accepts. Only a
- scheduled/autonomous run loads `references/weekly-review.md` and runs
- the review unprompted.
+ how many are open and roughly how many distinct findings they represent
+ (cluster on the `title` and `skill` fields you just scanned). A backlog
+ that is never drained fails quietly, by becoming too expensive to drain:
+ the per-session behaviour that is correct (never block the user) sums to
+ a review nobody accepts. Only a scheduled/autonomous run loads
+ `references/weekly-review.md` and runs the review unprompted.
4. **Activation.** Once per session: if no CLAUDE.md (or equivalent)
activation instruction for this skill exists, briefly suggest adding one
(see `references/environments.md`). Skip if already configured. Be clear
@@ -290,8 +287,7 @@ remove. Full catalogue with examples: `references/signals.md`.
**An unresolved defect is an observation, at a bounded point.** When a
defect that is not itself the deliverable takes a second hypothesis, load
`references/signals.md` ("An unresolved defect is an observation, at a
-bounded point") and log the evidenced problem report instead of a fifth
-probe.
+bounded point") and log the evidenced problem report, not a fifth probe.
**Do NOT log:** one-off corrections that don't generalise; preferences
already captured in a skill; tool bugs unrelated to methodology;
@@ -437,27 +433,30 @@ hi=$( { ls "$d" "$d/archive" 2>/dev/null | grep -oE '^[0-9]+'; cat "$d/archive/.
[ "$hi" -eq 0 ] && [ -n "$(find "$d" -maxdepth 1 -name '*.md')" ] && { echo "ID COMMAND BROKEN — log is non-empty but no ids extracted"; exit 1; }
next_id=$(( hi + 1 )); echo "$next_id" > "$d/archive/.id-floor"
f="$d/$(printf '%04d' "$next_id")-<slug>.md" # the target path, built from the id just derived
-[ -e "$f" ] && { echo "COLLISION — $f exists; re-derive the id"; exit 1; }
+[ -n "$(find "$d" -maxdepth 2 -name "$(printf '%04d' "$next_id")-*.md")" ] && { echo "COLLISION — id $next_id already used; re-derive"; exit 1; } # guard the id PREFIX across active + archive, not the path
(set -C; : > "$f") || exit 1 # noclobber: create, never truncate an existing file
```
-The `sed` strips the filename prefixes' zero-padding before the
-arithmetic — do not "simplify" it away: shell arithmetic reads a
-leading-zero number as octal, so `$(( 0105 + 1 ))` yields 70, and a
-prefix containing an 8 or 9 errors out.
+The `sed` strips the prefixes' zero-padding before the arithmetic — do not
+"simplify" it away: shell arithmetic reads a leading zero as octal, so
+`$(( 0105 + 1 ))` yields 70, and a prefix containing an 8 or 9 errors out.
The guard line distinguishes "the log says zero" from "I could not read
-the log", the sweep's own count does the same for the archival loop, and
-the `noclobber` create refuses an existing path — write the body only after
-that create succeeds, and on a collision re-derive the id. Load
-`references/observation-log.md` ("The guard line, the sweep's count and the
-noclobber create") when any of the three fires.
+the log", the sweep's count does the same for the archival loop, the prefix
+guard refuses a number already in use under any slug, and the `noclobber`
+create refuses an existing path — write the body only after that create
+succeeds. Load `references/observation-log.md` ("The guard line, the sweep's
+count and the noclobber create") when any of them fires.
**Run the snippet immediately before EVERY write, including the first and
-only one of a session** — an earlier read of the log for any other purpose
-is not a substitute. Load `references/observation-log.md` ("Run the snippet
-immediately before every write") when skipping it feels reasonable, or when
-two files turn out to share an id.
+only one of a session** — an earlier read of the log is not a substitute,
+and the id the session-start scan printed is never an input to a write.
+Where a helper can run, `scripts/new-observation.sh <slug>` is the only
+write path: it performs this whole snippet and prints the created path, so
+derivation cannot drift from creation (the structural barrier the
+second-violation rule demands). Load `references/observation-log.md` ("Run
+the snippet immediately before every write") when skipping feels
+reasonable, or when two files turn out to share an id.
**Resolve each id at its own write time** — run the snippet before EACH
file, never pre-compute a range, and put the value it printed into both the
@@ -551,8 +550,7 @@ traceable to a real project. Full confidentiality layers:
**Changing an existing observation:** re-read that one file, edit only the
frontmatter fields you are changing (`status`, `parked_until`, `resolved`,
-`resolution`),
-never batch-rewrite the directory. Archival is a plain `mv` (below).
+`resolution`), never batch-rewrite the directory. Archival is a plain `mv`.
## Referencing Observations
@@ -645,15 +643,15 @@ skill", "act on observation #N"); (3) in-session correction when a skill is
producing wrong output the user should know about. Otherwise: log, don't
act.
-**An outcome-level ask is not trigger (2).** "Make this part of the
-workflow", "make sure it happens every week", "make sure this is included
-going forward" name an outcome, not a mechanism. They are satisfied by
-logging the observation and saying it will be applied at the review —
-trigger (2) needs the user to name the change and the moment ("update skill
-X now", "act on observation #N"). A request about an outcome is never a
-licence to choose the change path: the workspace's own path — log, review,
-stage, install — wins over any route that reaches the installed skill
-sooner.
+**An outcome-level ask is not trigger (2).** The test: an explicit request
+NAMES THE ARTEFACT — "update the X skill", "edit the skill file", "restage
+it", "act on observation #N". A statement naming only the behaviour —
+"from now on", "stop doing X", "always do Y", "make this part of the
+workflow", "leave that out of the process" — is a decision whose carrier
+is the observation, however urgent it sounds: forward scope makes deferral
+feel unsafe, the same disguise the bridge argument wears above. Ambiguous
+wording gets a one-line question, not a guess, since a wrong guess is an
+unrequested artefact to review; log → review → stage → install always wins.
**A harness's own skill-proposal or skill-save control is an install path,
not a staging path.** Where the environment offers to save or propose a
@@ -715,7 +713,7 @@ in its `skill:` list. Full protocol: `references/observation-log.md`.
| 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 |
+| 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 |
| When do I surface? | End of session, or earlier if needed |
| 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" |
diff --git a/references/environments.md b/references/environments.md
index 11e2989..5b25bd5 100644
--- a/references/environments.md
+++ b/references/environments.md
@@ -11,6 +11,7 @@ in an environment without filesystem access.
- A session-start hook (Claude Code and similar harnesses)
- Verify activation in a NEW session — the installing session cannot prove it
- Activation config — late, intermittent, and why the guard cannot live inside it
+ - The probe rides inside the first batched call
- Install-layout hazards — three ways a skill silently stops existing
- Two harness behaviours that block the protocol rather than break it
- If CLAUDE.md (or the equivalent config) is governance-protected
@@ -18,6 +19,8 @@ in an environment without filesystem access.
- A delegated setup step is not done until you have observed it
- Environment mappings
- Git as an optional staging medium
+- Claude Code Projects — disposable threads, no local skills, no pinned
+ path (based on the platform's documentation, not yet field-tested)
- First-run backfill
- Storage regimes
- Bundle manifest
@@ -47,9 +50,13 @@ knowingly; do not assume any of the middle ones is a guarantee.
system prompt regardless of which folder, if any, is connected (in
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 — "before any other tool call, `ls` the
- workspace path; if it fails, call the folder-picker tool; never state
- whether the folder is connected without that probe" — because a config
+ 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
+ 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) —
+ because a config
file inside the workspace folder cannot fire in the very case it
targets: when no folder is connected, there is no config file. Verify
the channel once by asking a folder-less session to quote its
@@ -237,6 +244,19 @@ independently, ids collide, and each session sees only half the history.
When consolidating, leave a pointer file at the abandoned location so
sessions anchored there get redirected instead of re-creating the fork.
+**Report-back mode — when no pinned path resolves.** The Session Start
+guard warns and re-anchors when the resolved workspace sits under an
+ephemeral checkout. That assumes a stable path exists to re-anchor on. In
+a disposable worker — a Claude Code Projects thread, any agent whose only
+writable location is a clone torn down at the end of its task — there is
+none, and writing into the clone anyway produces observations that vanish
+with it while every write reports success. So the branch is: do not write
+into the clone; carry each observation in full in the final report to
+whatever coordinates the work, or commit it to a dedicated observations
+repository via PR, and say in the report which route was taken. See
+"Claude Code Projects" below for the install, activation and log-route
+consequences.
+
**Config detection (once per session):** with filesystem access, check the
workspace root's CLAUDE.md (or equivalent) for a task-observer activation
instruction — suggest adding it if absent. **Suggest; do not create.** If
@@ -400,6 +420,37 @@ and the protocol inside it never executed). Only the first two are fixed by
changing the channel; the last two are not, and an environmental cause found
first will otherwise absorb the whole explanation.
+### The probe rides inside the first batched call
+
+The probe line can be present and correct on turn 1 and still not fire
+first. Observed twice in one day, in two sessions: the preferences block
+carried "before any other tool call, `ls` the workspace path" verbatim, and
+the session's first tool call was a batch of `Skill` invocations; the probe
+rode in the second batch. No harm either time — the folder was mounted —
+which is the point: the failure is only ever detectable in the sessions
+where it costs nothing, and it costs everything in the session where the
+folder is not there and the agent asserts that it is.
+
+The cause is a contest for one slot. Loading the session-start skills is
+the one action that genuinely *is* prior to the work, so it recruits the
+same "before anything else" position the probe needs, and it arrives as an
+activation of the agent's own setup rather than as an instruction — which
+feels like preparation, not action, and wins. Stating the precedence more
+firmly does not change that; in the second instance the agent had loaded
+the skill carrying the rule in that same first batch and the rule still
+did not register as violated, because the load had discharged the felt
+obligation.
+
+So the rule is about the **content of the first call, not its order**: the
+session's first tool call is a single batched call that contains the probe,
+and any session-start skill loads ride in that same batch — never in an
+earlier one. That removes the contest instead of adjudicating it, the
+harness's parallel-call guidance already permits it, and it is checkable
+after the fact from the transcript (an ordering rule between two "first"
+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.
+
### Install-layout hazards — three ways a skill silently stops existing
Each of these leaves no error. The skill simply stops being offered, or an
@@ -628,6 +679,17 @@ same breath.
Grow the table when a new environment appears; do not scatter its tool
names through the procedure files.
+**A scheduled-task prompt's first listed action is its first tool call.**
+The Session Start Protocol wants the workspace probe (step 1) before any
+skill invocation, and a scheduled prompt that opens with "invoke, in this
+order: …" makes the first invocation the first call — observed: a scheduled
+run loaded every skill it was told to, with the probe-first rule loaded and
+correct, and ran the probe third. A rule that wants something before the
+first listed action has to appear in that list, not in the text the list
+loads: write the activation pointer in every scheduled prompt as "probe the
+workspace folder (one `ls` of its absolute path), then invoke <skills>",
+and keep the probe's procedure and failure handling in the skill.
+
**Managed skills directories (dotfile managers, sync tools).** Where the
skills directory is generated by chezmoi, GNU Stow, yadm, a symlinked
dotfiles repo or any sync tool, the live path is not the source of truth:
@@ -657,6 +719,58 @@ the change for a decision. Treat the version-control commands as a
mutation surface for the observation log (see
`references/observation-log.md`).
+## Claude Code Projects
+
+*Based on the platform's documentation, not yet field-tested — reports
+welcome.* Re-verify each claim below against the current Claude Code
+documentation before relying on it.
+
+Claude Code Projects run work as parallel cloud "threads" under one
+coordinating conversation. Per the documentation, a thread picks up
+nothing from the Claude Code setup on the user's own machine: skills load
+only from `.claude/skills/` in a repository added to the project, or from
+skills enabled on the account; CLAUDE.md loads only from the project's
+repositories; standing rules go in the project instructions, which every
+new thread receives. Each thread works in its own clone on its own
+branch, and the coordinator sees what threads report back, not every
+step they take. That breaks three install assumptions at once:
+
+- **Install.** A user-scope install is invisible to threads. Commit the
+ skill — with its `references/` and `scripts/` — to a repository added
+ to the project, or enable it as an account skill.
+- **Activation.** A user-level activation line never loads. Put the
+ activation block's instruction in the project instructions (preferred:
+ it reaches every thread and the coordinator, and survives multi-repo
+ projects where per-repo settings are not read) or in the repository's
+ CLAUDE.md.
+- **Log route.** No pinned shared path exists: the only writes that
+ outlive a thread are a pushed branch or PR, a project Library file, or
+ project memory. So either (a) threads carry every observation **in
+ full** in their final report to the coordinator, and the coordinator
+ or a scheduled project routine writes them to the real log; or (b)
+ observations are committed to a dedicated observations repository via
+ PR — the "Git as an optional staging medium" path above — and never
+ left only on a working branch, because an unmerged branch is torn down
+ with its thread. In a non-code project, a Library file is the carrier.
+ Per-observation files still prevent write collisions between parallel
+ threads; the problem here is survival, not concurrency.
+
+The Session Start guard warns and re-anchors when the resolved workspace
+is ephemeral; in a thread there is nothing stable to re-anchor on, so the
+branch is **report-back mode** ("Anchoring the workspace" above): the
+durable route is the channel the surface guarantees survives — the
+worker's report to its coordinator, a merged commit — not a location the
+worker can reach and hope outlives it.
+
+The characteristic failure is silent: a never-activated install and
+observations stranded on an unmerged branch both produce no error, so
+issue reports will under-represent it. The external diagnostic: **no
+observations arriving at the coordinator after several threads of real
+work means the skill is not activated, or the log route is not wired.**
+Check the project instructions for the activation line and the added
+repository for the skill directory, then report what was found — that
+report is the field test this section is waiting for.
+
## First-run backfill
The skill is least valuable at the moment it is adopted: the log is empty,
@@ -696,8 +810,8 @@ regimes:
This skill consists of `SKILL.md`, the reference files it lists
(`weekly-review.md`, `skill-authoring.md`, `environments.md`,
`observation-log.md`, `signals.md`, `migration.md`,
-`starter-principles.md`) and `scripts/migrate-log.py` and
-`scripts/validate-skill-bundle.py`. If a referenced
+`starter-principles.md`) and `scripts/migrate-log.py`,
+`scripts/new-observation.sh` and `scripts/validate-skill-bundle.py`. If a referenced
file is missing, the install is
incomplete: proceed using the rules in `SKILL.md`, tell the user which
files are missing, and point them to the full bundle at the canonical
@@ -706,14 +820,38 @@ block).
## Compaction behaviour
-When context compacts mid-task, the CLAUDE.md structural trigger re-invokes
-this skill on the resumed session automatically (the resumed session reads
-CLAUDE.md anew). Observations before and after compaction are written as
-separate files under the same `observation-log/` directory, each with its own
-id (the id counter is derived from existing filenames, so it continues
-seamlessly across the compaction boundary). This is the main reason the
-structural trigger exists — a resumed session's opening message may not
-match the description triggers.
+**A compaction is a session start.** So is a handoff-doc resume and a
+re-invoked scheduled run. Each is a new context with old work in it, which
+is exactly the condition the Session Start Protocol exists for, and on the
+first turn after any of them the protocol runs again in full — storage
+probe, frontmatter scan, review trigger, and the per-skill grep for every
+skill the task in front of you needs. Where the CLAUDE.md structural
+trigger reaches the resumed context it re-invokes the skill; do not rely on
+it having done so — observed: a session compacted mid-task and the resumed
+turn ran no probe, no scan and no per-skill grep, because nothing named the
+compaction as a trigger.
+
+**The compaction summary's list of previously invoked skills is a lower
+bound, never the session's skill set.** A summary preserves what it judged
+salient about the *work*; skill loads are infrastructure, not work, so they
+are exactly what a summary drops. Observed: the summary named three of at
+least six skills loaded before the compaction, the resumed turn read the
+list as an inventory, and two domain skills stayed unloaded through a full
+data pull until the user asked. The block's own framing — "shown here for
+context only so you remain aware of their guidelines" — describes what the
+block contains and is easily read as what the session has. Re-derive the
+skill set from the task (name the decision, name the artefact type, match
+the installed descriptions — "Select on the decision, not on the artefact"
+above), and treat any skill the summary lists as loaded-then-forgotten
+rather than as the whole set.
+
+Observations before and after compaction are written as separate files
+under the same `observation-log/` directory, each with its own id (the id
+counter is derived from existing filenames, so it continues seamlessly
+across the compaction boundary). A resumed session's opening message may
+not match the description triggers, which is one reason the structural
+trigger exists — and one reason the protocol re-runs by rule rather than
+by whichever trigger happens to fire.
## User-facing documentation
diff --git a/references/observation-log.md b/references/observation-log.md
index ca249d9..c8637f6 100644
--- a/references/observation-log.md
+++ b/references/observation-log.md
@@ -30,6 +30,7 @@ empty.
- The guard line, the sweep's count and the noclobber create
- Run the snippet immediately before every write
- Resolve each id at its own write time
+ - Floor staleness — the floor below the highest active prefix
- A structural probe that comes back empty is a stop signal
- Why this is the entire concurrency story
- Read the full body before resolving, dismissing, fixing or citing
@@ -317,6 +318,46 @@ Apply it to **any command whose empty or zero output is about to become a
claim**: pair it with a second probe by different means, or state the
result as "the probe returned nothing" rather than "there is nothing".
+**When the instrument is code written in this session, its input coverage
+is unverified by construction — print what it ingested, not only what it
+found.** A shipped snippet has at least been run against the population
+it is meant to read; a throwaway parser has been run against whatever its
+author's heuristic happened to match. Observed: a scan for a canonical
+term list, re-derived at call time from bullets under a plausible heading,
+reported "3 terms checked, hits: none" — the list's own machine-readable
+block held 24, and the parser had read three incidental bullets from an
+adjacent section. A pass from an instrument that saw an eighth of its
+input is not evidence of anything, and it was caught only because the
+count looked implausibly small. So the guard's form for session-written
+code is a **coverage assertion before any result**: print the count of
+terms, rows or files the instrument read and assert it against the
+canonical source's own count (the block's line count, the directory's
+file count, the table's row count) — a mismatch fails the step rather
+than degrading to a heuristic. The count is the guard; the hits are the
+finding. The same applies to green results as to empty ones: "0 hits" is
+a claim about the corpus only once the instrument is known to see the
+corpus (the timelessness scan in `skill-authoring.md` records which
+patterns ran for exactly this reason).
+
+**A claim about how an external system behaves is an instrument reading,
+and gets the same guard — whatever produced it.** Whether it comes from a
+delegated agent's report, from a tool written this session, or from the
+agent's own reasoning, it is unverified until something outside that
+inference returns it. State the mechanism as a hypothesis, name the
+observation that would settle it, and when the check costs minutes and
+being wrong costs an irreversible action, run the check before answering
+rather than after being challenged. Observed: whether signing a commit
+would clear a hosting platform's "unverified" badge decided a force-push
+to a public repository; the answer was asserted twice, confidently, with
+no evidence, and settled in ninety seconds by two API calls once the user
+pushed back with a competing mechanism — which turned out to be the
+correct cause. The tell that separates this from ordinary uncertainty is
+**repetition**: a first confident answer is a guess; repeating it under
+implicit doubt without going to look is the moment the guard should fire,
+because repetition feels like consistency and is entrenchment. Being
+accidentally right is not being reliable, and the user cannot tell the
+two apart from outside.
+
### A refused print is not an empty log
The session-start scan does two different jobs in one block, and they have
@@ -517,7 +558,7 @@ hi=$( { ls "$d" "$d/archive" 2>/dev/null | grep -oE '^[0-9]+'; cat "$d/archive/.
[ "$hi" -eq 0 ] && [ -n "$(find "$d" -maxdepth 1 -name '*.md')" ] && { echo "ID COMMAND BROKEN — log is non-empty but no ids extracted"; exit 1; }
next_id=$(( hi + 1 )); echo "$next_id" > "$d/archive/.id-floor"
f="$d/$(printf '%04d' "$next_id")-<slug>.md" # the target path, built from the id just derived
-[ -e "$f" ] && { echo "COLLISION — $f exists; re-derive the id"; exit 1; }
+[ -n "$(find "$d" -maxdepth 2 -name "$(printf '%04d' "$next_id")-*.md")" ] && { echo "COLLISION — id $next_id already used; re-derive"; exit 1; } # guard the id PREFIX across active + archive, not the path
(set -C; : > "$f") || exit 1 # noclobber: create, never truncate an existing file
```
@@ -525,6 +566,18 @@ The snippet leaves the derived number in `$next_id` and the target path in
`$f`; append `printf '%04d\n' "$next_id"` if you also want the filename
prefix echoed.
+**`scripts/new-observation.sh <slug> [workspace-root]` is this snippet as
+one command.** It performs the same steps in the same order — sweep, id,
+floor write, prefix guard, noclobber create — takes the pinned workspace
+root as its second argument or from `TASK_OBSERVER_WORKSPACE`, refuses a
+relative root, a malformed slug or a missing `observation-log/archive/`
+(halt and re-probe; never recreate from a writer), and prints the created
+path on stdout. Where it can run, it is the only write path: an id that
+exists only as the script's output cannot be carried in memory from an
+earlier read to a later write, which is the drift every rule in this
+section is trying to prevent. The inline snippet remains for harnesses
+where a script cannot be invoked.
+
The `sed` strips the filename prefixes' zero-padding before the
arithmetic. It is load-bearing, not cosmetic: shell arithmetic reads a
leading-zero number as octal, so `$(( 0105 + 1 ))` yields 70 — a silently
@@ -581,9 +634,24 @@ successfully, so without the count "nothing was due for archival" and
the one case per-file isolation does not ("Why this is the entire
concurrency story" below): two sessions that pick the same id *and* the
same slug resolve to one identical path, where the second writer would
-silently replace the first. So the snippet refuses an existing path and
-creates the file under `noclobber` — write the body only after that create
-succeeds, and on a collision re-derive the id rather than overwrite.
+silently replace the first. So the snippet creates the file under
+`noclobber` — write the body only after that create succeeds.
+
+**The collision guard is keyed on the id prefix, not on the path.** An
+earlier form tested `[ -e "$f" ]` — the full path, slug included — and
+could not catch the collision that actually happens: two writers deriving
+the same number with *different* slugs produce two different paths, both
+creates succeed, and two files share one id with no error anywhere. A
+guard has to be keyed on the invariant it protects; noclobber protects a
+path, the invariant is a unique number, and a guard on the path passes
+every violation of the number that uses a different slug — which is all
+of them. So the guard now asks whether any file with the derived prefix
+exists in `observation-log/` or `archive/` (`find … -name 'NNNN-*.md'`,
+never a bare glob), and halts if one does. It fires only when the
+derivation is stale — a correct max-of-three cannot produce a number that
+is already in use — so a COLLISION here means the id came from somewhere
+other than a snippet run immediately before this write. Re-run the
+snippet; never adjust the number by hand.
### Run the snippet immediately before every write
@@ -605,6 +673,20 @@ review to notice: derive a correct id with the snippet, `mv` the newer file
to that prefix, and edit its `id:` frontmatter field to match. Both are
ordinary single-file operations; no other entry is touched.
+**The id printed by the session-start scan is never an input to a write.**
+The scan prints ids for awareness — which observations exist, what they
+target — and awareness is the wrong source for a number that has to be a
+maximum at the moment of writing. The signature of the failure is
+unmistakable after the fact: a new file numbered "highest id visible at
+session start, plus one", written an hour later, while the directory and
+the floor both already stood ten higher. That has now happened twice with
+this rule loaded and correct in the writing session, which is the
+second-violation condition: the remedy is not a firmer sentence but a write
+path that cannot be split — `scripts/new-observation.sh` (above), where a
+script can run, so that "resolve at write time" is what the only available
+write path does rather than a rule about when to run a snippet. The prefix
+guard is the backstop for the harness where it cannot.
+
### Resolve each id at its own write time
**Every write, not just batched ones.** An earlier version of this rule
@@ -643,6 +725,30 @@ turn — which makes it the one no amount of caution about "other writers"
prevents. When several observations are due, write them one at a time, each
after the previous write has completed.
+### Floor staleness — the floor below the highest active prefix
+
+`.id-floor` is only a safety net if every issuer updates it. The
+max-of-three derivation absorbs a lagging floor without a collision, so the
+lag is invisible in ordinary use — until the active directory is archived
+down, when a floor that lags is exactly the precondition for the counter
+restarting over ids already issued. The lag is detectable: **floor < highest
+active prefix means an issuer skipped the floor write**, and whatever wrote
+those files did not run the snippet (observed: three consecutive ids issued
+with the floor left three behind). The scan may assert it; the check is one
+line, and it belongs after the scan's counts, before the content print:
+
+```bash
+floor=$(sed 's/^0*\([0-9]\)/\1/' "$d/archive/.id-floor" 2>/dev/null | tr -d ' \n')
+top=$(ls "$d" 2>/dev/null | grep -oE '^[0-9]+' | sed 's/^0*\([0-9]\)/\1/' | sort -n | tail -1)
+[ -n "${floor:-}" ] && [ -n "${top:-}" ] && [ "$floor" -lt "$top" ] && echo "NOTE: .id-floor ($floor) below highest active id ($top) — an issuer skipped the floor write"
+```
+
+The line is optional in the core's scan snippet (the core is at its
+ceiling); `scripts/new-observation.sh` runs the same check on every write
+and corrects the floor as its own floor write. A NOTE here is evidence that
+some writer bypassed the snippet — log that as the observation, not the
+number.
+
### A structural probe that comes back empty is a stop signal
**A structural probe that comes back empty where content existed before is
@@ -677,9 +783,11 @@ write-back once silently erased entries appended minutes earlier. None of
those failure modes exist when each file is isolated. In the rare case two
parallel sessions pick the same id, the result is two files sharing a
number — harmless, distinct files, nothing lost, as long as the slugs
-differ; an identical id AND slug is one path, which is what the snippet's
-existence check and `noclobber` create guard against; the next review renumbers
-one and logs a meta-observation.
+differ; the snippet's prefix guard catches that case at write time when the
+derivation is stale, an identical id AND slug is one path, which is what the
+`noclobber` create guards against, and the review's duplicate-id check (Step
+1, re-run at Step 6) renumbers whatever slips past both and logs a
+meta-observation.
**The bounded-mutation discipline outlived the single-file log.** It was
written for `log.md` and it applies to every deletion or replacement the
diff --git a/references/signals.md b/references/signals.md
index 4110eb2..1381d0b 100644
--- a/references/signals.md
+++ b/references/signals.md
@@ -19,6 +19,8 @@ session, and before writing any "later" into a recommendation.
- Do NOT log
- Where the observation mindset stays on
- Deferral disguised as diligence
+- Instructions handed across a boundary
+- A command's risk is what it does, not what it was reached for
## Signals for a NEW skill
@@ -170,3 +172,39 @@ state stays live meanwhile, the burden of proof is on deferring, not on acting.
A deferral is a decision and needs the same justification as acting; "more
evidence would be better" is not one, because the question is whether more
evidence could change the OUTCOME.
+
+## Instructions handed across a boundary
+
+A command block, a procedure or a checklist handed to a human is executed
+in an environment the author has not tested: the author's shell, flags and
+assumptions do not travel with the text. Anything optional in that text — a
+trailing comment, a line break between two steps that only make sense
+together, an implied ordering — is a place where the receiving environment
+gets to decide, and it decides differently from the author at least once.
+(Observed: a `# comment` trailing a command in a paste-able block was passed
+to the tool as arguments by an interactive shell that has comments off by
+default; the step silently failed and the next line acted on a state that
+had never arrived.) So: explanation goes in the prose around a block, never
+on a command line; steps whose order matters are chained so a failure stops
+the sequence; and the check that settles whether the step worked tests the
+PROPERTY the step exists for, not the command's exit. A handover whose
+failure was detected by the recipient reading output is an observation, and
+its second occurrence is a barrier (above), not a rewording.
+
+## A command's risk is what it does, not what it was reached for
+
+Classify a command by its EFFECT before running it — does it write, and
+where? — never by the intent it was reached for. A verb chosen for its read
+half performs its write half regardless, in whatever repository, branch,
+index or account it is pointed at, and the blast radius is set by the
+target, not by the intent. (Observed: a version-control "checkout <ref> --
+<path>" run to copy files OUT of a branch wrote that branch's whole tree
+into the current branch's index; the next routine commit-and-push
+published untested content on a public default branch, and every content
+gate passed because none of them looks at what is staged in a different
+repository.) The tell is a convenience shortcut taken in a location the
+process reserves for something else — a read-only clone, a production
+branch, a shared log — "just this once". Log it when caught; the fix is a
+rule stated as a property of the LOCATION ("this repository is read-and-push
+only"), because a rule stated as a property of the task does not feel like
+it covers the task that was not the task.
diff --git a/references/skill-authoring.md b/references/skill-authoring.md
index 41ccb1d..3c21c10 100644
--- a/references/skill-authoring.md
+++ b/references/skill-authoring.md
@@ -6,8 +6,8 @@ Load this before creating any skill or making substantial changes to one.
- Taxonomy in full
- The Pre-Flight Principle
-- Lean Content (including progressive disclosure, the default structure
- above ~500 lines)
+- Lean Content (including progressive disclosure — the default, and
+ mandatory for publication — and reference-file shape by trigger count)
- Configuration vs process — the three-container rule
- Documenting an external tool surface
- Licensing
@@ -198,6 +198,54 @@ skills is a separate, lower-priority job — the default binds immediately
for new work and for any revision substantial enough that the body is
being rewritten anyway.
+**For any skill intended for publication, progressive disclosure is
+mandatory, not the default for large ones.** A readiness check verifies
+what it was written to catch, and structure was agreed by everyone and
+encoded by no one — so a ~1,200-line single file passed every
+confidentiality, licence and attribution check and shipped, with its
+restructure noted as a "standing follow-up" for three runs. Define "flat"
+mechanically so the gate is a script line, not a judgement: **no
+`references/` directory, or a `references/` directory the `SKILL.md` never
+points at (no pointer list or section map naming a file in it), or a
+`SKILL.md` above the line budget the review sets with nothing loaded on
+demand.** The budget is the review's call; the
+existing cores sit in the 400–750 range and are the reference points. A
+flat skill is a skill that will need a restructure before it can ship, and
+the restructure is done at the live skill through the ordinary
+review-and-install path — never in the repo, where the installed copy and
+the published tree would diverge at once.
+
+**A reference file is shaped by its TRIGGERS, not its line count.** The
+core's size ceiling does not transfer to reference files, because their
+cost is conditional: the core is loaded in full every session, so a line
+there taxes every consumer; a reference file loads only when its episode
+fires, so a long file that loads rarely is cheap. The rule: a reference
+file serves one episode, or a set of episodes that reliably co-occur.
+Splitting is indicated when the count of distinct load triggers into one
+file grows, whatever its size — each trigger pays for every other
+episode's content — and a long single-episode file is correctly shaped
+and must not be split to satisfy a size rule. Measured once on this
+skill's own bundle (lines / distinct load triggers named in the core):
+
+| file | lines | triggers |
+|---|---:|---:|
+| `weekly-review.md` | ~1,100 | 1 |
+| `skill-authoring.md` | ~950 | ~1 |
+| `observation-log.md` | ~930 | **14** |
+| `environments.md` | ~720 | 2 |
+| `signals.md` | ~170 | 3 |
+
+A line ceiling would have flagged the largest file first — the one that
+needs no change, since a review loads it whole as a unit — and said
+nothing about the mid-sized file that fourteen separate moments in a
+session each pull in. So `scripts/validate-skill-bundle.py` prints the
+per-file trigger count on every run, deliberately **not gated**: one
+snapshot cannot site a threshold, and this one already overturned the
+rule that was about to be written; the next review argues from a trend.
+When a split is made, it needs a load-observation test per moved episode
+(below), and never two structural splits in one test period — a
+regression could not be attributed to either.
+
**The load trigger is a new failure point the monolith did not have.** A
split delivers its saving only if the reference file is actually fetched
when its episode fires. When it isn't, the agent improvises the episode
@@ -515,16 +563,36 @@ staleness markers. Replace them with verification-based phrasing — "at
last verification", "a later re-check found" — plus an explicit
instruction for how to re-verify against the live source; readers need to
know how to re-check a claim, not when the author last did. The same rule
-covers commit messages on published repos. And make the check mechanical:
-this rule was violated during fluent drafting while fully documented, so
-any publishing workflow must scan public artefacts for **dated first-party
-claims in any notation** before committing — a scan, not a reminder, and
-specified by what it forbids rather than by one shape it takes. Month-name
-plus year is one shape; `2026-06-10`, `10/06/2026`, `Q2 2026` and "as of
-2026" are the same claim, and a grep written from the rule's own example
-matches only the example. Put the pattern set in a script, where it can be
-extended in one place, and record which patterns ran — a green scan whose
-coverage is unstated is unauditable.
+covers commit messages on published repos.
+
+**The prohibition, stated by what it forbids: no dated first-party
+verification claim in any public artefact, in ANY date format.** The
+shapes are examples subordinate to that definition, never the definition:
+`YYYY-MM-DD`, `DD/MM/YYYY`, `Mon YYYY`, `Month YYYY`, `QN YYYY`, the
+bare-year "as of 2026", and the sentence-position forms "on <date>" and
+"run on <date>". The list matters because the rule was once specified as
+"month-name + year patterns", and every scan thereafter grepped exactly
+that shape: a reviewer running the example has complied with the
+rule as written, so nothing prompts the question whether the pattern
+covers the rule, and twelve ISO-dated claims survived — one inside a
+reviewed, signed-off release commit. So make the check mechanical and
+auditable: any publishing workflow scans public artefacts before
+committing — a scan, not a reminder — with the pattern set in a script
+where it can be extended in one place, and **the scan records WHICH
+patterns ran**; a green result whose coverage is unstated is unauditable.
+Two consequences follow. A count produced by an enumerated set of shapes
+is a **lower bound**, never a "corrected" figure: the sweep that reported
+eight sites as corrected had missed three the least specific grep found.
+And a check that has passed every run is evidence about the check, not
+about the artefact — the instrument guard (`observation-log.md`, "Every
+instrument gets the same guard") applies to green results exactly as to
+empty ones. **One question is open and is the maintainer's, not the
+scanning session's:** whether a claim-status form ("verified on <date>")
+is exempt, on the argument that it is what stops a claim going stale
+silently and that "at last check" makes a same-week verification
+indistinguishable from a months-old one. Until it is decided, the rule
+stands as written; if an exemption is granted, it is encoded as a scan
+exclusion in the script, never as prose the next scan re-interprets.
**The internal-document exemption assumes a maintenance loop that is only
prose.** The taxonomy sanctions internal skills that describe one
@@ -595,7 +663,10 @@ re-check exists, do not record the value — record how to obtain it.
the same day takes a discriminated anchor — weekly-review.md, Delivery) — the FULL
skill directory (SKILL.md plus references/, scripts/, assets/ where
present), never SKILL.md alone — and present it for review and
- installation; nothing goes live until the user installs it. Where no
+ installation; nothing goes live until the user installs it, and once
+ the user starts reviewing the copy it is frozen — defects found are
+ reported, not applied, until the review ends (weekly-review.md, Step 5
+ standing rules, "a review opens a freeze on the artefact"). Where no
presentation/upload tool exists (e.g. Claude Code CLI), present the
staged path and a change summary in chat instead; staging-only applies
in every environment — it's the review loop's safety property, not a
@@ -710,6 +781,25 @@ re-check exists, do not record the value — record how to obtain it.
a live violation of it, in a skill whose rules were under active
rewrite, found only because the prompt happened to be opened for an
unrelated reason).
+9. **Inserting into an ordered structure is a splice, not a replacement.**
+ String replacement edits text, but a list, a table, a `## Contents`
+ index, a frontmatter block or a numbered sequence of steps is
+ structure, and an anchor-relative insert is safe only if you know what
+ is adjacent to the anchor — which `replace` gives no way to assert.
+ Observed: a list entry prepended to the paragraph that followed the
+ list, "entry + blank line + anchor", pushed the list's own closing
+ blank into its middle; rendered, one list became two, and the defect
+ survived a validator run, a confidentiality scan and a commit review,
+ because an *unchanged* line had moved relative to its neighbours and
+ none of the three reads shape. So: parse to lines, locate the insertion
+ point by a **structural predicate** (the last line matching `^- `, the
+ last row before the blank, the key after which the new key sorts),
+ splice, rejoin. Never anchor on the text of a neighbouring paragraph.
+ Where a replacement is used anyway, assert the neighbour's shape first
+ — that the line before the anchor is the last list item, that the blank
+ you are about to add is not already there — and fail loudly if it
+ differs. The repo-mode gate in `scripts/validate-skill-bundle.py`
+ catches the list case after the fact; the predicate prevents it.
**Verifying an edit is a separate problem, and the loader works against
you.** The rules above cover editing safely; nothing covers confirming
diff --git a/references/weekly-review.md b/references/weekly-review.md
index 133bb17..fbbad42 100644
--- a/references/weekly-review.md
+++ b/references/weekly-review.md
@@ -207,8 +207,7 @@ Criterion (2) is about whose judgement is driving the change, not about
the size of the diff. Where the observation records the removal or
restructure as DECIDED by the user AND carries a complete specification
— it names what replaces what, in enough detail to apply without
-inventing anything — apply it, provided the target skill is not
-published open-source, and always flag it as the FIRST diff in the
+inventing anything — apply it, and always flag it as the FIRST diff in the
summary for the user to read. Where the spec is partial ("something
like…", "the old rules should probably go"), criterion (3) applies and
it stays escalated. An escalation rule guards against the agent's own
@@ -216,6 +215,28 @@ judgement, not against change as such: escalating a decision the user
already made returns their answer to them as a question, buys no safety,
and costs a cycle in which the skill stays knowingly wrong.
+**The published case is applied too, with its ceremony attached.** A
+restructure of a published skill needs a release branch, a test plan and
+a version bump, which an unattended run cannot decide alone — but
+"escalate without applying" is the wrong shape for that protection,
+because staging is not publishing: nothing reaches the repository until
+the publishing run, which already holds on `under_test` and on its
+freshness gate. So a user-decided, fully specified restructure of a
+published skill IS applied by the scheduled run, as a staged copy that
+(a) bumps the version by at least a minor; (b) is flagged as the first
+diff in the summary with the explicit line "published skill — install and
+the release are your call"; (c) carries a manifest entry that names it as
+a restructure, so the publishing run routes it to a release branch with a
+test plan under the standing rule for branches (Step 5); and (d) leaves
+the observation `open`, with the staged path in a `reference:` note, so
+the next review's presence check closes it once the copy is installed
+rather than re-applying it. What stays escalated is the decision the run
+cannot make — cut a branch or ship from main, and when — never the
+mechanical work. (Observed: read literally, the old proviso would have
+returned a maintainer's own "priority" decision to him as a question and
+left the published skill in the shape he had decided against for another
+cycle; the run staged it anyway, and this paragraph makes that the rule.)
+
Escalate one DECISION per cluster, never the same decision twice — cluster
the OPEN entries before the escalation list is written (Step 3), and list
the member observation numbers under each decision.
@@ -402,6 +423,23 @@ a claim, not a state; the check is one `diff -rq` per skill and runs in
seconds over a 20-skill batch. The Session Start Protocol (step 6) runs
the same gate whenever it announces staged updates.
+**A `release/`-shaped staging with no manifest entry is a GATE FAILURE,
+surfaced in the summary's first line — never a copy to reconstruct
+silently.** The fallback sweep over recent date directories exists to catch
+a missing entry, but catching it is a finding, not a repair: a
+release-branch staging is cut together with its manifest entry, its hold
+and its test plan (Step 5, standing rule), and the entry's absence means the
+cutting act skipped its writes, so the hold and the test plan are suspect
+too. Observed, twice: a branch staged for install with no manifest entry
+and the publishing registry's hold still naming the previous, abandoned
+branch — found only because this sweep diffs every recent directory, and
+repaired by a later interactive session a day after the cut, so the
+reconstruction left no trace that the mechanism had failed. Name the
+directory, name the missing writes, and treat the copy as state (c); if
+the run reconstructs the entry so the rest of the gate can proceed, the
+first line says so and says what was written — a repair the summary does
+not mention is the silent reconstruction this rule forbids.
+
Also read all active cross-cutting principles. If there are no OPEN
observations and no outstanding principles: report "no open observations
or outstanding principles", update the timestamp, and stop.
@@ -621,7 +659,26 @@ the summary carries.
with the current rules), **test branch** (behavioural changes to
snippets, procedures or activation, and anything that changes what an
agent does at session start), or **decline, with the reason**. Apply
- the include-now set to the staged copy. When the review REWORDS a
+ the include-now set to the staged copy — **folding in the class, not
+ the line numbers.** A report lists the instances its author happened
+ to hit, which is the only thing a reporter can measure; completeness
+ is a property of the class, visible only to whoever holds the whole
+ tree. Before editing, grep the class the report describes across the
+ whole bundle and fix every hit: the report supplies the diagnosis, the
+ tree supplies the extent (three reports folded into one release named
+ one, two and eight sites; the classes had four, three and eleven). A
+ completeness claim in a report — "exactly those two", "the one site
+ the earlier fix missed" — is the reporter's scope, not a finding, and
+ the more carefully it is argued the more it discourages the one grep
+ that would settle it, so treat the phrase as the prompt to run it.
+ Record the class and the count in the commit and in the reply
+ ("replaced at 4 sites; the report named 1"): it tells the reporter the
+ report was read as a class, and gives the next person a search term
+ that matches reality — a partial fix under a closed issue leaves the
+ rest live and removes the search term that would have found it. Where
+ the class is mechanically checkable, leave a check behind — a gate
+ line, a lint rule — rather than only a fixed file, so the next instance
+ fails at the gate instead of being reported again. When the review REWORDS a
contribution rather than merging its diff verbatim, the merge report
lists each reworded point beside the original bullet — the same
point-by-point relocation verification as a moved file, because a
@@ -677,16 +734,85 @@ review that grows a published skill by a hundred lines at an unchanged
version number ships a changed skill under the one promise a version
exists to keep.
-**Standing rule — a branch is cut together with its test plan.** The
-session that cuts a release/test branch classifies every change on it as
-*exercised naturally by a week of use* or *unlikely to happen
-naturally*, and for the second class writes a test plan — fixture,
-procedure and pass criterion per change — as an observation whose
-`skill:` list names the branch's skill. Filed that way, the plan reaches
-the next scheduled review by procedure rather than by anyone
-remembering, and the merge step above has the evidence it requires. A
-test period tests what the period's activity happens to touch; for
-everything else it is only a delay.
+**Standing rule — a branch is cut together with its test plan and its
+hold, by one command.** The session that cuts a release/test branch
+classifies every change on it as *exercised naturally by a week of use*
+or *unlikely to happen naturally*, and for the second class writes a test
+plan — fixture, procedure and pass criterion per change — as an
+observation whose `skill:` list names the branch's skill, created `open`
+and parked in the same turn. Filed that way, the plan reaches the merge
+review by procedure rather than by anyone remembering, and the merge step
+above has the evidence it requires. A test period tests what the period's
+activity happens to touch; for everything else it is only a delay. **In
+the same act, cutting the branch writes the hold into the publishing
+process's registry** — the skill's row gets `under_test: release/vX.Y.Z`,
+with the date and whatever value it replaced — and the merge in pass 1
+clears it in the same act; the principle is the observation-status rule,
+"set the status in the same turn you act", applied to a different state
+file. The hold is what stops the publishing cycle syncing the branch line
+onto `main` as a release; if the cut does not write it, nothing does, and
+its absence is indistinguishable from "not under test".
+
+Three writes, each specified as its own rule, is how the act gets
+performed with the writes it happens to remember (observed twice: first a
+branch cut with its test plan and no hold, the hold reconstructed at the
+next run from the staging ledger and the parked observation with no trace
+in the output that the mechanism had failed; then, two days later, the
+next branch cut with its test plan and neither the hold nor the manifest
+entry, the registry still naming the previous, abandoned branch, both
+repaired by a different session a day later). Under the second-violation
+rule the remedy is structural: **the cutting act is one scripted command
+whose side effects are the three writes** — the staging anchor with its
+manifest entry, the registry hold, and the parked test-plan observation —
+and which refuses to run if any of the three targets is unwritable. The
+script itself lives in the publishing process, which owns two of the three
+targets; this skill states the contract its output must satisfy, and the
+reader-side rules that give the contract teeth. **An absent hold field is
+an assertion, not a default**: a row that has ever carried one records
+when it was cleared and by which merge, so "no field" is distinguishable
+from "nobody wrote the field". The cycle **cross-checks the skill's
+staging directories** for a `release/` staging newer than the row's
+last-cleared date and asks rather than assumes when it finds one. And this
+review's reconciliation gate (Step 1) treats a `release/`-shaped staging
+with no manifest entry as a gate failure in the summary's first line,
+never as a copy to reconstruct silently.
+
+**The merge review is a fixed weekday, anchored on the install, not the
+cut.** The merge decision is taken in the publishing session, which runs
+on a fixed weekday; the merge review is therefore the publishing session's
+weekday that follows the INSTALL of the branch line by at least a few
+working sessions (the maintainer's observed choice: a Monday install →
+that same week's session, four days later) — not "cut date plus seven",
+which is arithmetic on the wrong event and lands on whatever day of the
+week the arithmetic says (observed: a test plan, a manifest entry, a
+registry row and a summary all naming the same date, a Sunday, corrected
+by the maintainer to the preceding publishing weekday). The test plan's
+`parked_until:` names that weekday's date explicitly, and every other copy
+of the date — manifest entry, registry row, summary — is derived the same
+way, so they cannot disagree. Where the install lands late in the week
+(fewer than three days before the weekday), the review runs to the second
+such weekday; the cutter states which was chosen and why in the test-plan
+observation, once, and the other copies follow it.
+
+**Standing rule — a review opens a freeze on the artefact.** When the
+user begins reviewing a staged skill, a release branch or a diff, stop
+producing new state on it. Defects found during the review are reported,
+not applied — "spotted X in what you are reading; fix now, or note for
+after?" — because the cost of re-reviewing is the reviewer's, so the
+choice is theirs. One artefact, one version, per review cycle: if
+something must change, say explicitly that the previous version is
+superseded and name what to re-read. Prefer an immutable review artefact
+— a diff written to a file is reviewable at the reader's pace and cannot
+be invalidated by later work — and offer it first, not as the recovery.
+Batch corrections behind the review, never in front of it. (Observed: a
+release branch cut, folded, merged, rebased twice, version-corrected and
+message-rewritten across one afternoon while the maintainer was trying to
+review it; every answer they received described a state that no longer
+existed by the time they acted on it, and the branch was deleted unused —
+the content survived only because it had been staged to the workspace
+separately.) Work done while someone is reviewing is not parallelism; it
+is contention for the same object, and every revision spends the
+reviewer's attention again from the beginning.
Choose the anchor first: if `[today]/[skill-name]` already exists, apply the
same-day rule under Delivery — integrate another writer's pending copy, or give
@@ -895,6 +1021,14 @@ review's base is then a staged copy whose provenance nobody re-derived);
pass silently, and never infer it from an id counter — a monotonic id
surfacing a number above the scan's maximum is a side effect, not a
detection mechanism. The check is one `ls` against a list already in hand.
+Re-run the Step 1 duplicate-id check over the new listing as well: this
+re-scan is not redundant with Step 1, because the collisions it exists to
+catch are the ones created *during* the run (observed: Step 1 found and
+renumbered one collision; Step 6's re-scan found a second, new one —
+written mid-run by a parallel interactive session at an id the directory
+and the floor had both passed an hour earlier — that no earlier step could
+have seen). A run that trims this step as duplicate work removes the only
+check positioned after the writes it is checking for.
Then, in each applied observation's frontmatter set
`status: actioned`, `resolved: YYYY-MM-DD` (today), and
@@ -934,6 +1068,9 @@ applied with the outstanding skill named — never left implicit]
### Published skills
[per published skill: release branch merged / held, with each change on
it and its evidence (exercised naturally where, or check run and result);
+merge review date = the publishing weekday ≥ 7 days after INSTALL;
+a user-decided restructure staged: listed FIRST, with the line
+"published skill — install and the release are your call";
community items included now, routed to the test branch, or declined
with the reason; README and user-guide counts re-derived, old → new]
@@ -959,8 +1096,10 @@ an event that cannot occur turns the run's one deliverable into a hang.
## Constraints
- Don't modify observation files beyond their `status`, `parked_until`,
- `resolved`, and `resolution` frontmatter fields — **with one exception:
- correcting a target that was recorded wrongly.** `skill:` and
+ `resolved`, and `resolution` frontmatter fields — plus `reference:` in the
+ one case the Approval policy names (a user-decided restructure of a
+ published skill, left `open` with its staged path recorded there) —
+ **with one exception: correcting a target that was recorded wrongly.** `skill:` and
`proposes_skill:` are validated at write time, and that validation can
return the wrong answer: a session in a stale checkout, or one resolving
against the wrong install, judges an existing skill absent and files the
@@ -1056,7 +1195,17 @@ gate item still runs on such a file, so the exemption never becomes the
hand-zip that skips the checks nobody was questioning.
`scripts/validate-skill-bundle.py`
asserts all seven and packs a well-formed bundle — run it where Python is
-available. Where the bundle ships a public extract of a private file
+available. It also enforces each skill's OWN declared core ceiling
+(`core_max_lines:` in its frontmatter, or a `.core-ceiling` file —
+`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
+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
+failed them — every other check passed, and the constant was the defect,
+but the bypass was the wrong response to it). Where the bundle ships a public extract of a private file
(this skill's `references/starter-principles.md`), run the
confidentiality scan over that extract here too: it is the one file in
the bundle whose content is copied from a private source, so the
@@ -1130,7 +1279,10 @@ test branch / declined, with the reason), per included item the
reporter's GitHub login and numeric id, so the publishing run's commit
can write the crediting trailer without going back to the API, and the
version bump for published skills (the new version, or the intended
-bump where the version lives only in the repo's manifest). The manifest is
+bump where the version lives only in the repo's manifest) — and, where
+the staging is a user-decided restructure of a published skill (Approval
+policy), the word `restructure`, so the publishing run routes it to a
+release branch with a test plan rather than to `main`. The manifest is
what the Session Start Protocol reads to announce "N staged updates
awaiting review", so staged work is never quietly forgotten; the
per-change summary is what lets the user review a full-file diff
diff --git a/scripts/new-observation.sh b/scripts/new-observation.sh
new file mode 100644
index 0000000..02c4128
--- /dev/null
+++ b/scripts/new-observation.sh
@@ -0,0 +1,122 @@
+#!/usr/bin/env bash
+# new-observation.sh — derive the next observation id AND create the file,
+# as one command that cannot be split.
+#
+# Usage:
+# scripts/new-observation.sh <slug> [workspace-root]
+#
+# <slug> kebab-case, no id prefix, no extension ("short-slug")
+# [workspace-root] the pinned absolute workspace path — the directory that
+# holds skill-observations/. Defaults to the environment
+# variable TASK_OBSERVER_WORKSPACE. One of the two is
+# required; the log is never resolved from the cwd.
+#
+# Prints the created file's absolute path on stdout (one line) and exits 0.
+# Any guard firing prints its message on stderr and exits 1 with NO file
+# created. Write the observation body into the printed path, with the id
+# from its NNNN- prefix in the `id:` field — copied, never retyped.
+#
+# This is the id-derivation snippet from SKILL.md "How to Log", unchanged in
+# substance, packaged so that the moment of derivation cannot drift away
+# from the moment of writing: an id derived at session start and carried in
+# memory to a later write is the collision the snippet's rules forbid, and
+# a rule that has failed twice while loaded needs the write path itself to
+# enforce it. Where this script can run, it is the only write path.
+#
+# Steps, in order: archival sweep of stale resolved files (a side effect of
+# deriving the id, never a separate duty) → id = max(active prefixes,
+# archive prefixes, .id-floor) + 1 → floor write → PREFIX collision guard
+# across active and archive (two slugs sharing one number is the failure;
+# a path check cannot see it) → noclobber create → print the path.
+#
+# bash, not sh: `read -r -d ''` is a bash extension. Runs on bash 3.2 (stock
+# macOS): case patterns inside $( ) are parenthesised for that reason.
+
+set -u
+
+slug="${1:-}"
+root="${2:-${TASK_OBSERVER_WORKSPACE:-}}"
+
+if [ -z "$slug" ]; then
+ echo "usage: new-observation.sh <slug> [workspace-root]" >&2; exit 1
+fi
+case $slug in
+ (*[!a-z0-9-]*|-*|*-|*--*|"")
+ echo "slug must be kebab-case (a-z, 0-9, single hyphens): got '$slug'" >&2; exit 1 ;;
+esac
+case $slug in
+ ([0-9][0-9][0-9][0-9]-*) echo "slug must not start with an id prefix: got '$slug'" >&2; exit 1 ;;
+esac
+if [ -z "$root" ]; then
+ echo "no workspace root: pass it as the second argument or set TASK_OBSERVER_WORKSPACE" >&2; exit 1
+fi
+case $root in
+ (/*) ;;
+ (*) echo "workspace root must be an ABSOLUTE path, never relative to the cwd: got '$root'" >&2; exit 1 ;;
+esac
+
+d="$root/skill-observations/observation-log" # may contain a space: every expansion stays quoted
+if [ ! -d "$d" ] || [ ! -d "$d/archive" ]; then
+ echo "STRUCTURE MISSING — expected '$d' and '$d/archive' (Session Start step 1 creates them); HALT and re-probe, never recreate from here" >&2
+ exit 1
+fi
+
+today=$(date +%F)
+
+# --- archival sweep: stale resolved files move before the id is read --------
+n_files=$(find "$d" -maxdepth 1 -name '*.md' | wc -l | tr -d ' ')
+seen=$(find "$d" -maxdepth 1 -name '*.md' -print0 | { n=0
+ while IFS= read -r -d '' f; do
+ n=$(( n + 1 ))
+ hdr=$(awk 'NR==1 && /^---[[:space:]]*$/ {fm=1; next}
+ fm && /^---[[:space:]]*$/ {exit} fm' "$f")
+ case $hdr in
+ (*"status: actioned"*|*"status: declined"*|*"status: superseded"*) ;;
+ (*) continue ;;
+ esac
+ r=$(printf '%s\n' "$hdr" | sed -n 's/^resolved:[[:space:]]*//p' | head -1)
+ case $r in ([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]) ;; (*) continue ;; esac
+ [ "$r" != "$today" ] && \
+ [ "$(printf '%s\n%s\n' "$r" "$today" | sort | head -1)" = "$r" ] && \
+ mv "$f" "$d/archive/"
+ done; printf %s "$n"; })
+if [ "$n_files" -gt 0 ] && [ "${seen:-0}" -eq 0 ]; then
+ echo "ARCHIVAL SWEEP BROKEN — $n_files files present, 0 examined" >&2; exit 1
+fi
+
+# --- id: max of active prefixes, archive prefixes and the floor, plus one ---
+hi=$( { ls "$d" "$d/archive" 2>/dev/null | grep -oE '^[0-9]+'; cat "$d/archive/.id-floor" 2>/dev/null; } \
+ | sed 's/^0*\([0-9]\)/\1/' | sort -n | tail -1); : "${hi:=0}"
+if [ "$hi" -eq 0 ] && [ -n "$(find "$d" -maxdepth 1 -name '*.md')" ]; then
+ echo "ID COMMAND BROKEN — log is non-empty but no ids extracted" >&2; exit 1
+fi
+next_id=$(( hi + 1 ))
+prefix=$(printf '%04d' "$next_id")
+
+# floor-staleness note: the floor lags the directory when an issuer skipped
+# the floor write. Harmless here (max-of-three absorbs it) but worth a line,
+# because a lagging floor is the precondition for a restart once the active
+# directory is archived down.
+floor=$(sed 's/^0*\([0-9]\)/\1/' "$d/archive/.id-floor" 2>/dev/null | tr -d ' \n')
+top_active=$(ls "$d" 2>/dev/null | grep -oE '^[0-9]+' | sed 's/^0*\([0-9]\)/\1/' | sort -n | tail -1)
+if [ -n "${floor:-}" ] && [ -n "${top_active:-}" ] && [ "$floor" -lt "$top_active" ]; then
+ echo "NOTE: .id-floor ($floor) is below the highest active id ($top_active) — an issuer skipped the floor write; corrected now" >&2
+fi
+
+echo "$next_id" > "$d/archive/.id-floor" || { echo "FLOOR WRITE FAILED — $d/archive/.id-floor" >&2; exit 1; }
+
+# --- collision guard on the id PREFIX, across active and archive ------------
+# Two writers deriving the same number with different slugs produce two
+# different paths; a path check passes both. The invariant is a unique
+# number, so the guard is keyed on the number.
+if [ -n "$(find "$d" -maxdepth 2 -name "${prefix}-*.md")" ]; then
+ echo "COLLISION — id $next_id already used; re-derive (re-run this script)" >&2; exit 1
+fi
+
+# --- noclobber create: never truncate an existing file ----------------------
+f="$d/${prefix}-${slug}.md"
+if ! (set -C; : > "$f") 2>/dev/null; then
+ echo "CREATE FAILED — $f exists or is unwritable" >&2; exit 1
+fi
+
+printf '%s\n' "$f"
diff --git a/scripts/validate-skill-bundle.py b/scripts/validate-skill-bundle.py
index 2edb256..9c85583 100644
--- a/scripts/validate-skill-bundle.py
+++ b/scripts/validate-skill-bundle.py
@@ -16,6 +16,9 @@ Usage
after the directory checks pass, then validates 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
+ files (README, guides): a blank line splitting one list in
+ two is reported as a failure with file:line.
Why --repo-only exists: in a repo whose root IS the skill directory
(`SKILL.md` at the top level), the two check sets contradict each other.
@@ -511,6 +514,52 @@ def check_repo_versions(repo_dir, fails):
f"copy to keep in sync for no benefit.")
+LIST_ITEM_RE = re.compile(r"^(\s*)([-*+]|\d+[.)])\s+\S")
+
+
+def check_markdown_shape(repo_dir, fails):
+ """A stray blank line inside a tight list splits it in two when rendered.
+
+ The skill checks never read repo-root prose, the confidentiality scan is
+ a term search, and a diff review reads added lines — so an entry inserted
+ into a README list by string replacement, which pushed the list's closing
+ blank into the middle of it, passed all three and was caught by a human
+ reading line numbers.
+
+ The predicate: a blank line whose previous and next non-empty lines are
+ list items at the same indent and of the same kind (bullet or numbered),
+ where the list is otherwise TIGHT — one of those two items sits directly
+ against another item with no blank between. Measured on seven repo roots
+ before the tightness clause: 9 hits, 0 defects, all one deliberately
+ loose list (every item blank-separated); with it: 0 hits, and the
+ fixture's known defect still reported. Fenced blocks become opaque
+ separator lines so code never reads as a list, and a run of blanks
+ reports once, at its first line.
+ """
+ def kind(m):
+ return (m.group(1), m.group(2)[0].isdigit()) if m else None
+
+ 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)
+ lines = prose.splitlines()
+ items = [kind(LIST_ITEM_RE.match(l)) for l in lines]
+ for i, line in enumerate(lines):
+ if line.strip() or (i and not lines[i - 1].strip()):
+ continue
+ prev = next((j for j in range(i - 1, -1, -1) if lines[j].strip()), None)
+ nxt = next((j for j in range(i + 1, len(lines)) if lines[j].strip()), None)
+ if prev is None or nxt is None or not items[prev] or items[prev] != items[nxt]:
+ continue
+ tight = (prev > 0 and items[prev - 1] == items[prev]) or \
+ (nxt + 1 < len(lines) and items[nxt + 1] == items[nxt])
+ if tight:
+ fails.append(f"{p.name}:{i + 1}: blank line splits a list in two "
+ f"(same-kind items at the same indent on both sides)")
+
+
def pack(src, out):
"""Always writes POSIX separators, on any platform."""
src = pathlib.Path(src)
@@ -552,7 +601,9 @@ def main(argv):
print(__doc__); return 2
if "--repo-only" in argv:
fails = []
- check_repo_versions(argv[argv.index("--repo-only") + 1], fails)
+ repo = argv[argv.index("--repo-only") + 1]
+ check_repo_versions(repo, fails)
+ check_markdown_shape(repo, fails)
if fails:
print("FAIL:")
for f in fails: