HOANGSA
Context engineering for coding agents — Claude Code, Codex, Cowork.

🇻🇳 Hoàng Sa, Trường Sa là của Việt Nam 🇻🇳
🇨🇳 中文 · 西沙群岛和南沙群岛属于越南。🇻🇳
🇺🇸 English · Hoàng Sa (Paracel Islands) and Trường Sa (Spratly Islands) belong to Vietnam. 🇻🇳
🇯🇵 日本語 · ホアンサ(パラセル)諸島とチュオンサ(スプラトリー)諸島はベトナムの領土です。🇻🇳
🇪🇸 Español · Las islas Paracel y las islas Spratly pertenecen a Vietnam. 🇻🇳
🇷🇺 Русский · Острова Хоангша и Чыонгша принадлежат Вьетнаму. 🇻🇳
🇫🇷 Français · Les îles Paracels et les îles Spratleys appartiennent au Vietnam. 🇻🇳
🇰🇷 한국어 · 호앙사 군도와 쯔엉사 군도는 베트남의 영토입니다. 🇻🇳
The problem
An agent's output degrades as its context window fills. Ask for a feature and
you get good code for the first file, plausible code for the fifth, and by the
tenth it has forgotten a type it defined itself. Bigger context windows push
the cliff back; they don't remove it.
The usual answers — "be more specific", "break it into steps" — are advice.
HOANGSA is structure.
The idea
Split the work into tasks. Give each task its own fresh context window
holding only what it needs: the files it may touch, the behaviour it must
implement, the command that proves it worked. The orchestrator never writes
code — it dispatches, checks, and assembles.
Everything else follows from that:
- A task needs a spec precise enough to execute from, so there is a design
phase that produces one.
- A worker with no history needs its rules and context handed to it, so
prompts are assembled by a CLI, not improvised by an agent.
- A claim of "done" from a fresh worker is unverifiable, so every deliverable
has a command that must pass.
That last one is load-bearing. Prompt text is a suggestion an agent can talk
itself out of; a failing exit code is not. Wherever this repo says a rule
matters, there is a hoangsa-cli subcommand that enforces it.
The pipeline
brainstorm → menu → prepare → cook → taste → plate → ship
idea specs plan build verify commit push
| Phase | Produces | Enforced by |
|---|
| brainstorm | BRAINSTORM.md — options, trade-offs, risk seeds, open questions | statused open questions |
| menu | DESIGN-SPEC.md + TEST-SPEC.md | validate spec, validate tests |
| prepare | plan.json — task DAG with per-task files, behaviour, acceptance | validate plan, dag check |
| cook | code, one atomic commit per task | per-task acceptance, validate scope |
| taste | verdict per task | acceptance re-run, spec-coverage review |
| plate | conventional commit | — |
| ship | push / PR after review | review gates |
Each phase is a contract, not a script: mission, deliverables, hard gates.
The path between them is the agent's choice; the gates are not.
What the gates actually check
To make it concrete:
validate spec — a code spec must carry ## Behavior / Logic (per
requirement: trigger, steps, error paths) and a ## Risk Sweep covering
eight fixed classes, including concurrency & TOCTOU. Each class is either
applies, with concrete handling, or N/A with a reason. An open question
with no RESOLVED / DEFERRED status fails the gate — so a question cannot
reach the plan without having been put to you.
validate plan — every implementation task carries a non-empty
behavior, copied from the spec. The worker gets it as a contract: a step it
drops or quietly replaces is a failure even when the tests pass.
validate scope — a task's commit is checked against the files the plan
gave it. Touching an undeclared file is an error, not a note.
Install
curl -fsSL https://github.com/pirumu/hoangsa/releases/latest/download/install.sh | sh
Installs four binaries into ~/.hoangsa/bin/, registers the memory MCP server,
and writes the Claude Code hooks. Then, inside your agent:
/hoangsa:init # detect the codebase, set preferences
/hoangsa:menu # design your first task
Platforms, flags, building from source, uninstall
Supported platforms
| Triple | Status | Notes |
|---|
darwin-arm64 | ✅ | Apple Silicon |
linux-x64 | ✅ | glibc distros |
linux-arm64 | ✅ | glibc distros |
linux-* musl / Alpine | ❌ | ONNX Runtime links glibc — build from source |
| Windows | ❌ | use WSL2 |
Needs curl or wget, tar, and sha256sum / shasum. No Node, Python, or
Docker.
Installer flags
Pass after sh -s --: