Hook Development for Claude Code Plugins
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
Claude Code artifact schemas: plugin.json, frontmatter, hooks, settings, tools.
$ npx skills add xiaolai/nlpm --skill conventions-claude -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install xiaolai/nlpm conventions-claude --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nlpm/conventions-claude .claude/skills/conventions-claude && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "conventions-claude" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/conventions-claude into .claude/skills/conventions-claude/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "conventions-claude", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/conventions-claudeType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add xiaolai/nlpm --skill conventions-claude -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install xiaolai/nlpm conventions-claude --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/nlpm/conventions-claude .agents/skills/conventions-claude && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "conventions-claude" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/conventions-claude into .agents/skills/conventions-claude/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "conventions-claude", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xiaolai/nlpm --skill conventions-claude -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install xiaolai/nlpm conventions-claude --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/nlpm/conventions-claude .cursor/skills/conventions-claude && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "conventions-claude" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/conventions-claude into .cursor/skills/conventions-claude/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "conventions-claude", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/xiaolai/nlpm.git --path skills/nlpm/conventions-claude--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add xiaolai/nlpm --skill conventions-claude -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install xiaolai/nlpm conventions-claude --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/nlpm/conventions-claude .gemini/skills/conventions-claude && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "conventions-claude" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/conventions-claude into .gemini/skills/conventions-claude/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "conventions-claude", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install xiaolai/nlpm conventions-claudeInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add xiaolai/nlpm --skill conventions-claude -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/nlpm/conventions-claude .github/skills/conventions-claude && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "conventions-claude" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/conventions-claude into .github/skills/conventions-claude/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "conventions-claude", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xiaolai/nlpm --skill conventions-claude -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install xiaolai/nlpm conventions-claude --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/nlpm/conventions-claude .opencode/skills/conventions-claude && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "conventions-claude" agent skill from https://github.com/xiaolai/nlpm/tree/main/skills/nlpm/conventions-claude into .opencode/skills/conventions-claude/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "conventions-claude", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
conventions-claudeClaude Code artifact schemas: plugin.json, frontmatter, hooks, settings, tools.
Conventions Claude is an agent skill from xiaolai/nlpm. Claude Code artifact schemas: plugin.json, frontmatter, hooks, settings, tools.
Its SKILL.md is about 6.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `reference.md`).
It sits in Agent Workflows, covering Hooks and plugins. The repository describes itself as: Natural-Language Programming Manager — scan, lint, and score NL artifacts with Claude-native quality scoring. The licence is ISC.
12 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 307328b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
claudegitFrom the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
code.claude.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Conventions Claude loads about 6.3k tokens when it runs. Until then it costs about 25 tokens; SKILL.md has 2,857 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from xiaolai/nlpm at commit 307328b, republished under its ISC licence (© xiaolai). 2,857 words, ~6,295 tokens.
.claude/skills/conventions-claude/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Tool-specific overlay for Claude Code plugin artifacts. Loaded by the scorer and checker when an artifact is classified as Tier 2-Claude (per agents/scorer.md step 3). The universal floor lives in nlpm:conventions; this overlay adds Claude-Code-specific schemas on top.
Last refreshed: 2026-08-02 against current docs (Claude Code ≥ v2.1.218); §2.2, §2.4 and §14 corrected 2026-10-01 against Claude Code 2.1.285. Notation: a + splits $+ARGUMENTS and the dollar-brace variables such as $+{CLAUDE_PLUGIN_ROOT} throughout this file. The real tokens have no +. They are split because Claude Code replaces the contiguous tokens with their values whenever it loads a skill, including when an agent preloads it, so a literal token here would reach the reader as an empty string or a path (§2.4).
Primary authoritative sources:
slash-commands.md).claude-plugin/plugin.jsonThe plugin manifest.
Required fields:
name — string, kebab-case, unique identifierThe manifest is fully optional — artifacts auto-discover from conventional paths, and only name is required when present. Unrecognized top-level fields are ignored with a warning (error only under claude plugin validate --strict).
Optional fields:
version — semver string (e.g. "0.1.0"). If omitted, commit SHA is used (every commit = new version). For stable releases, set explicit semver.description — one-line summarydisplayName — human-readable name shown in installer UI (v2.1.143+)author — object: { "name": "...", "email": "...", "url": "..." }homepage — URL stringrepository — URL string (the docs' Metadata table types this strictly as string; no object form is documented)license — SPDX identifierkeywords — string array for discovery$schema — URL to the manifest JSON Schema (editor validation)defaultEnabled — boolean; whether the plugin is enabled on install (v2.1.154+)userConfig — object; per-key prompts shown to the user at enable time; values exposed as $+{user_config.<key>} substitutionschannels — array; message-injection channel bindingsdependencies — array of other plugins this one requires (supports semver constraints)NOT plugin.json fields (common mistake):
agent — this is a settings.json default key (a plugin's bundled settings.json supports only agent and subagentStatusLine), not a manifest field.category — belongs to a marketplace.json plugin entry, not the manifest.Artifact path fields (all optional, string or string[]):
commands — path(s) to command markdown filesagents — path(s) to agent markdown filesskills — path(s) to skill directorieshooks — path to hooks.jsonmcpServers — path(s) to MCP server configlspServers — path(s) to LSP server config (stable in 2026; schema in §12)outputStyles — path(s) to output style definitionsworkflows — path(s) to workflow script files/directories (replaces default workflows/; ties to the Workflow tool)experimental.themes — path(s) to theme definitions (was top-level themes; now nested under experimental)experimental.monitors — path(s) to monitor config (was top-level monitors; schema in §13). Top-level still works but claude plugin validate warns; a future release will require the experimental.* form.Plugin structure note: a bin/ directory in a plugin root puts its executables on the Bash tool's PATH — files there are invokable as bare commands in any Bash call while the plugin is enabled.
Example manifest → reference.md.
Critical: as of Claude Code v2.1.x, commands and skills are the same architecture. Both surfaces support the same frontmatter and execution semantics. The recommended canonical path is:
.claude/skills/<name>/SKILL.md # preferred for new development
.claude/commands/<name>.md # still works; equivalent behaviorExisting .claude/commands/ files continue to function. New code should prefer the skill layout because it allows companion files (scripts/, references/, examples/) in the same directory.
Authoritative reference: https://code.claude.com/docs/en/skills.md (command/skill frontmatter now lives here; the old slash-commands.md page was retired)
Recommended (per official docs, the only recommended frontmatter field — all keys are technically optional):
description — string; explains what it does and when to invoke. Combined with when_to_use: if present. The schema treats it as optional, but a model-invoked skill with no (or a weak) description cannot trigger reliably — so nlpm scores a missing/weak description as a quality finding (R04), not a hard schema violation.Optional (universal):
name — string; per official docs, explicitly optional. When omitted, filename or enclosing directory is used. Pre-v0.7.15 nlpm incorrectly flagged missing name: as a bug; corrected after Jeffallan/claude-skills#184 maintainer feedback.argument-hint — string; placeholder shown in UI (e.g., "[path]")arguments — space-separated or YAML list of named arguments for $name substitution (e.g., "issue branch")allowed-tools — string array OR space-separated string; pre-approved tools (no per-use prompt). Format: "Read Grep Bash(git *)" or ["Read", "Grep"].disallowed-tools — string array OR space-separated string; tools removed from the pool while the skill is active.model — haiku / sonnet / opus / fable / a full model ID / inherit (keep the active model); overrides session model for one turn.effort — low / medium / high / xhigh / max; overrides session effort.user-invocable — boolean; false hides from menu (only Claude invokes).disable-model-invocation — boolean; true means only the user invokes (manual /skill-name only).Optional (v2.1.x additions — NEW since pre-2026 conventions):
when_to_use — string; additional trigger hints (appends to description)context — "fork" runs in a forked subagent (isolates from main history)agent — which subagent type (built-in: Explore, Plan, general-purpose)hooks — {...} skill-scoped hooks (same shape as settings.json hooks)paths — glob patterns; auto-load only for matching files (e.g., "src/**/*.ts,lib/**/*.ts")shell — bash (default) or powershell for the dynamic context blocks in §2.3background — boolean; only meaningful with context: fork. false waits for the forked subagent's result in the invoking turn instead of backgrounding it (default true; v2.1.218+).Boolean frontmatter fields accept yes/no/on/off/1/0 (any case) in addition to true/false (v2.1.218+). The combined description + when_to_use shown in the skill listing is truncated at 1,536 characters — keep triggers within that budget.
git diff HEAD) — runs the command before Claude sees the skill and replaces the span with its output."disableSkillShellExecution": true in settings.Claude Code replaces these tokens in command and skill bodies. Do NOT flag them as undefined variables. Each is written with this file's + split (see Notation at the top); drop the + to get the real token.
| Token | Replaced with |
|---|---|
$+ARGUMENTS | every argument passed on invocation |
$+ARGUMENTS[N] | the argument at index N, 0-based |
$+N (a digit, e.g. $+0) | shorthand for $+ARGUMENTS[N] |
$+name | a named argument declared in arguments: (§2.1) |
$+{CLAUDE_SESSION_ID} | the current session ID |
$+{CLAUDE_EFFORT} | the current effort level |
$+{CLAUDE_SKILL_DIR} | the directory that holds the skill's SKILL.md |
$+{CLAUDE_PLUGIN_ROOT} | the plugin's install directory |
$+{CLAUDE_PLUGIN_DATA} | the plugin's persistent data directory |
$+{CLAUDE_PROJECT_DIR} | the project directory |
Preloading substitutes too (observed on Claude Code 2.1.285, 2026-10-01): when an agent preloads a skill through skills:, $+ARGUMENTS becomes an empty string and every $+{CLAUDE_…} token above becomes its value; $+N and $+name stay literal because a preload passes no arguments. A backslash protects $+ARGUMENTS but not the braced tokens. A reference skill that describes these tokens must therefore split them as this file does, or its reader sees the substituted values instead of the token names.
Reusable shared partials located in commands/shared/.
Rules:
user-invocable: false in frontmatter — prevents appearing as top-level commandsdescription stating their purpose as a partialAgents live in .claude/agents/<name>.md.
The system prompt is the markdown body of the file (in --agents JSON form it is the prompt key). There is no system-prompt frontmatter key — flagging or recommending one is a bug (corrected 2026-06-07 against sub-agents.md).
Documented fields:
name — string; identifier for invocation. Cannot contain : (reserved for plugin-scoped identifiers, v2.1.218+).description — string; critical for reliable triggering — should contain 3+ specific phrases describing when to use this agenttools — tools the agent body uses; two valid formats:tools: ["Read", "Glob"]tools: Read, Glob, GrepdisallowedTools — tools removed from the inherited pool (this is the correct key — there is no tool-restrictions: {allow, deny} key; the old nlpm name was wrong)model — haiku / sonnet / opus / fable / a full ID (e.g. claude-opus-5) / inherit; defaults to inheritskills — preload skill content into this agent's context at startup. Two valid formats:skills: ["nlpm:conventions"]skills:\n - nlpm:conventionsConvention / additional fields:
effort — low / medium / high / xhigh / maxcolor — one of red, blue, green, yellow, purple, orange, pink, cyan; visual label. magenta is NOT valid (old nlpm list had it; the current valid set adds purple, orange, pink).permissionMode — default (alias manual, v2.1.200+) / acceptEdits / auto / dontAsk / bypassPermissions / planisolation — only valid value "worktree" (runs the agent in a git worktree)memory — user / project / localmaxTurns — integer turn capbackground — boolean; run asynchronouslyinitialPrompt — string; seeds the agent's first turnmcpServers, hooks — agent-scoped overridesPlugin-shipped agents are restricted: hooks, mcpServers, and permissionMode are ignored for agents distributed inside a plugin (security). Score plugin agents accordingly.
Best practice: include <example> blocks in description. The description is placed in the Agent tool's text on every turn and is the only thing Claude sees when choosing an agent, so examples belong there (not in the body). One well-chosen <example> plus a "Not for …" sentence carries the routing signal; extra examples are allowed but cost always-on context. nlpm R09 deducts 5 points when the description exceeds 1,200 characters.
Universal SKILL.md spec lives in nlpm:conventions (open spec at agentskills.io). Claude Code uses these path conventions:
skills/<name>/SKILL.mdskills/<plugin>/<name>/SKILL.md.claude/skills/<name>/SKILL.md~/.claude/skills/<name>/SKILL.mdSkill discovery paths now support parent-directory and monorepo nested scanning (v2.1.x). Skills from ./parent/.claude/skills/ and ./packages/frontend/.claude/skills/ auto-load. Skills from --add-dir paths also load from .claude/skills/ within added directories.
Supporting files: Same directory as SKILL.md — scripts/, references/, examples/, etc. Reference them from SKILL.md so Claude knows when to load them.
Skill preloading in agents (v2.1.x): Declare skills: [name1, name2] in agent frontmatter to inject full skill content at startup (vs. Claude auto-loading on demand).
Rules live in .claude/rules/<name>.md.
Frontmatter:
description — string (required)paths — string array (optional); glob patterns scoping which files this rule applies toBody format:
**Always do X.** or **Use Y instead of Z.**Budget: Under 500 lines total per rules file.
Naming convention for ordered sets: NN-kebab-name.md (e.g. 01-formatting.md).
Hook events are case-sensitive. Using wrong case silently ignores the hook.
Confirmed against 2026-06-07 docs refresh (hooks.md):
| Event | Trigger | Context fields |
|---|---|---|
SessionStart | Session begin | source (startup/resume/clear/compact), model |
SessionEnd | Session end | (trigger only) |
UserPromptSubmit | User submits a prompt | prompt text |
PreToolUse | Before any tool call | tool_name, tool_input |
PostToolUse | After tool call | tool_name, tool_input, tool_output |
PermissionRequest | When Claude requests permission | tool_name, tool_input, permission_mode |
Stop | Once per turn | reason (can set decision: block to prevent stopping) |
StopFailure | Once per turn — Claude failed to complete | reason |
FileChanged | Per file change | filename, watcher_path |
Beyond the table above, many more events are valid (SubagentStop, PreCompact, Notification, PostToolUseFailure, Setup, SubagentStart, PermissionDenied, PostCompact, TaskCompleted, MessageDisplay, …). Full allow-list → reference.md. Any documented event name is valid even if it post-dates this doc; do NOT flag as unknown — verify against hooks.md rather than penalizing.
Hook types (canonical, all lowercase in JSON):
command — shell script (stdin/stdout)http — HTTP POST endpointmcp_tool — MCP server tool invocationprompt — LLM evaluationagent — subagent verificationA command hook may add "shell": "powershell" to run that hook in PowerShell instead of the default shell.
Matcher patterns: string (exact), pipe-separated list (Bash|Edit), or regex (non-alphanumeric chars).
MCP tool naming: mcp__<server>__<tool> (e.g., mcp__memory__write.*). Hook matchers use this format.
Exit codes (command hooks):
0 — success (stdout to debug log; for UserPromptSubmit, UserPromptExpansion, and SessionStart, stdout is injected as context)2 — blocking error (action denied, stderr fed to Claude) — only on blockable events. Non-blockable events ignore exit 2: PostToolUse, PostToolUseFailure, Notification, SessionStart, SessionEnd, InstructionsLoaded, StopFailure, MessageDisplay, SubagentStart, Setup, CwdChanged, FileChanged, PostCompact, WorktreeRemove, PermissionDenied (on PermissionDenied, use JSON retry: true rather than exit 2).1, 3+ — non-blocking error (logged in debug only)hooks.json FormatLocated at .claude/hooks.json or <plugin>/hooks/hooks.json.
Full example, structure rules and optional hook-object fields → reference.md.
.mcp.jsonClaude Code reads MCP server registrations from a standalone JSON file at the repo root (NOT embedded in settings.json like Gemini, NOT inside config.toml like Codex).
Example → reference.md.
Plugin scope: <plugin>/.mcp.json at the plugin root, or inline in plugin.json under mcpServers. (Only the plugin-root form is documented; the older .claude-plugin/.mcp.json variant is not.)
Four memory scopes load in order (managed policy → user → project → local):
| Scope | Path | Notes |
|---|---|---|
| Managed policy | OS-specific managed path (e.g. /Library/Application Support/ClaudeCode/CLAUDE.md) | org-wide, set by administrators |
| User | ~/.claude/CLAUDE.md | personal, applies to all projects |
| Project | ./CLAUDE.md or ./.claude/CLAUDE.md | shared, committed |
| Local | ./CLAUDE.local.md | gitignored personal overrides for this repo |
Auto-memory is a separate system at ~/.claude/projects/<slug>/memory/ (see §15) — there is no .claude/memory/*.md convention.
Recommended pattern for multi-tool projects (per analysis/multi-tool-design-2026-05.md decision #5): make AGENTS.md the canonical universal memory file and ship no CLAUDE.md. Claude Code 2.1.277+ reads AGENTS.md natively when no CLAUDE.md, .claude/CLAUDE.md, or CLAUDE.local.md sits in the working directory or above it (~/.claude/CLAUDE.md does not count); Codex reads it natively; Gemini/Antigravity can be configured to read it via the context.fileName array. This is how nlpm itself works. A plugin root must not carry a CLAUDE.md at all — claude plugin validate warns that it is not loaded as plugin context.
For Claude Code older than 2.1.277, the compatibility shim is a one-line CLAUDE.md that imports AGENTS.md:
@AGENTS.mdBody conventions when content lives in CLAUDE.md directly:
@-imports must reference existing files.claude/settings.json and .claude/settings.local.json.local.json is gitignored (per-user); the non-local file is shared — never set bypassPermissions: true in the shared file. Field table (incl. autoMemoryEnabled/autoMemoryDirectory, see §15) → reference.md.
.lsp.json)Stable in 2026 (was experimental in 2025). .lsp.json file, or a lspServers object in plugin.json. Required fields command + extensionToLanguage. Full per-server schema → reference.md.
monitors/monitors.json)Experimental — lives under experimental.monitors (§1); its manifest schema may change between releases while it stabilizes. Plugin background watchers; requires v2.1.105+. Per-entry required name + command + description. Full schema → reference.md.
Commands referencing shared partials: point at the file by absolute path — "Follow the steps in $+{CLAUDE_PLUGIN_ROOT}/commands/shared/discover.md". Claude Code substitutes $+{CLAUDE_PLUGIN_ROOT} in command, skill and agent bodies; a bare commands/shared/… path does not resolve, because a command is not told where its plugin lives.
Give each partial user-invocable: false and disable-model-invocation: true, so it stays out of the skill listing while commands still read it.
Agents referencing skills in frontmatter:
skills: ["nlpm:conventions", "nlpm:conventions-claude"]Hooks referencing scripts:
"command": "$+{CLAUDE_PLUGIN_ROOT}/scripts/check.sh"Always use $+{CLAUDE_PLUGIN_ROOT} for intra-plugin file references. Hardcoded absolute paths break portability.
Cross-plugin skill references use the same plugin:skill format. The plugin must be installed for the reference to resolve.
~/.claude/projects/<slug>/memory/)Auto memory (v2.1.59+) lives at ~/.claude/projects/<project-slug>/memory/, toggled by autoMemoryEnabled / relocated by autoMemoryDirectory (§11); individual files need name/description/type frontmatter and an entry in the MEMORY.md index. Full schema, type values and rules → reference.md.
Tool names valid in tools:, allowed-tools:, disallowed-tools:. Never flag a well-formed tool name as "unknown" or "undocumented" — the catalog grows and any string matching Pascal-name or mcp__<server>__<tool> patterns is valid. Key renames: Task → Agent (alias kept); MultiEdit, BashOutput, KillBash removed; TodoWrite default-off (→ Task* family); SlashCommand folded into Skill.
Full catalog — built-in tools, renames/removals, MCP naming → reference.md. Authoritative source: code.claude.com/docs/en/tools-reference.md.
Marketplace manifest: .claude-plugin/marketplace.json at the marketplace repo root. Required top-level: name, owner (maintainer-info object), plugins. Optional: $schema, description, version, metadata.description, metadata.version, metadata.pluginRoot, forceRemoveDeletedPlugins, allowCrossMarketplaceDependenciesOn, renames. Per-plugin entries may add category, tags, strict, relevance, defaultEnabled. Full schema, source types, and renames/strict semantics → reference.md.
Plugin from URL (v2.1.x): --plugin-url and --plugin-dir flags accept .zip archives.
Namespacing: plugin skills, commands, and agents are all namespaced under the plugin — /my-plugin:hello for skills/commands, my-plugin:code-reviewer in the @-mention typeahead for agents. Prevents conflicts.
This skill covers Claude Code conventions. It does NOT cover:
nlpm:conventionsnlpm:scoringResolved in the 2026-08-02 refresh (no longer uncertain):
hooks.md (§7); exit-code non-blocking list completed.description is Recommended, not Required (§2.1); fable model alias + claude-opus-5 example added (§2.1, §4)..claude/memory/*.md claim removed (§10, was self-contradictory with §15).marketplace.json required owner + strict/renames folded into §17; namespacing corrected (agents/commands are namespaced too). slash-commands.md citation retired for skills.md/commands.md.TodoWrite default-off) and v2.1.154 (defaultEnabled) confirmed literal in current docs.Still approximate (verify before citing a specific tag):
language settings.json key still exists — not found in repeated fetches, but the source page returned inconsistent partial coverage, so it is NOT dropped on that evidence alone..claude/rules/ frontmatter recognizes a description field (§6) — not shown in any current docs example; unverified this pass.© xiaolai, ISC. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file in skills/nlpm/conventions-claude of xiaolai/nlpm.
Open the folder on GitHubat commit 307328b
Conventions Claude next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Conventions Claude this skillxiaolai/nlpm | 148 | — | ~6.3k | Automated safety check: Pass | ISC | |
| Hook Development for Claude Code Pluginsanthropics/claude-plugins-official | 38k | 10 repos | ~4.1k | Automated safety check: Notes | Apache-2.0 | |
| Claude Code Agent Developmentanthropics/claude-plugins-official | 38k | 7 repos | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Claude Code Skill Developer Guidediet103/claude-code-infrastructure-showcase | 10k | 11 repos | ~3.5k | Automated safety check: Pass | MIT | |
| Plugin Settings Patternanthropics/claude-plugins-official | 38k | 7 repos | ~3k | Automated safety check: Pass | Apache-2.0 | |
| MCP Integration for Pluginsanthropics/claude-plugins-official | 38k | 11 repos | ~3.1k | Automated safety check: Pass | Apache-2.0 |
anthropics/claude-plugins-official
Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.
anthropics/claude-plugins-official
Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.
diet103/claude-code-infrastructure-showcase
A guide to creating and managing Claude Code skills with auto-activation: skill-rules.json triggers, hooks, enforcement levels, YAML frontmatter and progressive disclosure.
anthropics/claude-plugins-official
Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.
anthropics/claude-plugins-official
Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.
anthropics/claude-plugins-official
Explains how to write Claude Code slash commands: Markdown files with YAML frontmatter, arguments, file references, bash context and interactive prompts.
xiaolai/nlpm
Universal NL conventions: SKILL.md open spec, AGENTS.md, vague quantifiers, naming.
xiaolai/nlpm
Antigravity and Gemini CLI artifact schemas: .gemini/ paths, extensions, hooks.
xiaolai/nlpm
Codex CLI artifact schemas: config.toml, .codex-plugin, skills, hooks, AGENTS.md.
xiaolai/nlpm
Multi-agent workflow patterns: parallel dispatch, pipelines, QC gates, retries.
xiaolai/nlpm
NL artifact anti-patterns: vague quantifiers, bare prohibitions, oversized skills.
xiaolai/nlpm
100-point NL artifact rubric: penalty tables per artifact type, calibration cases.
Categories
Claude Code artifact schemas: plugin.json, frontmatter, hooks, settings, tools. Conventions Claude is an agent skill from xiaolai/nlpm.json, frontmatter, hooks, settings, tools.
Conventions Claude fits situations like: tasks that involve Hooks and plugins.
Run `npx skills add xiaolai/nlpm --skill conventions-claude -a claude-code`. Or copy the skill folder (skills/nlpm/conventions-claude in xiaolai/nlpm) into .claude/skills/conventions-claude in your project. Claude Code loads it when a task matches its description.
Run `npx skills add xiaolai/nlpm --skill conventions-claude -a codex`. Or copy the skill folder (skills/nlpm/conventions-claude in xiaolai/nlpm) into .agents/skills/conventions-claude in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xiaolai/nlpm --skill conventions-claude -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/conventions-claude, .gemini/skills/conventions-claude, .github/skills/conventions-claude and .opencode/skills/conventions-claude in your project.
Going by SKILL.md and its folder, Conventions Claude needs the command-line tools its instructions call (claude and git).
SKILL.md names 1 domain. As links in the text: code.claude.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Conventions Claude is published under the ISC licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 6.3k tokens (SKILL.md is roughly 25k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Conventions Claude: Hook Development for Claude Code Plugins (anthropics/claude-plugins-official, 38k stars), Claude Code Agent Development (anthropics/claude-plugins-official, 38k stars), Claude Code Skill Developer Guide (diet103/claude-code-infrastructure-showcase, 10k stars) and Plugin Settings Pattern (anthropics/claude-plugins-official, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
xiaolai (a GitHub user) maintains it in xiaolai/nlpm, which has 148 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 9, 2026.
Source: xiaolai/nlpm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.