cloudcarver

anclax-develop-feature

Develop, review, or refactor Go services built with Anclax, including OpenAPI specs, handlers, service/business logic, database/sqlc changes, async tasks, and Wire dependency injection.

cloudcarver 13 3 Updated 3mo ago

Resources

8
GitHub

Install

npx skillscat add cloudcarver/anclax/anclax-develop-feature

Install via the SkillsCat registry.

SKILL.md

Anclax Development Workflow

Use Anclax generated types as the contract between layers and keep specs/SQL as the source of truth.

Design principles

  • Singleton services with dependency injection.
  • High cohesion, low coupling.

Core flow

  1. Inspect anclax.yaml to learn generation paths and enabled generators.
  2. Update sources first:
    • OpenAPI: api/v1.yaml
    • Tasks: api/tasks.yaml
    • DB schema: sql/migrations
    • Queries: sql/queries
  3. Run anclax gen after any spec/SQL/Wire changes.
  4. Implement code against generated interfaces and types.
  5. Add unit tests for service logic with mocks.

Layering rules

  • Handler: parse HTTP, call service, map errors to HTTP responses.
  • Service: implement business logic, accept and return apigen types.
  • Model: use pkg/zcore/model and sqlc-generated queries.
  • Async tasks: define in api/tasks.yaml, implement taskgen.ExecutorInterface, enqueue via taskgen.TaskRunner.

References and Examples