plugin-settings
使用 YAML frontmatter 模式設定外掛設定
Também disponível em: anthropics,davila7
外掛設定可以使用 YAML frontmatter 和 markdown 儲存在 .claude/plugin-name.local.md 檔案中。此模式可實現每個專案的外掛設定、狀態持久化,以及使用者可自訂的行為,而不需要複雜的資料庫或設定檔。
Baixar o ZIP da skill
Upload no Claude
Vá em Configurações → Capacidades → Skills → Upload skill
Ative e comece a usar
Testar
A utilizar "plugin-settings". 建立一個設定檔,以嚴格驗證模式啟用我的外掛
Resultado esperado:
- Settings file created at .claude/my-plugin.local.md
- Configuration: enabled=true, mode=strict, max_file_size=1000000
- To modify: edit file and restart Claude Code
- File is automatically gitignored
A utilizar "plugin-settings". 設定我的外掛以允許 JavaScript 和 TypeScript 檔案,限制為 2MB
Resultado esperado:
- Updated .claude/my-plugin.local.md with new settings
- Allowed extensions: .js, .ts
- Maximum file size: 2097152 bytes
- Restart Claude Code for changes to take effect
Auditoria de Segurança
SeguroOfficial Anthropic skill providing documentation on plugin settings pattern. Contains only educational content and utility scripts with safe bash practices including set -euo pipefail, file existence checks, and proper input validation. No network access, no dangerous operations, no external dependencies beyond standard POSIX tools.
Fatores de risco
⚡ Contém scripts (3)
📁 Acesso ao sistema de arquivos (2)
⚙️ Comandos externos (2)
Pontuação de qualidade
O Que Você Pode Construir
新增可設定行為
透過設定檔而非硬編碼預設值,讓使用者自訂外掛行為
追蹤代理程式狀態
儲存跨會話的代理程式任務分配、迭代計數器和協調器會話資訊
建立功能旗標
啟用或停用外掛功能,而無需修改外掛程式碼
Tente Estes Prompts
建立一個 .claude/my-plugin.local.md 檔案,以標準模式和日誌記錄啟用我的外掛
檢查 .claude/my-plugin.local.md 是否存在,並從 frontmatter 讀取 enabled 和 mode 欄位
更新 .claude/ralph-loop.local.md 中的 iteration 欄位,從目前值遞增
驗證 .claude/my-plugin.local.md 具有有效的 frontmatter,且 enabled 欄位設定為 true
Melhores Práticas
- 當設定檔不存在時,始終提供合理的預設值
- 使用快速退出模式,在外掛未設定時跳過鉤子處理
- 將 .claude/*.local.md 新增至專案 .gitignore,以防止提交使用者設定
Evitar
- 不要對設定檔使用絕對路徑(請使用相對路徑,例如 .claude/plugin-name.local.md)
- 不要在讀取設定前跳過檔案存在性檢查
- 不要使用非原子性的檔案更新,這可能會在中断時損壞設定
Perguntas Frequentes
哪些工具支援此模式?
設定檔的大小限制是多少?
如何與現有外掛整合?
設定檔是否安全?
為什麼我的變更沒有生效?
這與 CLAUDE.md 相比如何?
Detalhes do Desenvolvedor
Autor
anthropicsLicença
MIT
Repositório
https://github.com/anthropics/claude-code/tree/main/plugins/plugin-dev/skills/plugin-settingsReferência
main
Estrutura de arquivos