hns-moaiadk-patterns

Documents moai-adk-go architecture, template-first build cycle, and specialist delegation workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers working on the moai-adk-go codebase need to know where each subsystem lives, how templates are embedded and built, and which workflows to follow when adding templates, hooks, agents, or SPECs. This Skill gives the four harness specialists a single domain-patterns reference so they stop guessing at source paths and build steps.

Core Features & Use Cases

  • Architecture Quick Reference: Maps the four subsystems (CLI, template system, config, hook/CI) plus the SPEC lifecycle to concrete source paths like internal/cli, internal/template/templates, and internal/config/defaults.go.
  • Template-First Build Cycle: Enforces the edit-templates-then-make-build-then-moai-update sequence so changes ship correctly through go:embed into user projects.
  • Namespace Separation Contract: Clarifies which .claude and .moai paths are template-managed versus user-owned, and how moai update treats each.
  • Use Case: A specialist asked to add a new hook consults this Skill, writes the bash wrapper in .claude/hooks/moai, wires it in settings.json, and adds the template source before running the neutrality audit test.

Quick Start

Ask the harness specialist to add a new template file to moai-adk-go and have it follow the template-first build cycle from this reference.

Frequently Asked Questions about hns-moaiadk-patterns

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

FAQPage Schema
How do I add a new template to moai-adk-go?

Create the file under internal/template/templates/, run make build to recompile the binary with go:embed, then run moai update or test with ./moai init on a scratch project. Finish with go test ./internal/template/... to pass the neutrality audit.

How do I add a hook to the moai-adk harness?

Write a bash script at .claude/hooks/moai/handle-<event>.sh that reads stdin JSON and calls moai hook <event>, then wire it in .claude/settings.json with a timeout. If it ships to users, also add the template source under internal/template/templates/.

Which files does moai update overwrite and which are safe?

moai update overwrites template-managed paths like .claude/agents/{core,expert,meta}/ and moai-* skills. User-owned paths such as .claude/agents/harness/, harness-* skills, and .moai/harness/ are never deleted or modified.

Why should I not edit .claude or .moai files directly in moai-adk-go?

The source of truth is internal/template/templates/, embedded into the binary via go:embed. Direct edits to .claude or .moai are lost on the next moai update, so changes must be made in templates and propagated with make build.

What is the SPEC lifecycle workflow in moai-adk-go?

Run /moai plan to author plan artifacts, pass the plan-auditor gate and human approval, then /moai run for development and /moai sync for documentation. A sync-auditor scores four dimensions before the single sync commit closes the SPEC.