hns-moaiadk-best-practices
Skill1.2k starsChanged 3 months agoApache-2.0View on GitHub
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 specialists when authoring or reviewing moai-adk-go code.
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about modu-ai/moai-adk
- Ven0m0/claude-config“Add a structured external integration plan to the root TODO backlog”GitHub · Mar 18, 2026 · 4 reactions
- Ven0m0/claude-config“TODO list”GitHub · Jan 31, 2026 · 1 reactions
- sudosubin/agents.nix“agent-skills.github.modu-ai.moai-adk: init at 3.1.2”GitHub · Sep 30, 2026
- anthropics/claude-code“Worktree-isolation Bash check folds command substitutions in quoted-delimiter heredoc bodies but refuses …”GitHub · Sep 7, 2026
- bjw202/minidiscord“docs(t41): moai gate 종료 코드 합류 — upstream 이슈 문안 (제출 안 함)”GitHub · Sep 6, 2026
The biggest 5 of 13 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 13
Talked about on GitHub (13 times).
On GitHub · 13
- Mar 18, 2026Add a structured external integration plan to the root TODO backlog — Ven0m0/claude-config4 reactions · 4 comments
- Jan 31, 2026TODO list — Ven0m0/claude-config1 reaction · 18 comments
- Sep 30, 2026agent-skills.github.modu-ai.moai-adk: init at 3.1.2 — sudosubin/agents.nix0 reactions
- Sep 7, 2026Worktree-isolation Bash check folds command substitutions in quoted-delimiter heredoc bodies but refuses braces there, though such bodies cannot expand — anthropics/claude-code0 reactions
- Sep 6, 2026docs(t41): moai gate 종료 코드 합류 — upstream 이슈 문안 (제출 안 함) — bjw202/minidiscord0 reactions
8 more on GitHub
- Jul 23, 2026Hands-on eval: promote MoAI-ADK to core tier — cameronsjo/spec-compare0 reactions
- Apr 22, 2026Add MoAI-ADK to Collections & Libraries — travisvn/awesome-claude-skills0 reactions
- Apr 22, 2026Add MoAI-ADK to Meta & Orchestration category — VoltAgent/awesome-claude-code-subagents0 reactions
- Apr 22, 2026Add MoAI-ADK — SPEC-first Agentic Development Kit — jqueryscript/awesome-claude-code0 reactions
- Apr 22, 2026Add MoAI-ADK — SPEC-first AI-assisted coding framework — wsxiaoys/awesome-ai-coding0 reactions
- Apr 22, 2026Add MoAI-ADK — SPEC-first Agentic Development Kit for Claude Code — e2b-dev/awesome-ai-agents0 reactions
- Nov 19, 2025Issue #1: Estructura base del proyecto .NET 9 — mjcuadrado/mjcuadrado-net-sdk0 reactions
- Nov 13, 2025fix: resolve conflitos Git + remove hooks SYNC bloqueantes (Windows f… — PedroGiudice/lex-vector0 reactions
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hns-lsel-applierSkill
- hns-lsel-curatorSkill
- hns-moaiadk-dev-referenceSkill
- hns-moaiadk-patternsSkill
- hns-oss-docs-i18n-rulesSkill
- hns-oss-docs-readme-syncSkill
- hns-oss-docs-structure-mapSkill
- hns-oss-docs-verifySkill
- hns-workflow-ci-loopSkill
- moai-domain-backendSkill
- moai-domain-databaseSkill
- moai-domain-design-dnaSkill
- moai-domain-frontendSkill
- moai-domain-html-reportSkill
- moai-domain-humanizeSkill
- moai-domain-svg-infographicSkill
- moai-foundation-ccSkill
- moai-foundation-coreSkill
- moai-foundation-qualitySkill
- moai-foundation-thinkingSkill
- moai-harness-learnerSkill
- moai-kanban-foremanSkill
- moai-meta-harnessSkill
- moai-ref-api-patternsSkill
- moai-ref-cross-model-auditSkill
- moai-ref-git-workflowSkill
- moai-ref-llm-securitySkill
- moai-ref-owasp-checklistSkill
- moai-ref-react-patternsSkill
- moai-ref-secopsSkill
- moai-ref-seoSkill
- moai-ref-supply-chainSkill
- moai-ref-testing-pyramidSkill
- moai-ref-ui-polishSkill
- moaiSkill
- moai-workflow-dddSkill
- moai-workflow-docs-claim-checkSkill
- moai-workflow-loopSkill
- moai-workflow-projectSkill
- moai-workflow-specSkill
- moai-workflow-tddSkill
- moai-workflow-testingSkill
- moai-workflow-worktreeSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 38
Every change must pass all five dimensions before completion:
- Very specific: line 57
Use filepath.Abs() when resolving user-supplied paths in CLI commands.
- Very specific: line 78
Hardcoding allowed: only in CLAUDE.local.md, settings.local.json, and _test.go files inside t.TempDir().
- Very specific: line 134
Baseline attribution: Every verification claim names the command run + the verbatim output observed, measured against this tree in this run.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
moai-adk-go Best Practices
TRUST 5 Quality Gates
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).
Test Isolation
- Always
t.TempDir()for temp dirs — auto-cleanup, underos.TempDir(). - macOS path pitfall:
t.TempDir()returns/var/folders/.... Go'sfilepath.Join(cwd, absPath)does NOT strip the leading/:filepath.Join("/a/b", "/var/folders/x")→"/a/b/var/folders/x"(WRONG). Usefilepath.Abs()when resolving user-supplied paths in CLI commands. - No OTEL env in parallel tests (CLAUDE.local.md §WARN): never
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. - No
t.Setenv("HOME", tmpDir)in GLM integration tests — parallel-test pollution. Uset.TempDir()+ explicit path construction. - After fixing any test, run the FULL suite (
go test ./...) to catch cascading failures. Use-count=1to disable caching when debugging flaky tests; use-racefor concurrency-safety checks.
Hardcoding Prevention
- URLs / model names / org names / API headers → extract to
const. - Environment variable names → define in
internal/config/envkeys.goas constants; reference the constant everywhere. Never inline a raw env string. - Thresholds → single source in
internal/config/defaults.go. Never duplicate a threshold across packages. - Cross-platform paths → prefer
$HOME,HOMEBREW_PREFIX, etc. In.sh.tmplfallback paths use$HOME(not.HomeDir), because.HomeDirfreezes atmoai inittime and breaks for users with non-standard layouts. - Hardcoding allowed only in
CLAUDE.local.md,settings.local.json, and_test.gofiles insidet.TempDir().
AskUserQuestion Boundary (orchestrator-only)
AskUserQuestionis the ONLY user-facing question channel, and it is reserved for the MoAI orchestrator (main session).- Subagents (including these harness specialists) MUST NOT invoke
AskUserQuestion. If user input is required, return a structured blocker
report to the orchestrator (see
.claude/rules/moai/core/askuser-protocol.md§ Blocker Report Format). - Deferred-tool preload:
AskUserQuestion,TaskCreate,TaskUpdate,TaskList,TaskGetare deferred tools — schema not loaded at session start. The orchestrator MUST callToolSearch(query: "select:AskUserQuestion,TaskCreate,...")before first use. Subagents inherit this constraint. - Free-form prose questions in response text are prohibited — always route through AskUserQuestion (orchestrator) or a blocker report (subagent).
Archived-Agent Rejection Contract
12 agents are ARCHIVED and MUST NOT be referenced anywhere in generated
harness files — no delegates-to, no prose, no examples. The full list of
archived names lives in the canonical SSOT at
.claude/rules/moai/workflow/archived-agent-rejection.md §B; this skill does
not repeat the literal names (repeating them in every generated file would
re-seed the exact tokens the rejection contract is meant to suppress).
The 8 RETAINED agents are the only valid delegation targets:
manager-spec, manager-develop, manager-docs, manager-git,
plan-auditor, sync-auditor, builder-harness, Explore (Anthropic built-in)For domain expertise formerly provided by the archived domain-expert agents,
use the per-spawn pattern: Agent(subagent_type: "general-purpose", model:
"opus", tools: "<whitelist>", prompt: "...<domain> specialist:
<conventions>...") at delegation time. See
.claude/rules/moai/workflow/archived-agent-rejection.md §C for the full
migration table (rows #1-#12), which maps each archived agent to its
canonical retained-agent or per-spawn replacement.
Verification-Claim Integrity
Per .claude/rules/moai/core/verification-claim-integrity.md:
- No unobserved claims. A "tests pass" / "coverage 87%" / "lint clean" assertion is valid ONLY when the actor ran the command and observed the output. An unran command is a gap, never a pass.
- No unobserved defect claims. Inferring a defect/debt/drift from
frontmatter text or grep matches alone — without the domain's dedicated tool
(
moai spec audit,go test -cover,golangci-lint) — is a hypothesis, not a verified defect. The 2026-06-17 incident (29 SPECs wrongly flagged as "Mx-close debt";moai spec auditshowed all 29 were grandfather-protected) is the canonical worked example. - Baseline attribution. Every verification claim names the command run + the verbatim output observed, measured against this tree in this run. A number from a different SPEC/package/time is a carry-over, not a baseline.
- 5-section report format: Claim / Evidence / Baseline-attribution / Gaps / Residual-risk. The Gaps section is the defense — force yourself to enumerate what was NOT observed.
Cross-References
- CLAUDE.local.md §6 (testing), §14 (hardcoding), §19 (AskUserQuestion)
.claude/rules/moai/core/verification-claim-integrity.mdv1.1.0.claude/rules/moai/core/askuser-protocol.md.claude/rules/moai/workflow/archived-agent-rejection.md.claude/rules/moai/development/coding-standards.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

