Agent skill

Writing Plugins

by xiaolai in xiaolai/nlpm

How to design plugins: architecture, artifact choice, manifests, marketplaces.

ISCAuto-check passedAgent Workflows

Install Writing Plugins

skills CLI
$ npx skills add xiaolai/nlpm --skill writing-plugins -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install xiaolai/nlpm writing-plugins --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/xiaolai/nlpm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nlpm/writing-plugins .claude/skills/writing-plugins && rm -rf skills-src

Use ~/.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/

Facts

Skill name
writing-plugins
GitHub stars
146
Token cost
~3.5k tokens
SKILL.md length
1,264 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
ISC

At a glance

How to design plugins: architecture, artifact choice, manifests, marketplaces.

  • Works in 10 steps: Plugin = Commands + Agents + Skills +… → Architecture Patterns → The plugin.json Manifest → …
  • Tasks that involve Hooks and plugins
  • SKILL.md covers 1. Plugin = Commands + Agents…, 2. Architecture Patterns, 3. The plugin.json Manifest and 4. File Structure, plus 4 more sections
  • Calls claude and npx

What it does

Writing Plugins is an agent skill from xiaolai/nlpm. How to design plugins: architecture, artifact choice, manifests, marketplaces.

Its SKILL.md is about 3.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

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.

When your agent uses it

  • Tasks that involve Hooks and plugins

Example prompts

  • “/writing-plugins”

Requirements

  • Node.js

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Plugin = Commands + Agents + Skills + Hooks
  2. Architecture Patterns
  3. The plugin.json Manifest
  4. File Structure
  5. Versioning
  6. AGENTS.md for Plugins
  7. Shared Partials
  8. Testing Your Plugin
  9. Marketplace Publishing
  10. Common Mistakes

What it can do on your machine

Read from SKILL.md and the folder at commit 6fdbd05. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • claude
    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Writing Plugins loads about 3.5k tokens when it runs. Until then it costs about 24 tokens; SKILL.md has 1,264 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~24
When it runs · the whole SKILL.md, loaded when a task matches
~3.5k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from xiaolai/nlpm at commit 6fdbd05, republished under its ISC licence (© xiaolai). 1,264 words, ~3,531 tokens.

