| name | hns-moaiadk-dev-reference |
| description | moai-adk-go local dev reference โ version management/release process (sec 5), shell-script hook development (sec 7), build & dev commands (sec 10). Load only when performing these specific tasks. |
hns-moaiadk-dev-reference
moai-adk-go ๋ก์ปฌ dev ๋ ํผ๋ฐ์ค โ CLAUDE.local.md ยง5/ยง7/ยง10 ์ ์์
ํนํ ์์ธ๋ฅผ ์ด๊ณณ์ผ๋ก ์ด๊ด (lazy-load). ์ธ์
๋ง๋ค ํ์ ์๋ ์ฐธ๊ณ ์๋ฃ. ํญ์-๋ก๋ ์ปจํ
์คํธ ์ ๊ฐ์ฉ.
์์ : hns-* ๋ค์์คํ์ด์ค (user-owned, moai update ๋ณด์กด โ CLAUDE.local.md ยง24). ํ
ํ๋ฆฟ ๋ฏธ๋ฌ ๊ธ์ง.
Version Management (from CLAUDE.local.md ยง5)
Single Source of Truth
- [HARD]
go.mod module version + git tags are the authoritative sources
- [HARD]
pkg/version/version.go reads from git tags at build time
Version Reference:
- Authoritative Source: Git tags (e.g.,
v1.0.0)
- Runtime Access:
pkg/version/version.go via git describe
- Config Display:
.moai/config/sections/system.yaml (updated by release process)
Build Version Injection
Version is injected at build time using ldflags:
go build -ldflags="-X github.com/modu-ai/moai-adk/pkg/version.Version=v1.0.0"
make build VERSION=1.0.0
Files Requiring Version Sync
When releasing new version, update:
Documentation Files:
- README.md (Version line)
- README.ko.md (Version line)
- CHANGELOG.md (New version entry)
Configuration Files:
- .moai/config/sections/system.yaml (moai.version)
- internal/template/templates/.moai/config/sections/system.yaml.tmpl (moai.version)
Release Process
- Update CHANGELOG.md with new version entry
- Create git tag:
git tag v1.0.0
- Push tag:
git push origin v1.0.0
- Build release binaries:
make release VERSION=1.0.0
Hook Development (from CLAUDE.local.md ยง7)
[HARD] Shell Script Hooks Only
moai-adk-go uses shell scripts for hooks, NOT Python:
Hook Wrapper Pattern:
#!/bin/bash
INPUT=$(cat)
moai hook session-start <<< "$INPUT"
Why Shell Scripts:
- Faster execution (no Python startup overhead)
- Always available (no dependency on uv/python)
- Cross-platform (bash, /bin/sh)
Hook Command Format
settings.json hook configuration:
{
"hooks": {
"SessionStart": [{
"hooks": [{
"command": "\"$CLAUDE_PROJECT_DIR/.claude/hooks/moai/handle-session-start.sh\"",
"timeout": 5
}]
}]
}
}
Key Rules:
- [HARD] Always quote
$CLAUDE_PROJECT_DIR: "$CLAUDE_PROJECT_DIR"
- [HARD] Use full path to hook wrapper script
- [HARD] Set appropriate timeout. MoAI policy default is 5 seconds (the Claude Code platform default is 10 minutes; MoAI tightens this to 5 seconds to avoid stalling the session).
Platform Differences
macOS/Linux:
"command": "\"$CLAUDE_PROJECT_DIR/.claude/hooks/moai/hook.sh\""
Windows:
"command": "\"%CLAUDE_PROJECT_DIR%\\.claude\\hooks\\moai\\hook.sh\""
Build & Dev Commands (from CLAUDE.local.md ยง10)
Common Commands
make build
make test
make test-race
make lint
make fmt
make install
make clean
make fix
Development Workflow
vim internal/template/templates/.claude/skills/moai/SKILL.md
make build
go test ./internal/template/...
./moai init test-project
git add internal/template/templates/
git commit -m "feat(template): update SKILL.md"