shared-patterns

athola 的头像作者 athola

Claude Code技能和钩子开发的可重用模式和模板。触发器:验证模式,错误处理,测试模板,工作流模式,共享模式,可重用模板,DRY模式,通用工作流。适用于:创建需要一致模式的新技能或钩子,实现验证逻辑,设置错误处理,创建测试支架,引用标准工作流结构。不要当模式仅特定于一个技能时使用。不要当模式仍在演变时使用-等待稳定性。不要当模式是上下文相关需要变化时使用。参考这些模式以确保生态系统中的一致性。

📖 中文导读:Claude Code技能和钩子开发的可重用模式和模板。触发器:验证模式,错误处理,测试模板,工作流模式,共享模式,可重用模板,DRY模式,通用工作流。适用于:创建需要一致模式的新技能或钩子,实现验证逻辑,设置错误处理,创建测试支架,引用标准工作流结构。不要当模式仅特定于一个技能时使用。不要当模式仍在演变时使用-等待稳定性。不要当模式是上下文相关需要变化时使用。参考这些模式以确保生态系统中的一致性。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: shared-patterns description: |

Triggers: templates, validation, reusable, shared, patterns Reusable patterns and templates for Claude Code skill and hook development.

Triggers: validation patterns, error handling, testing templates, workflow patterns, shared patterns, reusable templates, DRY patterns, common workflows

Use when: creating new skills or hooks that need consistent patterns, implementing validation logic, setting up error handling, creating test scaffolding, referencing standard workflow structures

DO NOT use when: pattern is specific to one skill only. DO NOT use when: pattern is still evolving - wait for stability. DO NOT use when: pattern is context-dependent requiring variations.

Reference these patterns to validate consistency across the ecosystem. version: 1.0.0 category: meta-infrastructure tags: [patterns, templates, shared, validation, reusable] dependencies: [] estimated_tokens: 400

Shared Patterns

Reusable patterns and templates for skill and hook development.

Purpose

This skill provides shared patterns that are referenced by other skills in the abstract plugin. It follows DRY principles by centralizing common patterns.

Pattern Categories

Validation Patterns

See modules/validation-patterns.md for:

  • Input validation templates
  • Schema validation patterns
  • Error reporting formats

Error Handling

See modules/error-handling.md for:

  • Exception hierarchies
  • Error message formatting
  • Recovery strategies

Testing Templates

See modules/testing-templates.md for:

  • Unit test scaffolding
  • Integration test patterns
  • Mock fixtures

Workflow Patterns

See modules/workflow-patterns.md for:

  • Checklist templates
  • Feedback loop patterns
  • Progressive disclosure structures

Usage

Reference these patterns from other skills:

For validation patterns, see the `shared-patterns` skill's
[validation-patterns](../shared-patterns/modules/validation-patterns.md) module.

Verification: Run the command with --help flag to verify availability.

Troubleshooting

Common Issues

Command not found Ensure all dependencies are installed and in PATH

Permission errors Check file permissions and run with appropriate privileges

Unexpected behavior Enable verbose logging with --verbose flag