スキル一覧に戻る
erikpr1994

writing-patterns

by erikpr1994

0🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: writing-patterns description: "Use when documenting reusable code patterns, architectural approaches, or established solutions with keyword triggers and anti-patterns."

Writing Patterns

Overview

Patterns are reusable solutions to recurring problems. Good patterns have clear triggers, code examples, and known anti-patterns.

When to Create

Create a pattern when:

  • Solution applies to multiple projects
  • Same approach discovered repeatedly
  • Code pattern is non-obvious
  • Anti-patterns should be avoided

Don't create for:

  • One-time solutions
  • Project-specific conventions
  • Standard library usage (well-documented elsewhere)

Structure Template

---
name: pattern-name
keywords: [list, of, trigger, words]
category: [architecture | data | ui | testing | integration]
---

# Pattern Name

## Problem
[What problem this pattern solves]

## Solution
[Brief description of the approach]

## When to Use
[Trigger conditions]

## Code Example
[Working code with comments]

## Anti-Patterns
[What NOT to do and why]

## Related Patterns
[Links to complementary patterns]

## Version Notes
[Changes across versions/frameworks]

Quality Checklist

  • Problem clearly stated
  • Solution is concise
  • Keywords enable discovery
  • Code example is complete and runnable
  • Anti-patterns with explanations
  • Category assigned for organization
  • Version notes if framework-specific
  • Under 100 lines (reference to files for complex examples)

Testing Requirements

  1. Keyword test - Search finds pattern via keywords
  2. Code test - Example actually works
  3. Application test - Agent applies pattern correctly
  4. Anti-pattern test - Agent avoids documented pitfalls
  5. Version test - Notes accurate for target versions

Examples

Good Pattern:

---
name: optimistic-updates
keywords: [optimistic, instant, ux, state, rollback]
category: ui
---

# Optimistic Updates

## Problem
User waits for server response before seeing UI change.

## Solution
Update UI immediately, rollback on error.

## When to Use
- Non-critical updates (likes, comments)
- Fast perceived performance needed
- Server usually succeeds

## Code Example
const [items, setItems] = useState(data);

async function addItem(newItem) {
  // Optimistic update
  setItems(prev => [...prev, newItem]);

  try {
    await api.create(newItem);
  } catch {
    // Rollback on failure
    setItems(prev => prev.filter(i => i.id !== newItem.id));
    toast.error('Failed to add');
  }
}

## Anti-Patterns
- Using for critical operations (payments)
- No rollback mechanism
- Complex state with dependencies

## Related Patterns
- error-boundaries
- loading-states

Bad Pattern:

# Good Code

Write good code that works well.

(No problem, no example, no anti-patterns)

Common Mistakes

MistakeFix
No keywordsAdd 3-5 trigger words
Incomplete exampleProvide runnable code
Missing anti-patternsDocument what NOT to do
Too verboseKeep under 100 lines
No categoryAssign for organization
Outdated versionsAdd version notes

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です