eng-code-guidelines

Applies canonical Go coding, concurrency, and lifecycle rules to Compozy production code changes.

2.7k|171|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/compozy/compozy --skill eng-code-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eng-code-guidelines
Source: https://github.com/compozy/compozy/tree/main/.agents/skills/eng/eng-code-guidelines
Command: npx skills add https://github.com/compozy/compozy --skill eng-code-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Editing production Go code in a large daemon codebase without consistent rules leads to leaked goroutines, untracked subprocesses, inconsistent error handling, and configuration drift. This Skill enforces Compozy's canonical engineering rules before any change to non-test Go files under cmd or internal.

Core Features & Use Cases

  • Rule Routing and Loading: Routes each change to the correct canonical references (coding style, concurrency patterns) and companion skills for tests, cleanup paths, schema migrations, API contracts, or network work.
  • Ownership Auditing: Verifies every changed error, resource, goroutine, process, and shared state has exactly one explicit owner, with cleanup-failure-path audits for multi-step teardown.
  • Verification Gates: Runs make lint, scoped go test -race, cross-build checks for subprocess work, and make gate before PR CI.
  • Use Case: When adding a new background job to the session manager, the Skill ensures the goroutine is tracked by a Manager-owned WaitGroup, detached via context.WithoutCancel, logged with slog correlation keys, and verified with race-enabled tests.

Quick Start

Ask the AI to review or modify a production Go file under cmd or internal using the Compozy code guidelines before making the change.

Frequently Asked Questions about eng-code-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply Go coding guidelines to Compozy production code?

Confirm the target is a non-test Go file under cmd or internal, load the coding-style reference, and load concurrency-patterns when the change touches goroutines, subprocesses, or shared state. Then apply every matching rule and verify with make lint and scoped go test -race.

What Go concurrency rules apply to goroutines in Compozy?

Goroutines spawned by session managers must be tracked by a Manager-owned WaitGroup and joined in shutdown. Work outliving a request must detach via context.WithoutCancel, and time.Sleep is forbidden in orchestration in favor of timers or context deadlines.

Does this skill apply to Go test files?

No, it explicitly excludes *_test.go files. Test work routes to a separate narrower skill, while this skill covers only production Go under cmd and internal, including config, logging, CLI, and process-lifecycle paths.

How should subprocess shutdown work on Windows versus Unix?

Managed stop must respect ctx.Done() between Shutdown and Wait, wrapping proc.Wait in a select on ctx.Done(). Unix uses process groups while Windows uses a forced-exit fallback, and changes must be cross-built with GOOS=windows before completion.

When should I not use these code guidelines?

Do not use them for Go tests, schema migrations, API contract changes, cleanup-path audits, or internal/network work; those domains have dedicated narrower skills that should be paired or used instead.