Skip to content

Latest commit

 

History

History
358 lines (289 loc) · 15.3 KB

File metadata and controls

358 lines (289 loc) · 15.3 KB

Claude Code Marketplace & Plugin Development

This repository is a Claude Code marketplace containing plugins, agents, commands, hooks, skills, and scripts. When working in this codebase, you are developing Claude Code extensions - apply best practices accordingly.

Automatic Quality Assurance

CRITICAL: Before ANY modification to this package, use the developing-claude-plugins skill to ensure:

  • Consistency with existing patterns and structure
  • Adherence to current Claude Code best practices
  • Optimal configuration and naming conventions

Documentation Sources (MUST READ before implementation)

All Claude Code best practices are cached locally in .claude/docs-cache/*.md. This is the single source of truth for this repository.

Documentation Cache

File Content
skill-building-guide.md Anthropic's official complete guide to building skills (primary reference)
plugins.md Plugin structure and manifest
plugins-reference.md Plugin JSON schemas and reference
skills.md Skill YAML frontmatter and configuration
slash-commands.md Command frontmatter and usage
sub-agents.md Agent configuration and tools
hooks.md Hook event types and JSON structure
mcp.md MCP server configuration
memory.md CLAUDE.md structure and usage
settings.md Settings reference
cli-reference.md CLI options and flags
common-workflows.md Worktrees, parallel sessions, Plan Mode, subagents, PR workflows
github-plugins-readme.md Plugin structure, examples (from GitHub)
github-official-plugins.md Official plugin standards, quality guidelines (from GitHub)
github-skills-readme.md Skill specifications, templates (from GitHub)
github-changelog.md Recent changes and updates
agent-teams.md Agent Teams coordination, messaging, hooks, and best practices
platform-skills-best-practices.md Skill authoring best practices and patterns (primary source)
owasp-secure-coding-checklist.md OWASP Secure Coding Practices (security reference)

Cache Management

  • Configuration: .claude/docs-cache/sources.json (SINGLE SOURCE OF TRUTH)
  • Auto-Update: The /optimize command checks for version changes and offers to update

Scripts:

Script Description Usage
update-docs-cache.ts Downloads & converts documentation bun .claude/scripts/update-docs-cache.ts [--source=<name>]
check-cache-version.ts Checks if cache is outdated bun .claude/scripts/check-cache-version.ts
check-cache-integrity.ts Verifies all cache files exist bun .claude/scripts/check-cache-integrity.ts [--fix]
check-cross-references.ts Verifies markdown links and "Rule N" references across plugins/ resolve bun .claude/scripts/check-cross-references.ts [--json] [--plugin=<name>]

Source types in sources.json:

  • md: Direct Markdown files (downloaded as-is, relative links converted to absolute GitHub URLs)
  • html: HTML pages (converted to Markdown via Turndown)
  • spa: Single Page Applications (rendered with Playwright, then converted)
  • pdf: PDF documents (manually converted to Markdown, not auto-updated by scripts)

Error handling: If a source fails to fetch, existing cache is preserved (no data loss)

Fallback Strategy

If documentation cache is insufficient:

  1. WebSearch: Use WebSearch with query: "Claude Code [topic] documentation site:anthropic.com OR site:claude.com"
  2. Claude's Built-in Knowledge: Claude knows Claude Code best practices (Knowledge Cutoff: May 2025)

Repository Structure

claude-code/
├── .claude/                  # Project-level Claude Code extensions
│   ├── docs-cache/           # Cached Claude Code documentation (Markdown)
│   │   ├── sources.json      # URL configuration (SINGLE SOURCE OF TRUTH)
│   │   └── *.md              # Auto-generated from sources.json
│   ├── scripts/              # Utility scripts
│   │   ├── update-docs-cache.ts    # Downloads & converts docs (parallel)
│   │   ├── check-cache-version.ts  # Checks if cache is outdated
│   │   ├── check-cache-integrity.ts # Verifies all cache files exist
│   │   ├── types.ts                # Shared TypeScript types
│   │   └── types.d.ts              # Module declarations
│   ├── skills/               # Project-specific skills
│   │   └── marketplace-optimizer/
│   │       └── SKILL.md              # Marketplace optimization orchestrator
│   ├── agents/               # Project-specific agents (optimizer specialists)
│   │   ├── optimizer-skills.md       # Skills optimization expert
│   │   ├── optimizer-commands.md     # Commands optimization expert
│   │   ├── optimizer-agents.md       # Agents optimization expert
│   │   ├── optimizer-hooks.md        # Hooks optimization expert
│   │   ├── optimizer-mcp.md          # MCP optimization expert
│   │   └── optimizer-marketplace.md  # Cross-references & features expert
│   └── commands/             # Project-specific commands
│       └── optimize.md       # /optimize command
├── .claude-plugin/
│   └── marketplace.json      # Marketplace definition
├── plugins/
│   └── lt-dev/               # Main plugin
│       ├── .claude-plugin/
│       │   └── plugin.json   # Plugin manifest
│       ├── agents/           # Autonomous agents (.md files)
│       ├── commands/         # Slash commands (.md files, can be nested)
│       ├── hooks/            # Event hooks
│       │   ├── hooks.json    # Hook definitions
│       │   └── scripts/      # Hook handler scripts (.sh, .ts)
│       ├── scripts/          # Plugin helper scripts referenced by commands/agents/skills
│       │                     # (e.g. discover-check-scripts.sh) — narrow Bash permission
│       │                     # pattern: Bash(bash ${CLAUDE_PLUGIN_ROOT}/scripts/*)
│       ├── skills/           # Context-aware expertise (SKILL.md + references)
│       ├── permissions.json  # Bash permission patterns for auto-approval
│       ├── permissions.schema.json  # JSON Schema for permissions validation
│       └── .mcp.json         # MCP server dependencies

Important: Plugin Isolation

CRITICAL: The plugins/ directory is deployed to client machines and runs in isolation.

Location Access Can Reference
.claude/ This repository only Everything in this repo
CLAUDE.md This repository only Everything in this repo
plugins/ Client machines Only files within plugins/

Consequences:

  • Elements in plugins/ cannot access .claude/docs-cache/, .claude/scripts/, or any other repository files
  • Elements in plugins/ must use external sources (WebFetch to GitHub, WebSearch) for documentation
  • Elements in .claude/ and CLAUDE.md can access plugins/ and all repository files

When developing plugin elements:

  • Use WebFetch with GitHub raw URLs for documentation
  • Use WebSearch for Claude Code documentation lookups
  • Never reference paths like .claude/docs-cache/ or bun .claude/scripts/...

Configuration Files (MUST UPDATE when adding features)

permissions.json

Defines Bash command patterns that can be auto-approved without user confirmation.

Update when:

  • Adding new Bash commands to skills or agents (npm, lt, npx, etc.)
  • Creating new skills that use CLI tools

Structure:

{
  "permissions": [
    {
      "pattern": "Bash(npm test:*)",
      "description": "Run npm test commands",
      "usedBy": ["skill-name-1", "skill-name-2"]
    }
  ]
}

Rules:

  • Always add usedBy array with skill/agent names that need the permission
  • Use wildcard patterns (:*) for flexible matching
  • Keep descriptions clear and concise

Validation: Use permissions.schema.json for IDE autocompletion and validation. Reference it via "$schema": "./permissions.schema.json" in permissions.json.

.mcp.json

Defines MCP (Model Context Protocol) servers required by the plugin.

Update when:

  • Commands or skills require external MCP tools (Linear, Chrome DevTools, etc.)
  • Adding new integrations that use MCP servers

Current servers:

Server Type Used By
chrome-devtools stdio vibe commands, developing-lt-frontend, building-stories-with-tdd (browser testing & debugging)
linear http resolve-ticket, create-story, create-ticket, create-task, create-bug, review, debug, linear-comment, dev-submit (issue tracking & project management)
nuxt-ui-remote stdio developing-lt-frontend, frontend-dev agent (Nuxt UI component reference)
better-auth stdio frontend-dev agent (Better Auth documentation reference)
figma-desktop stdio figma-init, figma-research, figma-to-code (Figma design extraction)

plugin.json

Plugin manifest with metadata. Update version before releases.

Element Types & When to Use

Element Purpose Activation
Skill Contextual expertise that enhances capabilities Auto-detected or manually invoked
Command User-triggered actions via /command-name Explicit user invocation
Agent Autonomous task execution with specific tools Spawned by Task tool
Hook Automated responses to events Event-triggered (PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStart, SubagentStop, SessionStart, SessionEnd, etc.)
Script Utility functions for hooks or CLI Called by hooks or directly

File Naming Conventions

  • Skills: SKILL.md (main) + supporting .md files in skill directory
  • Commands: command-name.md (kebab-case)
  • Agents: agent-name.md (kebab-case)
  • Hooks: hooks.json + referenced scripts

YAML Frontmatter Requirements

Skills (SKILL.md)

---
name: skill-name
description: Concise description for auto-detection (max 1024 chars). Must explain WHEN to use this skill. Include trigger terms for auto-detection.
# Optional fields:
allowed-tools: Read, Grep, Glob  # Restrict available tools
model: sonnet | opus | haiku     # Override default model
context: fork                     # Run in isolated sub-agent
user-invocable: false            # Hide from slash command menu
---

Commands

---
description: What this command does (shown in /help)
# Optional fields:
allowed-tools: Bash(git:*), Read  # Restrict available tools
argument-hint: "[branch-name]"    # MUST quote values with brackets (YAML parses [...] as arrays)
model: haiku                      # Use specific model
disable-model-invocation: false   # Prevent SlashCommand tool use
---

YAML Quoting Rules

  • argument-hint: Always quote values containing [...] brackets: "[arg-name]"
  • description: Quote with single quotes when containing embedded "..." double quotes: 'Activates when user mentions "keyword"'
  • Validation: Run claude plugin validate plugins/lt-dev to catch YAML parse errors

Agents

---
name: agent-name
description: When and how to use this agent
model: sonnet | opus | haiku
tools: Bash, Read, Grep, Glob, Write, Edit, ...
permissionMode: default | acceptEdits | dontAsk | bypassPermissions
skills: optional-skill-names
---

Quality Standards

Description Guidelines

  • Skills: Focus on WHEN to use (triggers auto-detection)
  • Commands: Focus on WHAT it does
  • Agents: Focus on WHAT tasks it handles autonomously

Structural Consistency

  • Use consistent heading levels (# for title, ## for sections)
  • Include examples for complex workflows
  • Reference related elements explicitly
  • Keep markdown clean and scannable

Best Practices

  • One responsibility per element
  • Clear separation between skill (expertise) and command (action)
  • Prefer composition over duplication
  • Document dependencies between elements
  • Test all commands and workflows manually

Content Rules

  • No history references: Never mention "new", "updated", "changed from", or version-specific info in descriptions
  • Timeless documentation: Write as if features always existed (no "since v2.1" or "added in")
  • Compact content: Minimize tokens while maintaining clarity and completeness
  • No over-compression: Never remove important information for token savings

Creating New Elements

Use the /lt-dev:plugin:element command to interactively create new elements with:

  • Best practice compliance
  • Consistent structure
  • Proper frontmatter
  • Automatic placement

After creating elements, also update:

  1. permissions.json - If the element uses new Bash commands
  2. .mcp.json - If the element requires new MCP servers
  3. Related Skills sections - Add cross-references to related skills
  4. "When to Use" sections - For commands that are part of a workflow

After Context Loss (/clear or Summarization)

If the conversation was reset with /clear or context was summarized, run:

/lt-dev:plugin:check

This restores best practice awareness and validates any pending changes.

For comprehensive optimization after context loss, use:

/optimize

Optimization Workflow

When optimizing existing elements:

  1. Read the documentation cache (.claude/docs-cache/*.md)
  2. Analyze existing element against best practices
  3. Propose specific improvements
  4. Implement changes with minimal disruption
  5. Verify consistency with related elements

For batch optimization with user selection, use:

/optimize

Language Requirements

  • All code, comments, and documentation: English
  • Exception: User-facing German content where explicitly required (e.g., create-story.md)

Maintenance Checklist

Run /lt-dev:plugin:check periodically or before releases to verify:

Skills

  • All SKILL.md have valid frontmatter (name, description)
  • All referenced .md files exist
  • "Related Skills" sections are present and accurate
  • Descriptions include trigger terms for auto-detection

Commands

  • All commands have description in frontmatter
  • Complex/related commands have "When to Use" sections
  • allowed-tools is set where appropriate (especially git commands)
  • argument-hint is set for commands accepting arguments

Agents

  • Frontmatter includes: name, description, model, tools, permissionMode
  • Skills referenced in frontmatter exist
  • Agent tasks are clearly defined

Hooks

  • hooks.json is valid JSON
  • All referenced scripts in hooks/scripts/ exist
  • Hook matchers are correctly configured

Configuration Files

  • permissions.json: All Bash patterns used by skills/agents are listed
  • permissions.json: usedBy arrays are complete and accurate
  • .mcp.json: All required MCP servers are configured
  • plugin.json: Version is updated before release

Content Standards

  • No history references in any element ("new", "updated", "since vX.Y")
  • No version-specific markers in descriptions
  • Content is complete (no over-compression)

Documentation

  • CLAUDE.md: Repository structure matches actual layout
  • CLAUDE.md: Configuration file docs are current
  • All cross-references between elements are valid