/cc-authoring:cc-mid-session-registry-stalenessfrom cc-authoring
Fix 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.
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.
Two Claude Code registries are loaded at session start and NOT refreshed when files change mid-session:
.claude/agents/*.md): agents created during the
session are invisible to agentType (Workflow tool) and subagent_type
(Agent tool). The error lists only plugin/built-in agents — your project
agents are absent entirely, which is the tell..claude/workflows/*.js via
Workflow({name})): name resolution snapshots the script; later edits to
the file on disk are silently ignored on re-invocation.Both fail fast (<15ms, agent_count 1, 0 tool uses) — that timing signature means registry/validation failure, not a logic bug in your script.
Trap 2 (stale workflow): invoke by path, not name:
Workflow({ scriptPath: "/abs/path/.claude/workflows/my-workflow.js", args: {...} })
scriptPath reads the live file every time.
Trap 1 (unregistered agents): add a registry-independent fallback to the workflow script — same persona content, delivered by file read instead of system prompt:
const USE_AGENT_TYPES = opts.useAgentTypes !== false
const roleRef = (t) => USE_AGENT_TYPES ? '' :
`FIRST: Read ${ROOT}/.claude/agents/${t}.md and fully adopt the role, method, and rules defined there.\n`
const roleOpts = (t, base) => USE_AGENT_TYPES ? { ...base, agentType: t } : base
// call sites:
agent(`${roleRef('my-role')}<task...>`, roleOpts('my-role', { label: 'x', schema: S }))
Run with args: { useAgentTypes: false } in the session that created the
agents; after a session restart the registry has them and the default
(agentType) path works.
diff the snapshot script (path printed in the Workflow
result, .../workflows/scripts/<name>-<runId>.js) against your live file —
if they differ, you hit the cache..claude/skills/) shows the same
session-start loading behavior for its slash-command registration.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.