Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Pattern documentation for configuring settings in Claude Code plugins (from the official Anthropic claude-code repo).
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
examples/create-settings-command.md
1---2description: "Create plugin settings file with user preferences"3allowed-tools: ["Write", "AskUserQuestion"]4---56# Create Plugin Settings78This command helps users create a `.claude/my-plugin.local.md` settings file.910## Steps1112### Step 1: Ask User for Preferences1314Use AskUserQuestion to gather configuration:1516```json17{18"questions": [19{20"question": "Enable plugin for this project?",21"header": "Enable Plugin",22"multiSelect": false,23"options": [24{25"label": "Yes",26"description": "Plugin will be active"27},28{29"label": "No",30"description": "Plugin will be disabled"31}32]33},34{35"question": "Validation mode?",36"header": "Mode",37"multiSelect": false,38"options": [39{40"label": "Strict",41"description": "Maximum validation and security checks"42},43{44"label": "Standard",45"description": "Balanced validation (recommended)"46},47{48"label": "Lenient",49"description": "Minimal validation only"50}51]52}53]54}55```5657### Step 2: Parse Answers5859Extract answers from AskUserQuestion result:6061- answers["0"]: enabled (Yes/No)62- answers["1"]: mode (Strict/Standard/Lenient)6364### Step 3: Create Settings File6566Use Write tool to create `.claude/my-plugin.local.md`:6768```markdown69---70enabled: <true if Yes, false if No>71validation_mode: <strict, standard, or lenient>72max_file_size: 100000073notify_on_errors: true74---7576# Plugin Configuration7778Your plugin is configured with <mode> validation mode.7980To modify settings, edit this file and restart Claude Code.81```8283### Step 4: Inform User8485Tell the user:86- Settings file created at `.claude/my-plugin.local.md`87- Current configuration summary88- How to edit manually if needed89- Reminder: Restart Claude Code for changes to take effect90- Settings file is gitignored (won't be committed)9192## Implementation Notes9394Always validate user input before writing:95- Check mode is valid96- Validate numeric fields are numbers97- Ensure paths don't have traversal attempts98- Sanitize any free-text fields99