shared-patterns

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shared Patterns

共享模式

Reusable patterns and templates for skill and hook development.
用于skill和hook开发的可复用模式与模板。

Purpose

用途

This skill provides shared patterns that are referenced by other skills in the abstract plugin. It follows DRY principles by centralizing common patterns.
本skill提供抽象插件中其他skill会引用的共享模式,通过集中收纳通用模式践行DRY原则。

Pattern Categories

模式分类

Validation Patterns

校验模式

See modules/validation-patterns.md for:
  • Input validation templates
  • Schema validation patterns
  • Error reporting formats
请查看 modules/validation-patterns.md 了解以下内容:
  • 输入校验模板
  • Schema校验模式
  • 错误上报格式

Error Handling

错误处理

See modules/error-handling.md for:
  • Exception hierarchies
  • Error message formatting
  • Recovery strategies
请查看 modules/error-handling.md 了解以下内容:
  • 异常层级结构
  • 错误消息格式规范
  • 故障恢复策略

Testing Templates

测试模板

See modules/testing-templates.md for:
  • Unit test scaffolding
  • Integration test patterns
  • Mock fixtures
请查看 modules/testing-templates.md 了解以下内容:
  • 单元测试脚手架
  • 集成测试模式
  • Mock 夹具

Workflow Patterns

工作流模式

See modules/workflow-patterns.md for:
  • Checklist templates
  • Feedback loop patterns
  • Progressive disclosure structures
请查看 modules/workflow-patterns.md 了解以下内容:
  • 检查清单模板
  • 反馈循环模式
  • 渐进式披露结构

Usage

使用方法

Reference these patterns from other skills:
markdown
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.
从其他skill中引用这些模式:
markdown
For validation patterns, see the `shared-patterns` skill's
[validation-patterns](../shared-patterns/modules/validation-patterns.md) module.
验证: 携带
--help
参数运行命令以验证可用状态。

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
找不到命令 确保所有依赖已安装且处于PATH中
权限错误 检查文件权限并以适当的权限运行
非预期行为 携带
--verbose
参数开启详细日志