pattern-implement | Skill Performance & Reviews | TopRankSkills

TopRank Skills

Home / Skills / tools / pattern-implement

pattern-implement

maintained by commontoolsinc

star 24 account_tree 10 verified_user MIT License
bolt View GitHub

name: pattern-implement description: Build sub-patterns with minimal UI user-invocable: false

Use Skill("ct") for ct CLI documentation when running commands.

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

  1. Leaf patterns first (no dependencies on other patterns)
  2. Container patterns (compose leaf patterns)
  3. main.tsx last (composes everything)

Read First

  • docs/common/patterns/ - especially meta/ for generalizable idioms
  • docs/common/concepts/action.md - action() for local state
  • docs/common/concepts/handler.md - handler() for reusable logic
  • docs/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:

const inputValue = Cell.of("");
const submit = action(() => {
  items.push({ text: inputValue.get() });
  inputValue.set("");
});

handler() - Reused with different bindings:

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:

// ✅ 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

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!

Skill Details

GitHub Stars 24
GitHub Forks 10
Created Jan 2026
Last Updated 4 months ago
tools tools ide plugins

Related Skills

writing-skills
chevron_right
codex
chevron_right
smart-illustrator
chevron_right
ast-index
chevron_right
packmind-standard-creator
chevron_right

Build your own?

Join 12,000+ developers contributing to the Claude ecosystem.