Download SKILL.mdSave it as .claude/skills/writing-plugins/SKILL.md (or your agent's skills folder).
name
writing-plugins
description
How to design plugins: architecture, artifact choice, manifests, marketplaces.
version
0.2.0
user-invocable
false

Writing Plugins

Scope: covers plugin design and architecture. The examples use the Claude Code layout (.claude-plugin/plugin.json + auto-discovered commands/, agents/, skills/, hooks/). The same artifact-selection and architecture reasoning maps to the other tools — only the manifest path and packaging differ:

  • Codex CLI: .codex-plugin/plugin.json manifest + .agents/plugins/marketplace.json; skills live at .agents/skills/. See [[nlpm:conventions-codex]].
  • Antigravity: gemini-extension.json (becoming "Antigravity plugins"); skills at .agent/skills/. See [[nlpm:conventions-antigravity]].
  • Cross-tool skills: a SKILL.md collection with no plugin wrapper installs into any tool via npx skills add. See [[writing-skills]].

For individual artifact authoring, see [[writing-skills]], [[writing-agents]], [[writing-hooks]], [[writing-rules]].

1. Plugin = Commands + Agents + Skills + Hooks

A plugin is a collection of NL artifacts that work together. Before writing anything, decide which artifacts you need.

Artifact Selection Guide
User needArtifactExample
User runs a slash commandCommand/nlpm:score path/to/file.md
AI works autonomously on a taskAgentSecurity scanner dispatched by a command
Domain knowledge for agents/ClaudeSkillSKILL.md with patterns and decision tables
Something must happen automatically on eventsHookLint-on-save, block force push
External service integrationMCP server (.mcp.json)GitHub API, Slack notifications
Minimum Viable Plugin

The smallest useful plugin has one artifact:

my-plugin/
  .claude-plugin/
    plugin.json
  commands/
    do-thing.md

Don't add agents, skills, or hooks until you need them. Each artifact adds maintenance burden.

2. Architecture Patterns

Pattern: Single Command (simplest)

Command does everything itself. No agents, no orchestration.

Command receives input --> processes --> outputs result

Use when: task is simple, deterministic, single-step. Example: loc-guardian /scan -- counts lines, checks limits, reports.

File structure:

my-plugin/
  .claude-plugin/plugin.json
  commands/do-thing.md
Pattern: Command + Agent

Command parses input and dispatches one agent for heavy work.

Command parses input --> dispatches agent --> formats output

Use when: task requires AI judgment but has a clear entry point. Example: /nlpm:score dispatches a scorer agent.

File structure:

my-plugin/
  .claude-plugin/plugin.json
  commands/analyze.md
  agents/analyzer.md
Pattern: Command + Multiple Agents (parallel)

Command dispatches 2–6 agents in parallel, synthesizes results.

Command --> agent-1 (security)
        --> agent-2 (performance)    --> synthesize --> output
        --> agent-3 (architecture)

Use when: multiple independent analyses of the same input. Example: grill dispatches 6 review agents in parallel.

File structure:

my-plugin/
  .claude-plugin/plugin.json
  commands/review.md
  agents/
    security-agent.md
    performance-agent.md
    architecture-agent.md
Pattern: Command + Agent Pipeline (sequential)

Each agent feeds into the next. Stages have different model requirements.

Command --> parse (haiku) --> analyze (sonnet) --> QC (sonnet) --> output

Use when: multi-phase processing where each phase depends on the previous. Example: reading-assistant's 4-phase pipeline.

File structure:

my-plugin/
  .claude-plugin/plugin.json
  commands/process.md
  agents/
    parser.md       # haiku
    analyzer.md     # sonnet
    qc-agent.md     # sonnet
Pattern: Hooks Only (no commands)

Plugin enforces policy silently via hooks. No user-facing commands.

Event fires --> hook checks --> allow/deny/advise

Use when: enforcement should be automatic, not user-initiated. Example: tdd-guardian's pre-commit quality gate.

File structure:

my-plugin/
  .claude-plugin/plugin.json
  hooks/hooks.json
  scripts/check.sh
Pattern Selection Matrix
QuestionYes -->No -->
Does the user explicitly trigger it?Needs a commandHooks only
Does it require AI judgment?Needs agentsCommand-only or hooks
Are there independent sub-analyses?Parallel agentsSequential or single agent
Does each step depend on the previous?Sequential pipelineParallel or single
Should it run automatically on events?Add hooksCommands only
Does Claude need domain knowledge?Add skillsNo skills needed

3. The plugin.json Manifest

Required Fields

Only name is strictly required:

json
{
  "name": "my-plugin"
}

Ship with these for discoverability and marketplace listing:

json
{
  "name": "my-plugin",
  "version": "0.1.0",
  "description": "What this plugin does in one sentence",
  "author": { "name": "your-name" },
  "license": "MIT",
  "keywords": ["relevant", "search", "terms"]
}

category is not a manifest field: it belongs to the plugin's entry in a marketplace.json (see §9 and nlpm:conventions-claude §1). Claude Code ignores it in plugin.json.

Field Reference
FieldPurposeExample
nameUnique identifier, used in slash commands"nlpm"
versionSemver, used by marketplace and update checks"0.1.0"
descriptionOne-line summary for marketplace listing"NL programming quality tools"
author.nameCreator attribution"xiaolai"
licenseOpen source license"MIT"
keywordsSearch terms for marketplace discovery["linter", "quality"]

4. File Structure

Full Plugin Layout
my-plugin/
  .claude-plugin/
    plugin.json              # manifest (required)
    marketplace.json         # for marketplace publishing
  commands/                  # auto-discovered by Claude Code
    do-thing.md              # user-invocable: /plugin:do-thing
    advanced-thing.md
    shared/                  # non-invocable partials
      common-logic.md        # user-invocable: false
      format-output.md
  agents/                    # auto-discovered
    worker.md
    reviewer.md
  skills/                    # auto-discovered
    my-plugin/
      domain-knowledge/
        SKILL.md
      advanced-topic/
        SKILL.md
        references/
          deep-dive.md
  hooks/
    hooks.json               # hook definitions
  scripts/                   # hook scripts, utilities
    check.sh
    validate.sh
  AGENTS.md                  # developer notes and architecture (for the model); no root CLAUDE.md
  README.md                  # user documentation (for humans)
  LICENSE
Directory Conventions
DirectoryAuto-discovered?What goes here
.claude-plugin/Yes (manifest)Plugin metadata
commands/YesSlash command definitions
commands/shared/Yes (but not invocable)Shared command logic
agents/YesAgent definitions
skills/YesDomain knowledge
hooks/Yes (hooks.json)Event hooks
scripts/NoShell scripts, utilities
Naming Conventions
ArtifactFile namingExample
Commandskebab-case, descriptive verbscan-files.md, generate-report.md
Agentskebab-case, role-nounsecurity-reviewer.md, parser.md
Skillskebab-case directory, always SKILL.mdskills/my-plugin/react-patterns/SKILL.md
Hook scriptskebab-case, descriptivecheck-loc.sh, validate-config.sh

5. Versioning

Semver Rules
Change typeBumpExample
Bug fixes, typo corrections, penalty adjustmentsPatch: 0.1.0 -> 0.1.1Fix scoring formula
New commands, new agents, new featuresMinor: 0.1.0 -> 0.2.0Add /plugin:export command
Breaking changes (renamed commands, removed features)Major: 0.1.0 -> 1.0.0Rename /scan to /analyze
Four-Place Update

When bumping version, update in four places:

LocationFileField
1. Plugin manifest.claude-plugin/plugin.jsonversion
2. Plugin marketplace.claude-plugin/marketplace.jsonversion in the plugin's entry
3. Central marketplace manifest~/.claude/plugins/marketplaces/xiaolai/.claude-plugin/marketplace.jsonversion
4. Central marketplace README~/.claude/plugins/marketplaces/xiaolai/README.mdVersion in the table

Order: push plugin repo first, then update central marketplace. The marketplace points to the repo -- if the repo isn't updated yet, users pull stale code.

6. AGENTS.md for Plugins

Your plugin's AGENTS.md is for the model (Claude, Codex), not the user. It tells the model how the plugin's artifacts relate to each other. Claude Code 2.1.277+ reads AGENTS.md natively. Do not put a CLAUDE.md at the plugin root: it is not loaded as plugin context, claude plugin validate warns about it, and while it exists Claude Code skips AGENTS.md in that directory (see nlpm:conventions-claude §10).

Show full SKILL.md (483 more words)Show less
What to Include
markdown
# my-plugin

## Architecture
Brief description of what the plugin does and how artifacts interact.

## Artifacts

### Commands
| Command | Purpose |
|---------|---------|
| /plugin:scan | Discovers and inventories files |
| /plugin:fix | Auto-fixes issues found by scan |

### Agents
| Agent | Model | Role |
|-------|-------|------|
| scanner | haiku | Mechanical file discovery |
| fixer | sonnet | AI-powered fix generation |

### Conventions
- All agents output findings in severity-tagged format
- Scanner runs before fixer (sequential dependency)
- Hook scripts use fail-open pattern
What NOT to Include
  • Installation instructions (those go in README.md)
  • User-facing documentation (README.md)
  • Changelog (CHANGELOG.md or git history)
  • Contributing guidelines (CONTRIBUTING.md)

7. Shared Partials

Extract repeated logic into commands/shared/*.md with user-invocable: false.

Partial Frontmatter
yaml
---
user-invocable: false
description: "Shared config loading logic"
---
Good Candidates for Extraction
PartialContentWhen to extract
shared/load-config.mdRead and validate config file3+ commands need config
shared/discover-files.mdFind target files by pattern3+ commands scan files
shared/validate-prereqs.mdCheck tool availability2+ commands need same tools
shared/format-report.mdReport header, footer, severity format3+ commands output reports
When NOT to Extract
  • Logic used by only 1 command (premature abstraction)
  • Simple logic under 10 lines (duplication is fine)
  • Logic that differs slightly between commands (forced generalization adds complexity)

8. Testing Your Plugin

Pre-Publish Checklist
CheckHowPass criteria
Structure validationclaude plugin validate /path/to/pluginNo errors
Command: no argsRun each command with no argumentsHelpful error or usage message
Command: normal argsRun each command with typical inputCorrect output
Command: edge casesEmpty files, huge files, missing filesGraceful error handling
Agent triggeringTry queries that should and shouldn't triggerCorrect dispatch decisions
Hook scriptschmod +x check, run with test JSONValid JSON output
Hook fail-openKill script mid-executionAction is allowed
Testing Agent Triggers

For each agent, test with 3 types of queries:

Query typeExpectedExample
Direct matchAgent triggers"Scan this code for security issues"
Adjacent topicAgent may or may not trigger"Is this code okay?"
UnrelatedAgent does NOT trigger"What's the weather?"

9. Marketplace Publishing

  1. Push your plugin repo to GitHub
  2. Add entry to central marketplace.json (name, source, description, version, author, license, keywords, category)
  3. Add row to central marketplace README.md version table
  4. Commit and push the central marketplace repo
  5. Verify: claude plugin install my-plugin@xiaolai --scope project

Pre-publish checks: claude plugin validate ., verify no hardcoded paths (grep -r '/Users/' commands/ agents/ hooks/), verify all scripts executable, verify version matches in all 4 locations.

10. Common Mistakes

MistakeImpactFix
Commands that do too muchHard to maintain, unreliableSplit into focused commands
Agents without examples40% trigger accuracyAdd 1 specific scenario example in the description + a "Not for" sentence
Skills over 500 linesContext bloat, slow loadingExtract to references/ subdirectory
Hooks that block without explanationFrustrating UXAlways include permissionDecisionReason
No AGENTS.mdClaude doesn't understand plugin architectureAdd architecture overview to AGENTS.md (no root CLAUDE.md)
README documents internalsUsers confused by implementation detailsREADME = user guide, AGENTS.md = internals
Hardcoded pathsBreaks on other machinesUse the plugin-root variable $+{CLAUDE_PLUGIN_ROOT} everywhere (split by a + so Claude Code does not replace it when it loads this skill; the real token has no +)
No error handling in commandsSilent failuresAdd explicit error cases
Version not updated in all 4 placesMarketplace shows wrong versionUse the four-place update checklist
Premature extraction into shared/Over-abstracted, harder to understandExtract only when 3+ consumers exist

© xiaolai, ISC. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/nlpm/writing-plugins of xiaolai/nlpm.

Open the folder on GitHubat commit 6fdbd05

Compare with similar skills

Writing Plugins 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.

Writing Plugins compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Writing Plugins this skillxiaolai/nlpm146—~3.5kAutomated safety check: PassISC
Hook Development for Claude Code Pluginsanthropics/claude-plugins-official38k11 repos~4.1kAutomated safety check: NotesApache-2.0
Claude Code Agent Developmentanthropics/claude-plugins-official38k8 repos~2.8kAutomated safety check: PassApache-2.0
Claude Code Skill Developer Guidediet103/claude-code-infrastructure-showcase10k11 repos~3.5kAutomated safety check: PassMIT
Plugin Settings Patternanthropics/claude-plugins-official38k7 repos~3kAutomated safety check: PassApache-2.0
MCP Integration for Pluginsanthropics/claude-plugins-official38k11 repos~3.1kAutomated safety check: PassApache-2.0

Similar skills

  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    38k GitHub starsUsed in 11 repos~4.1k tokens
    Agent WorkflowsAuto-check: notes
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    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.

    38k GitHub starsUsed in 8 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Skill Developer Guide

    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.

    10k GitHub starsUsed in 11 repos~3.5k tokens
    Agent WorkflowsAuto-check passed
  • Plugin Settings Pattern

    anthropics/claude-plugins-official

    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.

    38k GitHub starsUsed in 7 repos~3k tokens
    Agent WorkflowsAuto-check passed
  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    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.

    38k GitHub starsUsed in 11 repos~3.1k tokens
    Agent WorkflowsAuto-check passed
  • Claude Code Command Development

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code slash commands: Markdown files with YAML frontmatter, arguments, file references, bash context and interactive prompts.

    38k GitHub starsUsed in 10 repos~4.8k tokens
    Agent WorkflowsAuto-check passed

More from xiaolai/nlpm

All 15 skills in this repo
  • Conventions

    xiaolai/nlpm

    Universal NL conventions: SKILL.md open spec, AGENTS.md, vague quantifiers, naming.

    146 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Antigravity and Gemini CLI artifact schemas: .gemini/ paths, extensions, hooks.

    146 GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Conventions Codex

    xiaolai/nlpm

    Codex CLI artifact schemas: config.toml, .codex-plugin, skills, hooks, AGENTS.md.

    146 GitHub stars~4.9k tokensUpdated today
    Auto-check passed
  • Orchestration

    xiaolai/nlpm

    Multi-agent workflow patterns: parallel dispatch, pipelines, QC gates, retries.

    146 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Patterns

    xiaolai/nlpm

    NL artifact anti-patterns: vague quantifiers, bare prohibitions, oversized skills.

    146 GitHub stars~3.9k tokensUpdated today
    Auto-check passed
  • Scoring

    xiaolai/nlpm

    100-point NL artifact rubric: penalty tables per artifact type, calibration cases.

    146 GitHub stars~5.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Writing Plugins

What does Writing Plugins do?

How to design plugins: architecture, artifact choice, manifests, marketplaces. Writing Plugins is an agent skill from xiaolai/nlpm. How to design plugins: architecture, artifact choice, manifests, marketplaces.

When should I use Writing Plugins?

Writing Plugins fits situations like: tasks that involve Hooks and plugins.

How do I install Writing Plugins in Claude Code?

Run `npx skills add xiaolai/nlpm --skill writing-plugins -a claude-code`. Or copy the skill folder (skills/nlpm/writing-plugins in xiaolai/nlpm) into .claude/skills/writing-plugins in your project. Claude Code loads it when a task matches its description.

How do I install Writing Plugins in Codex?

Run `npx skills add xiaolai/nlpm --skill writing-plugins -a codex`. Or copy the skill folder (skills/nlpm/writing-plugins in xiaolai/nlpm) into .agents/skills/writing-plugins in your project. Codex loads it when a task matches its description.

Can I use Writing Plugins in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xiaolai/nlpm --skill writing-plugins -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/writing-plugins, .gemini/skills/writing-plugins, .github/skills/writing-plugins and .opencode/skills/writing-plugins in your project.

What does Writing Plugins need to run?

Going by SKILL.md and its folder, Writing Plugins needs the command-line tools its instructions call (claude and npx). Our summary lists: Node.js.

Does Writing Plugins access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Writing Plugins safe to install?

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.

What licence does Writing Plugins use?

Writing Plugins is published under the ISC licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Writing Plugins use?

About 3.5k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Writing Plugins?

Skills that share tags, products or a category with Writing Plugins: 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.

Who maintains Writing Plugins?

xiaolai (a GitHub user) maintains it in xiaolai/nlpm, which has 146 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 8, 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.