pattern-discovery
Pattern library discovery for pattern-first development. Use BEFORE implementing any new feature, creating components, writing API routes, or adding database operations. Ensures existing patterns are checked first.
- License 许可
- MIT
- 最近更新
- 2026-10-18
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- pattern-discovery
- description
- Pattern library discovery for pattern-first development. Use BEFORE implementing any new feature, creating components, writing API routes, or adding database operations. Ensures existing patterns are checked first.
02 资源文件 1
- 参考文档README.md1.7 KB
03 SKILL.md 正文
Pattern Discovery Skill
Purpose
Enforce pattern-first development by checking the pattern library before implementing new functionality.
When to Use
- About to create a new API route
- About to create a new UI component
- About to add database operations
- User asks "how do I implement..." or "how should I build..."
Pattern Discovery Protocol
ALWAYS check patterns before writing new code:
Step 1: Check Pattern Library
ls patterns_library/api/ # API route patterns
ls patterns_library/ui/ # UI component patterns
ls patterns_library/database/ # Database patterns
ls patterns_library/testing/ # Testing patterns
Step 2: Review Pattern Index
See patterns_library/README.md for the complete index.
Step 3: Apply or Escalate
If pattern exists: Copy, customize, validate.
If missing: Search codebase, implement following conventions, report gap.
Pattern Matching Guide
| If you need to... | Use this pattern |
|---|---|
| Create authenticated API endpoint | api/user-context-api.md |
| Create admin-only API endpoint | api/admin-context-api.md |
| Handle external webhooks | api/webhook-handler.md |
| Validate API input with Zod | api/zod-validation-api.md |
| Create protected page | ui/authenticated-page.md |
| Build form with validation | ui/form-with-validation.md |
| Add new table with RLS | database/rls-migration.md |
| Test API endpoints | testing/api-integration-test.md |
Reference
- Pattern Index:
patterns_library/README.md - RLS Patterns: See
rls-patternsskill - Frontend Patterns: See
frontend-patternsskill
04 同仓库更多 Skills
stripe-patterns
暂无简介
payment-patterns
暂无简介
testing-patterns
Testing patterns for Jest and Playwright. Use when writing tests, setting up test fixtures, or validating RLS enforcement. Routes to existing test conventions.
team-coordination
Agent Teams orchestration patterns for multi-agent SAFe workflows. Use when spawning agent teams, coordinating teammates, enforcing quality gates via task dependencies, or orchestrating the 11-agent SAFe pipeline. Covers team creation, messaging, shared task lists, and SAFe gate enforcement. Do NOT use for single-agent or simple subagent workflows.
task-compilation
Compile broad audit goals into structured proof obligations with 9 mandatory fields. Used after decomposition by the Threat Modeler agent.
storage-layout-analysis
Proxy patterns, slot collisions, upgrade safety. Used during decomposition to identify storage-related vulnerabilities in upgradeable contracts.