refactor(claude-ops): precompute installed CC version via ! injection - #793
Conversation
The `changelog` skill's version-awareness step previously told Claude to run `claude --version` as a body instruction — a per-invocation tool round-trip on every `apply`/`diff`. Convert it to `!` dynamic-context injection so the probe runs once at load time and its output is inlined before Claude sees the skill. The probe qualifies under every precompute criterion: deterministic, read-only, needed up front, independent of Claude's judgement, and cheap with stable output. It carries the mandated `|| echo "(CC version unavailable)"` defensive fallback, and drops the bash-only `2>/dev/null` redirect so the command and its fallback stay valid on both the bash default shell and the Windows PowerShell fallback host. Scope note: this was a repo-wide sweep, but `changelog` is the only sound conversion. The check-18 precompute detector emits no warnings repo-wide (it fail-closes on `bash script.sh` and `2>/dev/null`), and the manual pass over every other fenced shell block found only mutating, argument- derived, procedural variable-assignment, core-action, or illustrative blocks — none injectable. An earlier kindle-dedrm `status.sh` conversion was reverted: it spawns multiple `powershell.exe` subprocesses and emits a changing timestamp + book counts, failing the cheap/bounded and stable-output criteria. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01U9zbRxtRuTx1WsQavFc2Gi Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Resolve claude-ops CHANGELOG conflict with #791 (which claimed 0.15.3): rebase the changelog precompute entry to 0.15.4 above main's 0.15.3, and bump plugin.json 0.15.3 -> 0.15.4 accordingly.
Phase 0 step 1 of the `changelog` apply pipeline re-ran `claude --version 2>/dev/null` inline, duplicating the probe now inlined at load by the Version-awareness `!` injection and undoing the round-trip the conversion removed. Point it at the precomputed value instead, and drop the non-portable `2>/dev/null` redirect. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01U9zbRxtRuTx1WsQavFc2Gi Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Claude finished @kyle-sexton's task in 57s —— View job Security Review — PR #793
FindingsNo security issues found. The three changed files are a plugin version bump (
The converted line (L34): Checked against the relevant attack surfaces:
|
|
Claude finished @kyle-sexton's task in 1m 40s —— View job PR Review
SummaryThis is a focused, conservative precompute sweep. The one conversion it makes ( SKILL.md — the core changeConversion quality: correct. Checked against all four criteria in
Defensive fallback ( Portability: dropping
The model can infer that version comparison is unavailable, which is a clean degradation. No correctness dependency on injection succeeding. Minor nit — After this change the version shown by plugin.json — version bumpVersion is CHANGELOG.mdEntry is accurate and well-written. Correctly placed under VerdictLGTM. The conversion is mechanically correct, follows all precompute conventions, and the conservatism of the sweep (one conversion, well-documented skips) is the right call given the UNDER-CONVERT mandate. The |
Summary
M2
!precompute sweep across all plugins' skills. The mandate was to convert deterministic, read-only, render-time-valid context-gathering shell blocks to!dynamic-context injection (perplugins/playbooks/skills/skill-authoring/reference/precompute-context.md), under-converting and skipping ambiguous cases.Outcome: exactly one sound conversion repo-wide —
claude-ops/changelog. The sweep was deliberately conservative; every other fenced shell block was disqualified.What changed
claude-ops/changelog— version probe converted. The version-awareness step ranclaude --versionas a body instruction (a per-invocation tool round-trip on everyapply/diff). It now injects at load time:!`claude --version || echo "(CC version unavailable)"`Deterministic, read-only, needed up front, judgement-independent, cheap + stable output. Carries the mandated
|| echofallback (Q14). The bash-only2>/dev/nullredirect was dropped so the command and fallback stay valid on both the bash default and the Windows PowerShell fallback host (noshell:frontmatter needed once portable).claude-opsbumped0.15.3 → 0.15.4+ CHANGELOG entry (rebased above feat(claude-ops): document lane mid-session staleness & restart cadence (#514) #791's 0.15.3, merged forward fromorigin/mainmid-review). Description unchanged → no root-catalog regen.Why the list is so short
The check-18 precompute detector (skill-quality) emits zero WARNs repo-wide. By construction it fail-closes on
bash script.sh(unknown head command) and on2>/dev/null(its>guard), so a cleangit status/git diffpreamble — the shape it would flag — simply does not exist in these skills. Every remaining fenced block is in the judgement-call tail the UNDER-CONVERT mandate targets, and the manual pass rejected all of them.Skipped-candidate ledger
Every non-vendor, non-setup skill with a fenced shell block was manually reviewed. Disqualification reasons:
| Skill(s) | Reason skipped |
|---|---|
|
kindle-dedrm/manage| Reverted a prior-session conversion.status.shspawns 3powershell.exesubprocesses + a full Calibre Libraryfind(not cheap/bounded, under undocumented!timeout) and emits acaptured_attimestamp + changing book counts (unstable output → CC re-appends full rendered skill each invocation, v2.1.202+). ||
claude-ops/lanes,session-flow/handoff| Mutating (spawns/kills sessions). ||
claude-ops/morning-brief,claude-ops/plugins,repo-fleet-hygiene/audit,skill-quality/check,ai-briefing/generate| The skill's core action/deliverable, not a context preamble; also argument-dependent. ||
claude-ops/observability| Conditional on$1;exec/delegate logic. ||
claude-config/audit-permission-grants| Core action (produces the report), requiresjq, not a preamble. ||
claude-config/audit-automation-gaps,testing/plan,context7/lookup,firecrawl/firecrawl| Illustrative templates / Claude-derived args (<tool-command>,HEAD~N,<name>/<question>, URLs). ||
code-tidying/batch-simplify| Conditional mode branch; Claude-derivedNORMALIZED_TIME_WINDOW. ||
code-tidying/tidy,docs-hygiene/compress,work-items/decompose,source-control/commit| Mutating (gh pr comment,mktemp/cp,create-item,git commit). ||
planning/draft-goal-condition,work-items/work| Argument-dependent (<LIMIT>,<path>,<id>). ||
repo-hygiene/clean,session-flow/retro,toolchain/check,toolchain/lint,source-control/pull-request,work-items/scan-todos,knowledge/course-digest| ProceduralVAR=$(...)assignments consumed by later body steps (single-pass injection can't feed a later step) and/or Claude-derived-argument extraction. ||
knowledge/youtube-digest| Already precomputes — carries!injection for its toolchain deps (video-digestion/yt-dlp/ffmpeg/ImageMagick) with|| echofallbacks. Its 13 fenced blocks are all Claude-derived-argumentnode run.mjs <script.js> <url>/<slice-dir>action invocations (many mutating), not context preambles. Pre-existing observation, not touched here: those injections use bash-only2>/dev/null | head -1without ashell:declaration — a portability inconsistency for a future pass. ||
playwright/playwright(top-level, non-vendor) | Illustrative quick-start;playwright-clicommands are Claude-derived-argument (<flow>,<url>, element refs likee42read from a prior snapshot) andkill-allis mutating. ||
*/vendor/*(playbooks/boris,playwright/vendor,context7/lookup) | Upstream-synced materializations — hard-excluded (check 8 byte-identity + CLAUDE.md managed-file rule). ||
*/setupskills | One-time provisioning, not every-invocation context. |Verification
skill-quality:check changelog→ PASS, 0 errors. Check 18 is silent on the converted skill (it now injects with!). The one WARN ("no Gotchas surface") is pre-existing and unrelated to this change — out of scope for this precompute-only sweep.origin/mainmerged forward before work (was 2 behind; fast-forward, no force-push).kindle-dedrmfiles restored byte-identical to HEAD.Related
No linked issue. Part of the Skill M program (better precomputed context —
!executions in skill.md). Companion to the M1 authoring-guidance + detector work already shipped in #773 (skill-quality 0.7.0). This PR is item 1 (the one-time sweep over own plugins' skills).🤖 Generated with Claude Code