/cc-authoring:skill-creator-trigger-eval-gotchasfrom cc-authoring
Six chained gotchas when running the skill-creator plugin's trigger-eval machinery (scripts/run_loop.py, scripts/run_eval.py) against a skill. Use when: the trigger eval reports 0% recall or "skill never triggers" even on verbatim trigger phrases; `python -m scripts.run_loop` fails with `ModuleNotFoundError: anthropic`; the loop crashes at the improvement step with "Could not resolve authentication method", or improve_description.py wants an ANTHROPIC_API_KEY that a subscription-authenticated Claude Code session never exports; scores look wrong because you launched from the plugin's directory instead of the project; 0% recall persists even after moving the skill out of .claude/skills/; or harness recall reads low (~50-60%) while ground-truth `claude -p` runs trigger the real skill fine. Causes and fixes covered: probe shadowing by an already-installed skill, SIBLING-probe shadowing from parallel --num-workers writing rival <name>-skill-<uuid> probes into .claude/commands/, cwd-sensitive project-root resolution, and the uuid-probe semantic gap that makes harness recall a lower bound.
Trending skills
7-day visitors to each skill page
Ships in cc-authoring. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The skill-creator plugin's description-optimization loop has four failure modes that compound, and the worst one (probe shadowing) produces a confidently WRONG result instead of an error.
python -m scripts.run_loop needs the anthropic package. Fix:
cd <skill-creator-dir> && uv run --with anthropic python -m scripts.run_loop ...
run_eval.find_project_root() walks up from cwd to the first .claude/
directory. Launching from the plugin cache dir (~/.claude/plugins/...)
resolves to $HOME — the probe lands in ~/.claude/commands/ and test
sessions run homed to $HOME, not your project. Fix: cwd = your project,
module path via PYTHONPATH:
cd "<project>" && PYTHONPATH=<skill-creator-dir> uv run --with anthropic \
python -m scripts.run_eval --eval-set ... --skill-path ... --model ...
The harness does NOT test your skill in place. It writes a command file named
<skill>-skill-<uuid8>.md carrying your skill's description, then checks the
stream for THAT name. If the real skill is already installed in the
project, Claude matches the query to the REAL skill name and invokes it; the
uuid probe never fires; the harness records 0% trigger rate on every positive
query — including verbatim phrases from the description itself.
Tell: recall = 0% across ALL positives (even exact trigger phrases) while all negatives "pass". Total zero is the signature; genuine undertriggering is partial.
Ground-truth check (one command):
cd "<project>" && env -u CLAUDECODE claude -p "<verbatim trigger phrase>" \
--output-format stream-json --verbose 2>/dev/null | grep -c "<real-skill-name>"
A large count = the real skill triggered; the harness scores are invalid.
To measure an installed skill for real: temporarily move the skill out of
.claude/skills/ (and any plugin copies) so the probe is the only candidate,
run the eval, move it back. Or accept ground-truth spot checks.
improve_description.py calls the Anthropic SDK directly →
ANTHROPIC_API_KEY required. Subscription-authenticated Claude Code doesn't
export one. Measurement (run_eval.py) is unaffected (it shells out to
claude -p). Without a key, do the improvement loop manually: propose a new
description, re-run run_eval, iterate.
Same 0%-recall signature as gotcha 3, but it strikes even when the real skill
WAS correctly moved out of .claude/skills/. run_eval's default
--num-workers 10 has each parallel worker write its own
<name>-skill-<uuid8>.md probe into the same shared .claude/commands/.
Spawned sessions see up to 10 identically-described probes, invoke whichever
uuid they pick (usually a sibling's), and every worker's own-name check fails
— uniform 0/N triggers.
Tell it apart from gotcha 3: the real skill is verifiably parked, a
1-probe diagnostic run passes, and a ground-truth claude -p shows the
description matching fine.
Fix: always pass --num-workers 1. Sequential cost is ~13 min for 18
queries in a skill-heavy environment — acceptable, and the only mode that
measures what a real session would see (one candidate probe).
Even with shadowing fully eliminated, the harness can read falsely LOW. It
registers the skill description under a uuid name (<skill>-skill-<uuid8>),
discarding the semantic value of the real skill name. Queries that
ground-truth strongly with the real installed skill (e.g. 7 stream mentions
via claude -p) can score 0/N against the uuid probe carrying the
IDENTICAL description — the real name itself was doing matching work the
probe can't replicate.
Observed instance (2026-06-11, Claude Code 2.1.173, claude-fable-5, skill
cc-hooks-main-vs-subagent): a 7-positive eval set scored 57% run-level
recall on the harness while spot-checked queries — including a harness 0/2
failure — triggered the real skill reliably.
Consequence: treat harness recall as a LOWER BOUND. Before "fixing" a description based on harness failures, ground-truth each failing query against the real installed skill:
env -u CLAUDECODE claude -p "<query>" --output-format stream-json --verbose \
2>/dev/null | grep -c <real-skill-name>
Only harden the description for queries that ALSO fail ground truth. Harness rejection of negatives is unaffected (no shadowing/semantics involved) and remains trustworthy.
run_eval strips the CLAUDECODE env var to allow nested claude -p; do
the same in manual ground-truth checks (env -u CLAUDECODE).claude -p boots; 3 trials × 20 queries is tens of minutes.run_eval.py supports --runs-per-query N to bound runtime (2 is usually
enough for a first pass).nohup ... & detached —
a plain Bash run_in_background process is killed at the subagent's turn
boundary; also clean up the dead run's leftover probe file or it
sibling-shadows the relaunch.scout-block PreToolUse hook
denies writes to any *.log path — tee the harness output to
run_eval.out, not run_eval.log.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cajias/claude-skills --plugin cc-authoring16 skills in this plugin
/apm-marketplace-authoring-gotchasEight APM-marketplace-authoring gotchas discovered during real
migrations from hand-authored .claude-plugin/marketplace.json to
APM-managed and from CC-native plugin authoring.
Use when: (1) running APM's packaging step (with or without
`--dry-run`) or its marketplace-check command in a repo with an
`apm.yml`; (2) wiring CI for an APM
marketplace; (3) the CI staleness check (repack, then `git diff
--quiet`) fails despite a clean local; (4) prettier reformats
`marketplace.json` after APM's packer writes it; (5) APM exit code 1 on
local-path-only marketplaces; (6) confused by `packages:` in apm.yml
vs `plugins:` in marketplace.json; (7) commitlint rejects a commit
with `footer-leading-blank` despite no apparent footer; (8) `apm
compile -t claude` exits 0 with zero output and no compiled plugin
appears; (9) husky+lint-staged pre-commit blocks the FIRST marketplace
commit with markdownlint `MD040/fenced-code-language` errors on a
SKILL.md file copied verbatim from `~/.claude/skills/`. The gotchas
form a chain — fixing one usually surfaces the next.
/apm-plugin-distribution-pathsCanonical authoring layout for an APM (microsoft/apm)
package, plus the decision matrix for whether you need a `marketplace:` block.
Use when: (1) you've run `apm init` and are unsure where SKILL.md / agent .md
/ command .md files belong (answer: under `.apm/`, NOT at repo root); (2)
you've authored CC-native files at `commands/agents/skills/` at repo root and
wonder if that's "right" (it works as fallback layout #3 "Claude plugin", but
it's not the canonical authoring path); (3) you're trying to choose between
the three layouts APM recognizes (one-skill repo, multi-primitive `.apm/`,
Claude plugin); (4) `apm targets` fails with "No such command" in CLI 0.12.1
(subcommand doesn't exist); (5) `apm validate` fails with "No such command"
in CLI 0.12.1 (use APM's packaging command in dry-run mode instead); (6) wondering whether
`apm compile -t claude` will generate output for a hand-authored CC-native
plugin (it won't; it's a no-op for layout #3); (7) wondering if you need a
`marketplace:` block in apm.yml (you don't, for a single-plugin repo).
Covers the canonical `.apm/` source layout, the source-to-plugin remap
table, the three-layout choice, and the four distribution paths.
/autoresearch-is-code-metric-optimizerThe `/autoresearch:autoresearch` Claude Code skill is a CODE-METRIC
OPTIMIZER (modify → verify → keep/discard loop). Use when: (1) you are
about to invoke `/autoresearch:autoresearch` to do literature / web
research (it does NOT fetch papers, search the web, or synthesize cited
reports — use `/deep-research` for that); (2) you have a measurable
target (test pass rate, perf delta, p&l, win rate, composite metric)
AND code-or-config that can be modified to hit it — that IS the right
use case, including non-traditional optimization targets like trading
strategy backtest results; (3) you're confused about when to reach for
the BASE skill vs the sub-skills `:reason` (adversarial debate) or
`:probe` (8-persona interrogation) — the base skill is for iterative
optimization with a clear verify function; the sub-skills are for
qualitative investigation when there is no verify function.
/cc-hooks-main-vs-subagentHow a Claude Code PreToolUse/PostToolUse hook can tell whether a tool call
came from the MAIN conversation thread or from a SUBAGENT (Task/Agent tool),
plus the gotchas of testing hooks via headless `claude -p`. Use when:
(1) building a hook that should apply only to the main thread (e.g.
orchestrator-only enforcement that denies Edit/Write in main but allows
subagents) or only to subagents; (2) wondering if hook input contains an
is_subagent / agent indicator — it does, but it's undocumented;
(3) a hook behaves differently than expected under `claude -p` because
CLAUDE_CODE_ENTRYPOINT is sdk-cli there and `env CLAUDE_CODE_ENTRYPOINT=cli`
does NOT survive (the CLI overwrites it); (4) a headless hook test shows
"Claude requested permissions ... but you haven't granted it yet" instead of
the hook's deny reason — the permission gate fires before the hook surfaces;
(5) you need to force the interactive code path in a headless test (use a
--settings file with an env block).
/cc-mid-session-registry-stalenessFix for two Claude Code mid-session staleness traps that fail Workflow runs
instantly (<15ms). Use when: (1) a Workflow agent() call fails with
"agent type '<name>' not found" listing only plugin/built-in agents, even
though .claude/agents/<name>.md exists with valid frontmatter — the agent
registry only loads .claude/agents/ at session START, so agent files created
mid-session are not resolvable via agentType/subagent_type until restart;
(2) re-invoking a saved workflow via Workflow({name}) runs STALE code after
you edited .claude/workflows/<name>.js — name resolution serves a cached
snapshot, so mid-session edits never reach it. Both failures look like your
code is wrong when it's actually registry caching. Fixes: launch via
Workflow({scriptPath: <live file path>}) to bypass the name cache, and
design workflow scripts with a registry-independent persona fallback
(prompt the agent to Read its own .claude/agents/<name>.md and adopt the
role) toggled by an arg like useAgentTypes:false.
/cc-plugin-cache-multi-version-not-recordedFix for Claude Code startup warning `Plugin "<name>" not cached at (not
recorded) — run /plugins to refresh`. Use when: (1) Claude Code prints a
`plugin-cache-miss` warning whose installPath is the literal string
`(not recorded)`; (2) `claude plugin list` shows the plugin as installed
with a valid version, AND
`~/.claude/plugins/installed_plugins.json` has a real `installPath` for
it, yet the warning still fires every session; (3) running `/plugins` or
reinstalling the plugin doesn't clear the warning; (4) the plugin's
cache directory at
`~/.claude/plugins/cache/<marketplace>/<plugin>/` contains TWO (or more)
version subdirectories — typically an old SHA-prefix dir and the
current one — left over from an in-place marketplace SHA bump.
Root cause: the Claude Code cache resolver (`fk8` in the binary) skips
any cache parent whose subdir count `!== 1`, returns null, and the
install-record fallback emits the warning with the hardcoded sentinel
`installPath: "(not recorded)"`. The phrase is NOT a missing config
field — it's a literal string in the error branch. Fix: delete every
stale version subdir under that plugin so exactly one remains (the one
recorded in `installed_plugins.json`).