Opencode ts

From pproenca/dot-skills · View interactive version

Opencode ts is an AI agent skill from the GitHub repository pproenca/dot-skills. Write and refactor TypeScript code in repos that use Effect-TS services, Effect Schema, event-sourced persistence, and barrel-module architecture. Use this skill when implementing features, fixing bugs, writing tests, or refactoring in opencode or any TypeScript codebase built on the same stack (Eff

How to use this skill

Skill file

Opencode TypeScript

Code like the opencode core team. This skill contains real code extracted from the repo — complete implementations, not abstract rules. Follow the workflow below based on your task.


Implement (new code)

Follow these phases in order:

1. Orient — where does this go?

Load architecture.md. Find:

2. Gather — what already exists?

Load helpers-deep-dive.md. Before writing ANY utility:

For quick lookups: primitives.md (shorter, import paths + signatures only)

3. Build — write the code

Load the reference that matches what you're building:

| Building... | Load this |

|---|---|

| Service module (namespace + Effect service + schemas + events) | service-module.md |

| Tool or modifying tool behavior | tool-module.md |

| Database tables, schemas, events, error types | schemas-and-state.md |

| Server routes, config, plugins, project lifecycle | server-and-routes.md |

| Tests | test-writing.md |

4. CHECK GATE — code MUST pass all of these before proceeding

Load style-dna.md. If ANY of the following fail, fix the code before proceeding to Review:

DO NOT proceed if any check fails. Go back to phase 3 and fix.

5. REVIEW GATE — REJECT the diff if any of these apply

Load review-voice.md. The diff MUST NOT contain any of the following. If it does, fix before submitting:


Refactor (changing existing code)

1. Orient — what touches what?

Load architecture.md. Map the blast radius before changing anything.

2. Study — which pattern applies here?

Load refactoring-patterns.md. Start with the Decision Matrix at the top — match the code smell you see to the correct pattern. Then read the specific pattern section for real before/after diffs:

3. Gather — can an existing utility replace this code?

Load helpers-deep-dive.md. The best refactor often replaces 20 lines with one utility call.

4. Check + Review

Same as implement phases 4-5: style-dna.md then review-voice.md.


Key decisions (always apply)


Reference index

| File | Size | What it contains |

|------|------|-----------------|

| style-dna.md | 18K | Mandatory style rules, naming, control flow, 14 review traps |

| primitives.md | 22K | Quick-lookup: every utility with import path + signature |

| helpers-deep-dive.md | ~40K | Full deep-dive: every utility, every usage site, when NOT to use |

| architecture.md | ~30K | Module map, dependency graph, data flow, file conventions |

| service-module.md | 27K | Complete Question + Permission implementations |

| tool-module.md | 28K | Full tool implementations, registry, prompt loop |

| test-writing.md | 42K | 5 complete test files with all fixture patterns |

| schemas-and-state.md | 36K | SQL tables, Effect Schema (Struct/annotate/Newtype), SyncEvent flow, errors |

| server-and-routes.md | 32K | Routes, config, plugins, project lifecycle |

| review-voice.md | ~25K | Real PR review comments from Dax + Aiden |

| refactoring-patterns.md | ~25K | Real before/after diffs from cleanup commits |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.