<< All versions
Skill v1.0.1
currentAutomated scan100/100majiayu000/claude-skill-registry/pattern-implement
3 files
──Details
PublishedMay 15, 2026 at 03:58 AM
Content Hashsha256:4322318f30ec1259...
Git SHA63c042456db3
Bump Typepatch
──Files
Files (1 file, 1.7 KB)
SKILL.md1.7 KBactive
SKILL.md · 59 lines · 1.7 KB
version: "1.0.1" name: pattern-implement description: Build sub-patterns with minimal UI user-invocable: false
Implement Sub-Pattern
Core Rule
Write ONE sub-pattern with minimal stub UI. No styling, just basic inputs/buttons to verify data flow.
Always use `pattern<Input, Output>()` - expose actions as Stream<T> for testability.
Order
- Leaf patterns first (no dependencies on other patterns)
- Container patterns (compose leaf patterns)
- main.tsx last (composes everything)
Read First
docs/common/patterns/- especiallymeta/for generalizable idiomsdocs/common/concepts/action.md- action() for local statedocs/common/concepts/handler.md- handler() for reusable logicdocs/common/concepts/reactivity.md- Cell behavior, .get()/.set()docs/common/concepts/identity.md- equals() for object comparison
Key Patterns
action() - Closes over local state in pattern body:
tsx
const inputValue = Cell.of("");const submit = action(() => {items.push({ text: inputValue.get() });inputValue.set("");});
handler() - Reused with different bindings:
tsx
const deleteItem = handler<void, { items: Writable<Item[]>; index: number }>((_, { items, index }) => items.set(items.get().toSpliced(index, 1)));// In JSX: onClick={deleteItem({ items, index })}
Rendering sub-patterns - Use function calls, not JSX:
tsx
// ✅ Correct{items.map((item) => ItemPattern({ item, allItems: items }))}// ❌ Wrong - JSX fails with typed Output{items.map((item) => <ItemPattern item={item} />)}
Done When
- Pattern compiles:
deno task ct check pattern.tsx --no-run - Minimal UI renders inputs/buttons
- Ready for testing