hns-moaiadk-best-practices

Enforces TRUST 5 quality gates and coding conventions for moai-adk-go harness development.

1.2k|222|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/modu-ai/moai-adk --skill hns-moaiadk-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hns-moaiadk-best-practices
Source: https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/hns-moaiadk-best-practices
Command: npx skills add https://github.com/modu-ai/moai-adk --skill hns-moaiadk-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Harness specialists authoring or reviewing moai-adk-go code need a single authoritative reference for quality gates, test isolation rules, and hardcoding-prevention conventions, otherwise reviews become inconsistent and verification claims go unverified.

Core Features & Use Cases

  • TRUST 5 Quality Gates: Defines the five mandatory gates (Tested, Readable, Unified, Secured, Trackable) with coverage targets of 85% package minimum and 90%+ for critical packages like internal/cli and internal/template.
  • Go Test Isolation Rules: Codifies t.TempDir() usage, macOS path pitfalls, the ban on OTEL env vars in parallel tests, and full-suite re-run requirements after test fixes.
  • Hardcoding Prevention & Agent Boundaries: Centralizes env var names in envkeys.go, thresholds in defaults.go, restricts AskUserQuestion to the orchestrator, and enforces the archived-agent rejection contract with 8 retained delegation targets.
  • Use Case: A quality-specialist reviewing a new Go test file loads this skill to confirm the test uses t.TempDir(), avoids t.Setenv on HOME, and that any coverage claim cites the actual go test output observed in this run.

Quick Start

Load the moai-adk-go best practices reference and review my new Go test file for TRUST 5 compliance and test isolation violations.

Frequently Asked Questions about hns-moaiadk-best-practices

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

FAQPage Schema
How do I write isolated Go tests for moai-adk-go?

Always use t.TempDir() for temporary directories since it auto-cleans under os.TempDir(). Never call t.Setenv with OTEL_EXPORTER_* or HOME in parallel tests, because the OTEL SDK reads env vars globally and causes data races.

What are the TRUST 5 quality gates in moai-adk?

TRUST 5 gates are Tested (go test with coverage), Readable (golangci-lint), Unified (go fmt plus goimports), Secured (OWASP-aligned review), and Trackable (Conventional Commits). Coverage targets are 85% per package and 90%+ for critical packages.

Where should environment variable names be defined in Go projects?

Define all environment variable names as constants in internal/config/envkeys.go and reference the constant everywhere. Thresholds belong in internal/config/defaults.go as a single source, never duplicated across packages.

Can subagents use AskUserQuestion in moai-adk?

No, AskUserQuestion is reserved for the MoAI orchestrator main session only. Subagents must return a structured blocker report to the orchestrator when user input is required, and free-form prose questions are prohibited.

Why does filepath.Join break with t.TempDir paths on macOS?

t.TempDir() returns absolute paths like /var/folders/..., and Go's filepath.Join does not strip the leading slash, producing wrong nested paths. Use filepath.Abs() when resolving user-supplied paths in CLI commands.

What makes a verification claim valid in moai-adk reviews?

A claim like tests pass or coverage 87% is valid only when the actor ran the command and observed the output in this tree. Reports must follow the 5-section format: Claim, Evidence, Baseline-attribution, Gaps, and Residual-risk.