Skip to content
Agentmart
Submit a tool

code-generation

Run and troubleshoot repository code generation after detecting the generator contract.

Skill by matt-riley

IndexedGPL-3.0★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/matt-riley-code-generation

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Run and troubleshoot repository code generation after detecting the generator contract. Use when schema, query, spec, or template inputs changed, or generated output may be stale.

Use cases: documents

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Shell scripts

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/code-generation

What's inside

Skill name
code-generation
Description
Run and troubleshoot repository code generation after detecting the generator contract. Use when schema, query, spec, or template inputs changed, or generated output may be stale.
License
GPL-3.0
Metadata
kind: task · owner: mattriley · version: 1.4.2 · audience: general-coding-agent · category: generation · maturity: stable
Instructions
78 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (7)

  • SKILL.md
  • openai.yaml · agents/
  • evals.json · evals/
  • trigger-queries.json · evals/
  • edge-cases.md · references/
  • examples.md · references/
  • check-generated.sh · scripts/

SKILL.md (first lines)

## Use this skill when

- The task changes generator inputs such as SQL, proto, OpenAPI, templates, or generator config.
- Build/test output points at stale generated packages, missing generated types, or outdated artifacts.
- You need to verify whether generated output should be refreshed, checked in, or left to CI/runtime generation.

## Do not use this skill when

- The request is to design a schema/spec/template format from scratch rather than run the repo's generator workflow.
- The task is a generic explanation of code generation.
- The failing area has no generator-backed inputs and no stale-generation symptoms.

## Inputs to gather

- Which generators the repo uses and what inputs feed them.
- The canonical generation command(s): wrapper target, script, or direct CLI.
- Repo contract for outputs:
  - generated files committed to Git
  - generated locally for validation but ignored in Git
  - regenerated in CI/runtime from source inputs
- Validation path: diff check, `check-generated` script, build/test target, or CI job.

## First move

Inspect the repo's build docs, CI workflow, and `.gitignore` before regenerating or committing anything. Detect whether generated output is checked in, ignored, or only rebuilt in CI/runtime.

## Workflow

1. Identify the real generation entrypoints.
   - Prefer repo wrappers such as `make generate`, `task generate`, or checked-in scripts.
   - If wrappers are absent, locate the exact generator command for each tool (`sqlc generate`, `templ generate`, `buf generate`, `protoc`, etc.).

2. Regenerate only when it matches the repo contract.
   - Run generation after changing generator-backed inputs or when failures point to stale output.
   - If the repo uses multiple generators, run only the affected ones unless the wrapper target is the canonical path.

3. Branch on output handling.
   - **Committed output:** regenerate, inspect the diff, and keep the generated changes with the source changes.
   - **Ignored or CI-only output:** regenerate locally when needed for validation, but do not commit ignored artifacts unless the repo explicitly expects snapshots.
   - **Mixed repos:** follow per-generator rules; some outputs may be committed while others are ephemeral.

4. If tooling is missing or behaving differently, recover safely.
   - Install or invoke the pinned tool version the repo expects.
   - Check generator config, tool versions, and source inputs before blaming generated files.

5. Run the repo's follow-on checks.
   - Use the repo's diff or cleanliness check for generated files.
   - Build/test the affected area after generation succeeds.

## Outputs

- The repo's canonical generator entrypoints and output-handling contract (committed, ignored, or mixed) identified for the touched inputs.
- Regenerated artifacts for the affected generators only, with the resulting diff or clean status inspected against the repo contract.
- Follow-on build, test, or generated-output checks confirming the regenerated state is valid.

## Guardrails

- Never edit generated files by hand; change the generator inputs or config instead.
- Do not assume `make generate` exists or that one command covers every generator in the repo.
- Do not assume generated output belongs in Git; check `.gitignore`, CI, and repo docs first.
- If no generator-backed inputs changed, do not force regeneration as the first move unless the failure clearly points to stale output.
- Unexpected generated diffs usually mean changed inputs, config drift, or tool-version drift; inspect those before patching outputs.

## Validation

- The relevant generation command completes successfully.
- The diff or status matches the repo contract:
  - expected generated files changed and are ready to commit, or
  - ignored/ephemeral output was verified locally without being staged accidentally.
- Follow-on build/test/check-generated steps pass.

## Reference files

- Read `references/examples.md` when you need examples of stale-generation diagnosis or "regenerate before test" prompts.
- Read `references/edge-cases.md` when the repo's committed-vs-ephemeral generation contract is unclear.
- [`scripts/check-generated.sh`](scripts/check-generated.sh) — run with `--help` for a deterministic generation + diff check for committed-output workflows.

From matt-riley/agent-skills, GPL-3.0.

More from matt-riley/agent-skills

Signals

Stars
4
Forks
0
Open issues
1
Last commit (this folder)
Sep 29, 2026 (29 days ago)
Last release
Oct 23, 2026 (5 days ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
1.4.2
License
GPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from matt-riley

Cite this page

code-generation skill. Agent Mart. https://agentmart.dev/skills/matt-riley-code-generation (last updated 2026-10-24)