pattern
Documents reusable design patterns with structure, examples, and usage guidelines.
- License 许可
- MIT
- 所属仓库
- goffity/dev-km
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pattern
- description
- Documents reusable design patterns with structure, examples, and usage guidelines.
- argument-hint
- [name]
- user-invocable
- true
02 资源文件 2
- 参考文档SOURCE.md199 B
- 参考文档TRUST.auto.yaml2.2 KB
03 SKILL.md 正文
Pattern - Design Pattern Library
Document reusable design patterns with structure, examples, and usage guidelines.
Usage
/pattern [name]
/pattern retry-with-backoff
/pattern worker-coordination
Output: $PROJECT_ROOT/kb/02-patterns/[name].md
Instructions
Language Setting
Check
LANGUAGEindocs/current.md. Ifth, translate output perreferences/language-guide.md. Seereferences/bash-helpers.mdfor detection snippet.
- Parse name → kebab-case filename
- Ask user about the pattern:
- What type? (behavioral/structural/creational)
- What problem does it solve?
- What language for the example?
- Generate pattern document
- Save to
kb/02-patterns/[name].md
Template
# [Pattern Name]
| Field | Value |
|-------|-------|
| Type | Behavioral / Structural / Creational |
| Language | [primary language] |
| Tags | [tag1, tag2] |
| Created | YYYY-MM-DD |
## Intent
> One sentence describing what this pattern solves.
## Problem
What situation triggers the need for this pattern?
## Solution
How the pattern addresses the problem.
## Structure
```[language]
// Key interfaces/types
Example
// Complete working example
When to Use
- Situation 1
- Situation 2
When NOT to Use
- Anti-situation 1
- Anti-situation 2
Trade-offs
| Pro | Con |
|---|---|
| [benefit] | [cost] |
Related Patterns
- [Pattern A] - [relationship]
- [Pattern B] - [relationship]
References
- [link or source]
## Related Commands
| Command | Purpose |
|---------|---------|
| `/distill` | Extract patterns from learnings |
| `/example` | Save code examples |
| `/pattern` | Document patterns (you are here) |
| `/search` | Find existing patterns |
04 同仓库更多 Skills
wait-what
Stop. That last message did not land: re-pitch it.
tdd
Test-driven development loop (red-green-refactor) with commit-based phase state and Jira traceability. Use when the user wants to build a feature or fix a bug test-first, mentions "tdd", "red-green-refactor", or "test-first". Replaces the tdg plugin — combines its commit/phase discipline with seam-based test quality rules from kb Testing Standards.
td
Creates post-task retrospectives with Before/After context and session documentation.
summary
Generates weekly or monthly session summaries from retrospectives and activity logs.
share
Shares knowledge across projects by copying to shared-knowledge directory with cross-project metadata.
session-analyzer
Analyzes git changes and creates retrospective drafts with Before/After context.