Skip to content

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

Activation: detect an install that went quiet after its first session

Eoghan Hennc58852be6402
diff --git a/README.md b/README.md
index 4e74e46..a4f7156 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,7 @@ The skill is a small bundle: `SKILL.md`, the files in `references/` that are loa
**Vercel's skills CLI:** the skills.sh listing 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.
+**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. If it exists, read the last `session-start scan` line in `skill-observations/checkpoints.log`: that is the last session that ran the skill, so a date days old while you kept working means activation stopped, however many entries the first session wrote. Another skill's start-up text appearing in your sessions is not evidence that this one is active.
## Claude environment notes
diff --git a/SKILL.md b/SKILL.md
index 976b674..7f8b61b 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -193,12 +193,12 @@ skill" (some upload paths keep only `SKILL.md`); its episodes do not run.
session whose output a caller owns does neither: `references/environments.md`
("Sessions whose output channel is owned by a caller").
4. **Activation.** Once per session: if no CLAUDE.md (or equivalent)
- activation instruction for this skill exists, briefly suggest adding one
- (see `references/environments.md`). Skip if already configured. Be clear
- about what this step is: it runs only after the skill has been invoked,
- so it verifies a working setup and structurally cannot detect the
- missing one — it is not the safety net for a never-activated install;
- the checks from outside the runtime are in `references/environments.md`.
+ activation instruction for this skill exists, suggest adding one (see
+ `references/environments.md`); after a scan `GAP:` line, open with the
+ gap and the missing instruction, plainly. Skip if configured. This step
+ runs only once the skill is invoked, so it verifies a working setup and
+ cannot detect a missing one — it is not the safety net for a
+ never-activated install; the outside checks are in that reference.
5. **Concurrency.** There is no shared log file to guard: each observation
is its own file, so creating one never collides with another session's
entry; re-read one before changing its *status* (How to Log).
diff --git a/references/environments.md b/references/environments.md
index 9ac3c39..0cbe86e 100644
--- a/references/environments.md
+++ b/references/environments.md
@@ -705,8 +705,32 @@ runs once activation has already succeeded — so the external diagnostic
is the one that catches a skipped install step: **if
`skill-observations/observation-log/` does not exist after a few sessions
of tool-using work, activation never happened**; check the activation
-block in the config, or install the hook. The README carries the same
-diagnostic for users who never read this file.
+block in the config, or install the hook. The directory existing proves
+only that one session ran: a first session loaded by hand, or by a lucky
+description match, writes entries and the trace, and the install then
+goes quiet (observed: four entries on day one, then three weeks of work
+with nothing logged and no review, found by an audit that read the
+dates). So the diagnostic has a second half: **the last
+`session-start scan` line in `skill-observations/checkpoints.log` is the
+last session that ran the protocol** — days old while work went on means
+activation is not running, whatever the log holds. The scan prints a
+`GAP:` line when that date is 7 or more days old, which helps only the
+session that is activated after the gap; the dated line is the check
+anyone can run from outside. The README carries the same diagnostic for
+users who never read this file.
+
+**Another skill's session-start output is a false positive for
+activation.** A harness that injects a different always-on skill's
+content at session start makes the session look skill-governed while
+this skill's activation does not exist (observed: a full working day of
+real work with the skill installed beside four others, no log and no
+activation block). Count only evidence of THIS skill: its own
+invocation, the protocol's trace in `checkpoints.log`, or the
+`observation-log/` it created. An install is not finished until an
+artefact outside the skill proves it: create the workspace AND write the
+activation, then print what was written and where. Where the activation
+cannot be written, the install does not succeed silently: report it as
+incomplete and hand over the block to paste.
### Activation config — late, intermittent, and why the guard cannot live inside it
diff --git a/scripts/session-start-scan.sh b/scripts/session-start-scan.sh
index 090aa2d..bb53d1f 100755
--- a/scripts/session-start-scan.sh
+++ b/scripts/session-start-scan.sh
@@ -12,7 +12,8 @@
# path may contain spaces.
#
# Prints, on stdout, in this order: any NOTE / LOST ENTRIES lines; the counts
-# line (files, parsed, suspect, archive-suspect); the logs found under the
+# line (files, parsed, suspect, archive-suspect); a GAP line when the previous
+# scan in checkpoints.log is 7 or more days old; the logs found under the
# root's parent; the active principles' headings; and LAST the frontmatter
# of every numbered entry, each header followed by one `---` line. Appends
# one line to skill-observations/checkpoints.log:
@@ -131,6 +132,22 @@ lost=$( { find "$d" -maxdepth 1 -name '[0-9]*.md' -empty; LC_ALL=C find "$d" -ma
[ "$suspect" -gt 0 ] || [ "$a_sus" -gt 0 ] && echo "NOTE: $suspect of $n headers (and $a_sus in archive/) look like invalid YAML (an unquoted ': ', text after a closing quote, a value opening with a backtick, @ or %, an undefined escape, a colon in an unquoted list entry) — quote or fix them (File format)"
printf 'files: %s parsed: %s suspect (awk, a floor): %s archive-suspect: %s\n' "$n" "$parsed" "$suspect" "$a_sus"
+# --- gap: days since the previous session-start scan --------------------------
+# Read before this run's trace line is appended. The previous scan's date is
+# the last day a session ran the protocol; a gap of 7 days or more (the
+# review interval) while the user kept working is the one sign a skill that
+# stopped being activated can leave: the sessions in between never reached
+# the step that would say so. Day numbers come from awk, so no `date -d`
+# (GNU) or `date -j` (BSD) is needed. No earlier scan line: no note.
+ck="$root/skill-observations/checkpoints.log"
+gap=$( [ -f "$ck" ] && LC_ALL=C awk -v today="$(date +%F)" '
+ function dn(s, y, m, d) { y = substr(s, 1, 4) + 0; m = substr(s, 6, 2) + 0; d = substr(s, 9, 2) + 0
+ if (m < 3) { y--; m += 12 }
+ return 365 * y + int(y / 4) - int(y / 100) + int(y / 400) + int((153 * (m - 3) + 2) / 5) + d }
+ / session-start scan:/ && /^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]/ { last = substr($ 0, 1, 10) }
+ END { if (last != "") { g = dn(today) - dn(last); if (g >= 7) print last " " g } }' "$ck")
+[ -n "$gap" ] && echo "GAP: the previous session-start scan ran ${gap% *}, ${gap#* } days ago. If work happened in between, the skill was not activated in those sessions: check the activation instruction (references/environments.md, \"Verify activation in a NEW session\")"
+
# --- the trace: one line per session, with date, time and source -------------
printf '%s [%s] session-start scan: files=%s parsed=%s principles=%s\n' "$(date '+%F %H:%M')" "${PWD##*/}" "$n" "$parsed" "$pr" \
>> "$root/skill-observations/checkpoints.log"
diff --git a/scripts/validate-skill-bundle.py b/scripts/validate-skill-bundle.py
index c93e7a8..4837ee4 100644
--- a/scripts/validate-skill-bundle.py
+++ b/scripts/validate-skill-bundle.py
@@ -876,15 +876,20 @@ ROUNDTRIP_FIXTURES = [
# The session-start scan ships as scripts/session-start-scan.sh beside this
# file. Each case runs it against a throwaway workspace (with a space in its
# path) and pins one boundary: (name, scenario, args, exit status, stdout
-# substring, checkpoint lines written). Skipped, not failed, where no bash is
-# on PATH: the scan is a bash script and the gate is not.
+# substring, checkpoint lines written, stdout substring that must be ABSENT).
+# Skipped, not failed, where no bash is on PATH: the scan is a bash script
+# and the gate is not. The "gap" and "recent" scenarios seed checkpoints.log
+# with one earlier scan line, 21 and 2 days old.
SCAN_SCRIPT = pathlib.Path(__file__).resolve().parent / "session-start-scan.sh"
SCAN_FIXTURES = [
("healthy log scans: counts line, one checkpoint line", "healthy", True, 0,
- "files: 2 parsed: 2 suspect (awk, a floor): 1", 1),
+ "files: 2 parsed: 2 suspect (awk, a floor): 1", 1, "GAP:"),
("no header parses: guard halts before the checkpoint", "broken", True, 1,
- "SCAN COMMAND BROKEN", 0),
- ("no workspace root: refused, nothing written", "healthy", False, 2, "", 0),
+ "SCAN COMMAND BROKEN", 0, ""),
+ ("no workspace root: refused, nothing written", "healthy", False, 2, "", 0, ""),
+ ("previous scan 21 days old: GAP line names its date", "gap", True, 0,
+ "GAP: the previous session-start scan ran ", 2, ""),
+ ("previous scan 2 days old: no GAP line", "recent", True, 0, "files: 2", 2, "GAP:"),
]
@@ -899,7 +904,12 @@ def scan_case(scenario, pass_root):
(log / "archive").mkdir(parents=True)
ck = root / "skill-observations" / "checkpoints.log"
ck.write_text("", encoding="utf-8")
- if scenario == "healthy":
+ if scenario in ("gap", "recent"):
+ import datetime
+ day = datetime.date.today() - datetime.timedelta(days=21 if scenario == "gap" else 2)
+ ck.write_text(f"{day} 09:00 [w] session-start scan: files=2 parsed=2 principles=absent\n",
+ encoding="utf-8")
+ if scenario != "broken":
(log / "0001-a.md").write_text('---\nid: 1\ntitle: "ok"\n---\nbody\n', encoding="utf-8")
(log / "0002-b.md").write_text("---\nid: 2\ntitle: Fix: unquoted\n---\n", encoding="utf-8")
else:
@@ -1014,9 +1024,9 @@ def selftest():
ok = subprocess.run(["bash", "-n", str(SCAN_SCRIPT)]).returncode == 0
bad += not ok; total += 1
print(f"{'ok ' if ok else 'FAIL'} scan script: bash -n passes")
- for name, scenario, pass_root, want_rc, want_out, want_ck in SCAN_FIXTURES:
+ for name, scenario, pass_root, want_rc, want_out, want_ck, absent in SCAN_FIXTURES:
rc, out, ck = scan_case(scenario, pass_root)
- ok = rc == want_rc and want_out in out and ck == want_ck
+ ok = rc == want_rc and want_out in out and ck == want_ck and not (absent and absent in out)
bad += not ok; total += 1
print(f"{'ok ' if ok else 'FAIL'} scan script: {name}"
+ ("" if ok else f" (exit {rc}, {ck} checkpoint lines)"))