code-generation
Run and troubleshoot project code generation (sqlc + templ).
When & Why to Use This Skill
This Claude skill automates and troubleshoots the code generation workflow for Go projects utilizing sqlc and templ. It streamlines the development process by ensuring that database access layers and UI components are perfectly synchronized with their source SQL and template files, effectively eliminating manual command execution and resolving common compilation errors related to missing generated code.
Use Cases
- Database Schema Synchronization: Automatically regenerating Go database access code in the repository layer whenever SQL queries or migration files are modified.
- Frontend Component Updates: Seamlessly converting .templ files into Go code to ensure UI changes are immediately reflected in the application build.
- Build Error Resolution: Identifying and fixing 'missing generated code' compile errors by executing standardized make generate or tool-specific commands within the agent environment.
- Workflow Automation: Reducing developer friction by handling the repetitive task of running code generators during the iterative development of Go-based web applications.
| name | code-generation |
|---|---|
| description | Run and troubleshoot project code generation (sqlc + templ). |
| license | MIT |
| compatibility | Requires bash, git, Go, make, sqlc v1.30.0+, and templ. |
| repo | mjrwtf |
| runner | github-copilot-cli |
| version | 1.2 |
| allowed-tools | Bash(git:*) Bash(make:*) Bash(go:*) Bash(sqlc:*) Bash(templ:*) Bash(curl:*) Read |
What this skill covers
This repo relies on generated code for:
- sqlc: generates DB access code into
internal/adapters/repository/sqlc/sqlite/ - templ: generates Go code from
.templtemplates
Standard commands
make generate
Manual equivalents:
sqlc generate
templ generate
When to run generation
Run make generate when you change:
internal/adapters/repository/sqlc/sqlite/queries.sqlsqlc.yaml- migration files referenced by
sqlc.yamlunderschema: - any
.templfiles
Troubleshooting
If you see compile errors referencing missing generated code, re-run:
make generate