| name | hns-moaiadk-patterns |
| description | 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.
|
| allowed-tools | Read, Grep, Glob, Bash |
| user-invocable | false |
| metadata | {"version":"1.0.0","category":"harness/domain-patterns","status":"active","updated":"2026-06-17","tags":"moai-adk-go,cli,template,harness,patterns"} |
| progressive_disclosure | {"level_1_tokens":120,"level_2_tokens":4500,"level_3_optional":true} |
| triggers | {"agents":["cli-template-specialist","quality-specialist","workflow-specialist","hook-ci-specialist"],"keywords":"moai-adk-go, internal/cli, internal/template, embed.go, make build, go:embed, template-first, harness namespace"} |
| paths | internal/**/*.go,internal/template/templates/**,.claude/**,.moai/** |
moai-adk-go Domain Patterns
Architecture Quick Reference
moai-adk-go is a Go binary (moai) with four subsystems:
- CLI (
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.
- Template system (
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.
- Config (
internal/config/) — defaults.go (single source for
thresholds), envkeys.go (env-var constants), TemplateContext renderer.
- Hook + CI (
.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).
Key Source Paths
| 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) |