Install any skill in seconds. Free to start, no credit card required.
Get Started Free →modu-ai/hns-moaiadk-best-practices
moai-adk-go best-practices reference for the 4 harness specialists (cli-template-specialist, quality-specialist, workflow-specialist, hook-ci-specialist). Covers TRUST 5 gates, Go test isolation (t.TempDir, no OTEL env in parallel tests), hardcoding-prevention rules (env constants in envkeys.go, thresholds in defaults.go), the AskUserQuestion orchestrator-only boundary, the deferred-tool preload rule, the archived-agent rejection contract, and verification-claim integrity. Loaded by the speciali
Passed 17 of 20 test cases with the skill, and 8 of 20 without it.
and 14 more in the full report
11 fixed8 passed either way2 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 11 test cases the skill fixed. Same model, same prompt, with and without the skill.
The main orchestrator session needs to invoke `AskUserQuestion` and task management tools (`TaskCreate`, `TaskUpdate`) for the first time in a new session. Describe the prerequisite step required before calling these tools in the orchestration flow.
| Checked | Without skill | With skill |
|---|---|---|
| requires calling ToolSearch before using deferred tools | Missed | Passed |
| specifies ToolSearch query string selecting AskUserQuestion | Missed | Passed |
The instructions your model reads when the skill loads.
Every change must pass all five dimensions before completion:
| Pillar | Gate | Failure action |
|---|---|---|
| Tested | go test ./... with coverage | Block merge; generate missing tests |
| Readable | golangci-lint run | Warn; suggest refactoring |
| Unified | go fmt + goimports | Auto-format or warn |
| Secured | OWASP-aligned review (per-spawn opus agent) | Block; require review |
| Trackable | Conventional Commits regex | Suggest format |
Coverage targets: 85% package minimum; 90%+ for critical packages
(internal/cli, internal/template, internal/hook).
t.TempDir() for temp dirs — auto-cleanup, under os.TempDir().t.TempDir() returns /var/folders/.... Go's
filepath.Join(cwd, absPath) does NOT strip the leading /:
filepath.Join("/a/b", "/var/folders/x") → "/a/b/var/folders/x" (WRONG).
Use filepath.Abs() when resolving user-supplied paths in CLI commands.t.Setenv("OTEL_EXPORTER_*", ...) in parallel tests — the OTEL SDK
initializes global state from env vars on first use, causing data races. Use
a fake/no-op exporter instead; or make the parent test non-parallel.t.Setenv("HOME", tmpDir) in GLM integration tests — parallel-test
pollution. Use t.TempDir() + explicit path construction.go test ./...) to catch
cascading failures. Use -count=1 to disable caching when debugging flaky
tests; use -race for concurrency-safety checks.const.internal/config/envkeys.go as
constants; reference the constant everywhere. Never inline a raw env string.internal/config/defaults.go. Nevertest cases passed, vs 8 / 20 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.