surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
| 1 | --- |
| 2 | description: "Create plugin settings file with user preferences" |
| 3 | allowed-tools: ["Write", "AskUserQuestion"] |
| 4 | --- |
| 5 | |
| 6 | # Create Plugin Settings |
| 7 | |
| 8 | This command helps users create a `.claude/my-plugin.local.md` settings file. |
| 9 | |
| 10 | ## Steps |
| 11 | |
| 12 | ### Step 1: Ask User for Preferences |
| 13 | |
| 14 | Use AskUserQuestion to gather configuration: |
| 15 | |
| 16 | ```json |
| 17 | { |
| 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 | ``` |
| 56 | |
| 57 | ### Step 2: Parse Answers |
| 58 | |
| 59 | Extract answers from AskUserQuestion result: |
| 60 | |
| 61 | - answers["0"]: enabled (Yes/No) |
| 62 | - answers["1"]: mode (Strict/Standard/Lenient) |
| 63 | |
| 64 | ### Step 3: Create Settings File |
| 65 | |
| 66 | Use Write tool to create `.claude/my-plugin.local.md`: |
| 67 | |
| 68 | ```markdown |
| 69 | --- |
| 70 | enabled: <true if Yes, false if No> |
| 71 | validation_mode: <strict, standard, or lenient> |
| 72 | max_file_size: 1000000 |
| 73 | notify_on_errors: true |
| 74 | --- |
| 75 | |
| 76 | # Plugin Configuration |
| 77 | |
| 78 | Your plugin is configured with <mode> validation mode. |
| 79 | |
| 80 | To modify settings, edit this file and restart Claude Code. |
| 81 | ``` |
| 82 | |
| 83 | ### Step 4: Inform User |
| 84 | |
| 85 | Tell the user: |
| 86 | - Settings file created at `.claude/my-plugin.local.md` |
| 87 | - Current configuration summary |
| 88 | - How to edit manually if needed |
| 89 | - Reminder: Restart Claude Code for changes to take effect |
| 90 | - Settings file is gitignored (won't be committed) |
| 91 | |
| 92 | ## Implementation Notes |
| 93 | |
| 94 | Always validate user input before writing: |
| 95 | - Check mode is valid |
| 96 | - Validate numeric fields are numbers |
| 97 | - Ensure paths don't have traversal attempts |
| 98 | - Sanitize any free-text fields |