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.
Python agent-skillsai-skillsaugmented-expertiseawesome-skillsclaudeclaude-codeclaude-code-skillclaude-code-skillsclaude-coworkclaude-skillsmeta-skillrebelyticsskill-automationskill-builderskill-creationskill-improvementskill-managementskills
Release 3.3.0: split the core, add a size ratchet, fold 39 reports
Eoghan Henn5cb73c4ad095
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonnew file mode 100644index 0000000..202dfa5--- /dev/null+++ b/.claude-plugin/marketplace.json@@ -0,0 +1,17 @@+{+ "$schema": "https://json.schemastore.org/claude-code-marketplace.json",+ "name": "one-skill-to-rule-them-all",+ "owner": {+ "name": "Eoghan Henn",+ "url": "https://rebelytics.com"+ },+ "plugins": [+ {+ "name": "task-observer",+ "source": {+ "source": "github",+ "repo": "rebelytics/one-skill-to-rule-them-all"+ }+ }+ ]+}diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonnew file mode 100644index 0000000..0485417--- /dev/null+++ b/.claude-plugin/plugin.json@@ -0,0 +1,20 @@+{+ "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",+ "name": "task-observer",+ "displayName": "Task Observer — One Skill to Rule Them All",+ "version": "3.3.0",+ "author": {+ "name": "Eoghan Henn",+ "url": "https://rebelytics.com"+ },+ "homepage": "https://github.com/rebelytics/one-skill-to-rule-them-all",+ "repository": "https://github.com/rebelytics/one-skill-to-rule-them-all",+ "license": "CC-BY-4.0",+ "keywords": [+ "skills",+ "meta-skill",+ "observation",+ "skill-improvement",+ "workflow"+ ]+}diff --git a/.tessl-plugin/plugin.json b/.tessl-plugin/plugin.jsonindex 114c188..e68341b 100644--- a/.tessl-plugin/plugin.json+++ b/.tessl-plugin/plugin.json@@ -1,9 +1,9 @@{"name": "rebelytics/task-observer",- "description": "Monitors task execution for skill improvement opportunities. Use during ANY multi-step task, agentic workflow, or work session where the agent uses tools and produces deliverables. Captures patterns, user corrections, workflow insights, and methodology worth preserving as reusable skills. Also triggers in post-task feedback discussions and when the user mentions skill observations, improvements, the observation log, skill taxonomy, or asks the agent to watch for skill opportunities. 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, however simple the opener looks. 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.",+ "description": "Monitors task execution for skill improvement opportunities. Use during ANY multi-step task, agentic workflow, or work session where the agent uses tools and produces deliverables. Captures patterns, user corrections, workflow insights, and methodology worth preserving as reusable skills. Also triggers in post-task feedback discussions and when the user mentions skill observations, improvements, the observation log, skill taxonomy, or asks the agent to watch for skill opportunities. Also known as \"One Skill to Rule Them All\" \u2014 trigger on this phrase too. IMPORTANT: invoke this skill before the FIRST tool call of any session and before writing or proposing a plan \u2014 any turn that will involve a tool call counts, however simple the opener looks. 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) \u2014 description matching alone is not enforceable.","private": false,"skills": ["."],- "version": "3.2.0"+ "version": "3.3.0"}diff --git a/README.md b/README.mdindex c968a00..fc82563 100644--- a/README.md+++ b/README.md@@ -2,9 +2,9 @@## The meta-skill that builds and improves all your skills, including itself.-In the first seven months of using this meta-skill, it **logged almost 1400 observations across my 78 skills**, most of which were turned into skill improvements. The majority of my 78 skills were themselves created based on observations by the meta-skill.+This meta-skill has **logged over 1,500 observations across my 82 skills**, most of which were turned into skill improvements. The majority of my 82 skills were themselves created based on observations by the meta-skill.-The current version of task-observer also includes improvements suggested by 50 different users, across 103 issues and 26 pull requests. Without these contributions, the project wouldn't be half as good as it is today.+The current version of task-observer also includes improvements suggested by 65 different users, across 141 issues and 33 pull requests. Without these contributions, the project wouldn't be half as good as it is today.This meta-skill is a practical application of the [Augmented Expertise](https://www.rebelytics.com/augmented-expertise/) methodology, an AI framework for knowledge workers. However, users have reported successful integrations into their Hermes and Openclaw setups, so it works equally well with autonomous agents.@@ -65,6 +65,8 @@ The skill is a small bundle: `SKILL.md`, the files in `references/` that are loa**Other systems:** keep the folder structure intact wherever your platform expects skills, and let your AI guide you (see "How it works" above).+**From the command line (skills.sh):** `npx skills add rebelytics/one-skill-to-rule-them-all --skill task-observer`. This is the most-used install route — the skills.sh listing reports over 7,000 installs, and it carries independent security audits from Gen Agent Trust Hub, Socket and Snyk.+**Check that it actually runs.** Installing the files is not the same as activating the skill: description matching alone under-triggers, so add the activation instruction from `references/environments.md` to your CLAUDE.md (or your platform's equivalent) or install the session-start hook. Then verify in a *new* session — the session you install in cannot prove it — that the skill is invoked before the first tool call. The external tell if you skipped this: if `skill-observations/observation-log/` doesn't exist after a few sessions of real work, activation never happened.## Claude environment notes@@ -122,6 +124,20 @@ You're free to use, adapt, and redistribute — even commercially — as long asIf you want to learn more about the methodology behind this skill, please read the [Augmented Expertise manifesto](https://www.rebelytics.com/augmented-expertise/).+## Listed in++task-observer is indexed in these community lists and skill directories:++- [VoltAgent / awesome-agent-skills](https://github.com/VoltAgent/awesome-agent-skills)+- [Get Claude Skills](https://www.getclaudeskills.com/skills/task-observer-rebelytics)+- [Claude Code Marketplaces](https://claudemarketplaces.com/skills/rebelytics/one-skill-to-rule-them-all/task-observer)+- [Surf Skills](https://surfskills.surf/s/rebelytics/one-skill-to-rule-them-all/task-observer)+- [BehiSecc / awesome-claude-skills](https://github.com/BehiSecc/awesome-claude-skills)+- [KIMI](https://www.kimi.ai/resources/claude-code-skills)+- [CorpusIQ — Hermes skills catalog](https://www.corpusiq.io/docs/hermes/skills/catalog/task-observer-setup)++It is also redistributed, unmodified and under CC BY 4.0, in [iamneilroberts/claude-skills](https://github.com/iamneilroberts/claude-skills).+## Recommended byI would like to thank the following creators, platforms, publications, companies and kind people who have recommended task-observer to their audiences:@@ -130,7 +146,6 @@ I would like to thank the following creators, platforms, publications, companies- Kelli Hrivnak: [https://www.linkedin.com/posts/kellihrivnak_to-those-building-out-skills-in-claude-lets-share-7478433968837517312-UhPj/](https://www.linkedin.com/posts/kellihrivnak_to-those-building-out-skills-in-claude-lets-share-7478433968837517312-UhPj/)- Maverick Maltin: [https://www.tiktok.com/@maverickgpt/video/7661705764901227807](https://www.tiktok.com/@maverickgpt/video/7661705764901227807)- Claudia Faith: [https://levelupwithai.substack.com/p/this-is-how-you-use-claude-in-2026](https://levelupwithai.substack.com/p/this-is-how-you-use-claude-in-2026)-- BehiSecc: [https://github.com/BehiSecc/awesome-claude-skills](https://github.com/BehiSecc/awesome-claude-skills)- Andrea Saez: [https://dreasaez.medium.com/your-ai-skills-are-silos-heres-how-to-fix-that-bdb04a507785](https://dreasaez.medium.com/your-ai-skills-are-silos-heres-how-to-fix-that-bdb04a507785)- Aashish Pahwa: [https://www.instagram.com/p/DXwqpPQj62s/](https://www.instagram.com/p/DXwqpPQj62s/)- Nick Saraev: [https://www.instagram.com/reels/DaN0yYtPzjY/](https://www.instagram.com/reels/DaN0yYtPzjY/)@@ -138,11 +153,9 @@ I would like to thank the following creators, platforms, publications, companies- Myriam Jessier: [https://www.linkedin.com/posts/myriamjessier_i-feel-like-i-am-part-of-an-mlm-sponsored-share-7483809490992140288-6Lwm/](https://www.linkedin.com/posts/myriamjessier_i-feel-like-i-am-part-of-an-mlm-sponsored-share-7483809490992140288-6Lwm/)- Victor Dorneanu: [https://brainfck.org/t/self-improving-agents/](https://brainfck.org/t/self-improving-agents/)- CORE.TODAY: [https://core.today/blog/task-observer-meta-skill](https://core.today/blog/task-observer-meta-skill)-- KIMI: [https://www.kimi.com/resources/claude-code-skills](https://www.kimi.com/resources/claude-code-skills)- Tom Dörr: [https://x.com/tom_doerr/status/2072251701608784049](https://x.com/tom_doerr/status/2072251701608784049)- Vaibhav Sisinty: [https://x.com/VaibhavSisinty/status/2063290847723192610](https://x.com/VaibhavSisinty/status/2063290847723192610)- Evgeny Shkuratov: [https://www.instagram.com/reels/DaHqy6MApwN/](https://www.instagram.com/reels/DaHqy6MApwN/)-- Surf Skills: [https://surfskills.surf/s/rebelytics/one-skill-to-rule-them-all/task-observer](https://surfskills.surf/s/rebelytics/one-skill-to-rule-them-all/task-observer)- Juan Pablo Rosso: [https://www.instagram.com/reels/Dayv8dvjeLi/](https://www.instagram.com/reels/Dayv8dvjeLi/)- Johannes Manske: [https://www.linkedin.com/posts/johannesmanske_vor-8-wochen-war-ki-noch-sparringspartner-share-7461096580809547777-0ty7/](https://www.linkedin.com/posts/johannesmanske_vor-8-wochen-war-ki-noch-sparringspartner-share-7461096580809547777-0ty7/)- Xavier Ting: [https://xaviertingai.com/tools/task-observer.html](https://xaviertingai.com/tools/task-observer.html)@@ -161,10 +174,11 @@ I would like to thank the following creators, platforms, publications, companies- Danielgpt2: [https://www.tiktok.com/@danielgpt2/photo/7663796072724172054](https://www.tiktok.com/@danielgpt2/photo/7663796072724172054)- Doit.systemIA: [https://www.youtube.com/shorts/535GKrg1E08](https://www.youtube.com/shorts/535GKrg1E08)- Erfan Yousefi: [https://codenight.ir/articles/claude-code-plugins](https://codenight.ir/articles/claude-code-plugins)-- DecimalAI: [https://app.decimal.ai/skills/rebelytics-task-observer](https://app.decimal.ai/skills/rebelytics-task-observer)- MigueBaenaIA: [https://www.youtube.com/shorts/OBeoYZzHDcw](https://www.youtube.com/shorts/OBeoYZzHDcw)- Santiago Cosme: [https://www.linkedin.com/posts/santiagocosme_5-skills-para-poner-90-ugcPost-7491131673254846465-SQAl/](https://www.linkedin.com/posts/santiagocosme_5-skills-para-poner-90-ugcPost-7491131673254846465-SQAl/)- Skillselion: [https://skillselion.com/guides/task-observer-skill-claude-code-guide](https://skillselion.com/guides/task-observer-skill-claude-code-guide)+- Adele Newenham: [https://www.aiwithadele.com/guides/claude-code-plugins](https://www.aiwithadele.com/guides/claude-code-plugins)+- Hysen Labs: [https://hysenlabs.com/en/projects/rebelytics-one-skill-to-rule-them-all](https://hysenlabs.com/en/projects/rebelytics-one-skill-to-rule-them-all)If I forgot to list your recommendation here, please let me know or submit it via a PR in the same format as the others.diff --git a/SKILL.md b/SKILL.mdindex a8aeaf5..f0eaa33 100644--- a/SKILL.md+++ b/SKILL.md@@ -1,21 +1,6 @@----name: task-observer-description: >- Monitors task execution for skill improvement opportunities. Use during ANY- multi-step task, agentic workflow, or work session where the agent uses- tools and produces deliverables. Captures patterns, user corrections,- workflow insights, and methodology worth preserving as reusable skills.- Also triggers in post-task feedback discussions and when the user mentions- skill observations, improvements, the observation log, skill taxonomy, or- asks the agent to watch for skill opportunities.- 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, however simple the opener looks. 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.+name: "task-observer"+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."---# Task Observer — Continuous Skill Discovery & Improvement@@ -44,23 +29,17 @@ shared folder; in Claude Code, the stable project identity (e.g.`~/.claude/projects/<project-id>/`), NOT the current working directory. Acwd inside an ephemeral checkout — a git worktree under`.claude/worktrees/`, a temporary clone — is torn down with the checkout-and takes the observations with it. Scope the workspace to what is-observed: globally installed skills need one path shared across projects,-tools and agents, never one derived per session — and "stable" is not-the same as "single". In Claude Code the project identity is derived-from the directory a session starts in, so a habit of starting sessions-in per-project subfolders yields one stable anchor per subfolder, each-a silent shard of the same log; a per-project default scatters-observations about a globally installed skill across every project-touched, and a review run in any one of them looks complete while seeing-a fraction of the backlog. The rule: if the skills being observed are-installed at user or global scope, pin the log to one matching-user-scope path (for example `~/.claude/skill-observations/` or the-equivalent outside any project) and keep the per-project default only-for skills that exist in that project alone. Never place it inside a-skills-discovery directory. Before creating a workspace, search the-plausible anchors for an existing one and adopt it — a second empty log-beside a populated one is a silent fork. **The observation log is a+and takes the observations with it. **Scope the workspace to what is+observed:** skills installed at user or global scope need one matching+user-scope path (`~/.claude/skill-observations/` or the equivalent outside+any project), shared across projects, tools and agents; keep a per-project+anchor only for skills that exist in that project alone. "Stable" is not+the same as "single", and a per-project default silently shards one log+into many, each of which looks complete from inside. Never place the+workspace inside a skills-discovery directory. Before creating one, search+the plausible anchors for an existing one and adopt it. Load+`references/environments.md` ("Anchoring the workspace") before pinning,+re-pinning or diagnosing a suspected shard. **The observation log is adirectory:**`[workspace folder]/skill-observations/observation-log/`, one Markdown filewith a YAML frontmatter header per observation, with resolved entries under@@ -105,9 +84,15 @@ was handled without its reference loaded, log an observation.**Load when setting up the log for the first time, when archiving, whenan id or frontmatter looks wrong, or before changing how anything readsthe log.**+ Also load it, as the pointers below direct, before resolving, dismissing+ or citing an observation, when setting `parked` or `reference:`, before+ adding or changing an enforcement trigger or writing a new instrument+ over the log, and whenever a scan, sweep or id probe comes back empty.- `references/signals.md` — the full catalogue of what is and isn't worthlogging. **Load when unsure whether something is an observation, or whensorting many candidates.**+ Also load it when a defect that is not the deliverable is consuming the+ session, and before writing any "later" into a recommendation.- `references/environments.md` — activation and config setup, compactionbehaviour, bundle manifest, handoff-doc mode for storage-lessenvironments. **Load for setup questions, after compaction, or when@@ -130,34 +115,39 @@ was handled without its reference loaded, log an observation.not the "no filesystem" branch: handoff-doc mode(`references/environments.md`) is for environments that have nofilesystem at all, and it is reached too easily when a missing mount is- read as one. Never assert the mount's state — connected or not — from- an environment flag, the presence of a config file in context, or- memory of an earlier turn; a claim about mount state needs a probe in- the same turn. Once the path resolves: if+ 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`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-setreconciliation**, 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` (the `Starter set version: N` line- in its header, below the title) — which covers a fresh install, an existing- install upgrading to a bundle that ships the file, and every later- growth of the set. Load the starter file, match each starter entry- against the adopter's existing principles by substance (a rule that- says the same thing under a different title counts as covered), and- offer once, in one line: "the bundle ships N starter principles; M are- not covered by your file — want to see them?" On yes, show only the- uncovered ones, let the adopter pick, and import the picks in the- template format with `**Origin:** imported from starter set`, so the- adopter's own reviews can prune them like any other rule. On a fresh- file M equals N and the choice is simply "start empty, or seed". Either- way, write the starter set's version into the marker file, so the- offer never repeats until the shipped set changes. Never pre-populate- silently: the file's authority comes from the adopter's own evidence- trail, and unexamined imported rules contradict the pruning principle- the file itself carries.+ `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 literalvalue `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@@ -176,24 +166,15 @@ was handled without its reference loaded, log an observation.format: the scan stays cheap once hundreds of observations exist.**This scan does not satisfy the per-skill check** (the grep run each- time a skill loads — `references/environments.md`, activation block).- Different scope (every skill vs one), different depth (frontmatter vs- body), different moment (session start vs the point the skill's rules- are applied). Both answer "have I looked at the log?", so running this- one discharges the felt obligation and makes the targeted one feel- redundant while leaving its function unperformed — awareness of a- hundred titles does not survive as recall of the one relevant body- twenty tool calls later. Retrieval has to happen where the decision is- made.+ time a skill loads — `references/environments.md`, activation block):+ different scope, depth and moment. Load `references/observation-log.md`+ ("Why the session-start scan does not satisfy the per-skill check")+ whenever the per-skill grep feels redundant because this scan already ran.**An empty scan in a log known to be non-empty is a broken command- until proven otherwise**, never the finding "no relevant observations".- Count the files independently of the parse — a literal path, not the- variable the loop uses — and halt if files exist but nothing parsed.- Re-derive every path inside the same tool call: shell state does not- carry between calls in most harnesses, and a path variable that- silently resolves to empty turns a filter into a match-nothing glob- rather than an error.+ until proven otherwise** — the snippet's guard halts on it. When the guard+ fires, or before adapting the snippet, load `references/observation-log.md`+ ("An empty scan over a non-empty log is a broken command").```bashd="[ABSOLUTE PATH]/skill-observations/observation-log" # the pinned workspace path — re-derive in EVERY call, never relative to the cwd; run under bash, not sh@@ -213,25 +194,20 @@ was handled without its reference loaded, log an observation.fi[ "$suspect" -gt 0 ] && echo "NOTE: $suspect of $n headers carry an unquoted ': ' in a value — quote those values (File format)"printf 'files: %s parsed: %s suspect: %s\n' "$n" "$parsed" "$suspect"- printf '%s session-start scan: files=%s parsed=%s\n' "$(date +%F)" "$n" "$parsed" \- >> "[ABSOLUTE PATH]/skill-observations/checkpoints.log" # the protocol's own trace+ printf '%s [%s] session-start scan: files=%s parsed=%s\n' "$(date '+%F %H:%M')" "${PWD##*/}" "$n" "$parsed" \+ >> "[ABSOLUTE PATH]/skill-observations/checkpoints.log" # date+time+source: one line per session, not per day```- **The scan ends in a write, not only a print.** Loading this skill and- executing this protocol are two acts, and only the load leaves an- artefact in the transcript — which discharges the felt obligation, so a- session that loaded and then ran nothing looks from outside exactly- like one that did both. The appended `checkpoints.log` line is the- protocol's own trace, for the same reason the checkpoint rule is a- write: a step whose value lies in happening at a specific moment needs- its own entry in the tool record. (Where the workspace prices every- write — the exception under "How to Log" — fold this line into the- session's first write instead.)+ **The scan ends in a write, not only a print** — the appended+ `checkpoints.log` line is the protocol's own trace (in a priced-write+ workspace, fold it into the session's first write instead). Load+ `references/observation-log.md` ("The scan ends in a write, not only a+ print") before removing, moving or replacing that line.3. **Review trigger.** Read `skill-observations/last-review-date.txt`. Thevalue carries the truth: a date = when the last review actually ran;`never` = no review has run yet. A missing file is abnormal (step 1creates it) — recreate it with `never`, don't invent a date. If the- value is `never` or older than 7 days AND there are OPEN observations:+ value is `never` or 7 or more days old AND there are OPEN observations:in an interactive session, offer the review in one line and proceedwith the user's task unless they opt in; never gate their work on thereview. Scale the offer's CONTENT with the backlog, never its@@ -265,25 +241,25 @@ was handled without its reference loaded, log an observation.6. **Targets and staged work.** Resolve each distinct `skill:` value inthe scanned frontmatter against the installed skill set and mention, inone line, any that no longer resolve — a deleted skill can accumulate- dozens of observations before a review discovers the target is gone.+ dozens of observations before a review notices. Say what you resolved+ against (this checkout, this install): an unresolved target is a fact+ about where you looked, not about the world.If `skill-updates/PENDING.md` lists staged updates, reconcile the listbefore announcing it — installation happens outside any session, so nosession observes the install itself, and the session that reads the- ledger owns its cleanup. For each entry, `diff -rq` the staged copy- against the live skill and classify three ways (live legitimately moves- on, so a bare "differs" is not a verdict): identical → installed,- remove the entry; live strictly newer/superset → superseded, remove- with a note; staged content absent from live → NOT installed, keep the- entry, surface it, and base any new staging of that skill on the staged- copy. Then say "N staged updates awaiting review" in one line.-7. **First run.** If the log is empty and the project has history- (handover or decision docs, commit history, test scripts, an existing- CLAUDE.md — which is largely a record of corrections nobody logged),- offer a one-off backfill pass over those artefacts. Backfilled entries- cite the durable artefact (file and section) in `session_context`- instead of a session, and the same-turn immediacy rule is satisfied by- one batched write. The pass is one-off; the scheduled review takes- over afterwards.+ ledger owns its cleanup. `diff -rq` each staged copy against live and+ classify it; a bare "differs" is not a verdict, because live moves on+ legitimately. The classification and its cases are in+ `references/weekly-review.md` ("Staged-work reconciliation gate") —+ load it before judging any entry. Then say "N staged updates awaiting+ review" in one line.+7. **First run.** If the log is empty and the project has history (handover+ or decision docs, commit history, test scripts, an existing CLAUDE.md —+ largely a record of corrections nobody logged), offer a one-off backfill+ pass over those artefacts. Backfilled entries cite the durable artefact+ (file and section) in `session_context` instead of a session, and one+ batched write satisfies the same-turn rule. One-off; the scheduled+ review takes over afterwards.## When to Observe@@ -310,66 +286,70 @@ agent consistently fails to follow — convert to structural enforcement orremove. 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 is consuming the session — one-more hypothesis, one more root-cause probe — there is a point at which the-right output is a precise, evidenced problem report, logged as an-observation (or as an issue where the defect belongs to someone else's-code) and the deliverables resumed. Set that point before the second-hypothesis, not after the fifth: a report that names the symptom, what was-ruled out and the cheapest next test is a legitimate deliverable, and it-is what the next session or the upstream maintainer needs; the fix found-in a file the project's own rules protect from unapproved edits was never-going to ship from this session anyway. This skill does not carry-debugging methodology — only the observation-capture rule at the boundary.+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.**Do NOT log:** one-off corrections that don't generalise; preferencesalready captured in a skill; tool bugs unrelated to methodology;-observations that would need proprietary client information to be useful-in an open-source skill (unless an internal skill is the right home). The+observations needing proprietary client information to be useful in an+open-source skill (unless an internal skill is the right home). Thegeneralisability test, when unsure: would this still make sense in anotherproject, and for another task using the same skill? Does it name a missingrule, step or principle rather than fix this task? Is it likely to recur?Mostly no → task context, not an observation. Before minting a-`proposes_skill` name, check the existing candidates and reuse a fitting-one — independently logged proposals for one skill rarely share a name.+`proposes_skill` name, reuse a fitting existing candidate — independently+logged proposals for one skill rarely share a name.**Check for a restatement before writing.** Before creating the file,list the open observations that name the same target skill (the scan at-session start already holds their titles; otherwise-`grep -l "skill:.*<skill>" observation-log/*.md`) and read those titles.-If the finding is the same one restated — the same rule, the same-failure shape, a different example — extend the existing entry instead:-append the new instance to its body and add the session to its-`session_context`, editing that one file. Duplication is only visible in-aggregate; measured on one log, roughly forty of ninety-one open entries-were one finding restated, and a dozen separately minted skill proposals-described two skills. A near-duplicate costs a capture every session and-a triage every review, and adds nothing the first entry did not.--**Validate the target at write time.** A name in `skill:` must be a skill-that exists now; if it doesn't, the observation proposes a skill instead.-Checking is cheap at write time and expensive forty entries later.+session start already holds their titles; otherwise `find observation-log+-name '*.md' -exec grep -l "skill:.*<skill>" {} +`) and read those titles.+If the finding is the same one restated — the same rule, the same failure+shape, a different example — extend the existing entry instead: append the+new instance to its body, add the session to `session_context`, edit that+one file. Duplication is only visible in aggregate (measured on one log:+roughly forty of ninety-one open entries were one finding restated), and a+near-duplicate costs a capture every session and a triage every review.++**Validate the target at write time.** `skill:` names a skill that exists+now. If the right home is not a skill — an instructions file, a memory+note, the register a routine reads — put that path in `target_file:`+instead of mapping the entry onto the nearest skill; if the skill does not+exist yet, use `proposes_skill:`.**Check the target's siblings at write time, and record that you did.**-Libraries accumulate *families* — several skills implementing one-methodology for different tools, one structure for different subjects, one-companion pattern for different base skills. An insight found while using-one member usually applies to the rest, but nothing in the workflow asks,-so `skill:` collapses to a single entry and the family silently diverges.Before writing, resolve the target against the family registry-(`skill-observations/skill-families.md`; spec, coherence models and the-no-registry fallback in `references/observation-log.md`), and for each-sibling either add it to `skill:` or state in the body why it does not-apply. Fast test: **could this sentence survive having the tool's or-subject's name removed?** If yes it belongs to every sibling — and a rule-that declares itself generic inside one artefact ("this applies to any-file-writing script, not just X") is the cheapest possible propagation-signal, so treat that phrasing as an automatic multi-skill flag. Then-record the outcome in the mandatory `siblings_checked:` frontmatter field,-including the verdict "checked — instance-specific, no propagation": a-one-entry `skill:` list is byte-identical whether the siblings were-evaluated or never considered, and only the recorded field makes the-*absence* of the judgement visible to a review or a drift audit.+(`skill-observations/skill-families.md`) and for each sibling either add it+to `skill:` or say in the body why it does not apply. Fast test: **could+this sentence survive having the tool's or subject's name removed?** If+yes it belongs to every sibling. Record the outcome in the mandatory+`siblings_checked:` field, including the verdict "checked —+instance-specific, no propagation": a one-entry `skill:` list is+byte-identical whether the siblings were evaluated or never considered,+and only the recorded field makes the *absence* of the judgement visible.+Load `references/observation-log.md` ("Skill families and the sibling+check") for the registry spec, the coherence models and the fallback when+no registry exists.++**Log your own rule violations.** Breaking a rule that a skill or a project+instruction file documents is a first-class observation, not an+embarrassment to move past: it is the only evidence that the rule's+*enforcement* is too weak, and nobody but the agent can see it. Log it in+the same turn, and name which protection was actually in play — written+down, loaded into context, or backed by a checkpoint. The restatement check+above surfaces the earlier entry when one exists, so the count arrives+without extra work.++**Second violation of the same rule: stop proposing text.** A rule that has+failed twice with no intervening `actioned` fix has a protection problem,+not a wording problem. From the second occurrence the proposed improvement+must be a structural barrier — a hook that refuses the call, a lint rule, a+default that makes the wrong path unavailable — never a clearer sentence, a+bolder warning, or the same rule moved somewhere more prominent. Load+`references/signals.md` ("Second violation — why a barrier, not a+rewording") before proposing either.## How to Log@@ -378,87 +358,47 @@ never batch mentally for later; the act of writing is the enforcementmechanism.**Mandatory checkpoint after every 3rd completed todo item.** After marking-the 3rd, 6th, 9th (etc.) item complete, you must **write to disk** — not-merely ask yourself whether anything is pending. Either write any pending-observation files, or, if genuinely none have accumulated, append a-one-line `no observations` acknowledgement to-`skill-observations/checkpoints.log`. The required action is a concrete-write; a remembered "ask whether" is not enforcement. The count need not be-precise; roughly every third completion is the rule. (Exception: where the-workspace is a shared hosted document store in which every write is priced-and invalidates other sessions' context, suppress the empty marker and-keep only the check — see `references/environments.md`.)+the 3rd, 6th, 9th (etc.) item complete you must **write to disk** — not+merely ask yourself whether anything is pending. Write any pending+observation files, or append a one-line `no observations` acknowledgement+to `skill-observations/checkpoints.log`. The required action is a concrete+write; a remembered "ask whether" is not enforcement. Roughly every third+completion is the rule; the count need not be precise. (Exception for a+priced-write workspace: `references/environments.md`.)**A denied or failed write is not a read-only log.** Retry once before-concluding the workspace is unwritable, and try a second tool that reaches-the same path — a permission classifier can deny one interface while-allowing another, and consecutive denials from a probabilistic gatekeeper-are noise, not a wall. Report "failed N times", never "cannot be done",-unless retries and alternate interfaces are actually exhausted; otherwise-observations are silently lost for the rest of the session.--**Deliverable-event flush.** Whenever you take any action by which a unit-of work is declared complete to a human — presenting a major deliverable-(a file handed to the user, a deck or PDF render, a staged skill file),-sending a completion notification, writing a final report or a status-entry that says "done", or completing a task/todo batch — write any-pending observation files at that moment, before moving on. These checkpoints already involve a-tool call; piggy-backing the flush onto them makes the write a side effect-of work you were doing anyway. (Why both checkpoints are writes rather than-questions: `references/observation-log.md`.)+concluding the workspace is unwritable, and try a second tool reaching the+same path — a classifier can deny one interface while allowing another,+and consecutive denials from a probabilistic gatekeeper are noise, not a+wall. Report "failed N times", never "cannot be done", unless retries and+alternate interfaces are exhausted; otherwise observations are silently+lost for the rest of the session.++**Deliverable-event flush.** Whenever a unit of work is declared complete+to a human — a file handed over, a render, a staged skill file, a+completion notification, a final report, a finished todo batch — write any+pending observation files at that moment. These checkpoints already+involve a tool call, so the flush rides on work you were doing anyway.+(Why both checkpoints are writes rather than questions:+`references/observation-log.md`.)**A failed write to an external system is a flush trigger in its ownright** — a tool result carrying `permission stream closed`, `permission-denied`, or a harness interrupt. It is not a completion, but it has both+denied`, or a harness interrupt. Not a completion, but it has bothproperties the flush needs: it is a literal string in the tool recordrather than a judgement about whether the moment qualifies, and it lands-at the point where a run has just discovered something worth reporting and-is therefore most likely to stop instead. Flush before doing anything else-with the failure, including deciding what to do about it. (Observed: an-unattended run completed every substantive step, took a permission error-on its first write to an external system, and ended without a report or a-logged observation.)--**Two gaps this pairing still leaves — both observed across full working days-in which nothing was logged at all.**--1. *A session can contain no todo items whatsoever.* The 3rd-completion- checkpoint is bound to ONE tool; work driven entirely through direct tool- calls and shell commands never trips it. It is armed only in sessions that- happen to use todos, so it is not a safety net that is always present. When- a session runs without them, the deliverable flush is the only enforcement- left and must be applied deliberately.-2. *"Is this a major deliverable?" is a self-assessment, and self-assessment is- what fails under load.* Prefer triggers unmistakable in the tool record over- ones needing a judgement call. The flush point is a **property, not a- command list**: any action by which a unit of work is declared complete to- a human. A deploy, release, publish, or push qualifies — but so does a- completion notification, a final report, or a status file set to "done".- Each is a concrete tool call, as hard a trigger as a completed todo, and it- reliably marks the end of a unit of work where insights have accumulated.- A command list cannot be the definition: it inherits the shape of the- sessions it was derived from and is silently inert in any session that- declares completion through other tools — no deploy and no version control- does not mean no completions.--The rule behind both: an enforcement trigger must hang on an event objectively-visible in the tool record, never on the agent noticing that a moment qualifies. Visibility is-necessary, not sufficient: a trigger's pattern is a claim about the future tool-record, so before it counts as armed, run the literal event string the project-actually produces through it as a positive control, and one known non-event-from the real tool record as a negative control — never invented examples,-which sample the author's model of the input, the same model that produced-the gap. Record both results next to the trigger. (Observed: a reminder hook-whose six patterns were derived from what the deploy script does internally-never matched the command the project actually types to run it, and had been-inert on its own target since installation; the same day it fired on a-read-only command whose test string merely contained a signal word.)-And a counter bound to a single tool is silently inert in every session that does-not use it — such triggers always need a second, independent path. Nor may a-trigger pre-empt a delivery decision a later layer already owns ("the recipient-is right there, no need to send"): fire the action and let the owning layer-suppress it — a suppressed send leaves a trace in the tool record, an unsent one-leaves nothing.+where a run has just found something worth reporting and is most likely to+stop instead. Flush before doing anything else with the failure, including+deciding what to do about it. (Observed: an unattended run completed every+step, took a permission error on its first external write, and ended with+no report and no logged observation.)++**Two gaps this pairing still leaves:** the 3rd-completion checkpoint is+inert in a session using no todos, and "is this a major deliverable?" is a+self-assessment — so the deliverable flush is the only enforcement left+and must be applied deliberately. Before adding or changing any+enforcement trigger, load `references/observation-log.md` ("Two gaps the+checkpoint pairing still leaves — and the rule behind both").**Id and filename.** Each observation is `NNNN-short-slug.md` (zero-paddedid + a kebab-case slug from the title). The id is the highest of three@@ -479,12 +419,12 @@ seen=$(find "$d" -maxdepth 1 -name '*.md' -print0 | { n=0 # -print0/-d '': nevn=$(( 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 ;;+ case $hdr in # patterns parenthesised: required inside $( ) on bash 3.2+ (*"status: actioned"*|*"status: declined"*|*"status: superseded"*) ;;+ (*) continue ;;esacr=$(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+ 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/"@@ -505,66 +445,34 @@ leading-zero number as octal, so `$(( 0105 + 1 ))` yields 70, and aprefix containing an 8 or 9 errors out.The guard line distinguishes "the log says zero" from "I could not read-the log": a command that fails to empty rather than to error would-otherwise propose id 1 in a populated log. The sweep carries the same-guard in its own right — it counts the files it actually examined and-halts if that count is zero while `find` reports files present. An-archival loop that never enters its body moves nothing and exits-successfully, so without the count "nothing was due for archival" and-"the loop never ran" are the same output. A new file never touches another entry's bytes, so it cannot truncate,-overwrite or renumber anyone else's work — provided it is a new file. If-two parallel sessions pick the same id and different slugs, two files-share a number — harmless; the next review renumbers one and logs a-meta-observation. If they pick the same id and the same slug (two-sessions logging the same finding at the same moment), the path is-identical and the second writer would silently replace the first, which is-why 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.+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.**Run the snippet immediately before EVERY write, including the first and-only one of a session.** Having already read the log directory earlier for-some other reason — the session-start frontmatter scan, a grep for-observations naming the skills in use, a status check — does not substitute-for it, and is the state in which skipping feels most reasonable. A filter-and a maximum are different questions over the same data, and the answer to-one is never evidence about the other; no ad-hoc listing reads `archive/`-or `.id-floor`, which are two of the three inputs and the reason the-command exists. If a collision happens anyway it is harmless but should be-fixed on discovery: derive a correct id, `mv` the file to that prefix, and-edit its `id:` frontmatter field to match.--**Batch writes: resolve each id at its own write time.** When logging more-than one observation in a session that may overlap a scheduled review or-another writer, run the id snippet before EACH file — never pre-compute a-range and hardcode sequential numbers into a batch. A batch append is N-separate races, not one; pre-baked numbers collapse N independent-max-checks into a single stale read (observed: a hardcoded id collided-with one a parallel review issued between the check and the write).+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.++**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+filename and the `id:` field. Load `references/observation-log.md`+("Resolve each id at its own write time") before batching or parallelising.**Every instrument gets the same guard: an empty or zero result is aclaim about the instrument until an independent probe shows the-population is empty.** `SCAN COMMAND BROKEN` and `ID COMMAND BROKEN` are-two instances of one rule, not two rules — a frontmatter scan, an id-derivation, a status grep, a count in a hook, a query in a script all-report on two possibilities at once (the data is absent, or the question-never got asked), and only the second is a defect that a "0" conceals.-So the guard is a property every new instrument arrives with, never a-line added after its first silent failure: pair each number-or-list-producing command with a second count derived by a different means from-a literal path, and halt on the disagreement. A guard enumerated per-snippet is unguarded for the next snippet by construction; a guard stated-as a property of instruments covers the one nobody has written yet.+population is empty.** Load `references/observation-log.md` ("Every+instrument gets the same guard") before writing any new scan, count, grep+or query over the log.**A structural probe that comes back empty where content existed before is-a stop signal, not a create.** If the directory or file you logged to-earlier in the session is suddenly missing, or the id check returns empty-in a log you know is populated, HALT and re-probe the structure (is there-an `observation-log/`? a `log.md.migrated`?) — a parallel session may have-migrated or reorganised the storage. Never let an append silently recreate-a missing target: that converts a migration signal into corruption-(observed: a stale session recreated the retired `log.md` with a fresh-"Observation 1" after the per-file migration renamed it).+a stop signal, not a create** — HALT and re-probe; never let an append+recreate a missing target. Load `references/observation-log.md` ("A+structural probe that comes back empty is a stop signal") before writing+anything after such a probe.**File format.** YAML frontmatter (the metadata every scan reads) followedby the Issue → Improvement → Principle body. **The frontmatter is mandatory;@@ -585,6 +493,8 @@ skill: [skill-a, skill-b] # existing skills this improves — always aproposes_skill: [] # new skills this argues for, by working# name; an observation can fill either# list or both+target_file: [] # when the right home is not a skill at all:+ # the path the fix will be written tosiblings_checked: "family-name: a, b — shared, both added"# MANDATORY, never blank: the family name,# the members evaluated and the verdict —@@ -613,49 +523,23 @@ section or rule; for new skills, scope and key components.]**Every prose value is double-quoted.** `title`, `siblings_checked`,`area`, `session_context`, `resolution`, `parked_until` and `reference`carry free text, and free text contains `: ` as the common case, not the-exotic one ("resolution: Actioned: principle #8 extended…"). Unquoted,-that is invalid YAML: the frontmatter still extracts, so nothing in the-scan notices, but every consumer that PARSES it — a review reading-`status`, a hook counting `skill:` — throws on the file. Measured on one-live log at last verification: 27 of 292 files unreadable, 25 of them in-`resolution:`, every one written by following the earlier unquoted-template. Quote the value (`"…"`, with inner `"` written as `\"`), keep-lists in `[]` with bare kebab-case names, and leave dates and status-words bare. The scan reports suspect headers — a value with an unquoted-`: ` — beside the file count, so a log drifting into this state announces-itself at session start.--**`parked` means decided, not pending.** Use it when an observation is sound-but cannot be acted on until an external precondition is met — the scheduled-task that produced it is disabled, the tool it describes is out of use, a-dependency has not landed. A parked entry is OUT of the work queue: reviews-must not re-escalate it, and the decision belongs in `status:`, not in a-free-text note beside a `status: open` (a note nothing classifies on leaves-the entry in the queue and it gets re-raised at every review). It is not-resolved either, so it never archives — archival needs a resolved status plus-a `resolved:` date. It stays in `observation-log/` indefinitely until either-its `parked_until:` condition is met — set it back to `open` and queue it — or-it is genuinely resolved. `parked_until:` is mandatory whenever status is-`parked`: one line stating the condition, phrased so a later session can-actually answer whether it has happened — and checked, before parking, for-whether it can happen at all: ask who or what would have to act to meet the-condition, and whether that party has a reason to do exactly the opposite-(sometimes as the intended effect of the very thing the entry is waiting to-observe). If the condition cannot occur, the entry is not waiting: close it on-the substitute evidence available today, or park it on a trigger that can-actually fire.--**Context preservation:** if an observation depends on session-local data-(uploads, API output), save that context into the workspace first and set-`reference:` to its path — an observation whose evidence dies with the-session is incomplete. The pointer must survive the handoff too:-`reference:` — like any pointer that hands work to a later session — must-name a durable path, one that outlives the session and a reboot and that-a session other than this one can resolve. A session-scoped temp-directory fails both tests, and a role name ("the scratchpad", "my-notes") is not a path at all. Such a pointer cannot fail at write time,-only at read time, when its author is no longer there to repair it — a-pointer a fresh session cannot follow is not preservation.+exotic one. Unquoted, that is invalid YAML: the frontmatter still+extracts, so the scan notices nothing, but every consumer that PARSES it+throws on the file. Quote the value (`"…"`, inner `"` as `\"`), keep+lists in `[]` with bare kebab-case names, leave dates and status words+bare. Load `references/observation-log.md` ("Frontmatter fields") for how+far this drifts unnoticed and what the scan's suspect count means.++**`parked` means decided, not pending:** sound but blocked on an external+precondition, out of the work queue, never archived, `parked_until:`+mandatory and naming a condition that can actually occur. Load+`references/observation-log.md` ("The `parked` status — decided, not+pending") before setting, reviewing or unparking a parked status.++**Context preservation:** if an observation depends on session-local data,+save it into the workspace first and set `reference:` to a durable path a+fresh session can resolve. Load `references/observation-log.md` ("Context+preservation — the `reference:` field") when setting `reference:`.**Confidentiality at logging time:** for `type: open-source` observations,the Issue/Improvement fields may reference specifics for context, but the@@ -671,20 +555,19 @@ never batch-rewrite the directory. Archival is a plain `mv` (below).## Referencing ObservationsCite an observation by the `id` field in its frontmatter (= the `NNNN-`-filename prefix). Never cite a `grep -n` line number as if it were the id —-search-tool line numbers are positional metadata, not identifiers. A cited-id must fall within the range that exists across `observation-log/`,-`archive/` and `.id-floor`; a number far outside it is almost certainly a-line number misread as an id.+filename prefix), never a `grep -n` line number — those are positional+metadata, not identifiers. A cited id must fall inside the range across+`observation-log/`, `archive/` and `.id-floor`; one far outside it is+almost certainly a line number misread as an id.## Taxonomy (quick version)**Open-source** — client-agnostic, methodology-driven, useful to otherpractitioners. **Internal** — contains user/client/project specifics orpersonal preferences. Default to open-source when it could go either way,-stripping specifics. The boundary is also a confidentiality boundary, and-the two errors are not symmetric: over-classifying as internal costs only-reach, under-classifying can leak — when genuinely uncertain, prefer+stripping specifics. The boundary is also a confidentiality boundary and+the two errors are not symmetric — over-classifying as internal costs only+reach, under-classifying can leak — so when genuinely uncertain, preferinternal and promote later. Full requirements (attribution, licensing,structure): `references/skill-authoring.md`.@@ -694,12 +577,11 @@ Archival is not a preamble duty to remember before writing — it ridesinside the id-derivation snippet above: the same command that computes thenext id first `mv`s already-resolved files from `observation-log/` to`observation-log/archive/`, so the sweep runs whenever an id is issued and-cannot be skipped without failing the write. (The prose form of this rule-— "on every write, first archive" — under-fires: a duty attached as a-preamble to another action inherits none of that action's enforcement; if-a step must always accompany a tool call, put it inside the same command,-not beside it in prose.) The scheduled review archives too, at its Step 1,-as an independent backstop. "Already resolved" is read from the file's+cannot be skipped without failing the write. (The prose form — "on every+write, first archive" — under-fires: a duty attached as a preamble to+another action inherits none of that action's enforcement. If a step must+always accompany a tool call, put it inside the same command.) The+scheduled review archives too, at Step 1, as an independent backstop. "Already resolved" is read from the file'sown frontmatter: `status: actioned`, `declined` or `superseded` AND a`resolved:` date **before today**. Files resolved today stay until the nextday, whichever session resolved them — the grace period lives in the file,@@ -717,24 +599,11 @@ suggested type; ask which to act on. Surface earlier when an observationneeds user input to be complete, when a skill is actively producing wrongoutput, or when observations cluster on one skill.-**Deferral wears a second disguise: not a promise, but an argument.** "Let's-wait until this has seen a few days of real use", "we should gather more data-first" — this reads as diligence, which is exactly why it goes unchallenged,-including by the person saying it. It is not an announcement, so a rule about-executing rather than announcing does not catch it. So before writing *any*-"later" into a recommendation, name two things: **which specific observation-would change the decision, and when it could realistically arrive.** If you-cannot name one, the evidence is either already conclusive (act now) or waiting-adds nothing (act now). A criterion you *can* name must also be able to occur:-ask who or what would have to act for it to fire, and whether that party has a-reason to do exactly the opposite — a deferral whose criterion cannot occur is-indistinguishable from a silent drop, only more expensive, and it looks better-than a vague one because it is precisely phrased. Then ask what the delay-costs — if a known-defective-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.+**Deferral wears a second disguise: not a promise, but an argument** ("let's+gather more data first"). Before writing any "later" into a+recommendation, load `references/signals.md` ("Deferral disguised as+diligence") and name which specific observation would change the decision+and when it could arrive.**Default to log-and-defer.** Surfacing an observation is not an invitationto act on it: state that it is logged for the next review, and stop.@@ -743,6 +612,21 @@ Observations". Do NOT routinely offer a binary "apply now vs leave for nextreview" choice; for users who run regular reviews that offer is unwantedfriction, and if a user has said they always defer, suppress it entirely.+**Log-and-defer means the observation is the sole carrier of the change**,+and applying an insight to the work in front of you is not the same act.+Letting an open observation change what you do in THIS task is the point of+the log. Writing the rule anywhere a later run reads it — a state file the+skill loads (registry, dossier, config note), a prompt, a handoff doc, a+project instruction file — is acting on it. The test: **does it leave a+durable change outside the observation log?** The disguise is a bridge —+"the rule has to live somewhere until the review runs". It does, and that+somewhere is the observation; a parked copy has no update path, so when the+review edits the skill the next run reads both. A state file that genuinely+needs to point at the rule gets one line naming the owner and the pending+change, never a restatement. A harness's skill-save control is the sharper+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 thewhole session (including discussion phases); logged silently; each followsIssue → Improvement → Principle; each is typed; existing-skill items name@@ -759,19 +643,37 @@ skill", "act on observation #N"); (3) in-session correction when a skill isproducing wrong output the user should know about. Otherwise: log, don'tact.-**Read the full body before resolving, dismissing, fixing, or citing.** A-tracked item's title (observation, GitHub issue, ticket) is an index entry,-not its content — it compresses away the failure story, the reporter's-context, and often the proposed fix. Dismissal is the path with no-downstream checkpoint: a resolved or cited item gets reviewed later, a-dismissed one silently disappears. Harvest fix designs from issue bodies —-reporters frequently include the correct solution, which also settles-attribution. When a parallel agent logs a finding that appears to duplicate-your own, diff the two bodies, not the titles: two entries about the same-mechanism can carry opposite operational conclusions, and the second is-often the refinement, not the echo. Apparent agreement suppresses-verification more effectively than disagreement does, so this rule binds-hardest exactly where it feels least necessary.+**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.++**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+skill from inside the conversation — and its tool description may well say+that is how a skill change is delivered — that control writes the installed+copy; it produces nothing under `skill-updates/`. Never use it in a+workspace that stages there. And before any in-session skill change, check+the staging manifest (`skill-updates/PENDING.md`) and today's+`skill-updates/<date>/` for the same skill: a review running in parallel+may already have staged it, built on the live file plus other changes.+Installing a conversation-side copy over that drops those changes, and+installing the review's copy afterwards silently reverts the one the+control installed — a shortcut taken while another session stages the same+artefact turns a one-line rule into a merge conflict the user has to catch.++**Read the full body before resolving, dismissing, fixing, or citing** — a+title is an index entry, not content. **A change you did not make resolves+an observation point by point, never title against title:** list the points+the body makes, name the line of the fix covering each, and any point+without a line stays open on a carrier. Load+`references/observation-log.md` ("Read the full body before resolving,+dismissing, fixing or citing") before any resolve, dismiss or cite step.When acting: small, clearly-additive, low-risk changes (a new rule, aclarification, a factual fix) may be applied without waiting for the next@@ -791,17 +693,20 @@ in-session must have its frontmatter updated — `status: actioned`,ends. The work and the bookkeeping are two acts, and the second is the onethat gets dropped; a stale `open` entry then invites redoing finished workover a section that has since moved on. The write is the enforcement,-exactly as it is for logging.+exactly as it is for logging. **"Acted on" includes a fix that lands as+ordinary work** — the rule written into the instructions file, the code+corrected — with the observation not in mind; and a later session finding+the remedy already in place closes the entry the same way. Neither looks+like acting on an observation, which is why both are missed (measured on+one first review: 10 of 27 entries were already applied while `open`).**Acting on only a subset of a multi-skill observation's `skill:` list?**Neither plain move is honest — left `open`, the finished portion getsre-applied by another session; marked `actioned`, the unfinished portions-silently leave every future queue. Use the carrier pattern: note the claim-in the body while the partial work is in progress, then mark the-observation `actioned` with a `resolution:` naming which portions were-applied, and log a carrier observation holding the remainder with only the-outstanding skills in its `skill:` list. Full protocol:-`references/observation-log.md`.+silently leave every future queue. Use the carrier pattern: mark the+observation `actioned` with a `resolution:` naming the portions applied,+then log a carrier holding the remainder, with only the outstanding skills+in its `skill:` list. Full protocol: `references/observation-log.md`.## Quick Reference@@ -816,6 +721,7 @@ outstanding skills in its `skill:` list. Full protocol:| Citing an observation number? | From the `id:` frontmatter field (= the `NNNN-` filename prefix); never a `grep -n` line number; sanity-check against the known id range || Open-source or internal? | Default open-source; the boundary is confidential || Small fix or substantial? | Additive → apply directly; restructuring/new skill → `references/skill-authoring.md` |+| Same rule broken twice? | The fix is a structural barrier (hook, lint, default) — never a third rewording || Changing an observation (status/archival)? | Re-read that one file, edit only its frontmatter, or `mv` it to `observation-log/archive/` — no shared-file rewrite || Upgrading from a single-file `log.md`? | Scripted, once — `references/migration.md` || Weekly review? | Trigger check at session start; procedure in `references/weekly-review.md` |diff --git a/references/environments.md b/references/environments.mdindex 7d8638a..60ed7df 100644--- a/references/environments.md+++ b/references/environments.md@@ -3,6 +3,28 @@Load this for setup questions, compaction/resume behaviour, or when runningin an environment without filesystem access.+## Contents++- Recommended activation setup+ - The activation block+ - Anchoring the workspace+ - 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+ - 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+- Environment mappings+- Git as an optional staging medium+- First-run backfill+- Storage regimes+- Bundle manifest+- Compaction behaviour+- User-facing documentation+- Repo/maintainer sessions — verify commit identity before writing+- Handoff-doc mode (no persistent storage)+- Handoff-doc analysis (when one arrives)+## Recommended activation setupFour activation tiers exist, and only the strongest is enforced. Pick@@ -85,7 +107,7 @@ the checklist rather than in a disposition.### The activation block-```+```textBefore the first tool call of any session — and before writing orproposing a plan, not merely before executing one — invoke thetask-observer skill AND execute its Session Start Protocol (storage@@ -107,10 +129,18 @@ first task boundary instead of never.Loading a skill is not complete until you have queried the observationlog for OPEN observations naming it and read their bodies:- grep -l "skill:.*<skill-name>" \- [ABSOLUTE PATH]/skill-observations/observation-log/*.md-Apply their insights to the current work, even if the skill file hasn't-been updated yet. Run this at every skill load, however many skills load+ find "[ABSOLUTE PATH]/skill-observations/observation-log" -maxdepth 1 \+ -name '*.md' -exec grep -l "skill:.*<skill-name>" {} ++(Use find, not a bare *.md glob. Under zsh an unmatched glob is an error,+so on an empty log the command never runs and the enclosing block aborts —+and 2>/dev/null does not help, because the redirection belongs to a+command that never starts. This is the first thing that fires on a fresh+install, in every session, for as long as the log is empty.)+Apply their insights to the current work — meaning: let them change what+you do in THIS task. Editing the skill file, or writing the rule into any+other file a later session reads, is acting on the observation and waits+for the review. See "Log, don't act" in SKILL.md: the test is whether the+action leaves a durable change outside the observation log. Run this at every skill load, however many skills loadin one session. The session-start scan does not cover it: that is afrontmatter sweep over every observation at session start, this is abody-level lookup for one skill at the moment its rules are applied.@@ -131,6 +161,12 @@ one agent works this project, the pinned path above is the single sharedlocation; do not derive one per session, tool or project.```+### Anchoring the workspace++SKILL.md's `[workspace folder]` definition states the rule; this is where+to pin it, how a stable anchor still goes plural, and which plural case is+legitimate.+Fill in the path when installing. Pinning turns anchoring into a one-timedecision instead of one the agent re-litigates every session with a freshchance to get it wrong. Pin the ROOT, and list the derived paths: a pin@@ -166,6 +202,29 @@ block in `weekly-review.md` before consolidating anything — it definesthat case and the aggregate review that serves it. A reader who stops atthis paragraph consolidates a set that was meant to stay separate.+**The fork rule as usually stated describes the harmless case.** "A second+**empty** log beside a populated one is a silent fork" — but an empty log+announces itself: the first scan returns nothing, and nobody trusts a+backlog of zero. The damaging fork is the one that has accumulated its own+entries. From inside it looks exactly like a working log: the scan returns+files, the review finds work, every instrument reports health. Nothing in+it can reveal that it is a shard.++And pinning does not settle it. Observed: a workspace pinned in a wired+session-start hook, correctly configured, running beside a second populated+workspace for three days and producing colliding ids. The pin governs the+sessions that read it; it does nothing about a session that resolved its+anchor before the pin, or by another route.++So the detection has to be positive, and it is nearly free: at the end of+the session-start scan the agent is already holding the `skill:` values of+every entry. A log whose targets are overwhelmingly **user-scope** skills,+while the log itself sits under a **per-project** path, has already+declared the mismatch — two `ls` and a comparison. Run it when the anchor+is per-project and the targets are not; report the candidate shard rather+than consolidating on your own judgement, because one plural case is+legitimate (see the multi-log block in `weekly-review.md`).+**Before creating a log, search for one.** Check the plausible anchorcandidates — the pinned path, the project identity root, theenvironment-managed persistence directory, the shared folder, the other@@ -178,8 +237,13 @@ sessions anchored there get redirected instead of re-creating the fork.**Config detection (once per session):** with filesystem access, check theworkspace root's CLAUDE.md (or equivalent) for a task-observer activation-instruction — suggest adding it if absent, creating the file if none-exists. Without filesystem access, check the system prompt / project+instruction — suggest adding it if absent. **Suggest; do not create.** If+no config file exists at all, offer to add one and let the user say yes:+creating a tracked project file changes every future session's behaviour,+and the governance-protected fallback below exists precisely because+writing to a shared config is not a free action. SKILL.md step 4 says+"suggest" and these two are read in sequence, so they must not disagree.+Without filesystem access, check the system prompt / projectinstructions and suggest the user add the instruction there. Keep thesuggestion to a sentence or two. The block above is the propagatedartefact: suggest it whole, including the anchoring paragraph, because@@ -238,7 +302,7 @@ last=$(cat "$d/last-review-date.txt" 2>/dev/null || echo never)msg="Invoke the task-observer skill before the first tool call."if [ "$open" -gt 0 ]; thenmsg="$msg $open open observations; last review: $last."- case "$last" in never) msg="$msg Offer the review." ;; esac+ case "$last" in (never) msg="$msg Offer the review." ;; esacfiprintf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"%s"}}\n' "$msg"```@@ -288,6 +352,130 @@ of tool-using work, activation never happened**; check the activationblock in the config, or install the hook. The README carries the samediagnostic for users who never read this file.+### Activation config — late, intermittent, and why the guard cannot live inside it++SKILL.md step 1 carries the instruction (on turn 1, load the session-start+skills directly rather than assuming the config did, and read the config+yourself if the mount resolves but its content is not in context). This is+the reasoning behind it, and the reason that instruction is only the backup.++In some hosted or bridged session types the activation config — a project+instruction file, a session-start hook's context — does not reach context+until the **second** user turn, while the workspace it lives in is already+mounted and probes clean. From inside turn 1 a config that is merely late is+indistinguishable from one that is absent, so a whole substantive turn can+run with no session-start skill loaded. **A config delivered on a later turn+than the work it governs is equivalent to an absent one for that work.**++It has also been seen **intermittent** rather than merely late: present for+turns 2 and 3 of a bridged session, then reported as no longer present at+turn 4, with no change in the workspace link and nothing the session did to+cause it. So a rule anchored on "once it arrives it stays" fails the same way+a rule anchored on "it arrives first" does. Do not treat an earlier turn's+config as still in force.++The durable form: **a guard against an activation config failing to load+cannot live inside the thing that config loads.** The guard in SKILL.md step+1 is in `task-observer`, which is loaded *because* the config says to load+it — so on the turn where the config is missing, nothing puts that guard in+context either. By construction it cannot fire on turn 1.++The primary guard therefore belongs in the earliest channel verified present+on turn 1 — in most harnesses the user-level preferences or system-prompt+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+guard is the backup for turns 2+ and for sessions where the skill happens to+be loaded directly.++**Log the cause, not just the miss.** When a session-start load is skipped,+the fix depends on which of these it was: *absent* (config unreachable),+*present-but-not-yet-injected* (late — record the turn it arrived), *present+and skipped* (attention), or *loaded-but-not-run* (the invocation succeeded+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.++### Install-layout hazards — three ways a skill silently stops existing++Each of these leaves no error. The skill simply stops being offered, or an+activation tier stops firing, and the only symptom is that the Session Start+Protocol no longer runs — which is indistinguishable from a session where it+ran and found nothing.++**Skill discovery is exactly one level deep.** The host reads the skills+directory and looks for `<entry>/SKILL.md`. There is no recursive lookup. On+a library of any size the natural organising instinct is to group skills into+category folders — `skills/seo/`, `skills/clients/`, `skills/writing/` — and+doing so makes **every skill inside them cease to exist**: no error, no+warning, no change in behaviour except that the skills stop being offered.+There is nothing to debug, because "not found" has no error to report. The+layout is not merely the happy path; it is the rule, and it does not travel+with the maintainer who reorganises six months later. Keep every skill+directly under the skills directory.++**A backup inside the skills directory registers as a rival skill.** The+obvious way to back a skill up before overwriting it —+`cp -r ~/.claude/skills/task-observer ~/.claude/skills/.task-observer-backup`+— puts a second copy where the host is looking. The leading dot does not+exclude it from discovery. The available-skills list then holds two entries+with near-identical descriptions, and the backup still advertises the OLD+version's trigger, including its session-start instruction. That defeats the+upgrade at the one activation tier that survives an unreachable config:+description matching now has two candidates competing for the same trigger,+one of them the file the upgrade just replaced. Back up **outside** the+skills directory.++**A hook registered by script path dies when the exec bit goes.** The+docs' example reads most naturally as naming the script directly:++```json+{ "type": "command", "command": "'/path/to/hooks/task-observer-activation.sh'" }+```++Anything that rewrites file modes — a cloud-drive resync switching between+stream and mirror mode, a restore from an archive, a checkout on a+filesystem without permission bits — returns the file as mode 600, and the+hook then fails with "permission denied" on every session start with+nothing surfacing the error. Observed: the enforced activation tier was+dead for days. Register the interpreter instead+(`"command": "bash '/path/to/hooks/…'"`), which does not depend on the exec+bit, and treat "the Session Start Protocol stopped running" as a prompt to+check the hook rather than the skill.++### Two harness behaviours that block the protocol rather than break it++**A command-shape guard can refuse a read-only call.** Some setups run a+pre-tool hook that inspects the literal command text for governed path+segments combined with a write indicator (`=`, `>`, `cp`, `mv`) and denies+the whole call when both appear anywhere in the string — regardless of+whether the path is actually being written to. Two consequences worth+knowing before diagnosing: a `cd` into a governed directory followed by a+read-only script call is denied even though nothing is written; and a+**blocked command merely quoted inside an observation body** can trip the+same guard when that body is written through a shell. Neither is a+permission problem with the destination. Where this bites, invoke the+script with an absolute path and no `cd`, and write observation bodies with+the editing tool rather than through a shell.++**Staging a harness configuration change is not like staging a skill.** A+skill's `SKILL.md` is read by itself; a corrupted staged copy fails to parse+and nothing else is affected. A harness config file — `settings.json` with+its hook entries, deny-lists and protection rules — is read by the harness,+and it commonly carries **other protections alongside** the thing being+changed. The natural delivery shape for a config change is a fragment:+"here's the new key, add it under `hooks`". A hand-merge that goes wrong+there does not fail loudly; it produces a valid file with the other+protections missing.++So: deliver a config change as a **complete replacement file** built from+the user's current one, never as a fragment to splice in; state in one line+what else that file was carrying, so the user can verify it survived; and+where the harness supports it, prefer a separate file over editing a shared+one.+### If CLAUDE.md (or the equivalent config) is governance-protectedSome setups guard shared config files with hooks or file-protection rulesdiff --git a/references/migration.md b/references/migration.mdindex 1e6b0fc..223efc4 100644--- a/references/migration.md+++ b/references/migration.md@@ -70,10 +70,16 @@ Run from the workspace folder. Python 3.8+, no dependencies.you do not intend to convert:```bash- python3 scripts/migrate-log.py --check \- skill-observations/log.md skill-observations/archive/*.md+ python3 scripts/migrate-log.py --check skill-observations/log.md+ find skill-observations/archive -maxdepth 1 -name '*.md' -exec \+ python3 scripts/migrate-log.py --check {} +```+ Two invocations rather than one glob: the archive directory may not+ exist, and an unmatched `*.md` is a hard error under zsh — which would+ take the live log's check down with it, for want of files that were+ only ever optional.+The archives are free test coverage: they contain format drift thatcurrent entries no longer show, and they exercise parser paths the livelog cannot. Read the flag counts. `needs human review` is the number@@ -110,7 +116,7 @@ Run from the workspace folder. Python 3.8+, no dependencies.```bashgrep -c '^### Observation' skill-observations/log.md- ls skill-observations/observation-log/*.md | wc -l+ find skill-observations/observation-log -maxdepth 1 -name '*.md' | wc -l```Spot-check three files against their originals, including one that was@@ -119,11 +125,19 @@ Run from the workspace folder. Python 3.8+, no dependencies.the whole history, and retire the old file so nothing scans it:```bash- mv skill-observations/archive/*.md skill-observations/observation-log/archive/- rmdir skill-observations/archive+ find skill-observations/archive -maxdepth 1 -name '*.md' \+ -exec mv {} skill-observations/observation-log/archive/ \;+ rmdir skill-observations/archive 2>/dev/nullmv skill-observations/log.md skill-observations/log.md.migrated```+ `find` again, for the same reason as step 6, plus one of its own: a+ bare `mv …/*.md` that matches nothing passes the literal pattern to+ `mv` under bash, which then fails with a confusing "No such file" —+ and under zsh it aborts before `mv` runs at all. The `rmdir` is+ allowed to fail: a directory that still holds something is a signal to+ look, not a reason to stop the migration.+Legacy archives stay in their monolithic format. They were writtenunder conventions that changed several times; converting them wouldfabricate precision the records never had, and nothing reads them on adiff --git a/references/observation-log.md b/references/observation-log.mdindex a882ec0..f456f31 100644--- a/references/observation-log.md+++ b/references/observation-log.md@@ -6,10 +6,45 @@ This file holds the layout in full, the helper snippets, and the reasoningbehind the rules. Load it when setting up the directory for the firsttime, when archiving, when something about ids or frontmatter looks wrong,and before changing how any other tool or skill reads the log.+Also load it, as the core skill's pointers direct, before resolving,+dismissing or citing an observation, when setting `parked` or `reference:`,+before adding or changing an enforcement trigger or writing a new+instrument over the log, and whenever a scan, sweep or id probe comes back+empty.++## Contents++- Layout+- Frontmatter fields+ - Unquoted `: ` in a prose value — how far it drifts before anyone notices+ - A park condition names the result, never your own vehicle+ - Context preservation — the `reference:` field+- Scanning cheaply+ - Why the session-start scan does not satisfy the per-skill check+ - An empty scan over a non-empty log is a broken command+ - Every instrument gets the same guard+- Skill families and the sibling check+- Assigning an id+ - Shell portability of the id snippet — why the case patterns are parenthesised+ - 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+ - 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+- Editing an existing observation+- The `parked` status — decided, not pending+- Partially actioning a multi-skill observation — the carrier pattern+- When the workspace is under version control+- Archival+- Referencing observations+- Why the checkpoints are writes, not questions+ - The scan ends in a write, not only a print+ - Two gaps the checkpoint pairing still leaves — and the rule behind both## Layout-```+```textskill-observations/observation-log/ # the log IS this directory: one file per observation0001-short-slug.md@@ -42,6 +77,7 @@ means this directory.| `type` | `open-source` or `internal` (see Taxonomy in the core skill). || `skill` | **Always a list**, even with one entry, so no consumer ever branches on string-vs-list. First entry is primary. May be empty. || `proposes_skill` | List of new-skill candidates by working name. Independent of `skill`; either may be empty, both may be filled. |+| `target_file` | List of paths, for observations whose right home is not a skill: an instructions file, a memory note, an agent brief, the register a routine reads. Name the file the fix will actually be written to, so a review can go there instead of remapping the entry onto the nearest skill. Measured on a first review of 27 legacy entries: 15 named a non-skill in `skill:` ("browser verification protocol", "documentation hygiene") and every one had to be resolved to a path by hand before the review could start. || `siblings_checked` | **Mandatory, never blank.** Records that the sibling check happened and what it concluded: the family name, the members evaluated, and the verdict (propagated / instance-specific). `none` only where the target belongs to no family. Missing or empty = logged without a sibling check, and reviews count it as such. || `area` | The part of the skill or workflow concerned. || `date` | Date logged, `YYYY-MM-DD`. |@@ -52,20 +88,88 @@ means this directory.| `skill_qualifiers` | Optional map: skill name → the section or part of that skill meant. || `migration_note` | Present only on files converted from a legacy log where the converter refused to guess; clear it once reviewed. |+### Unquoted `: ` in a prose value — how far it drifts before anyone notices++The core states the rule (quote every prose value). This is the measurement+behind it, because the failure is unusually quiet and the scale surprises+people.++An unquoted `: ` inside a free-text value is invalid YAML. The frontmatter+still *extracts* — a regex that slices between the two `---` lines is happy —+so the session-start scan reports the file as parsed and the log looks+healthy. What breaks is every consumer that actually **parses**: a review+reading `status`, a hook counting `skill:`, a validator checking the header.+Those throw on the file, and a thrown file is usually skipped rather than+reported.++Measured on one live log at last verification: **27 of 292 files+unreadable**, 25 of them in `resolution:` — which is the field most likely+to contain a colon, because a resolution naturally reads "Actioned:+principle #8 extended…". Every one of the 27 had been written by following+the template as it then stood, which carried the value unquoted. The+template taught the defect, and each author complied with it.++The scan's `suspect` count is the early warning: it reports headers whose+value contains an unquoted `: ` beside the file count, so a log drifting+into this state announces itself at session start rather than at the review+that trips over it. Re-verify by running a real YAML parse over the+frontmatter of every file, not by re-reading the template.++### A park condition names the result, never your own vehicle++`parked_until:` must name a condition that can occur — but there is a+second, sharper test that the first one passes right past.++"PR #N is merged or closed" waits on a path the other party need not take.+A maintainer folds the change into a commit of their own with a co-author+trailer, cherry-picks it, or rewrites it; the PR stays open or is closed as+overtaken, while **the result the entry was waiting for has fully+arrived**. The condition never fires. Observed twice in the same+repository, which suggests it is the normal case for a contribution to a+repository someone else maintains, not the exception.++So the test is not only *can this condition occur at all* but **can the+result arrive without the condition firing?** For anything depending on+another party's process the answer is yes, so phrase the condition on the+**text of the target artefact** — "rule X is present in `main`'s+SKILL.md" — which is answered by reading the target, whatever route the+change took to get there.++The same applies to any vehicle standing in for a result: a ticket+resolved, a build green, a message replied to. Park on what you actually+need to be true.++### Context preservation — the `reference:` field++**Context preservation:** if an observation depends on session-local data+(uploads, API output), save that context into the workspace first and set+`reference:` to its path — an observation whose evidence dies with the+session is incomplete. The pointer must survive the handoff too:+`reference:` — like any pointer that hands work to a later session — must+name a durable path, one that outlives the session and a reboot and that+a session other than this one can resolve. A session-scoped temp+directory fails both tests, and a role name ("the scratchpad", "my+notes") is not a path at all. Such a pointer cannot fail at write time,+only at read time, when its author is no longer there to repair it — a+pointer a fresh session cannot follow is not preservation.+## Scanning cheaplyRead only the frontmatter — the header block between the first two `---`lines — never the bodies. This is what keeps the session-start scan and-the review's work-queue pass cheap once hundreds of observations exist:+the review's work-queue pass cheap once hundreds of observations exist.+The core skill's Session Start Protocol holds the authoritative copy of+this snippet; the copy below is reproduced for reading in context, and if+the two ever disagree, the core wins:```bash-d="[ABSOLUTE PATH]/skill-observations/observation-log" # the pinned workspace path — re-derive in EVERY call, never relative to the cwd+d="[ABSOLUTE PATH]/skill-observations/observation-log" # the pinned workspace path — re-derive in EVERY call, never relative to the cwd; run under bash, not shn=$(find "[ABSOLUTE PATH]/skill-observations/observation-log" -maxdepth 1 -name '*.md' | wc -l | tr -d ' ') # literal path: independent of $dparsed=$(find "$d" -maxdepth 1 -name '*.md' -exec awk 'FNR==1 {if (/^---[[:space:]]*$/) print FILENAME; nextfile}' {} + | wc -l | tr -d ' ')suspect=$(find "$d" -maxdepth 1 -name '*.md' -exec awk 'FNR==1 && /^---[[:space:]]*$/ {fm=1; next}fm && /^---[[:space:]]*$/ {fm=0; nextfile}fm && /^[a-z_]+: [^"\047[|>].*: / {print FILENAME; nextfile}' {} + | wc -l | tr -d ' ') # values with an unquoted ": " — invalid YAML-for f in $(find "$d" -maxdepth 1 -name '*.md' | sort); do+find "$d" -maxdepth 1 -name '*.md' | LC_ALL=C sort | while IFS= read -r f; do # quote + IFS=: never word-split a path containing a spaceawk 'NR==1 && /^---[[:space:]]*$/ {fm=1; next}fm && /^---[[:space:]]*$/ {exit}fm' "$f"@@ -76,8 +180,30 @@ if [ "$n" -gt 0 ] && [ "$parsed" -eq 0 ]; thenfi[ "$suspect" -gt 0 ] && echo "NOTE: $suspect of $n headers carry an unquoted ': ' in a value — quote those values (File format)"printf 'files: %s parsed: %s suspect: %s\n' "$n" "$parsed" "$suspect"+printf '%s [%s] session-start scan: files=%s parsed=%s\n' "$(date '+%F %H:%M')" "${PWD##*/}" "$n" "$parsed" \+ >> "[ABSOLUTE PATH]/skill-observations/checkpoints.log" # date+time+source: one line per session, not per day```+**Why the line carries a time and a source, not just a date.** The+workspace is deliberately shared across every project that observes the+same globally installed skill — that is the anchoring rule — so+`checkpoints.log` is a multi-project, multi-session file by design. A line+carrying only `YYYY-MM-DD` cannot distinguish two sessions that ran the+same day, which is the common case and precisely the case the file exists+to adjudicate: the whole point of the trace is to show that *this* session+ran the protocol, as opposed to the skill having been loaded and the+protocol skipped. Two same-day lines with identical text prove that one+session did, not which. The time disambiguates the session; the bracketed+source (the working directory's last segment, or any equally cheap+per-project token the harness exposes) disambiguates the project.++The final append is the session-start run's own trace (see "The scan ends+in a write, not only a print"); a review's work-queue pass over the same+frontmatter can drop it. The enumeration is a `find | sort | while IFS=+read -r` loop rather than `for f in $(find …)`: the unquoted command+substitution word-splits any path containing a space, which is a live+hazard on every workspace whose folder name has one.+**Guard the read, not just the write.** A query that returns nothing isreporting on two possibilities at once — the data is absent, or thequestion never got asked — and only one of them is a finding. Guard every@@ -118,6 +244,69 @@ matches nothing, and a filter silently becomes a match-nothing filter;with `find`. Every snippet here defines the paths it uses in the sameinvocation that uses them; keep that property when adapting them.+### Why the session-start scan does not satisfy the per-skill check++**This scan does not satisfy the per-skill check** (the grep run each time a+skill loads — `references/environments.md`, activation block). Different+scope (every skill vs one), different depth (frontmatter vs body),+different moment (session start vs the point the skill's rules are+applied). Both answer "have I looked at the log?", so running this one+discharges the felt obligation and makes the targeted one feel redundant+while leaving its function unperformed — awareness of a hundred titles does+not survive as recall of the one relevant body twenty tool calls later.+Retrieval has to happen where the decision is made.++### An empty scan over a non-empty log is a broken command++**An empty scan in a log known to be non-empty is a broken command until+proven otherwise**, never the finding "no relevant observations". The+snippet's guard is what settles which of the two it is, and both halves of+its independence are load-bearing: the file count comes from a literal+path rather than from the variable the parse loop uses, and the assertion+compares two numbers derived by different means — halt if files exist and+nothing parsed. Keep that independence when adapting the snippet, and keep+every path re-derived inside the same tool call. The reasoning and the+reports each rule came from are in "Guard the read, not just the write"+and "Snippets spanning several tool calls must re-derive their own paths"+above.++### Every instrument gets the same guard++**Every instrument gets the same guard: an empty or zero result is a+claim about the instrument until an independent probe shows the+population is empty.** `SCAN COMMAND BROKEN` and `ID COMMAND BROKEN` are+two instances of one rule, not two rules — a frontmatter scan, an id+derivation, a status grep, a count in a hook, a query in a script all+report on the same two possibilities as the scan above, and only the+second of them is a defect that a "0" conceals.+So the guard is a property every new instrument arrives with, never a+line added after its first silent failure: pair each number-or-list+producing command with a second count derived by a different means from+a literal path, and halt on the disagreement. A guard enumerated per+snippet is unguarded for the next snippet by construction; a guard stated+as a property of instruments covers the one nobody has written yet.++**The guard is scoped by what a command IS, not by what it looks like.**+Both named instances above — `SCAN COMMAND BROKEN`, `ID COMMAND BROKEN` —+are log-reading snippets shipped inside this skill, so the rule reads, in+practice, as being about *those*. It is not, and the gap is precisely where+it costs most: the one-line environment probes run ad hoc mid-investigation,+whose empty result goes straight into a runbook or an observation body as a+fact.++Two observed shapes, both recorded as findings that were not there:++- `ls /usr/bin/*askpass* /usr/lib/ssh/*askpass* …` in an interactive zsh+ printed `no matches found` — a glob error, not an answer — and "no+ askpass helper present" was written down.+- A presence listing over a directory the session lacked permission to read+ returned nothing, and the absence was reported as the state of the system.++Neither command was a "log instrument", so neither attracted the guard.+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".+## Skill families and the sibling checkWhere several skills implement one idea — the same methodology for@@ -131,6 +320,20 @@ file-writing script, not specific to this one", present in one of four,while two of the other three break the same way. Nobody removed anything;some members simply grew and others did not.+**Why the check has to be a write-time step rather than a habit.** An+insight found while using one member usually applies to the rest, and+nothing in the ordinary workflow asks — so `skill:` collapses to the one+skill in front of you and the family diverges quietly. The divergence has+no symptom until someone reads two members side by side, which happens at+a drift audit, months later.++**The cheapest propagation signal is a phrase.** A rule that declares+itself generic *inside one artefact* — "this applies to any file-writing+script, not just X", "true of every companion in this family" — has+already told you it belongs to every sibling. Treat that phrasing as an+automatic multi-skill flag; it costs nothing to notice and it catches the+case the name-removal test is only a proxy for.+The `skill:` field is already a list, so multi-skill observations areexpressible. The mechanism exists; the *check* does not — and a list fieldwith no rule to populate it collapses to a single value. Four parts, in@@ -238,22 +441,30 @@ below) is folded into this same command: every id derivation first movesstale resolved files to `archive/`, so archival happens as a side effectof a step no write can skip.+The core skill's "How to Log" section holds the authoritative copy of this+snippet; the copy below is reproduced for reading in context, and if the+two ever disagree, the core wins:+```bash-d="[ABSOLUTE PATH]/skill-observations/observation-log" # the pinned workspace path, never relative to the cwd+d="[ABSOLUTE PATH]/skill-observations/observation-log" # the pinned workspace path, never relative to the cwd; it may contain a space, so keep it quoted; bash, not shtoday=$(date +%F) # archival rides inside this command (see below):-for f in $(find "$d" -maxdepth 1 -name '*.md'); do # stale resolved files move before the id is read- 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+n_files=$(find "$d" -maxdepth 1 -name '*.md' | wc -l | tr -d ' ')+seen=$(find "$d" -maxdepth 1 -name '*.md' -print0 | { n=0 # -print0/-d '': never word-split a path containing a space — `read -d` is a bash extension, so this loop requires bash+ while IFS= read -r -d '' f; do # stale resolved files move before the id is read+ n=$(( n + 1 ))+ hdr=$(awk 'NR==1 && /^---[[:space:]]*$/ {fm=1; next}+ fm && /^---[[:space:]]*$/ {exit} fm' "$f")+ case $hdr in # patterns parenthesised: required inside $( ) on bash 3.2+ (*"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"; })+[ "$n_files" -gt 0 ] && [ "${seen:-0}" -eq 0 ] && { echo "ARCHIVAL SWEEP BROKEN — $n_files files present, 0 examined"; exit 1; }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}"[ "$hi" -eq 0 ] && [ -n "$(find "$d" -maxdepth 1 -name '*.md')" ] && { echo "ID COMMAND BROKEN — log is non-empty but no ids extracted"; exit 1; }@@ -261,17 +472,23 @@ 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; }(set -C; : > "$f") || exit 1 # noclobber: create, never truncate an existing file-printf '%04d\n' "$next_id" # filename prefix```+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.+The `sed` strips the filename prefixes' zero-padding before thearithmetic. It is load-bearing, not cosmetic: shell arithmetic reads aleading-zero number as octal, so `$(( 0105 + 1 ))` yields 70 — a silentlywrong id — and a prefix containing an 8 or 9 (e.g. `0108`) is an invalidoctal constant and errors the whole derivation.-`ls`, `awk`, `sed -n`, `grep -oE`, `sort -n`, `mv` and `printf` are POSIX;-the snippet runs unchanged on macOS, Linux and Git Bash. The date+`ls`, `awk`, `sed -n`, `grep -oE`, `sort -n`, `mv` and `printf` are POSIX,+and the one non-POSIX construct is deliberate: `read -r -d ''` over+`find -print0` is a bash extension, taken because it is the only form that+cannot word-split a path containing a space — so run the snippet under+`bash`, not `sh`. It runs unchanged on macOS, Linux and Git Bash. The datecomparison relies on ISO dates sorting lexically, so it needs no `date`arithmetic. A skill that hands the agent ashell command owns that command's portability: lead with the portable@@ -280,55 +497,126 @@ has failed — and make any command that derives a number from a file failloudly on an empty result, because a command that fails to empty ratherthan to error may never announce that it failed at all.-**A prior read of the log is not an id derivation.** The snippet runs-immediately before every write, including the first and only one of a-session. The precondition worth naming is the one in which skipping it-feels most reasonable: the directory has already been listed or grepped-earlier in the session for some other purpose — the session-start-frontmatter scan, a filter for observations naming the skills in use, a-status check — and having just read it makes the range feel already-surveyed. It is not. Those are *relevance* queries; the id is a-*maximum*, and the answer to one is never evidence about the other. A-relevance grep returns its highest matching entry, not the highest-entry, and neither it nor any plain listing of `observation-log/` reads-`archive/` or `.id-floor` — two of the three inputs, and the reason the-command exists at all. (Observed: a relevance grep whose top hit was-id N was read as meaning the next id was N+1, over an id already in-use, while the true maximum, sitting in the archive, was twenty higher.)--**Recovering from a collision.** Two files sharing an id is harmless —-distinct files, nothing lost — but should be fixed on discovery rather-than left for a 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.--**Run the snippet once per file when writing a batch.** Appending several-observations in one session that may overlap a scheduled review or another-writer means N separate id races, not one. Pre-computing a base and-hardcoding sequential numbers (e.g. into a multi-entry heredoc) collapses-those N independent max-checks into a single stale read — a parallel-writer's id issued between the check and the write turns the whole batch-into duplicates. Resolve each entry's id against the live directory at the-moment of its own write, and run a post-write per-number count when+### Shell portability of the id snippet — why the case patterns are parenthesised++Both `case` statements in the snippet sit inside the command substitution+`seen=$( … )`, and both are written `(pattern)` rather than `pattern)`. The+leading parenthesis is not style.++Bash 3.2 — which is what `/bin/bash` still is on a stock macOS install — ends+a command substitution at the first unbalanced `)`, and an unparenthesised+case pattern supplies exactly that. The whole block then fails at **parse**+time with `syntax error near unexpected token ';;'` and exits 2. Nothing+inside it runs: no archival sweep, no id, no file, and — the part that makes+it hard to diagnose — neither `ARCHIVAL SWEEP BROKEN` nor `ID COMMAND BROKEN`+can fire, because those guards are inside the block that never started. A+guard cannot report a failure that happens before it exists.++Parenthesised patterns are valid in every POSIX shell and in every bash+version, so the portable form costs nothing. Keep it in every copy of the+snippet, here and in SKILL.md.++**If you are porting the snippet or writing a new one:** run it once under+`/bin/bash` on macOS, not only under the shell your session happens to have.+`bash -n <file>` is enough — it parses without executing, so it is safe to+run against a snippet that would otherwise write to the log.++### The guard line, the sweep's count and the noclobber create++The guard line distinguishes "the log says zero" from "I could not read+the log": a command that fails to empty rather than to error would+otherwise propose id 1 in a populated log. The sweep carries the same+guard in its own right — it counts the files it actually examined and+halts if that count is zero while `find` reports files present. An+archival loop that never enters its body moves nothing and exits+successfully, so without the count "nothing was due for archival" and+"the loop never ran" are the same output. The `noclobber` create covers+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.++### Run the snippet immediately before every write++**Run the snippet immediately before EVERY write, including the first and+only one of a session.** Having already read the log directory earlier for+some other reason — the session-start frontmatter scan, a grep for+observations naming the skills in use, a status check — does not substitute+for it, and is the state in which skipping feels most reasonable. Those are+*relevance* queries; the id is a *maximum*, and the answer to one is never+evidence about the other: a relevance grep returns its highest **matching**+entry, not the highest entry, and neither it nor any plain listing of+`observation-log/` reads `archive/` or `.id-floor`, which are two of the+three inputs and the reason the command exists. (Observed: a relevance grep+whose top hit was id N was read as meaning the next id was N+1, over an id+already in use, while the true maximum, sitting in the archive, was twenty+higher.) If a collision happens anyway it is harmless — distinct files,+nothing lost — but should be fixed on discovery rather than left for a+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.++### Resolve each id at its own write time++**Every write, not just batched ones.** An earlier version of this rule+opened "when logging more than one observation in a session that may+overlap a scheduled review or another writer" — two scope conditions, and a+single write in a session that looks like it overlaps nothing satisfies+neither. The reported failure was exactly that shape: one observation, the+snippet run in the same shell call printing `next_id=92`, and the heredoc+that followed carrying `91` in both the filename and the `id:` field. A+parallel session had written `0091` in between. The scope conditions are+gone: run the snippet before **each** write, including the first and only+one of a session.++**Write the value the snippet printed.** This is the step the rule never+stated, and it is where that failure actually happened — not in deriving+the id, which was correct, but in the gap between deriving it and typing it.+The number the snippet prints goes into the filename **and** the `id:`+field, copied, not retyped from memory of what you expected it to be. If+the two disagree, the file is the one every later scan believes.++**Never pre-compute a range.** A batch append is N separate races, not one;+pre-baked sequential numbers collapse N independent max-checks into a+single stale read. Resolve each entry's id against the live directory at+the moment of its own write, and run a post-write per-number count whenoverlap is plausible.-**An empty probe over a populated log is a migration signal, not a zero.**-If a structure you wrote to earlier in the session has vanished — the-directory is missing, the id extraction returns empty where ids existed —-stop and re-probe the layout (`observation-log/` present? a-`log.md.migrated` tombstone?) before writing anything. A parallel session-may have migrated or reorganised the storage; a writer's model of shared-mutable state is only as fresh as its last read. Append paths must fail-loudly on a missing target, never silently create it — auto-creation-converts the signal into corruption (see `migration.md` on coexistence-with live sessions). **This rule covers reads as well as writes.** A-retrieval that comes back empty over content you know exists — the-session-start scan, a filter for observations naming the current skills, a-grep for a prior finding — is the same signal wearing different clothes,-and it is more dangerous, because a broken read produces no error and its-result ("nothing relevant") is a legitimate possible answer. Re-probe-before acting on it (see "Guard the read, not just the write" above).+**Observation writes are not independent calls — do not parallelise them.**+Harnesses commonly instruct the agent to issue independent tool calls in+one block, for latency. Observation writes look independent (different+files, no shared variable) and are not: each one's id depends on the state+the previous one leaves behind, so two writes dispatched in the same block+both read the same maximum and mint the same number. This is a third source+of collision, alongside a parallel session and a subagent of this session,+and it is the only one that lives entirely inside a single agent's own+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.++### A structural probe that comes back empty is a stop signal++**A structural probe that comes back empty where content existed before is+a stop signal, not a create.** If the directory or file you logged to+earlier in the session is suddenly missing, or the id check returns empty+in a log you know is populated, HALT and re-probe the structure (is there+an `observation-log/`? a `log.md.migrated`?) — a parallel session may have+migrated or reorganised the storage. Never let an append silently recreate+a missing target: that converts a migration signal into corruption+(observed: a stale session recreated the retired `log.md` with a fresh+"Observation 1" after the per-file migration renamed it; see+`migration.md` on coexistence with live sessions). A writer's model of+shared mutable state is only as fresh as its last read.++**This covers reads as well as writes.** A retrieval that comes back empty+over content you know exists — the session-start scan, a filter for+observations naming the current skills, a grep for a prior finding — is the+same signal wearing different clothes, and it is the more dangerous half,+because a broken read produces no error and its result ("nothing relevant")+is a legitimate possible answer. Re-probe before acting on it (see "Guard+the read, not just the write" above).### Why this is the entire concurrency story@@ -357,6 +645,22 @@ every item after it, exactly the shape of the sixteen-entry loss above.Re-read the region after the edit and count what survived against whatwas meant to survive.+## Read the full body before resolving, dismissing, fixing or citing++**Read the full body before resolving, dismissing, fixing, or citing.** A+tracked item's title (observation, GitHub issue, ticket) is an index entry,+not its content — it compresses away the failure story, the reporter's+context, and often the proposed fix. Dismissal is the path with no+downstream checkpoint: a resolved or cited item gets reviewed later, a+dismissed one silently disappears. Harvest fix designs from issue bodies —+reporters frequently include the correct solution, which also settles+attribution. When a parallel agent logs a finding that appears to duplicate+your own, diff the two bodies, not the titles: two entries about the same+mechanism can carry opposite operational conclusions, and the second is+often the refinement, not the echo. Apparent agreement suppresses+verification more effectively than disagreement does, so this rule binds+hardest exactly where it feels least necessary.+## Editing an existing observationStatus changes and archival touch exactly one file. Re-read that file@@ -373,6 +677,99 @@ ownership fence: an explicit in-scope list by id, an explicit out-of-scopelist, and the instruction that each session edits status only on its ownids.+**Re-check ownership immediately before the first write, not at planning+time.** "Is anyone else working on this?" is answered from two sources that+are both honest and both stale the moment they are read: a handoff or+manifest state, and a session listing. A **paused** session has not released+its task — it is idle, it reads as idle, and it can resume at any moment+with its own decisions intact.++Observed: a long multi-step review was left paused partway through, its+state saying "waiting on the user's decisions" and the listing showing it+not running. A second session checked both at planning time, correctly+concluded the first was idle, and planned to take over. Before it made its+first write the user resumed the first session, which then recorded its+decisions and completed most of the work. Had the second session written,+it would have re-asked the user decisions they had already made.++So the check belongs immediately before the first write, in the same turn —+the same rule as re-reading a file before editing it, for the same reason.+Planning-time evidence of idleness has a shelf life of exactly as long as+the planning takes. And prefer a check on **the result** — has the work+already landed in the target? — over a check on the vehicle, since a paused+session's state says nothing about what it is about to do.++**Edit log files with the editing tool — never `sed -i`, `perl -pi`, or a+redirection over the file.** No exception for a quick fix or a temporary+negative test; the temptation peaks exactly on a file with uncommitted work+and nothing to fall back to.++Rewriting a text file from the shell passes the replacement through the+shell's quoting first, and what arrives is not always what was typed. An+unescaped `$` inside a double-quoted replacement has landed in a source+file as a NUL byte, turning the file binary — and **the command exited 0**.+The damage surfaced later and by accident, when a `grep` answered "Binary+file matches" instead of the expected line.++Observation bodies make this sharply worse than it sounds. They are full of+backticks, `$`, quotes and braces, because they quote commands and+frontmatter for a living. A heredoc is the natural way to write one from a+shell, and an **unquoted** heredoc executes every backticked span inside+it: the file is created, it looks superficially right, and parts of its+content have been replaced by the output of commands. Quote the delimiter+(`<<'OBS'`) whenever a shell write is genuinely the only path — a+`set -C` noclobber create has no editing-tool equivalent — and prefer the+editing tool everywhere else.++If a shell write happened anyway, **verify the file is still text before+doing anything else**: `file "$f"` or a `grep -c ''` that does not answer+"Binary file matches".++**A declined entry records a verdict; without its premise the verdict+cannot be revisited.** `declined` means someone judged an alternative+unworkable, and that judgement is a factual claim which can be wrong — in+which case it silently vetoes the better solution forever, because every+later reader finds the decision already made.++Observed: an entry recorded that a helper had been rejected because it+"would die hard inside a nonfatal wrapper and leak the session it had+started". Plausible, specific, and completely unfalsifiable from the entry+itself — no file, no line, no command. A later session read the helper's+source: it uses the library's return-instead-of-exit form under exactly+that wrapper, so the stated failure could not occur. The premise was simply+false. The helper was adopted and improved both call paths. Between those+two sessions the entry did its job perfectly — it was read, believed, and+honoured.++So a `resolution:` on a declined entry carries **the evidence, not only the+verdict**: what was examined (file, line, command, output), and what would+have to be true for the decline to be wrong. And re-reading a declined+entry obliges you to check that its premise still holds before relying on+it — a decline is the one status whose correctness nothing downstream ever+tests.++## The `parked` status — decided, not pending++**`parked` means decided, not pending.** Use it when an observation is sound+but cannot be acted on until an external precondition is met — the scheduled+task that produced it is disabled, the tool it describes is out of use, a+dependency has not landed. A parked entry is OUT of the work queue: reviews+must not re-escalate it, and the decision belongs in `status:`, not in a+free-text note beside a `status: open` (a note nothing classifies on leaves+the entry in the queue and it gets re-raised at every review). It is not+resolved either, so it never archives — archival needs a resolved status plus+a `resolved:` date. It stays in `observation-log/` indefinitely until either+its `parked_until:` condition is met — set it back to `open` and queue it — or+it is genuinely resolved. `parked_until:` is mandatory whenever status is+`parked`: one line stating the condition, phrased so a later session can+actually answer whether it has happened — and checked, before parking, for+whether it can happen at all: ask who or what would have to act to meet the+condition, and whether that party has a reason to do exactly the opposite+(sometimes as the intended effect of the very thing the entry is waiting to+observe). If the condition cannot occur, the entry is not waiting: close it on+the substitute evidence available today, or park it on a trigger that can+actually fire.+## Partially actioning a multi-skill observation — the carrier pattern`status:` is per-observation, but `skill:` is a list, so the lifecycle@@ -500,3 +897,58 @@ a file, rendering a deck, completing a todo batch) means the write happensas a side effect of work you were doing anyway, rather than depending on aseparate act of memory. The count need not be precise; roughly every thirdcompletion is the rule.++### The scan ends in a write, not only a print++Loading this skill and executing this protocol are two acts, and only the+load leaves an artefact in the transcript — which discharges the felt+obligation, so a session that loaded and then ran nothing looks from+outside exactly like one that did both. The appended `checkpoints.log`+line is the protocol's own trace, for the same reason the checkpoint rule+is a write: a step whose value lies in happening at a specific moment needs+its own entry in the tool record. (Where the workspace prices every write —+the exception under "How to Log" — fold this line into the session's first+write instead.)++### Two gaps the checkpoint pairing still leaves — and the rule behind both++**Two gaps this pairing still leaves — both observed across full working days+in which nothing was logged at all.**++1. *A session can contain no todo items whatsoever.* The 3rd-completion+ checkpoint is bound to ONE tool; work driven entirely through direct tool+ calls and shell commands never trips it. It is armed only in sessions that+ happen to use todos, so it is not a safety net that is always present. When+ a session runs without them, the deliverable flush is the only enforcement+ left and must be applied deliberately.+2. *"Is this a major deliverable?" is a self-assessment, and self-assessment is+ what fails under load.* Prefer triggers unmistakable in the tool record over+ ones needing a judgement call. The flush point is a **property, not a+ command list**: any action by which a unit of work is declared complete to+ a human. A deploy, release, publish, or push qualifies — but so does a+ completion notification, a final report, or a status file set to "done".+ Each is a concrete tool call, as hard a trigger as a completed todo, and it+ reliably marks the end of a unit of work where insights have accumulated.+ A command list cannot be the definition: it inherits the shape of the+ sessions it was derived from and is silently inert in any session that+ declares completion through other tools — no deploy and no version control+ does not mean no completions.++The rule behind both: an enforcement trigger must hang on an event objectively+visible in the tool record, never on the agent noticing that a moment qualifies. Visibility is+necessary, not sufficient: a trigger's pattern is a claim about the future tool+record, so before it counts as armed, run the literal event string the project+actually produces through it as a positive control, and one known non-event+from the real tool record as a negative control — never invented examples,+which sample the author's model of the input, the same model that produced+the gap. Record both results next to the trigger. (Observed: a reminder hook+whose six patterns were derived from what the deploy script does internally+never matched the command the project actually types to run it, and had been+inert on its own target since installation; the same day it fired on a+read-only command whose test string merely contained a signal word.)+And a counter bound to a single tool is silently inert in every session that does+not use it — such triggers always need a second, independent path. Nor may a+trigger pre-empt a delivery decision a later layer already owns ("the recipient+is right there, no need to send"): fire the action and let the owning layer+suppress it — a suppressed send leaves a trace in the tool record, an unsent one+leaves nothing.diff --git a/references/signals.md b/references/signals.mdindex df3c920..4110eb2 100644--- a/references/signals.md+++ b/references/signals.md@@ -5,6 +5,20 @@ catalogue with examples. Load it when you are unsure whether something isworth logging, when a session is producing many candidate observations andyou want to sort them, and during a review when deciding what a skillshould lose as well as gain.+Also load it when a defect that is not the deliverable is consuming the+session, and before writing any "later" into a recommendation.++## Contents++- Signals for a NEW skill+- Signals for IMPROVING an existing skill+- Signals for SIMPLIFYING a skill+- The generalisability test+- An unresolved defect is an observation, at a bounded point+- Second violation — why a barrier, not a rewording+- Do NOT log+- Where the observation mindset stays on+- Deferral disguised as diligence## Signals for a NEW skill@@ -63,6 +77,62 @@ deciding when shared modules should be centralised". Knowing when *not*to learn is as important as detecting signals: over-learning from isolatedexamples is how a skill drifts into over-specific complexity.+## An unresolved defect is an observation, at a bounded point++**An unresolved defect is an observation, at a bounded point.** When a+defect that is not itself the deliverable is consuming the session — one+more hypothesis, one more root-cause probe — there is a point at which the+right output is a precise, evidenced problem report, logged as an+observation (or as an issue where the defect belongs to someone else's+code) and the deliverables resumed. Set that point before the second+hypothesis, not after the fifth: a report that names the symptom, what was+ruled out and the cheapest next test is a legitimate deliverable, and it+is what the next session or the upstream maintainer needs; the fix found+in a file the project's own rules protect from unapproved edits was never+going to ship from this session anyway. This skill does not carry+debugging methodology — only the observation-capture rule at the boundary.++## Second violation — why a barrier, not a rewording++The core carries the rule: from a rule's second failure onward, the proposed+improvement is a structural barrier, not better wording. This is why, and+what counts as a barrier.++The observed case: one documented rule broken three times in three separate+sessions. The rule lived in a project instruction file re-read at the start+of every session, so it was never "unloaded" — it was in context each time+it broke. Each occurrence was handled correctly by the text as it then+stood, and the first two produced only new wording:++| Occurrence | What was logged | What changed |+|---|---|---|+| 1st | rule broken, add a post-write check | wording |+| 2nd | rule broken *again*, same rule | wording, more emphatic |+| 3rd | "this needs a barrier, not a rule" | a pre-tool hook that refuses the call |++Only the third changed the outcome. The first two were not mistakes in+diligence — they were the natural output of a loop whose only available+lever is text.++**Why text loses.** A rule in context is re-interpreted on every run and+competes with everything else pulling at the same moment; a barrier at the+tool boundary does not compete, it refuses. Emphasis does not change that+asymmetry — an emphatic rule is still a rule, and the third rewrite reads as+diligence while changing nothing measurable.++**What counts as a barrier**, roughly in order of preference: a hook or+permission rule that refuses the call; a lint or gate check that fails the+artefact; a default or path layout that makes the wrong action unavailable;+a script that performs the step so it cannot be performed differently. What+does not count: a bolder warning, the same rule moved somewhere more+prominent, a checklist item, or a promise to be careful.++**Where this matters most** is the class where the absence of an error is+not evidence of success — silent corruption, a command that exits 0 having+done the wrong thing, a check that cannot come out negative. There, a+missed rule produces no signal at all, so the loop that would eventually+catch a wording failure never starts.+## Do NOT logOne-off corrections that don't generalise; preferences already captured in@@ -79,3 +149,24 @@ observation mindset does not deactivate when the conversation shifts fromdoing the work to discussing it — user feedback in review phases is oftenthe highest-signal input. Inactive only for casual conversation and quickfactual questions with no tools or deliverables involved.++## Deferral disguised as diligence++**Deferral wears a second disguise: not a promise, but an argument.** "Let's+wait until this has seen a few days of real use", "we should gather more data+first" — this reads as diligence, which is exactly why it goes unchallenged,+including by the person saying it. It is not an announcement, so a rule about+executing rather than announcing does not catch it. So before writing *any*+"later" into a recommendation, name two things: **which specific observation+would change the decision, and when it could realistically arrive.** If you+cannot name one, the evidence is either already conclusive (act now) or waiting+adds nothing (act now). A criterion you *can* name must also be able to occur:+ask who or what would have to act for it to fire, and whether that party has a+reason to do exactly the opposite — a deferral whose criterion cannot occur is+indistinguishable from a silent drop, only more expensive, and it looks better+than a vague one because it is precisely phrased. Then ask what the delay+costs — if a known-defective+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.diff --git a/references/skill-authoring.md b/references/skill-authoring.mdindex 0ad053a..bd6ce6c 100644--- a/references/skill-authoring.md+++ b/references/skill-authoring.md@@ -2,13 +2,26 @@Load this before creating any skill or making substantial changes to one.-**Contents:** Taxonomy in full · The Pre-Flight Principle · Lean Content-(including progressive disclosure, the default structure above ~500 lines)-· Documenting an external tool surface · Licensing · Versioning releases ·-Author Attribution Template · Confidentiality layers · Timelessness ·-Editing skills — always start from the live file · Verifying relocations-and restructures · Trial design · New skills · Retiring skills · Principle-Propagation.+## Contents++- Taxonomy in full+- The Pre-Flight Principle+- Lean Content (including progressive disclosure, the default structure+ above ~500 lines)+- Configuration vs process — the three-container rule+- Documenting an external tool surface+- Licensing+- Versioning releases+- Author Attribution Template+- Confidentiality layers+- Timelessness — shared skills must not capture current state+- Editing skills — always start from the live file+- Declaring a block's scope mechanically+- Verifying relocations and restructures+- Trial design — measuring whether a behaviour fires unprompted+- New skills+- Retiring skills — harvest before you retire+- Principle Propagation## Taxonomy in full@@ -79,6 +92,46 @@ and only `--untracked-files=all` expands it. Before shipping a verificationstep that reports a number, confirm what the number's unit is, andenumerate and read the set whenever enumeration is cheap.+**A list of sources is an embedded command too.** The rule above is easy to+read as being about shell snippets, because those are what "command" looks+like. It is not: it governs anything the skill instructs a future session to+*use* without checking — and a URL, an API endpoint, a database name, a file+path or a tool invocation is exactly that. A skill whose core is "consult+these sources" ships its sources the way another ships a command.++Observed on one such skill: eight sources, all plausible, all written down+without being tried. **Four were unusable** — two returned 403 even with a+browser user agent, one returned "Making sure you're not a bot!", and one+returned an empty single-page-app shell with no results. Every one of them+read as correct on the page, and would have gone on reading as correct on+every later re-read.++Why this is worse than a broken shell command: a broken command fails+loudly, and the session knows to stop. An unreachable source returns+*something* — an empty result set, a login page, a shell — and the natural+reading of an empty result is "nothing matched", which is a finding. The+skill then teaches a future session to report absence where there was only+a blocked door. Execute every source once, against real data, before the+skill file is saved; record which ones were tried and what they returned.++**A verification that cannot come out negative is not a verification.**+Before shipping any check, ask what it would look like if the thing being+checked had failed — and if the answer is "the same", the check is+decoration. The trap has a characteristic shape: the artefact being+inspected was produced or touched by the same session doing the inspection.+Observed: a set of bundles was published to a remote destination and+verified by reading a local extraction folder that the same session had+written the corrected content into. It would have reported "all correct"+had the publication failed completely.++What distinguishes arrival from non-arrival is a **discriminator** — a+value only the far side can produce: a server-assigned identifier, an+upstream timestamp, a digest computed remotely, a field the local copy has+no way to fabricate. Hash-matching a published artefact against your own+source is not one, because both sides are yours. Name the discriminator+when writing the check, and if you cannot name one, say the step is+unverified rather than writing a check that always passes.+## Lean ContentA skill should contain only content that changes the agent's behaviour at@@ -301,6 +354,25 @@ is modified or may have drifted, verify the problem still exists atupstream HEAD before reporting it; (4) match the repository's house stylefor reports.+**Pre-send gate — run on the finished draft, after the pre-flight.** The+pre-flight decides whether and where a report goes; nothing reads the+finished text for what must not be in it, and **a check that only confirms+required parts is passed by adding, never by leaving out**. Before sending,+search the finished draft for every identifier the workspace keys carry —+the project or client name in each participating workspace root, hostnames,+account identifiers — expecting 0 hits, with a positive control on a text+known to contain one. A generic path segment the skill itself names+(`skill-observations`, `observation-log`) is not an identifier and stays+off the list.++The failure this prevents: a verification report posted to an upstream+maintainer carried two private project names, because the multi-log block+asks that every id leaving its log carry its workspace key, and in a local+install the key IS the project's directory name. The report complied with+the rule and leaked because of it. A human noticed about ten minutes after+posting; the fix was delete and re-post, because an edit leaves the first+version in the edit history.+## Confidentiality layersThe open-source/internal boundary is a confidentiality boundary; enforce it@@ -312,10 +384,11 @@ in layers so any one catches what others miss:skill, scan all source material for client names, URLs, domains,internal terminology, identifiably-specific structures; replace withgeneric equivalents first.-3. **Post-draft sweep** — a separate re-read focused only on leakage:- proper nouns besides the author, domains/URLs/project identifiers,- vertical details that narrow the client, examples traceable to a real- project.+3. **Post-draft sweep** — a separate re-read focused only on leakage.+ Read the examples, usage strings, default arguments and fixtures+ **first** (layer 8 says why), then proper nouns besides the author,+ domains/URLs/project identifiers, vertical details that narrow the+ client, examples traceable to a real project.4. **Structural principle** — when in doubt, remove. Slightly more genericbeats slightly leaky.5. **Cross-product re-identifiability sweep** — the final pass before any@@ -374,6 +447,29 @@ in layers so any one catches what others miss:writes into: internal registries can name internal things; publicartefacts reference them by capability, not by name.+8. **Examples are synthetic by construction, not scrubbed afterwards** —+ examples, usage strings, default arguments, test fixtures and sample+ payloads are the highest-risk text in a skill and the least reviewed.+ Their whole purpose is to have been real: an example is pasted from a+ working run precisely so that it works, so live data survives a scrub+ there more reliably than anywhere else. Write them synthetic at+ authoring time — a generic label and a round number in the shape the+ argument or payload actually takes, which still teaches the format.+ This layer is prospective, and it has to be, because no term-based+ scan can back it up: a confidentiality scan matches names, domains and+ handles, and a **number** is not one of those. Nor can such a scan+ usefully be keyed on a vertical or category noun — a generic category+ word fires on nearly every file, so adding it to the tripwire list+ trades one failure mode for a worse one. A clean scan is therefore+ evidence about the listed terms only, and says nothing about whether+ an example carries a real allocation, count, date or sample payload.+ This is the house rule that every instrument gets the same guard, in+ its confidentiality form: an empty result from an instrument that+ cannot see the object is not evidence of absence. So the sweep in+ 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.+## Timelessness — shared skills must not capture current stateAny skill leaving the author's own maintenance loop (published, or shared@@ -403,8 +499,33 @@ instruction for how to re-verify against the live source; readers need toknow how to re-check a claim, not when the author last did. The same rulecovers 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 grep public artefacts for month-name + year-patterns before committing — a scan, not a reminder.+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.++**The internal-document exemption assumes a maintenance loop that is only+prose.** The taxonomy sanctions internal skills that describe one+installation, and those may legitimately name current state. The unstated+assumption is that someone re-checks that state — but nothing fires when it+drifts, so "internal, therefore dated facts are fine" becomes "internal,+therefore permanently wrong".++Observed: an internal skill opened with a hardcoded version number of the+system it described; the deployed system moved on and the skill's first+paragraph was wrong within a day. It was the second time the same number+had gone stale, and five further copies sat in memory files and handover+notes. The first paragraph is where it does most damage, because it is read+before anything that might contradict it.++So an internal skill may carry current state only with a **named+re-check**: what re-derives the value, and when. "Version X (re-derive from+`<command>` at each review)" is acceptable; a bare number is not. Where no+re-check exists, do not record the value — record how to obtain it.## Editing skills — always start from the live file@@ -485,7 +606,17 @@ patterns before committing — a scan, not a reminder.set, not just the one that failed — the pressure toward trigger-richdescriptions puts others near the boundary too, and only measuring theset reveals it; (4) `name` is kebab-case and matches the containing- directory; the frontmatter parses as YAML with both required keys;+ directory; the frontmatter parses as YAML with both required keys. A+ `description:` (or `name:`) value that contains `: ` anywhere, or that+ starts or ends with a YAML-special character (`#`, `*`, `&`, `!`, `|`,+ `>`, `{`, `[`, `'`, `"`), must be double-quoted or reworded to avoid+ the colon — an unquoted `: ` inside the value turns the rest of the+ line into a nested key and the whole block stops parsing. The+ validator reporting "`name` missing" on a frontmatter that visibly has+ a `name:` line is the signature of an unparseable block, not of a+ missing field: fix the quoting, not the name. The quoting rule for the+ observation-log frontmatter does not travel here by analogy; it is+ stated here because this is where skill frontmatter is authored;(5) the packed archive's member paths contain no backslash — read asRAW central-directory bytes, because CPython's `zipfile` normalises`0x5C` to `/` on read and reports a malformed archive as clean; Windows@@ -562,6 +693,59 @@ patterns before committing — a scan, not a reminder.rewrite, found only because the prompt happened to be opened for anunrelated reason).+**Verifying an edit is a separate problem, and the loader works against+you.** The rules above cover editing safely; nothing covers confirming+afterwards that the edit took. Three things get conflated — the file on+disk, the copy the loader injected into this session, and what a fresh+session would receive — and they can all differ at once.++Observed, in one session: the loader served a *previous lineage* of a+`SKILL.md`, missing an entire section and stating the opposite rule on a+formatting standard, while the file on disk (hash-verified, edited 45+minutes earlier in that same session) carried the corrected text. Answering+from the injected copy would have given the user exactly the wrong answer+on a normative question. It was caught only because someone grepped the+file on disk for a literal quote.++The obvious remedy fails too: launching a subagent to simulate "a fresh+session" does not break the freeze. A subagent's context starts cold but+its skills come from the **same snapshot**, so it reports the same stale+content with the added authority of an independent-looking check.++So: **verify an edit by reading the file on disk**, never by asking the+loaded skill what it says and never by asking a subagent. And when the+question is what a *future* session will receive, only a genuinely new+session answers it — the installing session structurally cannot.++## Declaring a block's scope mechanically++A section of an instructions file, a skill, or a shared config often applies+to only some of the work done on a machine. The usual approach is to trust+the agent to notice the irrelevance from context. That fails quietly, and it+fails in the direction that does damage: advice written for one domain is+applied confidently to another.++Instead, open the block with a **detectable condition** — something the+agent can check rather than infer:++> Applies ONLY when the project has a `package.json` with a `react`+> dependency. In every other project, ignore this section entirely.++Observed working in both directions inside a single session on a machine+serving two unrelated lines of work: the section stayed inert while the+working directory was a documents folder, and governed the whole workflow+once a React project was open.++**State the negative branch explicitly**, because it is the half that gets+left out. "Applies when X" reads as complete and leaves the agent to decide+what happens otherwise; "and in every other case ignore this entirely" is+the sentence that makes the block safe to carry. A condition with no stated+negative is a preference, not a scope.++Prefer conditions the agent can test cheaply and locally — a file's+presence, a path segment, a declared dependency — over ones needing+judgement ("when working on frontend tasks").+## Verifying relocations and restructuresTwo modes, and picking the wrong one is why a good move looks broken.@@ -645,6 +829,29 @@ enforcement machinery because it reads as redundancy — and sweep any "purerestructuring" change for net-new behaviour, which hides well in a largerewording diff.+**Build a relocation as a re-runnable derivation, not a one-off patch.** A+relocation verified against the base as it stood at build time is correct+only for that base. If a concurrent edit lands on the live file before+delivery — inside the very block being moved — laying the finished target+files over the new tip **silently reverts it, with no conflict reported**,+because nothing in the delivery compares against the tip it is landing on.+Git will not save you here: the relocation is a set of whole files, not a+patch, so there is nothing to conflict.++Observed: a split of one file into a core plus new reference files, built+and verified three ways (line-range diff against the old base, exact-match+against the new files, word-count check), all of which passed — against the+base from an hour earlier. One line inside a moved block had changed in the+meantime.++So express the relocation as something **re-derivable from whatever the+live base currently is** — a script, or a procedure precise enough to+re-run — and re-derive immediately before delivery rather than trusting the+earlier verification. Where a manual patch is genuinely the only option,+diff the moved regions against the live tip at delivery time and stop on+any difference. The verification that matters is the one against the state+you are landing on, not the state you started from.+## Trial design — measuring whether a behaviour fires unpromptedWhen a change is on trial and what's being measured is whether the agent@@ -664,6 +871,26 @@ or the trial cannot distinguish "not yet observed" from "not happening".## New skills+**Building next to siblings: separate the inherited steps from the+necessary ones.** A new member of a family inherits its siblings' shape,+and consistency with the family is a legitimate design value — which is+precisely why the inherited-but-unnecessary step survives review. It does+not read as wrong; it reads as belonging.++Observed: a family whose every member opens by identifying a governing+institution, because every member's output depends on which rulebook+applies. The new member copied that step and required the institution to be+resolved before any work. The user's correction was one line: *don't ask+about the institution — just ask how many items I want of each kind.* They+already knew the numbers. An inherited question had turned a one-line input+into a two-step interrogation.++The person who detects this is the one who has to answer the question, and+by then it has shipped. So make it an explicit authoring step: for each+step copied from a sibling, state **what this skill's output would lose if+the step were removed**. A step whose answer is "consistency" is inherited,+not necessary — drop it, or demote it to an optional branch.+**Before authoring a skill for a library, tool or project, check whetherthe project already ships one.** The reflex on "make a skill for X" is toread X's documentation and write a `SKILL.md` from scratch; many projectsdiff --git a/references/starter-principles.md b/references/starter-principles.mdindex df058dc..fb5daae 100644--- a/references/starter-principles.md+++ b/references/starter-principles.md@@ -10,6 +10,11 @@ The live file is `[workspace folder]/skill-observations/cross-cutting-principlesand its authority comes from the adopter's own evidence trail — so nothinghere takes effect until the adopter consciously imports it.+## Reconciliation++SKILL.md step 1 points here for the whole procedure; it carries only the+trigger and the one-line summary.+**When to read this file:** only when the Session Start Protocol(SKILL.md, step 1) finds the starter-set reconciliation due — the marker`skill-observations/starter-principles-reviewed.txt` is absent, or holds@@ -22,6 +27,16 @@ carries a rule under their own wording is covered, and only the uncoveredentries are offered. Bump the version line whenever entries are added ormaterially changed, or existing installs never see the change.+**The offer is one line, made once:** "the bundle ships N starter+principles; M are not covered by your file — want to see them?" On yes,+show only the uncovered ones and let the adopter pick. On a fresh install+M equals N and the choice is simply "start empty, or seed". Either way,+write the shipped version into the marker file afterwards, so the offer+never repeats until the set changes. **Never pre-populate silently:** the+live file's authority comes from the adopter's own evidence trail, and+unexamined imported rules contradict the pruning principle the file itself+carries (entry 11).+**How to import:** copy the entries the adopter chooses (all, or a subset)into the live file in the template format from `references/skill-authoring.md`,setting `**Added:**` to the import date, `**Propagation:** opportunistic`,@@ -31,6 +46,36 @@ the entry arrived without local evidence, so the pruning pass can drop itas freely as any single-observation rule. Imported principles that neverfire in the adopter's own work should be removed, not kept out of respect.+## Contents++- 1. Open-source skills must include an open-source licence+- 2. Open-source skills must include author attribution and a feedback pathway+- 3. Skills with rules must include a pre-flight verification step+- 4. Open-source skills must not contain client-identifying information+- 5. Open-source skills must use tool-agnostic language, with concrete examples first+- 6. Skills that generate structured output must be grounded in multiple real examples+- 7. Subagents must have complete inputs and verified outputs+- 8. Graceful tool-failure recovery+- 9. Match interaction modality to conversation energy+- 10. Small actionable sets are presented inline AND saved to file+- 11. Skills require pruning, not just growth+- 12. Use canonical identifiers from source data, never reconstruct from derived fields+- 13. Skills that read or write workspace files must maintain a reference index+- 14. Scheduled tasks invoke skills; they do not reimplement them+- 15. Scheduled task prompts are lightweight orchestrators — intelligence lives in skills+- 16. Interrupted operations are partial operations — verify state before retrying+- 17. Never suggest manual typing of technical content as a workaround+- 18. Browser automation is a costly last resort+- 19. Skills recommending API access must note network-sandbox implications+- 20. Skills contain only behaviour-changing content+- 21. Use agent-agnostic language in open-source skills+- 22. Verifying current vendor guidance requires a dated changelog check, not just the docs page+- 23. Never aggregate across structurally different segments+- 24. Fetch the instance before describing it+- 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+---### 1. Open-source skills must include an open-source licencediff --git a/references/weekly-review.md b/references/weekly-review.mdindex ad031ff..66567ce 100644--- a/references/weekly-review.md+++ b/references/weekly-review.md@@ -10,12 +10,36 @@ input. Two modes:- **In-session 7-day fallback:** pending at session start when BOTH aretrue: no scheduled review is registered (or none succeeded in 7+ days),AND `skill-observations/last-review-date.txt` contains `never` or a date- more than 7 days old (a missing file is recreated with `never` — see+ 7 or more days old — the same boundary SKILL.md step 3 uses, stated the+ same way on purpose: at exactly seven days the two files must agree, or+ whether a review runs depends on which one the session consulted+ (a missing file is recreated with `never` — seeSession Start steps 1 and 3; the file's value is authoritative, a datemeans a review actually ran). In an interactive session a pendingfallback surfaces as a one-line offer and runs only if the user opts in(SKILL.md, Session Start step 3) — it never gates the user's task.+## Contents++- Approval policy+- Steps+ - Step 0 — recommend scheduled setup (fallback mode only)+ - Step 1 — load+ - Staged-work reconciliation gate+ - Step 2 — inventory skills and classify each write target+ - Step 3 — cross-check observations+ - Step 4 — cross-check principles, and audit the families for drift+ - Step 5 — apply+ - Step 6 — re-scan, then mark ACTIONED+ - Step 7 — timestamp+ - Step 8 — deliver and summarise+- Constraints+- Delivering updated skills++The material between this index and Approval policy is preamble the whole+file depends on: reachability regimes, the offline-workspace policy, and+how an aggregate review over several observation logs is scoped.+**Reachability — where does scheduled work actually run?** Scheduled moderequires the scheduling agent's execution environment to read and writethe workspace folder. Persistence and execution context are independent@@ -85,7 +109,11 @@ Given the roots:- **Qualify every id that leaves its log.** Ids are allocated per log,so `#5` exists in each of them. Any cross-log reference — approvallist, `resolution: "by #N"`, Step 8 summary, manifest entry — carries- the workspace key alongside the number.+ the workspace key alongside the number. **The key is an identifier:** it+ is derived from a path, and the path carries the project's name. When a+ cross-log reference leaves the machine — an upstream report, a shared+ summary — re-key the workspaces neutrally (`root`, `p1`, `p2`) and say so+ once at the top.- **Stage each affected skill ONCE, and publish the anchor workspaceeverywhere.** One participant is the **anchor workspace**: its`skill-updates/` holds the staged copy, and it supplies@@ -95,8 +123,11 @@ Given the roots:senses are separate axes and are always named in full: *anchorworkspace* = which log's `skill-updates/` tree, *anchor directory* =which dated directory inside it. Append the manifest entry in the- anchor workspace AND a pointer entry in every participating- workspace's `PENDING.md`, **creating that manifest where it does not+ anchor workspace AND a pointer entry in every *other* participating+ workspace's `PENDING.md` — never in the anchor's own, because the+ anchor already holds the manifest entry itself, and a pointer there is+ a self-reference its own reconciliation gate would double-count —+ **creating that manifest where it does notexist yet** — a participant that has never staged anything has no`PENDING.md`, and an appender that assumes the file is there writesnothing. A manifest is read only from its own workspace and its entry@@ -271,6 +302,43 @@ when other sessions are logging, so the result decays for the duration ofthe run. Keep the Step 1 file list — Step 6 re-scans against it beforeanything is marked.+**Duplicate-id check — nothing else in the process looks for one.** The id+rules say a collision is "left for the next review to renumber", and until+now no review step went looking, so a duplicate could sit indefinitely.+Worse, it is silently destructive to the review itself: any pass that+merges per-entry results **keyed by id** — the common shape when the+reading is fanned out to helpers — collapses the pair into one, and the+entry that loses is dropped from the review it was waiting for, with no+error. The collision surfaced, once, only because someone compared a+merged count against a file count.++```bash+d="[ABSOLUTE PATH]/skill-observations/observation-log"+find "$d" "$d/archive" -maxdepth 1 -name '*.md' -exec basename {} \; \+ | grep -oE '^[0-9]+' | sed 's/^0*\([0-9]\)/\1/' | sort -n | uniq -d+```++`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+duplicate id. Any install that migrated — the ones most likely to have a+real collision — would have been sent chasing a phantom. The+zero-padding strip is the same one the id snippet uses, so `0091` and `91`+are recognised as the same number.++Any output is a duplicate id across the active set and the archive. Fix it+now, before the work queue is built: keep the number on the **earlier**+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.++**And key the merge on the filename, not the id**, wherever a review fans+reading out and merges results. The filename is unique by construction —+the noclobber create guarantees it — and the id is exactly the field a+collision has made ambiguous. A merge keyed on the one field that can+collide has no way to notice that it did.+**Parked entries: excluded from the queue, not from view.** `status: parked`means the observation was judged sound but is blocked on an externalprecondition recorded in `parked_until:` (SKILL.md, How to Log). It is a@@ -283,7 +351,9 @@ carry it into this review's queue; (b) list every still-parked entry in theStep 8 summary in ONE LINE each — id, title, unpark condition — so a parkedbacklog stays visible without re-entering the work queue.-**Staged-work reconciliation gate.** Installation is a manual, per-item+### Staged-work reconciliation gate++Installation is a manual, per-itemact that happens outside any session, so no session observes it andnothing fires at install time: a ledger whose removal trigger is an eventno session observes only ever grows. Bind the cleanup to the moment the@@ -301,8 +371,10 @@ legitimately moves on, so a bare "differs" is not a verdict:installed; surface it, and treat the staged copy — not live — as thebase for any new staging of that skill in this review. Also list, inthe summary, the observations whose `resolution:` names that staged- path (`grep -l "skill-updates/<anchor>/<skill>" observation-log/*.md- observation-log/archive/*.md`): they were marked `actioned` at staging+ path (`find observation-log -name '*.md' -exec grep -l+ "skill-updates/<anchor>/<skill>" {} +` — `find`, never a bare glob, which+ zsh treats as an error when it matches nothing, and which would also miss+ `archive/`): they were marked `actioned` at stagingand their work has not landed. They stay `actioned` — the statusdescribes the review's act, and re-opening would re-queue work alreadydone — but the summary carries them under "actioned, awaiting install",@@ -349,9 +421,23 @@ permissions; grow the (b) list when a change you made has vanished.against every skill — not just the skills named in its `skill:` list;Principles often generalise. Build skill → [relevant observations], seedingit from the frontmatter: every entry in an observation's `skill:` list puts-it in that skill's bucket (the first entry is primary), and every entry in-`proposes_skill:` puts it under a new-skill candidate of that name. An-observation may appear in both. Then, before anything is presented:+it in that skill's bucket (the first entry is primary), every entry in+`proposes_skill:` puts it under a new-skill candidate of that name, and+every entry in `target_file:` puts it under that file — a bucket the review+applies to like a skill (staged, never edited in place), instead of+remapping the entry onto the nearest skill. An observation may appear in+more than one. Then, before anything is presented:++- **Presence check, here, against the real target.** Step 5 greps the+ staged copy for each improvement before writing; run that same+ already-applied / partially-applied / outstanding classification here+ too, before anything is presented. In an interactive review the user+ approves at this step, so Step 5 never sees an entry the user was asked+ to approve twice. Run it against the file the observation actually+ targets — its `skill:` entries, its `target_file:` entries, the code or+ register it names — never a proxy such as a routine's own `SKILL.md`+ when the entry asks for the register that routine declares. Close what+ is already applied, with a resolution naming where it was found.- **Consolidate new-skill candidates by the problem they solve, not byname.** Independently logged proposals for the same skill will not look@@ -455,6 +541,32 @@ skills).**Step 5 — apply.** Begin with the copy, not the edit: for each skillwith approved/non-escalated items,+**Verify an observation's factual claims against the live system before+promoting them into a skill.** An observation records what one session+saw; a skill states what is true. Promoting the first into the second+verbatim launders a sample into a rule, and the rule then outlives every+chance to notice.++Observed: an entry stated as settled fact that a document's `balance`+field "is always 0 in this org", and therefore could not be used to detect+outstanding payments. It was about to be promoted verbatim. One query+against the live API showed the claim was false — `balance` is populated+correctly on documents in `pending` status. The original session had+sampled only `approved` documents, where the vendor's system reports a+full `amountPaid` and a zero `balance` regardless of actual payments. The+observation was honest and the sample was unrepresentative, which is the+normal relationship between the two.++So before a factual claim about an external system enters a skill — a+schema, an enum, a field's behaviour, a transition rule, "X is always Y" —+re-run the smallest query that would falsify it, and widen the sample past+whatever state the original session happened to be looking at. Where the+system is unreachable at review time, promote the claim **with its+provenance** ("observed on N documents, all in `approved` status") rather+than as a fact, so the next reader knows what would have to be re-checked.+The cost is one query; the alternative is a rule that is wrong in exactly+the cases nobody sampled.+Where an approved item's destination is an upstream report — an issue orPR against a skill someone else maintains — drafting that report IS theapply step for it, so the feedback pre-flight in@@ -496,7 +608,14 @@ the summary carries.with the current rules), **test branch** (behavioural changes tosnippets, procedures or activation, and anything that changes what anagent does at session start), or **decline, with the reason**. Apply- the include-now set to the staged copy, and record in the staging+ the include-now set to the staged copy. 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+ rewording is a relocation with a change of words, and "the substance+ was kept" is a feeling, not a check (one such rewording dropped a+ single qualifier and was caught by the contributor, not the review).+ Record in the stagingmanifest both the classification and, per include-now item, thereporter's **GitHub login and numeric user ID** — the publishing runneeds both to write a trailer GitHub can resolve@@ -529,6 +648,22 @@ the summary carries.week. Both are staged copies under `skill-updates/` with their ownmanifest entries; neither is pushed by the review.+**Standing rule — the review that changes a published skill bumps its+version.** When the staged skill is published, or built and awaiting its+first push (however your publication process records that state), the+review bumps the version as part of the+staging: patch for wording, minor for new rules or sections, major for+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+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+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.** Thesession that cuts a release/test branch classifies every change on it as*exercised naturally by a week of use* or *unlikely to happen@@ -561,6 +696,36 @@ diff -rq "$live" "$s" # must be identical before any edit# then make EVERY edit against the staged path```+**Seed from the CURRENT state, which for a shared artefact is upstream —+not the local file.** That `diff` proves the staged copy started from live;+it is silent on whether live is current, and it passes trivially in exactly+the state it looks like it is guarding. "Edit a copy, not the original"+answers what you may damage, not what you are building on. For any skill+with an upstream — a repository it is installed or refreshed from,+including one the user themselves commits to from several machines or+sessions — the live directory is itself a copy that does not announce how+far behind it is, and a stale local file looks exactly like a fresh one.++So before seeding, fetch the upstream revision of every file about to be+edited and diff it against live: identical → seed from live and record the+revision; divergent → pull upstream first, seed from that, and re-check+whether the observation is already addressed there, because a maintainer+who fixed it differently and better is the common case. The session editing+a skill is a parallel writer like any other, so this is the write-time+state check the procedure already requires of shared logs, applied to the+agent's own tools. Name the revision staged from in the Step 8 summary.++Two things fall out of the same fetch. It settles **section-level+provenance** — whether the passage being edited is upstream content or a+local addition — which is what the Approval policy needs in order to route+between an upstream report and a fork-local edit. And **an unreachable+upstream needs a positive control before it is called unreachable**: fetch+a path known to exist (the repository README) before concluding the network+is the problem, because a 404 on a guessed skill path with a 200 on the+README means the path assumption is wrong. Without that control the+honest-looking conclusion is "upstream unreachable, seeding from live",+which is this same failure reached by a route that feels diligent.+Two details in that snippet are load-bearing and were both wrong in anearlier version. Strip the prefix **without** a trailing slash — `${d#$live}`,not `${d#$live/}`. The pattern with the slash strips correctly for every@@ -609,11 +774,44 @@ for observation interdependencies (which observation supersedes, refines,or folds into which — the parent must state this per cluster explicitly,or subagents applying observations sequentially produce patch-on-patchinstead of coherent final state), the confidentiality rules for-open-source skills, and an explicit rule that subagents do not change any observation's-status. Reserve status marking and archival for the parent session. The principle: the apply-phase is embarrassingly parallel across+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), and an explicit rule that subagents do not change any+observation's status. Reserve status marking and archival for the parent+session. 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+edits produced; run after the bookkeeping, a failure means unwinding+`actioned` marks. The principle: the apply-phase is embarrassingly parallel acrossskills but the bookkeeping must have one owner — split the work alongthat seam.+**A delegated adversarial review needs the unchanged files its central+claim depends on.** When a fix is sent to a second agent for review, the+natural brief is the changed files, the diff and a log. That is exactly+wrong when the fix's central claim is about something it did **not**+change: an assumption about how a caller behaves, what a default is, what+some other file guarantees.++Observed: a reviewer could not find the caller whose behaviour the fix+assumed, and had to return its single most important finding — whether the+central assumption held — as "not verifiable". The minor findings came back+fine. The review ran, produced output, and silently failed at the one thing+it was for.++So build the brief from **what the claim depends on**, not from what the+change touched: name the fix's load-bearing assumption in one line, and+include every file needed to confirm or refute it, changed or not. Ask the+reviewer to report an unverifiable central claim as a failure of the brief+rather than a finding — otherwise "not verifiable" is filed beside the+minor findings and reads as a completed review.+**The orchestrator owns a merge-time validation pass.** Splitting workacross parallel workers splits the verification surface with it, and thesplit is not clean: local checks partition neatly, global invariants do@@ -704,7 +902,7 @@ next write on a later day archives them.**Step 8 — deliver and summarise.** Stage updated skills (see Deliverybelow), then present:-```+```markdown## Weekly Skill Review Complete — [date]Updated skills ([N] observations, [N] principles applied):@@ -738,12 +936,29 @@ for the next review; or "none" — the line is never omitted][items with reasons]```-Wait for the user to acknowledge before other work.+**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+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.+ `resolved`, and `resolution` frontmatter fields — **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+ observation under `proposes_skill:` instead. Observed: seven entries+ logged with `skill: []` and `proposes_skill: [<name>]` on the honest+ judgement that the skill did not exist — it did, in commits the session's+ checkout was 160 behind. Left alone, they sit under a new-skill candidate+ for a skill that already exists, and every later review re-reads them the+ same way. A review that establishes the target does exist may correct+ those two fields, and records the correction in `resolution:`. Nothing+ else in the body changes.- Don't create new skills in a review — note candidates for the user toaction via the skill-creator. The one exception is the `{skill}-extras`companion for a read-only or volatile target (Step 2): it is a routing@@ -757,6 +972,27 @@ Wait for the user to acknowledge before other work.## Delivering updated skills+**A message drafted ahead of a delayed send states status that has since+changed.** Where a delivery message, commit body or summary is composed now+and sent later — a run gated behind a waiting period, an automated send, a+queued handover — its *measured* values are usually filled in correctly at+send time from live output. The prose is not. A paragraph written at draft+time naming what some other branch or commit still needs will be sent+verbatim, and it reads with exactly the authority of the measured figures+beside it.++Observed: a template whose line counts, byte counts and evidence figures+were all correct at send time, alongside a fixed paragraph saying a+particular branch was still pending a change and describing what would have+to happen at merge. By the time the automated run sent it, that branch had+landed and the change was already present in the delivered result.++So in anything drafted for later sending: **state only what is measured at+send time, or nothing.** Claims about the state of other branches, commits,+tickets or sessions either come from a value the run computes as it sends,+or come out. A sentence that was true when written is not a safe default —+it is the one part of the message nothing re-checks.+Save each updated skill to`[workspace folder]/skill-updates/[date]/[skill-name]/` — the FULL skilldirectory (SKILL.md plus references/, scripts/, assets/ where present),@@ -818,7 +1054,17 @@ copies from the read-only mount, `chmod -R u+w` the staged path first —the mount's read-only mode travels with the copy, for directories aswell as files. Do not edit skill files in place — nothing goes liveuntil the user installs it. **Keep-two rule:** for any skill, keep only-the two most recent staged copies under `skill-updates/`; for the older+the two most recent staged copies under `skill-updates/` **that have been+installed** — never prune an uninstalled one. The invariant two lines+above says nothing goes live until the user installs it; the prune+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+that came back **(a) identical** or **(b) superseded**; a copy in state+(c) is uninstalled work and is kept whatever its age, and named in the+summary so it does not accumulate invisibly. For the prunableones, **request the delete grant on the target directory, then delete —never rename into a holding folder** (if the permission stream fails inan autonomous run, leave them in place and name them in the report as@@ -867,9 +1113,11 @@ observation ids applied, and a per-change summaryartefact is always the `.skill` bundle, so the entry never distinguishesa single-file from a multi-file skill. For a published skill it alsocarries the community-item classification from Step 5 (include now /-test branch / declined, with the reason) and, per included item, the+test branch / declined, with the reason), per included item thereporter's GitHub login and numeric id, so the publishing run's commit-can write the crediting trailer without going back to the API. The manifest is+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 iswhat the Session Start Protocol reads to announce "N staged updatesawaiting review", so staged work is never quietly forgotten; theper-change summary is what lets the user review a full-file diffdiff --git a/scripts/validate-skill-bundle.py b/scripts/validate-skill-bundle.pyindex a6cfc87..4dc9b51 100644--- a/scripts/validate-skill-bundle.py+++ b/scripts/validate-skill-bundle.py@@ -10,9 +10,21 @@ an unasserted metric manufactures confidence that no defect exists.Usage-----python3 validate-skill-bundle.py <staged-skill-dir> [--bundle file.skill] [--pack out.skill]+ python3 validate-skill-bundle.py --repo-only <repo-dir>- --pack writes a well-formed bundle (POSIX separators on any platform)- after the directory checks pass, then validates it.+ --pack writes a well-formed bundle (POSIX separators on any platform)+ 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.++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.+The skill checks require the directory name to equal the frontmatter `name`+and forbid a plugin manifest; the repo is named after the repository, not+the skill, and is the one place the manifest belongs. Running the skill+checks over a repo root therefore reports two failures that are both+correct behaviour. Point the skill checks at the staged skill directory and+`--repo-only` at the repo.Exit status 0 = every check passed; 1 = at least one failed (all failuresare listed, not just the first).@@ -30,6 +42,26 @@ import zipfileMAX_DESCRIPTION_CHARS = 1024 # installer's documented cap on the folded descriptionNAME_RE = re.compile(r"^[a-z0-9]+(-[a-z0-9]+)*$") # kebab-case+SEMVER_RE = re.compile(r"^\d+\.\d+\.\d+$")++# --- Core-size ratchet -------------------------------------------------------+# The per-session core is loaded in full, every session, by every consumer of+# the skill. It has grown before: a split brought it down and two months of+# ordinary review rounds put it back, because nothing in the loop pushed the+# other way. A guideline that is only prose loses to a hundred individually+# reasonable additions.+#+# CEILING ONLY EVER GOES DOWN. Raising it is not a fix for a failing gate; it+# is the failure. A release that needs more room in the core needs a split+# instead, and the reference files are where the room is. The number below is+# the high-water mark at the release that introduced this check — every later+# release either holds it or lowers it.+#+# TARGET is the size the core is trying to reach. The gap between CEILING and+# TARGET is reported on every run, passing or failing, so the debt stays+# visible rather than being rediscovered by a contributor with a line counter.+MAX_CORE_LINES = 728+TARGET_CORE_LINES = 500PATH_RE = re.compile(r"`((?:references|scripts|assets)/[^`\s*?]+\.[A-Za-z0-9]+)`")BUILD_JUNK = {"__pycache__", ".DS_Store"}# Edit residue: strings that only ever enter a file through a failed@@ -62,13 +94,217 @@ def frontmatter(text):def folded_description(fm):- m = re.search(r"(?ms)^description:\s*>-?\s*\n(.*?)(?=^\S|\Z)", fm)+ """The description as the installer sees it, for both YAML block styles.++ Folded (`>`) joins its lines with spaces; literal (`|`) keeps the line+ breaks. Both accept a chomping indicator (`-`, `+`) and an explicit indent+ digit. Matching only `>` meant a `|` description fell through to the+ single-line branch below, which measured the string "|" — one character,+ inside every cap by construction, so the gate reported a pass having+ measured nothing at all. Any block style must be recognised here or the+ length check silently stops being a length check.+ """+ m = re.search(r"(?ms)^description:\s*([>|])[-+]?\d?\s*\n(.*?)(?=^\S|\Z)", fm)if m:- return " ".join(m.group(1).split())+ body = m.group(2)+ if m.group(1) == ">":+ return " ".join(body.split())+ return "\n".join(line.strip() for line in body.strip("\n").splitlines())m = re.search(r"(?m)^description:\s*(.+)$", fm)return m.group(1).strip().strip('"\'') if m else ""+def check_frontmatter_shape(fm, fails, yaml_available):+ """Structural checks that do not need PyYAML.++ The gate's `frontmatter parses` item degrades to a regex when PyYAML is+ absent, and a regex happily accepts a block a YAML parser rejects. The+ case that got through: a cosmetic re-wrap turned a single-line+ `description:` into a key line followed by UNINDENTED continuation lines.+ The body loaded fine, so the defect surfaced only in the client's skill+ listing, where the description had been replaced by the H1 title.++ So: check the shape here, always, whichever branch ran above — and say+ which branch ran, because `OK` from the regex branch and `OK` from the+ parser branch are not the same assurance.+ """+ in_block = False+ for n, line in enumerate(fm.splitlines(), 1):+ if not line.strip() or line.lstrip().startswith("#"):+ continue+ if re.match(r"^[A-Za-z_][\w.-]*:", line):+ in_block = bool(re.search(r":\s*[>|][-+]?\d?\s*$", line))+ continue+ if line[:1].isspace() or line.lstrip().startswith("- "):+ continue # indented continuation or list item: fine+ if in_block:+ # A block scalar's body must be indented. An unindented line ends+ # the block, and since it is not a `key:` line either, it is the+ # re-wrap defect.+ fails.append(+ f"frontmatter:{n}: unindented continuation line inside a block "+ f"scalar — YAML ends the block here and rejects the rest "+ f"({line.strip()[:60]!r})")+ else:+ fails.append(+ f"frontmatter:{n}: line is neither `key: value` nor an indented "+ f"continuation ({line.strip()[:60]!r})")+ in_block = False+ if not yaml_available:+ print("note: PyYAML not installed — frontmatter checked structurally, "+ "not parsed. Install PyYAML for the stronger check.")+++def check_core_size(skill_md, fails):+ """The ratchet. See MAX_CORE_LINES.++ Counted with splitlines() so the number matches `wc -l` on a+ newline-terminated file. Counting newlines and adding one reports 755 for+ a 754-line file, which is a one-line phantom in a check whose whole job is+ to compare a count to a bound.+ """+ lines = len(skill_md.read_text(encoding="utf-8").splitlines())+ over_target = lines - TARGET_CORE_LINES+ if lines > MAX_CORE_LINES:+ fails.append(+ f"core SKILL.md {lines} lines > ceiling {MAX_CORE_LINES}. "+ f"Move content to a reference file — do not raise the ceiling.")+ else:+ headroom = MAX_CORE_LINES - lines+ note = f"core SKILL.md {lines} lines (ceiling {MAX_CORE_LINES}, {headroom} to spare"+ if over_target > 0:+ note += f"; {over_target} over the {TARGET_CORE_LINES}-line target"+ print(note + ")")+++def check_reference_indexes(skill_dir, fails):+ """Every heading in a reference file appears in that file's own Contents.++ The per-file `## Contents` index exists so a reader can see what the file+ covers without loading it, and so the core's pointers have something to+ resolve against. Nothing kept it current: an index is edited by hand, in a+ different part of the file from the section being added, and a stale one+ is indistinguishable from a complete one at a glance. Both misses this+ check caught were made while writing the rule that the index matters.++ Pointer targets are checked too — a core pointer naming a heading that+ does not exist sends the reader to a file to find nothing, which is worse+ than no pointer, because they stop looking.+ """+ def norm(s):+ return " ".join(s.split())++ def defence(text):+ """Blank fenced blocks, keeping line count, so a `##` inside a+ 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)++ refs = skill_dir / "references"+ if not refs.is_dir():+ return+ for p in sorted(refs.glob("*.md")):+ body = defence(p.read_text(encoding="utf-8"))+ m = re.search(r"(?ms)^## Contents\s*\n(.*?)(?=^## )", body)+ if not m:+ continue # a file may legitimately have no index+ # Index entries wrap, and legitimately carry a parenthetical the+ # heading does not ("Lean Content (including progressive+ # disclosure…)"). So: join continuation lines into their entry, then+ # match a heading as a PREFIX of an entry, not by equality. Requiring+ # equality reported a correctly-indexed section as missing — the+ # check's own first finding was its own defect.+ entries, cur = [], None+ for line in m.group(1).splitlines():+ if re.match(r"^\s*-\s+", line):+ if cur is not None:+ entries.append(norm(cur))+ cur = re.sub(r"^\s*-\s+", "", line)+ elif cur is not None and line.strip():+ cur += " " + line.strip()+ if cur is not None:+ entries.append(norm(cur))+ # Headings below the index, excluding the index itself+ after = body[m.end():]+ for h in re.findall(r"(?m)^#{2,3}\s+(.+?)\s*$", after):+ hn = norm(h)+ if not any(e == hn or e.startswith(hn + " ") or e.startswith(hn + "(")+ for e in entries):+ fails.append(f"{p.name}: heading not in its own Contents index: {h!r}")++ core = (skill_dir / "SKILL.md").read_text(encoding="utf-8")++ # --- Reference shape: reported, never gated -----------------------------+ # The core's size ceiling does not transfer to reference files, because+ # their cost is conditional: a long file loaded once a month is cheap. The+ # signal that matters is how many DISTINCT episodes pull a file in, since+ # every one of them pays for the whole file. Measured once on this bundle,+ # the largest reference (1,105 lines) had a single trigger and was+ # correctly shaped, while a smaller one carried fourteen — so a size rule+ # would have flagged the healthy file and missed the mis-shaped one.+ #+ # Printed rather than enforced on purpose: one snapshot is not enough to+ # site a threshold, and the same measurement already overturned the rule+ # it was meant to support. Let a series accumulate, then decide.+ triggers = {}+ for m in re.finditer(r'`references/([a-z-]+\.md)`[^(]{0,40}\("([^"]+)"\)', core, re.S):+ triggers.setdefault(m.group(1), set()).add(norm(m.group(2)))+ if refs.is_dir():+ rows = []+ for p in sorted(refs.glob("*.md")):+ n = len(p.read_text(encoding="utf-8").splitlines())+ rows.append((p.name, n, len(triggers.get(p.name, ()))))+ worst = max((t for _, _, t in rows), default=0)+ print("reference shape (lines / distinct load triggers; not gated): "+ + ", ".join(f"{n}={ln}/{t}" for n, ln, t in rows))+ if worst >= 10:+ print(f"note: one reference file carries {worst} distinct load triggers — "+ f"split by episode is indicated when this grows; size is not the signal")++ for m in re.finditer(r'`references/([a-z-]+\.md)`[^(]{0,40}\("([^"]+)"\)', core, re.S):+ fname, heading = m.group(1), norm(m.group(2))+ target = refs / fname+ if not target.is_file():+ fails.append(f"SKILL.md points at a reference that does not exist: {fname}")+ continue+ heads = {norm(x) for x in re.findall(r"(?m)^#{2,4}\s+(.+?)\s*$",+ defence(target.read_text(encoding="utf-8")))}+ if heading not in heads:+ fails.append(f"SKILL.md pointer has no target heading: {fname} -> {heading!r}")+++def check_plugin_manifest(skill_dir, fails):+ """A skill bundle must NOT contain a plugin manifest.++ The uploader refuses it outright: *"A skill cannot contain a plugin+ manifest (…/.claude-plugin/plugin.json). Remove it, or upload this content+ as a plugin instead."* Skill and plugin are two upload kinds, not one+ artefact wearing both hats.++ This check was originally written the other way round, because the plugin+ reference documents a skills-directory plugin: a folder under a skills+ directory carrying this manifest loads as a plugin in place. That is true+ of a directory copied there by hand, and says nothing about what the+ uploader accepts — a distinction no amount of reading the plugin docs+ surfaces, because the constraint lives in the other product surface. The+ manifest is therefore repo-only, and `check_repo_versions` validates it+ there.++ The practical consequence, worth stating where someone will read it: a+ user who installs the `.skill` gets a skill, not a plugin. Only the+ repo-copy install path yields plugin behaviour.+ """+ manifest = skill_dir / ".claude-plugin" / "plugin.json"+ if manifest.is_file():+ fails.append(+ "a skill bundle must not contain .claude-plugin/plugin.json — the "+ "uploader rejects it ('upload this content as a plugin instead'). "+ "Keep the manifest at the repo root only; check_repo_versions "+ "validates it there.")++def check_dir(skill_dir, fails):# Resolve before comparing names: Path('.').name is '' for a relative# argument naming the current directory, which false-fails a correct@@ -81,6 +317,10 @@ def check_dir(skill_dir, fails):fm = frontmatter(text)if fm is None:fails.append("frontmatter: no leading --- block"); return+ # `yaml_available` is about the LIBRARY, not about this file parsing. A+ # parse failure is a defect in the file and is reported as one; only a+ # missing library downgrades the check, and only that case earns the note.+ yaml_available = Truetry:import yaml # optional; fall back to regex checks if absentdata = yaml.safe_load(fm)@@ -88,12 +328,22 @@ def check_dir(skill_dir, fails):fails.append("frontmatter: does not parse to a mapping")data = {}except ImportError:+ yaml_available = Falsedata = {"name": (re.search(r"(?m)^name:\s*(.+)$", fm) or [None, ""])[1].strip(),"description": folded_description(fm)}except Exception as e: # yaml error- fails.append(f"frontmatter: YAML parse error: {e}"); data = {}- name = str(data.get("name") or "").strip()- if not name:+ # Name the cause the check can detect, not the first field it then+ # fails to find: an unquoted `: ` inside a description is the common+ # way a whole block stops parsing, and "name missing" sends the+ # author to fix a field that is present.+ fails.append(+ f"frontmatter did not parse (likely an unquoted `: ` in a value — "+ f"double-quote the value or reword it): {e}")+ data = None+ name = str((data or {}).get("name") or "").strip()+ if data is None:+ pass # already reported above; a missing-name report here would mislead+ elif not name:fails.append("frontmatter: `name` missing")elif not NAME_RE.match(name):fails.append(f"frontmatter: `name` not kebab-case: {name!r}")@@ -127,6 +377,10 @@ def check_dir(skill_dir, fails):# header that every field check passes by constructionif SECOND_FRONTMATTER_RE.match(text):fails.append("frontmatter: a second frontmatter block follows the first")+ check_frontmatter_shape(fm, fails, yaml_available)+ check_core_size(skill_md, fails)+ check_reference_indexes(skill_dir, fails)+ check_plugin_manifest(skill_dir, fails)for p in skill_dir.rglob("*"):if p.name in BUILD_JUNK or p.suffix == ".pyc" or p.name.startswith(".~lock"):fails.append(f"build artefact in staged tree: {p.relative_to(skill_dir)}")@@ -148,6 +402,71 @@ def check_dir(skill_dir, fails):fails.append(f"edit residue in {p.relative_to(skill_dir)}:{line}: {why} ({m.group(0).strip()!r})")+def check_repo_versions(repo_dir, fails):+ """Every manifest in the repo carries the same version as the skill's own.++ `.claude-plugin/plugin.json` is canonical — it is the one the installer+ reads, and it is the one that ships inside the skill bundle. Every other+ site is a copy, and a copy that drifts is worse than no copy: the+ installer's update check is keyed on the version, so a manifest left at+ the old number means `/plugin update` reports "already at the latest+ version" while serving stale files.++ Deliberately NOT a site: `marketplace.json` has no `version` field. The+ plugin's own manifest wins where both are set, so leaving it out removes+ a copy rather than synchronising one.+ """+ import json+ repo_dir = pathlib.Path(repo_dir)+ canonical_path = repo_dir / ".claude-plugin" / "plugin.json"+ if not canonical_path.is_file():+ fails.append("repo: .claude-plugin/plugin.json missing (the canonical version site)")+ return+ try:+ canonical = str(json.loads(canonical_path.read_text(encoding="utf-8")).get("version", "")).strip()+ except Exception as e:+ fails.append(f"repo: .claude-plugin/plugin.json does not parse: {e}")+ return+ if not SEMVER_RE.match(canonical):+ fails.append(f"repo: canonical version is not semver: {canonical!r}")+ return+ name = str(json.loads(canonical_path.read_text(encoding="utf-8")).get("name") or "").strip()+ if not NAME_RE.match(name):+ fails.append(f"repo: .claude-plugin/plugin.json `name` not kebab-case: {name!r}")+ if "description" in json.loads(canonical_path.read_text(encoding="utf-8")):+ fails.append(+ "repo: .claude-plugin/plugin.json carries `description`. Remove it — "+ "the skill's own frontmatter description drives invocation, and a "+ "second copy here is unread by the loader and drifts from the first.")+ print(f"repo: canonical version {canonical}")+ for rel in (".tessl-plugin/plugin.json",):+ p = repo_dir / rel+ if not p.is_file():+ continue+ try:+ v = str(json.loads(p.read_text(encoding="utf-8")).get("version", "")).strip()+ except Exception as e:+ fails.append(f"repo: {rel} does not parse: {e}")+ continue+ if v != canonical:+ fails.append(f"repo: {rel} version {v!r} != canonical {canonical!r}")+ mp = repo_dir / ".claude-plugin" / "marketplace.json"+ if mp.is_file():+ try:+ data = json.loads(mp.read_text(encoding="utf-8"))+ except Exception as e:+ fails.append(f"repo: .claude-plugin/marketplace.json does not parse: {e}")+ data = {}+ stray = [k for k in ("version",) if k in data]+ stray += [f"plugins[{i}].version" for i, e in enumerate(data.get("plugins", []))+ if isinstance(e, dict) and "version" in e]+ if stray:+ fails.append(+ f"repo: marketplace.json carries a version ({', '.join(stray)}). "+ f"Remove it — plugin.json wins where both are set, so this is a "+ f"copy to keep in sync for no benefit.")++def pack(src, out):"""Always writes POSIX separators, on any platform."""src = pathlib.Path(src)@@ -171,6 +490,14 @@ def check_bundle(path, fails):n_members += 1if b"\x5c" in name:fails.append(f"bundle: backslash in member path {name!r} (installer rejects it)")+ # The uploader rejects a skill bundle carrying a plugin manifest. The+ # release workflow happens to copy three paths by name rather than the+ # whole tree, so it never picked this up — an accident, not a design.+ # Assert it here so the property holds however the bundle is built.+ if b".claude-plugin/" in name:+ fails.append(+ f"bundle: contains a plugin manifest ({name.decode(errors='replace')}) — "+ f"the uploader rejects a skill bundle that carries one")i += 46 + n + m + kif n_members == 0:fails.append("bundle: no members found")@@ -179,14 +506,27 @@ def check_bundle(path, fails):def main(argv):if len(argv) < 2:print(__doc__); return 2+ if "--repo-only" in argv:+ fails = []+ check_repo_versions(argv[argv.index("--repo-only") + 1], fails)+ if fails:+ print("FAIL:")+ for f in fails:+ print(" -", f)+ return 1+ print("OK: repo manifest checks passed")+ return 0skill_dir = argv[1]bundle = pack_to = Noneif "--bundle" in argv:bundle = argv[argv.index("--bundle") + 1]if "--pack" in argv:pack_to = argv[argv.index("--pack") + 1]+ repo = argv[argv.index("--repo") + 1] if "--repo" in argv else Nonefails = []check_dir(skill_dir, fails)+ if repo:+ check_repo_versions(repo, fails)if pack_to and not fails:pack(skill_dir, pack_to); bundle = pack_toprint(f"packed {pack_to}")