/cc-authoring:claude-workflow-plugin-distributionfrom cc-authoring
How to distribute a Claude Code Workflow-tool script (the Workflow({script}) orchestration engine / .claude/workflows/*.js) through a plugin or marketplace, and how to architect it around the Workflow sandbox. Use when: (1) you want to "ship / package / distribute a workflow" in a plugin; (2) designing a skill or command that launches a Workflow; (3) you assumed a plugin has a `workflows/` component (it does NOT); (4) your workflow .js needs to read a file/config/data but the sandbox has no filesystem; (5) deciding where file I/O and deterministic pre-processing should live relative to the engine.
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.
You built a Workflow-tool script (Workflow({ script }), runs as .claude/workflows/*.js)
and want to ship it to others via a plugin/marketplace. But Claude Code plugins auto-discover
only commands, agents, skills, hooks, and MCP servers — there is no workflows/
component. A workflow .js is a harness feature, not a first-class plugin component, so it
cannot be distributed as one directly.
workflows/ directory convention in the plugin spec and found none..js needs to read the input file / config / a data file, but fails because
the Workflow sandbox has no filesystem or import.1. Bundle the engine as a skill/command asset; launch it via the Workflow tool.
Skills and commands may include arbitrary supporting files and reference them with
${CLAUDE_PLUGIN_ROOT}. So:
skills/<name>/workflows/engine.js inside the plugin.SKILL.md (the discoverable entry point) instructs Claude to call:
Workflow({ scriptPath: "${CLAUDE_PLUGIN_ROOT}/skills/<name>/workflows/engine.js", args })..js = the engine behind it. Same pattern plugins
already use to ship Python hooks (hooks/*.py referenced via ${CLAUDE_PLUGIN_ROOT}).2. Architect around the sandbox: the launcher does I/O, the engine stays in-memory.
The Workflow .js sandbox has no filesystem, no import/require, and no
Date.now()/Math.random()/new Date() — only in-memory JS built-ins (JSON, RegExp, String…)
and the injected globals (args, phase, log, agent, parallel, pipeline, workflow, budget).
Consequences that shape the design:
args (e.g. { text, config, patterns, prompts, ... }). Nothing inside the
engine reads a file..js module the skill runs
(node prescan.js …) — real Node has fs, so it is directly unit-testable — and whose
output the skill passes into the engine via args. Do NOT try to do it inside the sandbox.agent() DO have tool access (Read, Grep, …). So judgment-based
reading/analysis goes in agent prompts, not in the engine body.3. Degrade gracefully. The launcher only truly runs where the harness has the Workflow tool. Document a fallback (dispatch the same phases as subagents via the Agent tool) so the skill still works where the Workflow tool is absent.
Shipped exactly this: an ai-writing-humanizer skill whose SKILL.md reads the doc +
patterns.json + prompts, runs a standalone prescan.js node module, then launches
workflows/humanize.js via Workflow({ scriptPath: "${CLAUDE_PLUGIN_ROOT}/…/humanize.js", args }). The engine ran in-memory and dispatched analyze/revise/review agents; 18/18 tests
passed; the plugin installs as a normal skill.
workflows key in plugin.json; do not invent one.claude-workflow-authoring-gotchas skill (pure-literal meta, args
normalization) and the claude-workflow-tdd-harness skill (how to unit-test the engine by
mocking agent()). Also see claude-workflow-meta-markdownlint-pure-literal-break.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.