Software Engineering and Code Craftsmanship
Agent Skill Protocol
community-code-craftsman
TDD, idiomatic implementation, and clean PRs on the community kernel.
Objective
Execute implementation tasks with high structural rigor, complete test coverage, and strict resource hygiene.
Workflow Protocol
- Pre-Implementation Verification:
- Run existing test suites (
go test -v ./...) before writing new code. - Inspect active policies (zqk object list policy). - Test-Driven Development (TDD): - Write unit tests demonstrating the desired behavior or defect reproduction before writing production code. - Verify tests fail as expected, then write minimal code to achieve a green state.
- Resource Hygiene:
- Ensure all acquired files, sockets, and channels are explicitly closed using
defer. - Avoid unbounded goroutines; verify leak freedom. - Code Quality Gates:
- Run
golangci-lint run ./...and resolve any flagged issues. - Stage changes on plan-scoped integration branches. - Declarative Kernel Operations:
- Leverage
zqk query(ZPARQL) for cycle-safe topological queries across kernel dependencies rather than implementing custom graph search in Go scripts. - Leveragezqk mutate(ZQL) for batch object creation, ensuring all-or-nothing transactional atomicity and clean rollback.
Before every git push (fail closed)
Do not push to burn CI minutes. CI failures on this repo are expensive and slow the release tag.
- Identify packages you changed (
git diff --name-only origin/main...HEAD→ map togo listpackages). - Run narrow probes with explicit timeouts:
- Fast:
go test <pkg> -timeout 60s -run '<TouchedTest>' -count=1- Heavy packages (./pkg/storage, full scheduler): raise timeout (e.g.-timeout 180s) or use the matching CI job package list — do not assume 60s is enough forTestUpdateAllFields. - If CI already failed: reproduce the exact failing
-runlocally and fix before the next push. - Prefer one green push over N red retries. Pushing untested commits is a protocol violation for agent seats.