Guide for developing CommonTools patterns (TypeScript modules that define reactive data transformations with UI)...
Use Skill("ct") for ct CLI documentation when running commands.
You and the user are a team finding the efficient path to their vision.
Use EnterPlanMode before building. Scale the plan to the task:
Simple pattern (todo list, counter):
Medium pattern (form with validation, data viewer):
Complex pattern (multi-entity system, integrations):
Always start simple. One file first. Split when it helps, not before.
Start simple:
packages/patterns/[name]/
βββ main.tsx # Everything in one file to start
Split when it helps (not before):
packages/patterns/[name]/
βββ schemas.tsx # Types, if complex
βββ main.tsx # Main pattern
βββ [other].tsx # Extract when reuse is clear
Don't create separate files for every entity. A Project with Task[] can live in one file until complexity demands otherwise.
Don't write finished code. Write the minimum to see something work:
deno task ct check main.tsx and see what happens.Each iteration should be deployable. If you can't run it, you've written too much.
Run the code, not just tests. The primary verification is: does it work when you run it?
deno task ct check main.tsx β See it render, click things, check consolePattern tests when needed: deno task ct test [file].test.tsx
For implementing pattern code:
Task({
prompt: "Implement [feature]. Keep it simple, one file.",
subagent_type: "pattern-maker"
})
For deploying and testing with ct CLI:
Task({
prompt: "Deploy and test [pattern].",
subagent_type: "pattern-user"
})
For checking violations before release or when stuck:
Task({
prompt: "Review [file] for violations.",
subagent_type: "pattern-critic"
})
Not phases, just common sense:
ct check)Always run pattern-critic before first deploy. It's fast (uses haiku) and catches mistakes that cause runtime errors. Skip only for tiny fixes where you're confident.
Start with docs/common/patterns/βespecially docs/common/patterns/meta/ which contains generalizable idioms that grow over time.
Prefer docs over existing patterns in packages/patterns/βdocs contain validated snippets while existing patterns may be outdated. Use packages/patterns/ as reference but don't copy blindly.
Phase skills consult as needed:
docs/common/concepts/types-and-schemas/docs/common/concepts/action.md, docs/common/concepts/handler.mddocs/common/workflows/pattern-testing.mddocs/common/components/COMPONENTS.mddocs/development/debugging/