init-claude-plugin

A command that creates the structure of a Claude Code plugin, including optional commands, agents, skills, hooks, MCP servers, validation, and automated checks.

In plain words
What is it for?
Use it to start a Claude Code plugin with selected components and built-in files for validation and GitHub Actions checks.
Why use it?
It avoids assembling the plugin layout and development rules from scratch.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alphaaiservice/cortex/init-claude-plugin
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 97 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,743 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00097 $0.04743
Opus 5 $0.00048 $0.02371
Sonnet 5 $0.00019 $0.00949
Haiku 4.5 $0.00010 $0.00474

Measured 2d ago against content hash 25d224e143d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

init-claude-plugin scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

run: sudo apt-get update && sudo apt-get install -y jq

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

CRITICAL=("rm -rf /" "mkfs\\." "dd if=" ":(){ :|:& };:")
commands/init-claude-plugin.md · 533 lines

How it starts

The opening of the file, as written. The whole thing — 533 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Init Claude Plugin — Scaffold a Claude Code Plugin

Create: $ARGUMENTS

This command scaffolds a Claude Code plugin with the structure Cortex itself uses. It encodes every plugin best practice we've learned: single-source-of-truth references, extracted hook scripts (no inline bash soup), worktree-safety preamble for risky commands, plugin validator, GitHub Actions CI, and proper semver/CHANGELOG discipline.

📖 CANONICAL REFERENCE: skills/alpha-architecture/references/CODE_PATTERNS_CLAUDE_PLUGIN.md contains the full plugin development patterns (frontmatter rules, hook event matrix, skill trigger discipline, validator port, marketplace.json schema). Load that file for all templates referenced below.


Step 0: Parse arguments

Extract from $ARGUMENTS:

  • plugin-name (required, first positional arg) — kebab-case, e.g. my-plugin, acme-devops. Becomes the plugin directory + the name field in .claude-plugin/plugin.json.
  • --with-commands (default ON) — scaffold the commands/ directory with 1 example command.
  • --with-agents (default OFF) — scaffold the agents/ directory with 1 example agent.
  • --with-skills (default ON) — scaffold skills/<plugin-name>/SKILL.md with proper frontmatter.
  • --with-hooks (default OFF) — scaffold hooks/hooks.json with PreToolUse safety check.
  • --with-mcp (default OFF) — scaffold an embedded MCP server in mcp/ + wire into .mcp.json.
  • --license = MIT (default) | Proprietary | Apache-2.0 | GPL-3.0. MIT is the Claude Code plugin ecosystem norm.
  • --author-name + --author-email — populate plugin.json author field. If missing, prompt the user.

If plugin-name is missing, stop and ask. Validate it's kebab-case, lowercase, starts with a letter.


Step 1: Confirm — is this the right tool?

Before scaffolding, confirm:

Ask: "What kind of plugin is this?"

  A) Internal team plugin (commands/skills for your own team)         → continue
  B) Open-source plugin to publish to a marketplace                   → continue + ensure --license=MIT
  C) Custom commands for a single project (not really a plugin)       → STOP. Use .claude/commands/ in the project directly instead — lighter weight.
  D) Replacing a /command in another plugin                           → STOP. Override the command in that plugin's directory or fork it.
  E) Just one slash command, nothing else                             → STOP. Create .claude/commands/<name>.md in your project; a full plugin is overkill.

Read the full file on GitHub · 533 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 533 lines · 97 tokens per session scan D 25d224e143d0

Subscribe to this mod's changes

init-claude-plugin is a command published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 26d ago), licensed MIT. It adds 97 tokens to every session and 4,743 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it D with 2 findings (asks for root, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.