moai-adk-go domain-patterns reference for the 4 harness specialists (cli-template-specialist, quality-specialist, workflow-specialist, hook-ci-specialist). Covers the CLI/template/config/hook/spec subsystem architecture, key source paths, the Pipeline specialist delegation map, the Template-First build cycle, the namespace separation contract, and common add-a-template / add-a-hook / add-an-agent / add-a-SPEC workflows. Loaded by the specialists when working on moai-adk-go's own Go codebase and templates.
66
80%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
moai-adk-go is a Go binary (moai) with four subsystems:
internal/cli/*.go, cmd/moai/) — Cobra commands: init,
update, hook, build, glm, cc, cg, version, doctor,
spec. Subcommand handlers read stdin JSON for hooks, emit structured
output for the orchestrator.internal/template/) — go:embed-based scaffolding.
Source at internal/template/templates/, embedded into the binary via
//go:embed all:templates in internal/template/embed.go (no generated
.go file). make build recompiles the binary.
TemplateContext ({{.GoBinPath}} / {{.HomeDir}}) renders at moai init.internal/config/) — defaults.go (single source for
thresholds), envkeys.go (env-var constants), TemplateContext renderer..claude/hooks/moai/*.sh, .github/workflows/) — bash
wrapper hooks calling moai hook <event>; CI guard enforces template
neutrality.Plus the SPEC lifecycle (.moai/specs/) governing the project's own
development (plan→run→sync→Mx).
| Subsystem | Path | Notes |
|---|---|---|
| Cobra commands | internal/cli/*.go | wired from cmd/moai/ |
| Template source | internal/template/templates/** | edit HERE first |
| Embedded assets | internal/template/embed.go | //go:embed all:templates (no generated file) |
| Config defaults | internal/config/defaults.go | threshold SSOT |
| Env constants | internal/config/envkeys.go | no hardcoded env names |
| SPEC docs | .moai/specs/SPEC-*/ | spec/plan/acceptance/progress |
| Era classifier | internal/spec/era.go | ClassifyEra() H-1..H-6 |
| Hook scripts | .claude/hooks/moai/*.sh | bash only, no Python |
| CI workflows | .github/workflows/*.yaml | neutrality guard active |
| Harness agents | .claude/agents/harness/*.md | USER-OWNED (this skill) |
This harness is a 4-stage pipeline; each specialist delegates to retained agents (never archived, never replaces them):
CLI/Template ──→ quality ──→ workflow ──→ hook/CI
│ │ │ │
├─ manager-develop (tdd, backend)
├─ Explore (read-only)
├─ sync-auditor (4-dim scoring)
├─ sync-phase-quality-gate.sh (Stop hook)
├─ manager-spec (plan)
├─ manager-develop (run)
├─ manager-docs (sync)
├─ plan-auditor (audit)
├─ builder-harness (artifact_type=hook|command|plugin)
└─ Agent(general-purpose, model: opus, tools: ..., prompt: "...CI specialist...")When adding/editing anything that ships to user projects:
internal/template/templates/<path> FIRST.make build → recompiles the binary (templates embedded via
//go:embed all:templates in embed.go; no generated .go file).moai update (or manual copy)..claude/ / .moai/ reflects the template.go test ./internal/template/... (neutrality audit included).Never edit .claude/ or .moai/ directly without a template source. The
source of truth is templates/ — edit files there, then make build.
Two namespaces, enforced by moai update:
| Namespace | Location | Owner | moai update behavior |
|---|---|---|---|
| Template-managed | internal/template/templates/** → .claude/agents/{core,expert,meta}/, moai-* skills | MoAI-ADK distribution | Overwrites local on sync |
| User-owned (this harness) | .claude/agents/harness/, harness-* skills, .moai/harness/ | Project developer | NEVER deleted/modified; backup before update |
The canonical user-owned skill prefix is harness-* (recognized by Go
enforcement after the namespace catch-up, SPEC-V3R6-HARNESS-NAMESPACE-V2-001).
The legacy my-harness-* form is retained during a backward-compat
deprecation window; new skills MUST use the bare harness-* prefix.
internal/template/templates/<path>.make build.moai update (or test via ./moai init /tmp/test-project).go test ./internal/template/... -run TestTemplateNeutralityAudit..claude/hooks/moai/handle-<event>.sh (bash, reads stdin JSON, calls
moai hook <event>)..claude/settings.json with "$CLAUDE_PROJECT_DIR/..." quoting +
timeout: 5.internal/template/templates/..claude/agents/harness/<role>-specialist.md with name,
trigger-shaped description, skills: array (companion skill), tools:
(CSV string).harness-* skill exists (else self-activation
smoke gate FAILs)./moai plan "<description>" → manager-spec authors plan-phase artifacts.plan-auditor independent audit gate.AskUserQuestion)./moai run SPEC-<ID> → manager-develop (cycle_type per quality.yaml)./moai sync SPEC-<ID> → manager-docs.sync-auditor 4-dimension gate.sync_commit_sha in §E.4; the sync commit carries the implemented → completed transition — per SPEC-V3R6-LIFECYCLE-REDESIGN-001, the former separate mx_commit_sha / §E.5 Mx-phase step is retired; MX Tag validation is a sync sub-step)..claude/rules/moai/development/agent-authoring.md — agent frontmatter schema.claude/rules/moai/development/skill-authoring.md — skill frontmatter schema.claude/rules/moai/workflow/archived-agent-rejection.md §C — migration table.claude/skills/moai-meta-harness/SKILL.md § Namespace Separation2213871
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.