codegen-sync
Skill59 starsChanged 9 months agoMITView on GitHub
Verifies TypeScript codegen is in sync with Elixir protocol definitions. Use this skill after modifying Elixir structs, protocol messages, or RPC types in lib/opal/ to regenerate and verify the TypeScript client SDK types.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ci-preflightSkill
- citationsSkill
- debuggingSkill
- docsSkill
- elixir-cyclic-depsSkill
- gitSkill
- lint-and-formatSkill
- live-testsSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 13
After modifying any Elixir structs, message types, or RPC definitions in lib/opal/.
- Very specific: line 14
After adding or changing tool schemas in lib/opal/tool/.
- Distinctive: line 15
When CI fails with a codegen drift error.
- Distinctive: line 16
When the user asks to sync or regenerate types.
- Very specific: line 30
After modifying Elixir protocol types, run mix run scripts/codegen_ts.exs.
- Distinctive: line 36
Never hand-edit generated files: Always regenerate from the Elixir source.
- Very specific: line 37
If codegen output looks wrong, fix the Elixir definitions or the codegen script (scripts/codegen_ts.exs), not the output.
- Distinctive: line 38
Always commit codegen output alongside the source changes — never in a separate commit.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codegen Sync Skill
This project uses code generation to keep TypeScript SDK types in sync with Elixir protocol definitions. When Elixir types change, the TypeScript side must be regenerated.
When to act
- After modifying any Elixir structs, message types, or RPC definitions in
lib/opal/. - After adding or changing tool schemas in
lib/opal/tool/. - When CI fails with a codegen drift error.
- When the user asks to sync or regenerate types.
Commands
# Run codegen (Elixir -> TypeScript)
mix run scripts/codegen_ts.exs
# Verify codegen is up to date (what CI runs)
mix run scripts/codegen_ts.exs --checkWorkflow
- After modifying Elixir protocol types, run
mix run scripts/codegen_ts.exs. - Review the generated diff in
cli/src/sdk/to verify correctness. - Include the regenerated files in the same commit as the Elixir changes.
Rules
- Never hand-edit generated files. Always regenerate from the Elixir source.
- If codegen output looks wrong, fix the Elixir definitions or the codegen script (
scripts/codegen_ts.exs), not the output. - Always commit codegen output alongside the source changes — never in a separate commit.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

