agentleFS
matteingmatteing/opal/.claude/skills/codegen-sync/SKILL.md

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.

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
  1. Very specific:

    After modifying any Elixir structs, message types, or RPC definitions in lib/opal/.

    line 13
  2. Very specific:

    After adding or changing tool schemas in lib/opal/tool/.

    line 14
  3. Distinctive:

    When CI fails with a codegen drift error.

    line 15
  4. Distinctive:

    When the user asks to sync or regenerate types.

    line 16
  5. Very specific:

    After modifying Elixir protocol types, run mix run scripts/codegen_ts.exs.

    line 30
  6. Distinctive:

    Never hand-edit generated files: Always regenerate from the Elixir source.

    line 36
  7. Very specific:

    If codegen output looks wrong, fix the Elixir definitions or the codegen script (scripts/codegen_ts.exs), not the output.

    line 37
  8. Distinctive:

    Always commit codegen output alongside the source changes — never in a separate commit.

    line 38

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 --check

Workflow

  1. After modifying Elixir protocol types, run mix run scripts/codegen_ts.exs.
  2. Review the generated diff in cli/src/sdk/ to verify correctness.
  3. Include the regenerated files in the same commit as the Elixir changes.

Rules

  1. Never hand-edit generated files. Always regenerate from the Elixir source.
  2. If codegen output looks wrong, fix the Elixir definitions or the codegen script (scripts/codegen_ts.exs), not the output.
  3. Always commit codegen output alongside the source changes — never in a separate commit.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.