Pro Plugin Settings
Production-ready skill that handles skill, should, used, user. Includes structured workflows, validation checks, and reusable patterns for development.
Plugin Settings Pattern Skill
A Claude Code skill for implementing user-configurable settings in Claude Code plugins — covering settings storage, schema definitions, defaults, validation, and runtime access patterns.
When to Use This Skill
Choose this skill when:
- Adding user configuration to a Claude Code plugin
- Defining settings schema with types and defaults
- Storing persistent settings in project-level files
- Reading and validating plugin settings at runtime
- Building settings migration for plugin updates
Consider alternatives when:
- You need environment-specific config (use .env files)
- You need machine-level settings (use the global Claude config)
- You need one-time configuration (use command arguments)
Quick Start
// plugin.json - Define settings schema { "name": "my-plugin", "version": "1.0.0", "settings": { "language": { "type": "string", "default": "typescript", "description": "Default programming language for code generation", "enum": ["typescript", "javascript", "python"] }, "strictMode": { "type": "boolean", "default": true, "description": "Enable strict validation rules" }, "maxFiles": { "type": "number", "default": 10, "description": "Maximum files to process in a single batch" } } }
<!-- .claude/my-plugin.local.md - User's local settings --> # My Plugin Settings language: python strictMode: false maxFiles: 25
Core Concepts
Settings Architecture
| Layer | File | Purpose |
|---|---|---|
| Schema | plugin.json → settings | Define available settings with types and defaults |
| Global | ~/.claude/plugins/my-plugin/settings.md | User-level defaults |
| Project | .claude/my-plugin.local.md | Project-specific overrides |
| Runtime | Environment variables | Temporary overrides |
Settings Types
| Type | Format | Example |
|---|---|---|
string | Plain text or enum | language: typescript |
boolean | true or false | strictMode: true |
number | Integer or float | maxFiles: 10 |
array | Comma-separated or list | ignorePatterns: *.test.ts, *.spec.ts |
object | Key-value pairs | database: { host: localhost, port: 5432 } |
Reading Settings in Skills
# skills/code-generator.md --- description: Generate code with configured settings --- Before generating code: 1. Read `.claude/my-plugin.local.md` for user settings 2. Apply defaults from plugin.json for any missing settings 3. Use the configured language and strictMode settings Generate code in the user's preferred language. If strictMode is enabled, include type annotations and error handling.
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
type | string | — | Setting type: string, boolean, number, array |
default | any | — | Default value when not configured |
description | string | — | Help text for the setting |
enum | array | — | Allowed values (for string type) |
min | number | — | Minimum value (for number type) |
max | number | — | Maximum value (for number type) |
required | boolean | false | Whether the setting must be configured |
Best Practices
-
Define sensible defaults for every setting — plugins should work out of the box without any configuration; defaults should cover the most common use case.
-
Use
.local.mdfile extension for project settings — the.localsuffix signals the file contains local configuration that may contain preferences; add it to.gitignoreif it contains user-specific values. -
Validate settings at the start of skill execution — check that configured values match the schema (type, enum, range) and fall back to defaults for invalid values rather than crashing.
-
Document each setting in the plugin README — list all settings with their types, defaults, and descriptions so users know what they can configure without reading the source.
-
Support both project-level and global settings — project settings override global settings; this lets users set personal defaults while allowing per-project customization.
Common Issues
Settings file not found — The plugin looks for .claude/plugin-name.local.md in the project root. Ensure the file exists and the plugin name matches exactly.
Boolean settings parsed as strings — When reading from markdown files, true and false are strings. Convert them: value === 'true' or use a proper parser.
Settings reset after plugin update — Plugin updates should not overwrite user settings files. Only update the schema in plugin.json; add migration logic for renamed or removed settings.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.