6767-c-DR-STND-claude-code-extensions-standard.md
Document Type: Developer Resource - Standard (DR-STND)
Document ID: 6767-c-DR-STND-claude-code-extensions-standard
Title: Claude Code Extensions Standard (Unified)
Version: 3.0.0
Status: CANONICAL (Enterprise-Only)
Date: 2025-12-20
Supersedes: 6767-a (plugins), 6767-b (skills)
Superseded By: 6767-h (master spec)
Authority: Intent Solutions (Enterprise Marketplace)
TRUTH INVARIANTS (ENTERPRISE MODE)
MODE: ENTERPRISE MODE ALWAYS ON. No "Anthropic-minimum" fallback. All fields marked "REQUIRED" are REQUIRED.
CORE RULES:
allowed-tools Format:
- ✅ CORRECT: CSV string →
allowed-tools: "Read,Write,Grep,Glob"
- ❌ WRONG: YAML array →
allowed-tools: [Read, Write, Grep]
- Violation: CRITICAL ERROR (
SKILL_022)
Bash Scoping:
- ✅ CORRECT: Scoped →
Bash(git:*), Bash(npm:*), Bash(python:*)
- ❌ WRONG: Unscoped →
Bash
- Violation: CRITICAL ERROR (
SKILL_024)
Path Portability:
- ✅ CORRECT:
${CLAUDE_PLUGIN_ROOT}/... or {baseDir}/...
- ❌ WRONG:
/home/user/... or ~/...
- Violation: CRITICAL ERROR (
SKILL_103, SEC_005)
Naming Convention:
- Pattern:
^[a-z0-9-]+$ (kebab-case only)
- Max length: 64 chars
- Reserved words: NO "claude" or "anthropic"
- Violation: CRITICAL ERROR (
NAMING_001, NAMING_002, NAMING_003)
Versioning:
- Format: SemVer
MAJOR.MINOR.PATCH (3 parts)
- Example:
1.0.0, 2.3.1
- Violation: CRITICAL ERROR (
PLUGIN_012, SKILL_032)
Directory Structure:
.claude-plugin/ contains ONLY plugin.json
- Component dirs (skills/, agents/, commands/) at plugin root, NOT inside
.claude-plugin/
- Violation: CRITICAL ERROR (
DIR_002, DIR_005)
Security:
- NO hardcoded secrets, API keys, .env files committed
- Secrets via environment variables ONLY
- Exemptions: ONLY
tests/fixtures/** + known test patterns (EXAMPLE, DUMMY, test-)
- Violation: CRITICAL ERROR (
SEC_001, SEC_002, SEC_003, SEC_004)
Context Hygiene:
- SKILL.md body ≤ 5,000 words / 500 lines / ~7,500 tokens
- Heavy content in
references/ directory (loaded on-demand)
- Violation: HIGH ERROR (
SKILL_100, SKILL_101)
Discoverability:
- Description MUST include "Use when..." phrase
- Description MUST include 2-6 trigger phrases
- Violation: HIGH ERROR (
SKILL_015, SKILL_016)
Required Fields (Enterprise):
- Plugin: name, version, description, author (name + email), license, keywords
- Skill: name, description, allowed-tools (CSV), version, author, license, tags
- Violation: CRITICAL ERROR (various
PLUGIN_*, SKILL_* codes)
VALIDATION:
- Validator runs in ENTERPRISE MODE ONLY
- CRITICAL/HIGH errors BLOCK PR merge
- Deterministic error codes (6767-d schema)
NO EXCEPTIONS: These rules apply to ALL plugins/skills, regardless of size or complexity.
1. Purpose and Scope
1.1 Purpose
This specification defines the unified standard for all Claude Code extension types:
- Plugins (containers: manifest, metadata, lifecycle)
- Skills (capabilities: workflows, tool authorization, context)
- Agents (subagents: delegation, specialization, model selection)
- Commands (slash commands: user-triggered prompts)
- Hooks (event handlers: lifecycle automation)
- MCP Servers (Model Context Protocol: external tool integration)
This standard operates in ENTERPRISE MODE ONLY. There is no "Anthropic-minimum" mode. All requirements herein are MANDATORY for marketplace publication, CI gates, and production deployment.
1.2 Scope
In Scope:
- Directory structure and naming conventions
- Manifest schemas (plugin.json, SKILL.md frontmatter, agent.md, hooks.json, .mcp.json)
- Security constraints (secrets, paths, tool scoping)
- Context hygiene (progressive disclosure, .claudeignore, size limits)
- Portability (environment variables, relative paths)
- Discoverability (descriptions, trigger phrases, router guidance)
- Validation and CI enforcement
Out of Scope:
- Runtime execution behavior (covered by Claude Code core)
- User interface design (covered by Claude frontend specs)
- Third-party integrations (covered by MCP protocol spec)
2. Key Definitions
2.1 Extension Types
| Type |
Definition |
Primary File |
Location |
| Plugin |
Container for skills/agents/commands/hooks/MCP servers |
plugin.json |
.claude-plugin/plugin.json |
| Skill |
Capability that teaches Claude a workflow or process |
SKILL.md |
skills/<skill-name>/SKILL.md |
| Agent |
Specialized subagent for complex, multi-step tasks |
agent.md (frontmatter) |
agents/<agent-name>.md |
| Command |
User-triggered slash command that expands to a prompt |
command.md (optional frontmatter) |
commands/<command-name>.md |
| Hook |
Event handler that runs on lifecycle events |
hooks.json |
hooks/hooks.json OR inline in plugin.json |
| MCP Server |
External tool server using Model Context Protocol |
.mcp.json |
.mcp.json OR inline in plugin.json |
2.2 Container vs Capability
- Container (Plugin): Metadata and lifecycle management. The
.claude-plugin/plugin.json file is the plugin manifest.
- Capability (Skill/Agent/Command): Actual functionality. Lives in component directories at plugin root.
- Integration (Hook/MCP): Automation and external tools. Configured via JSON.
Critical Rule: .claude-plugin/ contains ONLY plugin.json. All component directories (skills/, agents/, commands/, hooks/) MUST be at plugin root, NOT inside .claude-plugin/.
2.3 Enterprise vs Anthropic-Minimum
This spec operates in ENTERPRISE MODE ONLY. Historical "Anthropic-minimum" mode is deprecated. All fields marked "Enterprise Required" in this spec are REQUIRED. Validators, CI gates, and marketplaces MUST enforce enterprise requirements.
3. Directory Structure
3.1 Plugin Root Anatomy
my-plugin/ ← Plugin root
├── .claude-plugin/ ← Metadata directory
│ └── plugin.json ← ONLY file allowed here
├── skills/ ← Optional: skill capabilities
│ └── <skill-name>/
│ ├── SKILL.md ← Skill definition (frontmatter + body)
│ └── references/ ← Optional: heavy tables/docs
├── agents/ ← Optional: agent definitions
│ └── <agent-name>.md ← Agent definition (frontmatter + body)
├── commands/ ← Optional: slash commands
│ └── <command-name>.md ← Command definition
├── hooks/ ← Optional: event hooks
│ └── hooks.json ← Hook configuration
├── scripts/ ← Optional: helper scripts
│ ├── validate_standards.py
│ └── ...
├── .mcp.json ← Optional: MCP server config
├── .claudeignore ← Optional: context exclusions
├── README.md ← Required: documentation
└── 000-docs/ ← Optional: project docs (if complex)
└── (flat structure, NNN-CC-ABCD naming)
3.2 Critical Constraints
MUST:
.claude-plugin/ contains ONLY plugin.json (no other files)
- Component directories (skills/, agents/, commands/, hooks/) at plugin root (NOT inside
.claude-plugin/)
- Only create directories you use (NO empty placeholders)
- Plugin name, skill names, agent names MUST be kebab-case
- All paths MUST be relative or use
${CLAUDE_PLUGIN_ROOT} / {baseDir}
MUST NOT:
- Place any components inside
.claude-plugin/ besides plugin.json
- Use absolute paths (e.g.,
/home/user/...)
- Hardcode secrets or API keys
- Commit
.env files
- Use uppercase letters in names
4. Plugin Manifest (plugin.json)
4.1 Schema (Enterprise Required Fields)
{
"name": "my-plugin-name", // REQUIRED: kebab-case, max 64 chars, ^[a-z0-9-]+$
"version": "1.0.0", // REQUIRED: SemVer (MAJOR.MINOR.PATCH)
"description": "...", // REQUIRED: brief explanation
"author": { // REQUIRED: author object
"name": "Developer Name", // REQUIRED: author name
"email": "dev@example.com" // REQUIRED: author email
},
"license": "MIT", // REQUIRED: SPDX identifier
"keywords": ["tag1", "tag2"], // REQUIRED: array of strings
"homepage": "https://...", // OPTIONAL: documentation URL
"repository": "https://github.com/...", // OPTIONAL: source URL
"commands": "./commands/", // OPTIONAL: path(s) to commands
"agents": "./agents/", // OPTIONAL: path(s) to agents
"skills": ["./skills/skill-1/"], // OPTIONAL: array of skill paths
"hooks": "./hooks/hooks.json", // OPTIONAL: path or inline config
"mcpServers": { // OPTIONAL: MCP server config
"server-name": {
"command": "python",
"args": ["${CLAUDE_PLUGIN_ROOT}/bin/server.py"]
}
}
}
4.2 Field Constraints (Enterprise)
| Field |
Type |
Required |
Constraints |
name |
string |
✅ REQUIRED |
kebab-case, max 64 chars, pattern ^[a-z0-9-]+$, no "claude" or "anthropic" |
version |
string |
✅ REQUIRED |
SemVer (MAJOR.MINOR.PATCH), 3 parts |
description |
string |
✅ REQUIRED |
Non-empty, max 1024 chars |
author |
object |
✅ REQUIRED |
MUST have name and email |
author.name |
string |
✅ REQUIRED |
Non-empty |
author.email |
string |
✅ REQUIRED |
Valid email format |
license |
string |
✅ REQUIRED |
SPDX identifier (MIT, Apache-2.0, Proprietary, etc.) |
keywords |
array |
✅ REQUIRED |
Array of strings, min 1 item |
homepage |
string |
OPTIONAL |
Valid URL if present |
repository |
string |
OPTIONAL |
Valid URL if present |
commands |
string or array |
OPTIONAL |
Path(s) to command directories |
agents |
string or array |
OPTIONAL |
Path(s) to agent files/directories |
skills |
string or array |
OPTIONAL |
Path(s) to skill directories |
hooks |
string or object |
OPTIONAL |
Path to hooks.json OR inline config |
mcpServers |
object |
OPTIONAL |
MCP server configuration |
4.3 Portability Rules
Environment Variable: ${CLAUDE_PLUGIN_ROOT}
- Expands to plugin root directory at runtime
- MUST be used for all plugin-relative paths in
plugin.json, hooks, MCP servers
- Example:
"${CLAUDE_PLUGIN_ROOT}/bin/server.py"
MUST NOT:
- Use absolute paths (e.g.,
/home/jeremy/...)
- Use
~ or $HOME (not portable)
- Use
. or .. for parent traversal (security risk)
MUST:
- Use
${CLAUDE_PLUGIN_ROOT} for plugin-internal paths
- Use relative paths within plugin root where possible
- Validate all paths in validator
5. Skills
5.1 Skill Anatomy
Location: skills/<skill-name>/SKILL.md
Structure:
- Frontmatter (YAML): Metadata and configuration
- Body (Markdown): Instructions, workflow, examples, error handling
5.2 Frontmatter Schema (Enterprise Required)
---
name: skill-name # REQUIRED: kebab-case, max 64 chars, ^[a-z0-9-]+$
description: "..." # REQUIRED: max 1024 chars, third-person, includes "Use when..." + triggers
allowed-tools: "Read,Write,Grep,Glob" # REQUIRED: CSV string (NOT YAML array)
version: "1.0.0" # REQUIRED: SemVer
author: "Name <email>" # REQUIRED: Name + email
license: "MIT" # REQUIRED: SPDX identifier
tags: ["tag1", "tag2"] # REQUIRED: array of strings
model: "inherit" # OPTIONAL: model override (inherit, sonnet, opus, haiku)
mode: false # OPTIONAL: categorize as mode (default false)
disable-model-invocation: false # OPTIONAL: hide from auto-discovery (default false)
---
5.3 Field Constraints (Enterprise)
| Field |
Type |
Required |
Constraints |
name |
string |
✅ REQUIRED |
kebab-case, max 64 chars, pattern ^[a-z0-9-]+$, no "claude" or "anthropic" |
description |
string |
✅ REQUIRED |
Max 1024 chars, third-person voice, MUST include "Use when..." + trigger phrases |
allowed-tools |
string |
✅ REQUIRED |
CSV string (comma-separated), NOT YAML array. Example: "Read,Write,Grep" |
version |
string |
✅ REQUIRED |
SemVer (MAJOR.MINOR.PATCH) |
author |
string |
✅ REQUIRED |
Format: "Name " or "Name" |
license |
string |
✅ REQUIRED |
SPDX identifier |
tags |
array |
✅ REQUIRED |
Array of strings, min 1 item (marketplace discoverability) |
model |
string |
OPTIONAL |
"inherit" (default), "sonnet", "opus", "haiku", or specific model ID |
mode |
boolean |
OPTIONAL |
Default false. Set true for mode commands (separate UI section) |
disable-model-invocation |
boolean |
OPTIONAL |
Default false. Set true to remove from auto-discovery |
5.4 Description Formula (REQUIRED)
Template:
[Primary capabilities]. [Secondary features]. Use when [scenarios]. Trigger with "[phrases]", "[synonyms]", or "[common-terms]".
Example (Good):
description: "Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction. Trigger with 'process pdf', 'extract from pdf', or 'merge pdfs'."
Example (Bad):
description: "Helps with documents" # ❌ Missing: Use when, triggers, specifics
5.5 allowed-tools (CRITICAL: CSV String NOT YAML Array)
CORRECT (CSV string):
allowed-tools: "Read,Write,Grep,Glob,Bash(git status:*),Bash(git diff:*)"
WRONG (YAML array):
allowed-tools: # ❌ INVALID (will be rejected by validator)
- Read
- Write
- Bash
Tool Scoping (Enterprise Security Policy):
- Prefer minimal tools:
Read,Write,Grep,Glob
- If Bash needed, scope it:
Bash(git:*), Bash(npm:*), Bash(python:*)
- NEVER grant unscoped
Bash (security risk)
- Unscoped Bash MUST be flagged as CRITICAL error by validator
5.6 Body Constraints (Enterprise Context Hygiene)
| Constraint |
Limit |
Rationale |
| Max word count |
5,000 words |
Context window hygiene |
| Max line count |
500 lines |
Progressive disclosure |
| Max tokens |
~7,500 tokens |
LLM context budget |
| Path format |
{baseDir}/... |
Portability (no absolute paths) |
| Reference depth |
1 level |
Prevent reference chains (SKILL.md → ref.md OK; SKILL.md → ref1.md → ref2.md NOT OK) |
Progressive Disclosure Pattern:
- SKILL.md contains workflow, instructions, examples
- Heavy tables/data go in
references/ directory
- References loaded on-demand, not always in context
- Example:
{baseDir}/skills/my-skill/references/error-codes.md
5.7 Required Sections (Enterprise Quality Standard)
- Title (H1): Skill name
- Purpose (1-2 sentences): What this skill does
- Overview (3-5 sentences): How it works
- Prerequisites: Required tools, dependencies, environment setup
- Instructions: Step-by-step numbered workflow
- Output: What the skill produces
- Error Handling: Minimum 4 failure cases with cause + recovery
- Examples: 2-3 examples with input/output pairs
- Resources: Links to references, documentation
6. Agents
6.1 Agent Anatomy
Location: agents/<agent-name>.md
Structure:
- Frontmatter (YAML): Metadata and configuration
- Body (Markdown): Delegation criteria, specialization, instructions
6.2 Frontmatter Schema (Enterprise)
---
name: agent-name # REQUIRED: Agent identifier
description: "..." # REQUIRED: When Claude should delegate to this agent
tools: "Read,Write,Grep,Glob" # OPTIONAL: CSV string (inherits all if omitted)
model: "inherit" # OPTIONAL: model override
permissionMode: "auto" # OPTIONAL: permission mode
skills: "skill-1,skill-2" # OPTIONAL: comma-separated skill names to auto-load
---
6.3 Field Constraints
| Field |
Type |
Required |
Constraints |
name |
string |
✅ REQUIRED |
Agent identifier (kebab-case recommended) |
description |
string |
✅ REQUIRED |
When Claude should delegate (clear criteria) |
tools |
string |
OPTIONAL |
CSV string (inherits all if omitted) |
model |
string |
OPTIONAL |
Model override (inherit, sonnet, opus, haiku) |
permissionMode |
string |
OPTIONAL |
Permission mode |
skills |
string |
OPTIONAL |
Comma-separated skill names to auto-load |
7. Commands
7.1 Command Anatomy
Location: commands/<command-name>.md
Invocation: User types /<command-name> (filename without .md)
Structure:
- Frontmatter (YAML, optional): Metadata
- Body (Markdown): Prompt text that expands when command is invoked
7.2 Frontmatter Schema (Optional)
---
description: "Brief explanation" # OPTIONAL: What this command does
allowed-tools: "Read,Write,Grep" # OPTIONAL: CSV string (tool restrictions)
---
8. Hooks
8.1 Hook Configuration
Location: hooks/hooks.json OR inline in plugin.json under "hooks" key
Events:
PreToolUse (matcher required)
PostToolUse (matcher required)
PermissionRequest (matcher required)
UserPromptSubmit
Stop
SubagentStop
SessionStart (matcher required)
SessionEnd
PreCompact (matcher required)
Notification (matcher optional)
8.2 Hook Types
- command: Execute bash command
- prompt: LLM-based evaluation
8.3 Output Schema
{
"continue": true, // Boolean: continue or block
"stopReason": "...", // Optional: reason for stopping
"suppressOutput": false, // Boolean: hide output
"systemMessage": "...", // String: message to LLM
"hookSpecificOutput": {} // Object: event-specific fields
}
8.4 Security Constraints
MUST:
- Set timeouts on all hooks (prevent hangs)
- Scope bash commands (no unrestricted bash)
- Validate paths (prevent traversal)
- Use
${CLAUDE_PLUGIN_ROOT} for plugin-relative paths
MUST NOT:
- Execute arbitrary user input without sanitization
- Allow unbounded network calls
- Expose sensitive data in logs
9. MCP Servers
9.1 MCP Configuration
Location: .mcp.json OR inline in plugin.json under "mcpServers" key
Schema:
{
"server-name": {
"command": "python", // Command to execute
"args": [ // Arguments
"${CLAUDE_PLUGIN_ROOT}/bin/server.py"
],
"env": { // Optional: environment variables
"API_KEY": "${MY_API_KEY}"
}
}
}
9.2 Portability Rules
MUST:
- Use
${CLAUDE_PLUGIN_ROOT} for plugin-relative paths
- Use environment variables for secrets (e.g.,
${MY_API_KEY})
- Document required environment variables in README
MUST NOT:
- Hardcode absolute paths
- Hardcode secrets or API keys
- Assume specific directory structure outside plugin root
10. Security Constraints (Enterprise Policy)
10.1 Secrets and Credentials
MUST NOT:
- Hardcode API keys, tokens, passwords in code/config
- Commit
.env files
- Commit credential files
- Log sensitive data
- Pass unvalidated user input to shell
MUST:
- Use environment variables for secrets
- Add
.env to .gitignore
- Document required env vars in README (with
.env.example)
- Sanitize all inputs
- Use
${VARIABLE_NAME} syntax in configs
10.2 Tool Scoping
Bash Tool Scoping (CRITICAL):
- ✅ GOOD:
Bash(git status:*), Bash(npm run test:*), Bash(python -m:*)
- ❌ BAD:
Bash (unscoped - allows arbitrary commands)
Validator MUST:
- Flag unscoped
Bash as CRITICAL error
- Require explicit scoping:
Bash(command:*) or Bash(command subcommand:*)
10.3 Path Safety
MUST NOT:
- Use absolute paths (e.g.,
/home/user/...)
- Use
.. for parent traversal (security risk)
- Allow user-controlled paths without validation
MUST:
- Use
${CLAUDE_PLUGIN_ROOT} for plugin paths
- Use
{baseDir} for repo-relative skill references
- Validate all paths to prevent traversal
10.4 Secret Scanning (Enterprise Validator)
Exemptions (minimal allowlist):
tests/fixtures/** (explicit test data directory)
- Files containing known test patterns:
EXAMPLE, DUMMY, test-, etc.
Scanned Everywhere Else:
- All source code (including non-fixture test code)
- All configuration files
- All documentation
Detected Patterns:
- API keys (32+ char alphanumeric)
- AWS keys (
AKIA...)
- SSH keys (
-----BEGIN RSA PRIVATE KEY-----)
- Emails (PII in non-author contexts)
- Credit cards
Severity: CRITICAL (blocks PR, fails CI)
11. Context Hygiene (Enterprise Policy)
11.1 Progressive Disclosure
Problem: Loading all plugin content into context wastes tokens.
Solution:
- Keep SKILL.md body ≤ 5,000 words
- Move heavy tables/data to
references/ directory
- Load references on-demand, not always in context
- Use
.claudeignore to exclude non-essential files
11.2 .claudeignore Pattern
Purpose: Exclude files from context to save tokens.
Example:
# Build artifacts
*.pyc
__pycache__/
.venv/
node_modules/
# Heavy data files
data/
fixtures/
*.log
*.csv
# Documentation (load on-demand)
docs/
examples/
11.3 Size Limits (Enterprise Quality)
| Component |
Limit |
Enforced By |
| SKILL.md body |
5,000 words / 500 lines / ~7,500 tokens |
Validator (CRITICAL) |
| Plugin description |
1,024 characters |
Validator (CRITICAL) |
| Skill description |
1,024 characters |
Validator (CRITICAL) |
| Reference docs |
No hard limit (loaded on-demand) |
N/A |
12. Discoverability (Router Guidance)
12.1 Description Best Practices
Goal: Help Claude's router decide when to invoke a skill/agent.
Formula:
[Capabilities]. Use when [user scenarios]. Trigger with "[phrases]", "[synonyms]".
Good Example:
Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction. Trigger with "process pdf", "extract from pdf", or "merge pdfs".
Bad Examples:
- "Helps with PDFs" (too vague)
- "PDF processing tool" (no triggers, no scenarios)
- "Extracts text..." (missing "Use when", missing triggers)
12.2 Third-Person Voice (Required)
Descriptions MUST:
- Use third-person voice ("Extracts...", "Processes...", not "I extract...")
- Be objective (not promotional: "amazing tool", "best solution")
- Include concrete scenarios ("when user uploads PDF", not "when needed")
13. Versioning and Deprecation
13.1 Semantic Versioning (SemVer)
Required Format: MAJOR.MINOR.PATCH
Rules:
- MAJOR: Breaking changes (incompatible API changes)
- MINOR: New features, backward-compatible
- PATCH: Bug fixes, documentation
Examples:
- ✅
1.0.0, 2.3.1, 0.1.0
- ❌
v1.0, 1.0, 1 (missing parts)
13.2 Deprecation Process
- Mark deprecated in description:
[DEPRECATED] Old command...
- Keep working for one minor version (e.g., 1.3.x)
- Remove in next major version (e.g., 2.0.0)
- Document in CHANGELOG and README
14. Compliance Modes
14.1 Enterprise Mode (ONLY Mode)
This spec operates in ENTERPRISE MODE ONLY. All fields marked "REQUIRED" in this spec are REQUIRED. Validators MUST enforce enterprise requirements.
Historical Note: Previous specs (6767-a, 6767-b) distinguished "Anthropic-minimum" vs "Enterprise/Marketplace" requirements. This spec deprecates that distinction. Enterprise requirements are now the ONLY requirements.
14.2 Required Fields Summary
Plugin:
- name, version, description, author (name + email), license, keywords
Skill:
- name, description, allowed-tools (CSV string), version, author, license, tags
Agent:
Command:
- (No required frontmatter; body is the prompt)
15. Validation and Enforcement
15.1 Validator Requirements
Every validator MUST:
- Enforce ALL enterprise requirements (no "Anthropic-min" mode)
- Flag violations with severity: CRITICAL, HIGH, MEDIUM, LOW
- Block CRITICAL and HIGH errors in CI
- Report deterministic, actionable errors
Validation Categories:
- Manifest: plugin.json schema, required fields, name format, version format
- Directory Structure:
.claude-plugin/ contains ONLY plugin.json, components at root
- Skills: frontmatter fields, CSV string for allowed-tools, body size limits
- Security: hardcoded secrets, .env files, path traversal, tool scoping
- Naming: kebab-case, max length, reserved words
15.2 CI Gates (Enterprise Policy)
PR Workflow:
- Run validator in enterprise mode
- Block PR on CRITICAL or HIGH errors
- Report all findings
Main Branch Workflow:
- Run comprehensive validation (enterprise mode)
- Run security scans (secrets, dependencies)
- Generate coverage reports
- Archive validation artifacts
15.3 Error Reporting Format
Required Fields:
- Severity: CRITICAL | HIGH | MEDIUM | LOW
- File path: Exact location of violation
- Field: Which field/rule violated
- Expected: What was expected
- Actual: What was found
- Fix: How to remediate (actionable guidance)
Example:
[CRITICAL] skills/my-skill/SKILL.md
Field: allowed-tools
Expected: CSV string (e.g., "Read,Write,Bash(git:*)")
Actual: YAML array format
Fix: Change frontmatter to: allowed-tools: "Read,Write,Bash(git:*)"
16. Governance and Updates
16.1 Authority
This specification is maintained by Intent Solutions for the Enterprise Marketplace.
Contact: jeremy@intentsolutions.io
16.2 Change Process
- Propose change via GitHub issue or pull request
- Review by maintainers (Intent Solutions)
- Approve via consensus
- Update version:
- MAJOR: Breaking changes
- MINOR: New requirements (backward-compatible)
- PATCH: Clarifications, typo fixes
- Publish updated spec
- Deprecate old versions (if breaking)
16.3 Backward Compatibility
Breaking Changes:
- Require MAJOR version bump
- Must include migration guide
- Old version marked DEPRECATED
- Grace period: 1 quarter (3 months)
Non-Breaking Changes:
- New optional fields: MINOR bump
- Clarifications: PATCH bump
17. References
17.1 Related Standards
- 6767-d: Schema definition (machine-readable validation rules)
- 6767-e: Validation and CI gates (enforcement specification)
- Document Filing System v4.2: 000-docs/ structure and naming
17.2 Deprecated Standards
- 6767-a: Claude Code Plugins Standard (v2.x) - DEPRECATED
- 6767-b: Claude Skills Standard (v2.x) - DEPRECATED
Superseded By: This specification (6767-c v3.0.0)
17.3 External Standards
18. Appendix: Examples
18.1 Minimal Plugin (Enterprise Compliant)
Directory:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
└── README.md
plugin.json:
{
"name": "my-plugin",
"version": "1.0.0",
"description": "Example plugin for demonstration",
"author": {
"name": "Developer Name",
"email": "dev@example.com"
},
"license": "MIT",
"keywords": ["example", "demo"]
}
18.2 Plugin with Skills (Enterprise Compliant)
Directory:
analytics-plugin/
├── .claude-plugin/
│ └── plugin.json
├── skills/
│ └── data-analysis/
│ ├── SKILL.md
│ └── references/
│ └── error-codes.md
└── README.md
skills/data-analysis/SKILL.md:
---
name: data-analysis
description: "Analyze datasets with statistical methods, generate visualizations, and export reports. Use when user provides data files or requests analysis, charts, or statistical summaries. Trigger with 'analyze data', 'create chart', or 'statistical analysis'."
allowed-tools: "Read,Write,Grep,Glob,Bash(python:*)"
version: "1.0.0"
author: "Analytics Team <analytics@example.com>"
license: "MIT"
tags: ["analytics", "statistics", "visualization"]
---
# Data Analysis Skill
## Purpose
Analyze datasets and generate insights.
## Instructions
1. Read data file
2. Validate schema
3. Compute statistics
4. Generate visualizations
5. Export report
## Error Handling
- **Missing columns**: Check schema, prompt user for column names
- **Invalid data types**: Convert or skip rows with errors
- **Empty dataset**: Return error message with guidance
- **Memory limits**: Sample large datasets before full processing
## Examples
...
END OF SPECIFICATION
Version: 3.0.0
Status: CANONICAL (Enterprise-Only)
Date: 2025-12-20
1---2name: 2154-6767-c-dr-stnd-claude-code-extensions-standard-0b4533293description: 2154 6767 C Dr Stnd Claude Code Extensions Standard 0b4533294---5# 6767-c-DR-STND-claude-code-extensions-standard.md67**Document Type**: Developer Resource - Standard (DR-STND)8**Document ID**: 6767-c-DR-STND-claude-code-extensions-standard9**Title**: Claude Code Extensions Standard (Unified)10**Version**: 3.0.011**Status**: CANONICAL (Enterprise-Only)12**Date**: 2025-12-2013**Supersedes**: 6767-a (plugins), 6767-b (skills)14**Superseded By**: 6767-h (master spec)15**Authority**: Intent Solutions (Enterprise Marketplace)1617---1819## TRUTH INVARIANTS (ENTERPRISE MODE)2021**MODE**: ENTERPRISE MODE ALWAYS ON. No "Anthropic-minimum" fallback. All fields marked "REQUIRED" are REQUIRED.2223**CORE RULES**:24251. **allowed-tools Format**:26 - ✅ CORRECT: CSV string → `allowed-tools: "Read,Write,Grep,Glob"`27 - ❌ WRONG: YAML array → `allowed-tools: [Read, Write, Grep]`28 - Violation: CRITICAL ERROR (`SKILL_022`)29302. **Bash Scoping**:31 - ✅ CORRECT: Scoped → `Bash(git:*)`, `Bash(npm:*)`, `Bash(python:*)`32 - ❌ WRONG: Unscoped → `Bash`33 - Violation: CRITICAL ERROR (`SKILL_024`)34353. **Path Portability**:36 - ✅ CORRECT: `${CLAUDE_PLUGIN_ROOT}/...` or `{baseDir}/...`37 - ❌ WRONG: `/home/user/...` or `~/...`38 - Violation: CRITICAL ERROR (`SKILL_103`, `SEC_005`)39404. **Naming Convention**:41 - Pattern: `^[a-z0-9-]+$` (kebab-case only)42 - Max length: 64 chars43 - Reserved words: NO "claude" or "anthropic"44 - Violation: CRITICAL ERROR (`NAMING_001`, `NAMING_002`, `NAMING_003`)45465. **Versioning**:47 - Format: SemVer `MAJOR.MINOR.PATCH` (3 parts)48 - Example: `1.0.0`, `2.3.1`49 - Violation: CRITICAL ERROR (`PLUGIN_012`, `SKILL_032`)50516. **Directory Structure**:52 - `.claude-plugin/` contains ONLY `plugin.json`53 - Component dirs (skills/, agents/, commands/) at plugin root, NOT inside `.claude-plugin/`54 - Violation: CRITICAL ERROR (`DIR_002`, `DIR_005`)55567. **Security**:57 - NO hardcoded secrets, API keys, .env files committed58 - Secrets via environment variables ONLY59 - Exemptions: ONLY `tests/fixtures/**` + known test patterns (EXAMPLE, DUMMY, test-)60 - Violation: CRITICAL ERROR (`SEC_001`, `SEC_002`, `SEC_003`, `SEC_004`)61628. **Context Hygiene**:63 - SKILL.md body ≤ 5,000 words / 500 lines / ~7,500 tokens64 - Heavy content in `references/` directory (loaded on-demand)65 - Violation: HIGH ERROR (`SKILL_100`, `SKILL_101`)66679. **Discoverability**:68 - Description MUST include "Use when..." phrase69 - Description MUST include 2-6 trigger phrases70 - Violation: HIGH ERROR (`SKILL_015`, `SKILL_016`)717210. **Required Fields (Enterprise)**:73 - Plugin: name, version, description, author (name + email), license, keywords74 - Skill: name, description, allowed-tools (CSV), version, author, license, tags75 - Violation: CRITICAL ERROR (various `PLUGIN_*`, `SKILL_*` codes)7677**VALIDATION**:78- Validator runs in ENTERPRISE MODE ONLY79- CRITICAL/HIGH errors BLOCK PR merge80- Deterministic error codes (6767-d schema)8182**NO EXCEPTIONS**: These rules apply to ALL plugins/skills, regardless of size or complexity.8384---8586## 1. Purpose and Scope8788### 1.1 Purpose8990This specification defines the **unified standard** for all Claude Code extension types:91- **Plugins** (containers: manifest, metadata, lifecycle)92- **Skills** (capabilities: workflows, tool authorization, context)93- **Agents** (subagents: delegation, specialization, model selection)94- **Commands** (slash commands: user-triggered prompts)95- **Hooks** (event handlers: lifecycle automation)96- **MCP Servers** (Model Context Protocol: external tool integration)9798This standard operates in **ENTERPRISE MODE ONLY**. There is no "Anthropic-minimum" mode. All requirements herein are MANDATORY for marketplace publication, CI gates, and production deployment.99100### 1.2 Scope101102**In Scope:**103- Directory structure and naming conventions104- Manifest schemas (plugin.json, SKILL.md frontmatter, agent.md, hooks.json, .mcp.json)105- Security constraints (secrets, paths, tool scoping)106- Context hygiene (progressive disclosure, .claudeignore, size limits)107- Portability (environment variables, relative paths)108- Discoverability (descriptions, trigger phrases, router guidance)109- Validation and CI enforcement110111**Out of Scope:**112- Runtime execution behavior (covered by Claude Code core)113- User interface design (covered by Claude frontend specs)114- Third-party integrations (covered by MCP protocol spec)115116---117118## 2. Key Definitions119120### 2.1 Extension Types121122| Type | Definition | Primary File | Location |123|------|------------|--------------|----------|124| **Plugin** | Container for skills/agents/commands/hooks/MCP servers | `plugin.json` | `.claude-plugin/plugin.json` |125| **Skill** | Capability that teaches Claude a workflow or process | `SKILL.md` | `skills/<skill-name>/SKILL.md` |126| **Agent** | Specialized subagent for complex, multi-step tasks | `agent.md` (frontmatter) | `agents/<agent-name>.md` |127| **Command** | User-triggered slash command that expands to a prompt | `command.md` (optional frontmatter) | `commands/<command-name>.md` |128| **Hook** | Event handler that runs on lifecycle events | `hooks.json` | `hooks/hooks.json` OR inline in plugin.json |129| **MCP Server** | External tool server using Model Context Protocol | `.mcp.json` | `.mcp.json` OR inline in plugin.json |130131### 2.2 Container vs Capability132133- **Container** (Plugin): Metadata and lifecycle management. The `.claude-plugin/plugin.json` file is the plugin manifest.134- **Capability** (Skill/Agent/Command): Actual functionality. Lives in component directories at plugin root.135- **Integration** (Hook/MCP): Automation and external tools. Configured via JSON.136137**Critical Rule**: `.claude-plugin/` contains ONLY `plugin.json`. All component directories (skills/, agents/, commands/, hooks/) MUST be at plugin root, NOT inside `.claude-plugin/`.138139### 2.3 Enterprise vs Anthropic-Minimum140141**This spec operates in ENTERPRISE MODE ONLY**. Historical "Anthropic-minimum" mode is deprecated. All fields marked "Enterprise Required" in this spec are REQUIRED. Validators, CI gates, and marketplaces MUST enforce enterprise requirements.142143---144145## 3. Directory Structure146147### 3.1 Plugin Root Anatomy148149```150my-plugin/ ← Plugin root151├── .claude-plugin/ ← Metadata directory152│ └── plugin.json ← ONLY file allowed here153├── skills/ ← Optional: skill capabilities154│ └── <skill-name>/155│ ├── SKILL.md ← Skill definition (frontmatter + body)156│ └── references/ ← Optional: heavy tables/docs157├── agents/ ← Optional: agent definitions158│ └── <agent-name>.md ← Agent definition (frontmatter + body)159├── commands/ ← Optional: slash commands160│ └── <command-name>.md ← Command definition161├── hooks/ ← Optional: event hooks162│ └── hooks.json ← Hook configuration163├── scripts/ ← Optional: helper scripts164│ ├── validate_standards.py165│ └── ...166├── .mcp.json ← Optional: MCP server config167├── .claudeignore ← Optional: context exclusions168├── README.md ← Required: documentation169└── 000-docs/ ← Optional: project docs (if complex)170 └── (flat structure, NNN-CC-ABCD naming)171```172173### 3.2 Critical Constraints174175**MUST**:176- `.claude-plugin/` contains ONLY `plugin.json` (no other files)177- Component directories (skills/, agents/, commands/, hooks/) at plugin root (NOT inside `.claude-plugin/`)178- Only create directories you use (NO empty placeholders)179- Plugin name, skill names, agent names MUST be kebab-case180- All paths MUST be relative or use `${CLAUDE_PLUGIN_ROOT}` / `{baseDir}`181182**MUST NOT**:183- Place any components inside `.claude-plugin/` besides plugin.json184- Use absolute paths (e.g., `/home/user/...`)185- Hardcode secrets or API keys186- Commit `.env` files187- Use uppercase letters in names188189---190191## 4. Plugin Manifest (plugin.json)192193### 4.1 Schema (Enterprise Required Fields)194195```json196{197 "name": "my-plugin-name", // REQUIRED: kebab-case, max 64 chars, ^[a-z0-9-]+$198 "version": "1.0.0", // REQUIRED: SemVer (MAJOR.MINOR.PATCH)199 "description": "...", // REQUIRED: brief explanation200 "author": { // REQUIRED: author object201 "name": "Developer Name", // REQUIRED: author name202 "email": "dev@example.com" // REQUIRED: author email203 },204 "license": "MIT", // REQUIRED: SPDX identifier205 "keywords": ["tag1", "tag2"], // REQUIRED: array of strings206 "homepage": "https://...", // OPTIONAL: documentation URL207 "repository": "https://github.com/...", // OPTIONAL: source URL208 "commands": "./commands/", // OPTIONAL: path(s) to commands209 "agents": "./agents/", // OPTIONAL: path(s) to agents210 "skills": ["./skills/skill-1/"], // OPTIONAL: array of skill paths211 "hooks": "./hooks/hooks.json", // OPTIONAL: path or inline config212 "mcpServers": { // OPTIONAL: MCP server config213 "server-name": {214 "command": "python",215 "args": ["${CLAUDE_PLUGIN_ROOT}/bin/server.py"]216 }217 }218}219```220221### 4.2 Field Constraints (Enterprise)222223| Field | Type | Required | Constraints |224|-------|------|----------|-------------|225| `name` | string | ✅ REQUIRED | kebab-case, max 64 chars, pattern `^[a-z0-9-]+$`, no "claude" or "anthropic" |226| `version` | string | ✅ REQUIRED | SemVer (MAJOR.MINOR.PATCH), 3 parts |227| `description` | string | ✅ REQUIRED | Non-empty, max 1024 chars |228| `author` | object | ✅ REQUIRED | MUST have `name` and `email` |229| `author.name` | string | ✅ REQUIRED | Non-empty |230| `author.email` | string | ✅ REQUIRED | Valid email format |231| `license` | string | ✅ REQUIRED | SPDX identifier (MIT, Apache-2.0, Proprietary, etc.) |232| `keywords` | array | ✅ REQUIRED | Array of strings, min 1 item |233| `homepage` | string | OPTIONAL | Valid URL if present |234| `repository` | string | OPTIONAL | Valid URL if present |235| `commands` | string or array | OPTIONAL | Path(s) to command directories |236| `agents` | string or array | OPTIONAL | Path(s) to agent files/directories |237| `skills` | string or array | OPTIONAL | Path(s) to skill directories |238| `hooks` | string or object | OPTIONAL | Path to hooks.json OR inline config |239| `mcpServers` | object | OPTIONAL | MCP server configuration |240241### 4.3 Portability Rules242243**Environment Variable**: `${CLAUDE_PLUGIN_ROOT}`244- Expands to plugin root directory at runtime245- MUST be used for all plugin-relative paths in `plugin.json`, hooks, MCP servers246- Example: `"${CLAUDE_PLUGIN_ROOT}/bin/server.py"`247248**MUST NOT**:249- Use absolute paths (e.g., `/home/jeremy/...`)250- Use `~` or `$HOME` (not portable)251- Use `.` or `..` for parent traversal (security risk)252253**MUST**:254- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-internal paths255- Use relative paths within plugin root where possible256- Validate all paths in validator257258---259260## 5. Skills261262### 5.1 Skill Anatomy263264**Location**: `skills/<skill-name>/SKILL.md`265266**Structure**:2671. **Frontmatter** (YAML): Metadata and configuration2682. **Body** (Markdown): Instructions, workflow, examples, error handling269270### 5.2 Frontmatter Schema (Enterprise Required)271272```yaml273---274name: skill-name # REQUIRED: kebab-case, max 64 chars, ^[a-z0-9-]+$275description: "..." # REQUIRED: max 1024 chars, third-person, includes "Use when..." + triggers276allowed-tools: "Read,Write,Grep,Glob" # REQUIRED: CSV string (NOT YAML array)277version: "1.0.0" # REQUIRED: SemVer278author: "Name <email>" # REQUIRED: Name + email279license: "MIT" # REQUIRED: SPDX identifier280tags: ["tag1", "tag2"] # REQUIRED: array of strings281model: "inherit" # OPTIONAL: model override (inherit, sonnet, opus, haiku)282mode: false # OPTIONAL: categorize as mode (default false)283disable-model-invocation: false # OPTIONAL: hide from auto-discovery (default false)284---285```286287### 5.3 Field Constraints (Enterprise)288289| Field | Type | Required | Constraints |290|-------|------|----------|-------------|291| `name` | string | ✅ REQUIRED | kebab-case, max 64 chars, pattern `^[a-z0-9-]+$`, no "claude" or "anthropic" |292| `description` | string | ✅ REQUIRED | Max 1024 chars, third-person voice, MUST include "Use when..." + trigger phrases |293| `allowed-tools` | string | ✅ REQUIRED | CSV string (comma-separated), NOT YAML array. Example: "Read,Write,Grep" |294| `version` | string | ✅ REQUIRED | SemVer (MAJOR.MINOR.PATCH) |295| `author` | string | ✅ REQUIRED | Format: "Name <email>" or "Name" |296| `license` | string | ✅ REQUIRED | SPDX identifier |297| `tags` | array | ✅ REQUIRED | Array of strings, min 1 item (marketplace discoverability) |298| `model` | string | OPTIONAL | "inherit" (default), "sonnet", "opus", "haiku", or specific model ID |299| `mode` | boolean | OPTIONAL | Default false. Set true for mode commands (separate UI section) |300| `disable-model-invocation` | boolean | OPTIONAL | Default false. Set true to remove from auto-discovery |301302### 5.4 Description Formula (REQUIRED)303304**Template**:305```306[Primary capabilities]. [Secondary features]. Use when [scenarios]. Trigger with "[phrases]", "[synonyms]", or "[common-terms]".307```308309**Example (Good)**:310```yaml311description: "Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction. Trigger with 'process pdf', 'extract from pdf', or 'merge pdfs'."312```313314**Example (Bad)**:315```yaml316description: "Helps with documents" # ❌ Missing: Use when, triggers, specifics317```318319### 5.5 allowed-tools (CRITICAL: CSV String NOT YAML Array)320321**CORRECT** (CSV string):322```yaml323allowed-tools: "Read,Write,Grep,Glob,Bash(git status:*),Bash(git diff:*)"324```325326**WRONG** (YAML array):327```yaml328allowed-tools: # ❌ INVALID (will be rejected by validator)329 - Read330 - Write331 - Bash332```333334**Tool Scoping** (Enterprise Security Policy):335- Prefer minimal tools: `Read,Write,Grep,Glob`336- If Bash needed, scope it: `Bash(git:*)`, `Bash(npm:*)`, `Bash(python:*)`337- NEVER grant unscoped `Bash` (security risk)338- Unscoped Bash MUST be flagged as CRITICAL error by validator339340### 5.6 Body Constraints (Enterprise Context Hygiene)341342| Constraint | Limit | Rationale |343|------------|-------|-----------|344| **Max word count** | 5,000 words | Context window hygiene |345| **Max line count** | 500 lines | Progressive disclosure |346| **Max tokens** | ~7,500 tokens | LLM context budget |347| **Path format** | `{baseDir}/...` | Portability (no absolute paths) |348| **Reference depth** | 1 level | Prevent reference chains (SKILL.md → ref.md OK; SKILL.md → ref1.md → ref2.md NOT OK) |349350**Progressive Disclosure Pattern**:351- SKILL.md contains workflow, instructions, examples352- Heavy tables/data go in `references/` directory353- References loaded on-demand, not always in context354- Example: `{baseDir}/skills/my-skill/references/error-codes.md`355356### 5.7 Required Sections (Enterprise Quality Standard)3573581. **Title** (H1): Skill name3592. **Purpose** (1-2 sentences): What this skill does3603. **Overview** (3-5 sentences): How it works3614. **Prerequisites**: Required tools, dependencies, environment setup3625. **Instructions**: Step-by-step numbered workflow3636. **Output**: What the skill produces3647. **Error Handling**: Minimum 4 failure cases with cause + recovery3658. **Examples**: 2-3 examples with input/output pairs3669. **Resources**: Links to references, documentation367368---369370## 6. Agents371372### 6.1 Agent Anatomy373374**Location**: `agents/<agent-name>.md`375376**Structure**:3771. **Frontmatter** (YAML): Metadata and configuration3782. **Body** (Markdown): Delegation criteria, specialization, instructions379380### 6.2 Frontmatter Schema (Enterprise)381382```yaml383---384name: agent-name # REQUIRED: Agent identifier385description: "..." # REQUIRED: When Claude should delegate to this agent386tools: "Read,Write,Grep,Glob" # OPTIONAL: CSV string (inherits all if omitted)387model: "inherit" # OPTIONAL: model override388permissionMode: "auto" # OPTIONAL: permission mode389skills: "skill-1,skill-2" # OPTIONAL: comma-separated skill names to auto-load390---391```392393### 6.3 Field Constraints394395| Field | Type | Required | Constraints |396|-------|------|----------|-------------|397| `name` | string | ✅ REQUIRED | Agent identifier (kebab-case recommended) |398| `description` | string | ✅ REQUIRED | When Claude should delegate (clear criteria) |399| `tools` | string | OPTIONAL | CSV string (inherits all if omitted) |400| `model` | string | OPTIONAL | Model override (inherit, sonnet, opus, haiku) |401| `permissionMode` | string | OPTIONAL | Permission mode |402| `skills` | string | OPTIONAL | Comma-separated skill names to auto-load |403404---405406## 7. Commands407408### 7.1 Command Anatomy409410**Location**: `commands/<command-name>.md`411412**Invocation**: User types `/<command-name>` (filename without .md)413414**Structure**:4151. **Frontmatter** (YAML, optional): Metadata4162. **Body** (Markdown): Prompt text that expands when command is invoked417418### 7.2 Frontmatter Schema (Optional)419420```yaml421---422description: "Brief explanation" # OPTIONAL: What this command does423allowed-tools: "Read,Write,Grep" # OPTIONAL: CSV string (tool restrictions)424---425```426427---428429## 8. Hooks430431### 8.1 Hook Configuration432433**Location**: `hooks/hooks.json` OR inline in `plugin.json` under `"hooks"` key434435**Events**:436- `PreToolUse` (matcher required)437- `PostToolUse` (matcher required)438- `PermissionRequest` (matcher required)439- `UserPromptSubmit`440- `Stop`441- `SubagentStop`442- `SessionStart` (matcher required)443- `SessionEnd`444- `PreCompact` (matcher required)445- `Notification` (matcher optional)446447### 8.2 Hook Types4484491. **command**: Execute bash command4502. **prompt**: LLM-based evaluation451452### 8.3 Output Schema453454```json455{456 "continue": true, // Boolean: continue or block457 "stopReason": "...", // Optional: reason for stopping458 "suppressOutput": false, // Boolean: hide output459 "systemMessage": "...", // String: message to LLM460 "hookSpecificOutput": {} // Object: event-specific fields461}462```463464### 8.4 Security Constraints465466**MUST**:467- Set timeouts on all hooks (prevent hangs)468- Scope bash commands (no unrestricted bash)469- Validate paths (prevent traversal)470- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths471472**MUST NOT**:473- Execute arbitrary user input without sanitization474- Allow unbounded network calls475- Expose sensitive data in logs476477---478479## 9. MCP Servers480481### 9.1 MCP Configuration482483**Location**: `.mcp.json` OR inline in `plugin.json` under `"mcpServers"` key484485**Schema**:486```json487{488 "server-name": {489 "command": "python", // Command to execute490 "args": [ // Arguments491 "${CLAUDE_PLUGIN_ROOT}/bin/server.py"492 ],493 "env": { // Optional: environment variables494 "API_KEY": "${MY_API_KEY}"495 }496 }497}498```499500### 9.2 Portability Rules501502**MUST**:503- Use `${CLAUDE_PLUGIN_ROOT}` for plugin-relative paths504- Use environment variables for secrets (e.g., `${MY_API_KEY}`)505- Document required environment variables in README506507**MUST NOT**:508- Hardcode absolute paths509- Hardcode secrets or API keys510- Assume specific directory structure outside plugin root511512---513514## 10. Security Constraints (Enterprise Policy)515516### 10.1 Secrets and Credentials517518**MUST NOT**:519- Hardcode API keys, tokens, passwords in code/config520- Commit `.env` files521- Commit credential files522- Log sensitive data523- Pass unvalidated user input to shell524525**MUST**:526- Use environment variables for secrets527- Add `.env` to `.gitignore`528- Document required env vars in README (with `.env.example`)529- Sanitize all inputs530- Use `${VARIABLE_NAME}` syntax in configs531532### 10.2 Tool Scoping533534**Bash Tool Scoping** (CRITICAL):535- ✅ GOOD: `Bash(git status:*)`, `Bash(npm run test:*)`, `Bash(python -m:*)`536- ❌ BAD: `Bash` (unscoped - allows arbitrary commands)537538**Validator MUST**:539- Flag unscoped `Bash` as CRITICAL error540- Require explicit scoping: `Bash(command:*)` or `Bash(command subcommand:*)`541542### 10.3 Path Safety543544**MUST NOT**:545- Use absolute paths (e.g., `/home/user/...`)546- Use `..` for parent traversal (security risk)547- Allow user-controlled paths without validation548549**MUST**:550- Use `${CLAUDE_PLUGIN_ROOT}` for plugin paths551- Use `{baseDir}` for repo-relative skill references552- Validate all paths to prevent traversal553554### 10.4 Secret Scanning (Enterprise Validator)555556**Exemptions** (minimal allowlist):557- `tests/fixtures/**` (explicit test data directory)558- Files containing known test patterns: `EXAMPLE`, `DUMMY`, `test-`, etc.559560**Scanned Everywhere Else**:561- All source code (including non-fixture test code)562- All configuration files563- All documentation564565**Detected Patterns**:566- API keys (32+ char alphanumeric)567- AWS keys (`AKIA...`)568- SSH keys (`-----BEGIN RSA PRIVATE KEY-----`)569- Emails (PII in non-author contexts)570- Credit cards571572**Severity**: CRITICAL (blocks PR, fails CI)573574---575576## 11. Context Hygiene (Enterprise Policy)577578### 11.1 Progressive Disclosure579580**Problem**: Loading all plugin content into context wastes tokens.581582**Solution**:583- Keep SKILL.md body ≤ 5,000 words584- Move heavy tables/data to `references/` directory585- Load references on-demand, not always in context586- Use `.claudeignore` to exclude non-essential files587588### 11.2 .claudeignore Pattern589590**Purpose**: Exclude files from context to save tokens.591592**Example**:593```594# Build artifacts595*.pyc596__pycache__/597.venv/598node_modules/599600# Heavy data files601data/602fixtures/603*.log604*.csv605606# Documentation (load on-demand)607docs/608examples/609```610611### 11.3 Size Limits (Enterprise Quality)612613| Component | Limit | Enforced By |614|-----------|-------|-------------|615| SKILL.md body | 5,000 words / 500 lines / ~7,500 tokens | Validator (CRITICAL) |616| Plugin description | 1,024 characters | Validator (CRITICAL) |617| Skill description | 1,024 characters | Validator (CRITICAL) |618| Reference docs | No hard limit (loaded on-demand) | N/A |619620---621622## 12. Discoverability (Router Guidance)623624### 12.1 Description Best Practices625626**Goal**: Help Claude's router decide when to invoke a skill/agent.627628**Formula**:629```630[Capabilities]. Use when [user scenarios]. Trigger with "[phrases]", "[synonyms]".631```632633**Good Example**:634```635Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction. Trigger with "process pdf", "extract from pdf", or "merge pdfs".636```637638**Bad Examples**:639- "Helps with PDFs" (too vague)640- "PDF processing tool" (no triggers, no scenarios)641- "Extracts text..." (missing "Use when", missing triggers)642643### 12.2 Third-Person Voice (Required)644645**Descriptions MUST**:646- Use third-person voice ("Extracts...", "Processes...", not "I extract...")647- Be objective (not promotional: "amazing tool", "best solution")648- Include concrete scenarios ("when user uploads PDF", not "when needed")649650---651652## 13. Versioning and Deprecation653654### 13.1 Semantic Versioning (SemVer)655656**Required Format**: `MAJOR.MINOR.PATCH`657658**Rules**:659- **MAJOR**: Breaking changes (incompatible API changes)660- **MINOR**: New features, backward-compatible661- **PATCH**: Bug fixes, documentation662663**Examples**:664- ✅ `1.0.0`, `2.3.1`, `0.1.0`665- ❌ `v1.0`, `1.0`, `1` (missing parts)666667### 13.2 Deprecation Process6686691. **Mark deprecated** in description: `[DEPRECATED] Old command...`6702. **Keep working** for one minor version (e.g., 1.3.x)6713. **Remove** in next major version (e.g., 2.0.0)6724. **Document** in CHANGELOG and README673674---675676## 14. Compliance Modes677678### 14.1 Enterprise Mode (ONLY Mode)679680**This spec operates in ENTERPRISE MODE ONLY**. All fields marked "REQUIRED" in this spec are REQUIRED. Validators MUST enforce enterprise requirements.681682**Historical Note**: Previous specs (6767-a, 6767-b) distinguished "Anthropic-minimum" vs "Enterprise/Marketplace" requirements. This spec **deprecates** that distinction. Enterprise requirements are now the **ONLY** requirements.683684### 14.2 Required Fields Summary685686**Plugin**:687- name, version, description, author (name + email), license, keywords688689**Skill**:690- name, description, allowed-tools (CSV string), version, author, license, tags691692**Agent**:693- name, description694695**Command**:696- (No required frontmatter; body is the prompt)697698---699700## 15. Validation and Enforcement701702### 15.1 Validator Requirements703704**Every validator MUST**:705- Enforce ALL enterprise requirements (no "Anthropic-min" mode)706- Flag violations with severity: CRITICAL, HIGH, MEDIUM, LOW707- Block CRITICAL and HIGH errors in CI708- Report deterministic, actionable errors709710**Validation Categories**:7111. **Manifest**: plugin.json schema, required fields, name format, version format7122. **Directory Structure**: `.claude-plugin/` contains ONLY plugin.json, components at root7133. **Skills**: frontmatter fields, CSV string for allowed-tools, body size limits7144. **Security**: hardcoded secrets, .env files, path traversal, tool scoping7155. **Naming**: kebab-case, max length, reserved words716717### 15.2 CI Gates (Enterprise Policy)718719**PR Workflow**:720- Run validator in enterprise mode721- Block PR on CRITICAL or HIGH errors722- Report all findings723724**Main Branch Workflow**:725- Run comprehensive validation (enterprise mode)726- Run security scans (secrets, dependencies)727- Generate coverage reports728- Archive validation artifacts729730### 15.3 Error Reporting Format731732**Required Fields**:733- Severity: CRITICAL | HIGH | MEDIUM | LOW734- File path: Exact location of violation735- Field: Which field/rule violated736- Expected: What was expected737- Actual: What was found738- Fix: How to remediate (actionable guidance)739740**Example**:741```742[CRITICAL] skills/my-skill/SKILL.md743 Field: allowed-tools744 Expected: CSV string (e.g., "Read,Write,Bash(git:*)")745 Actual: YAML array format746 Fix: Change frontmatter to: allowed-tools: "Read,Write,Bash(git:*)"747```748749---750751## 16. Governance and Updates752753### 16.1 Authority754755This specification is maintained by **Intent Solutions** for the **Enterprise Marketplace**.756757**Contact**: jeremy@intentsolutions.io758759### 16.2 Change Process7607611. **Propose change** via GitHub issue or pull request7622. **Review** by maintainers (Intent Solutions)7633. **Approve** via consensus7644. **Update version**:765 - MAJOR: Breaking changes766 - MINOR: New requirements (backward-compatible)767 - PATCH: Clarifications, typo fixes7685. **Publish** updated spec7696. **Deprecate** old versions (if breaking)770771### 16.3 Backward Compatibility772773**Breaking Changes**:774- Require MAJOR version bump775- Must include migration guide776- Old version marked DEPRECATED777- Grace period: 1 quarter (3 months)778779**Non-Breaking Changes**:780- New optional fields: MINOR bump781- Clarifications: PATCH bump782783---784785## 17. References786787### 17.1 Related Standards788789- **6767-d**: Schema definition (machine-readable validation rules)790- **6767-e**: Validation and CI gates (enforcement specification)791- **Document Filing System v4.2**: 000-docs/ structure and naming792793### 17.2 Deprecated Standards794795- **6767-a**: Claude Code Plugins Standard (v2.x) - DEPRECATED796- **6767-b**: Claude Skills Standard (v2.x) - DEPRECATED797798**Superseded By**: This specification (6767-c v3.0.0)799800### 17.3 External Standards801802- **Semantic Versioning**: https://semver.org/803- **SPDX License Identifiers**: https://spdx.org/licenses/804- **Kebab Case**: https://en.wikipedia.org/wiki/Letter_case#Kebab_case805- **Model Context Protocol**: https://modelcontextprotocol.io/806807---808809## 18. Appendix: Examples810811### 18.1 Minimal Plugin (Enterprise Compliant)812813**Directory**:814```815my-plugin/816├── .claude-plugin/817│ └── plugin.json818└── README.md819```820821**plugin.json**:822```json823{824 "name": "my-plugin",825 "version": "1.0.0",826 "description": "Example plugin for demonstration",827 "author": {828 "name": "Developer Name",829 "email": "dev@example.com"830 },831 "license": "MIT",832 "keywords": ["example", "demo"]833}834```835836### 18.2 Plugin with Skills (Enterprise Compliant)837838**Directory**:839```840analytics-plugin/841├── .claude-plugin/842│ └── plugin.json843├── skills/844│ └── data-analysis/845│ ├── SKILL.md846│ └── references/847│ └── error-codes.md848└── README.md849```850851**skills/data-analysis/SKILL.md**:852```yaml853---854name: data-analysis855description: "Analyze datasets with statistical methods, generate visualizations, and export reports. Use when user provides data files or requests analysis, charts, or statistical summaries. Trigger with 'analyze data', 'create chart', or 'statistical analysis'."856allowed-tools: "Read,Write,Grep,Glob,Bash(python:*)"857version: "1.0.0"858author: "Analytics Team <analytics@example.com>"859license: "MIT"860tags: ["analytics", "statistics", "visualization"]861---862863# Data Analysis Skill864865## Purpose866Analyze datasets and generate insights.867868## Instructions8691. Read data file8702. Validate schema8713. Compute statistics8724. Generate visualizations8735. Export report874875## Error Handling876- **Missing columns**: Check schema, prompt user for column names877- **Invalid data types**: Convert or skip rows with errors878- **Empty dataset**: Return error message with guidance879- **Memory limits**: Sample large datasets before full processing880881## Examples882...883```884885---886887**END OF SPECIFICATION**888889**Version**: 3.0.0890**Status**: CANONICAL (Enterprise-Only)891**Date**: 2025-12-20