Skip to main content

Claude Code Plugin Overview

The @a16njs/plugin-claude package implements agent customization awareness for Claude Code.

Installation

This plugin is bundled with the a16n CLI. For programmatic use:

npm install @a16njs/plugin-claude

Supported Files

Discovery

Emission

  • GlobalPrompt: .claude/rules/<name>.md (individual files)
  • FileRule: .claude/rules/<name>.md with paths: YAML frontmatter (native support)
  • SimpleAgentSkill: .claude/skills/<name>/SKILL.md
  • AgentIgnore: .claude/settings.json with permissions.deny
  • ManualPrompt: .claude/skills/<name>/SKILL.md with enable-model-invocation: false

Programmatic Usage

import claudePlugin from '@a16njs/plugin-claude';
import { A16nEngine } from '@a16njs/engine';

// Create engine with Claude plugin
const engine = new A16nEngine([claudePlugin]);

// Discover Claude configuration
const result = await claudePlugin.discover('./my-project');
console.log(`Found ${result.items.length} items`);

for (const item of result.items) {
console.log(` ${item.type}: ${item.sourcePath}`);
}

// Emit to Claude format
const items = [/* AgentCustomization items */];
const emitResult = await claudePlugin.emit(items, './my-project');
console.log(`Wrote ${emitResult.written.length} files`);

Dry Run

// Calculate what would be written without writing
const emitResult = await claudePlugin.emit(items, './my-project', {
dryRun: true,
});

for (const file of emitResult.written) {
console.log(`Would write: ${file.path}`);
}

API Reference

For complete plugin API details, see the Plugin Claude API Reference.


See Also