Imported from hieudoanm/hieudoanm.github.io (
packages/app/headless/cv/languages/go/docs/AGENTS.md). Install upstream withnpx skills add hieudoanm/hieudoanm.github.io --skill docs. Copyright stays with the author.
🤖 Agents
Entry point for coding agents in this repo. This file is the router, not the rulebook. It holds only the conventions that hold across every language, and points at the directories that hold everything else.
| Directory | Holds | Consult when |
|---|---|---|
.agents/ |
Personas and change-type workflows | Starting a task — adopt a persona, then a workflow |
.skills/ |
Technology playbooks, one file per technology | Writing, reviewing or debugging code in a given stack |
examples/ |
Runnable multi-file configs (Docker, CI, nginx) | You need a working artifact, not a pasted snippet |
packages/ |
The pnpm + turbo workspace | Building, testing, or running anything |
Indexes: .agents/TREE.md · .skills/TREE.md
Run python3 .agents/scripts/validate.py to check agent metadata, local links, workflow routes, and the agent tree.
How to work here
- Adopt a persona — it fixes identity, priorities, boundaries and the quality bar.
- Follow a workflow — it fixes the phases and the Definition of Done for the change type.
- Consult the matching skill — it owns the stack's conventions, idioms and pitfalls.
- Ground it in reality — read
examples/and the surrounding code before inventing a pattern.
Never restate a convention that a skill already owns. If a rule is missing from a skill, add it to the skill instead of duplicating it here. This file stays under 200 lines for the same reason code does: a rule an agent has to hunt for is a rule it will not apply.
Before a change, inspect relevant guidance, implementation, documentation, and tests. Afterward, validate the change and review the diff. Report the outcome, material trade-offs, validation, and unresolved issues when relevant. For significant decisions, check constraints and prior decisions, consider a reasonable alternative, and prefer the simplest solution that meets the requirements.
📐 Coding Convention
Language-agnostic. Stack-specific rules live in .skills/.
Explicit types > Implicit— TypeScript types, Rust annotations, Python hints, Kotlin signatures. A signature tells more than a hundred lines of body.Flat over deeply nested— Shallow trees, short functions, minimal indentation. Callback hell and 5-levelifpyramids exhaust a context window faster than anything else.Self-documenting identifiers—getUserById(id)needs no comment;processData(x)needs one. Name the what and the why, never the how.Don't repeat yourself— When a pattern appears 15 times across files, an agent will handle 14 of them and miss the 15th. Centralise it.Small, focused files— One responsibility per file. Functions ≤ 30 lines, because an agent's reasoning degrades past ~2000 tokens and a 30-line function stays visible next to its callers. Files ≤ 200 lines — beyond that, tracing data flow between distant sections becomes guesswork. If you have to scroll to see a whole function, it is too long.Explicit error handling—if (err) return Err(...)rather than silent propagation. Agents must see the error path to handle it.Test names as documentation—test("returns 404 when user not found")reads faster than the implementation.Consistent import structure— Group by origin: stdlib, third-party, internal. Agents infer the dependency graph from import blocks alone.Prefer pure functions with explicit dependencies— Take inputs as parameters, return outputs; no globals or singletons. Return values are the single source of truth; mutations hide their impact.Conventional project layouts—src/,cmd/,internal/,tests/. Agents locate files by convention instead of scanning build configs.
🔀 Stack → skill
Open the playbook before writing code in a stack. Never carry conventions between stacks by memory.
| Stack | Skill |
|---|---|
| Bash | Bash |
| Go · CLI | Go skills · Cobra |
| Kotlin · web/CLI/UI | Kotlin · Ktor · Clikt · Compose · Material Design 3 |
| Python · data | Python · Pandas |
| Rust · CLI/web/desktop | Rust · Clap · Axum · Tauri |
| Swift · CLI/UI | Swift · Argument Parser · SwiftUI |
| C++ · Qt | C++ · Qt |
| TypeScript · web | TypeScript · Web framework skills |
| Docker · Compose · Makefile | Docker · Docker Compose · Makefile |
| Databases · messaging · SaaS | Database skills · Event skills · SaaS skills |
| Terraform · cloud | Terraform core, AWS, Azure, and GCP |
| Research | Research skills · Research workflow |
Skills follow one shape: name/description frontmatter, numbered sections, bolded rules, then a
Quick-Start Checklist. Match that shape when you add one. Several skills are written against a
specific major version — read the intro before trusting an example.
🔄 SDLC
| Phase | Adopt | Output |
|---|---|---|
| Planning | product-owner |
Outcomes and a prioritised backlog; items small enough to accept |
| Analysis | business-analyst |
Given/When/Then criteria with explicit assumptions |
| Design | architect · design · solution architecture |
Trade-offs recorded, existing patterns favoured over silent shortcuts |
| Research | researcher · research workflow |
Evidence is traceable, methods fit the question, and conclusions preserve uncertainty |
| Develop | Senior Engineer or Lead Engineer |
The change, per its workflow, against the skill rules above |
| Test | Senior Engineer |
Tests that encode the contract; unit locally per change, integration across boundaries and failure paths |
| Review | Lead Engineer |
Correctness, contracts and scope; the workflow's DoD confirmed |
| Deliver | scrum-master |
Cadence, blockers and the release train |
📦 Workspace
A pnpm workspace (packages/**) driven by turbo. pnpm-workspace.yaml also pins allowBuilds for
native modules and overrides for transitive deps — change those, not the lockfile.
| Path | Contents |
|---|---|
packages/app |
Next.js web app, plus headless, hybrid, native variants |
packages/cli |
Command-line tooling (jack), with a bash variant |
packages/data |
Data projects (github, world.bank, machine-learning, …) |
packages/extensions |
Browser and VS Code extensions |
packages/modules |
Shared libraries (api, css, frontend, lodash, chess, …) |
packages/watch |
Device integrations (garmin) |
examples/ |
Runnable configs — see below |
Commands (turbo fans these out across the workspace; test is serialised to avoid port clashes):
pnpm dev # watch mode pnpm lint # lint
pnpm build # production build pnpm typecheck # types only
pnpm test # full test suite pnpm format # write
🧪 Examples
examples/ holds runnable multi-file artifacts, not snippets — the things a skill
cannot inline. Prefer a skill snippet for a pattern; prefer examples/ when you need a whole file to
copy or a stack to actually run.
| Path | Contains |
|---|---|
examples/docker/compose/ |
Per-database stacks (Postgres, Cassandra, HBase, CouchDB, Kafka, …) |
examples/docker/file/ |
Production Dockerfiles per language and per server (nginx, HAProxy) |
examples/ci/ |
GitHub Actions and Jenkins pipelines per language |
When you add one, keep the path shape and link it from the relevant skill. When you find a skill whose "quick start" should really be a working stack, add the artifact rather than growing the playbook — playbooks are capped at 200 lines for a reason.
✅ Definition of Done
- Persona adopted, workflow followed, its DoD met
- Matching skills consulted; no convention invented against them
- Functions ≤ 30 lines, files ≤ 200 lines
- Error paths explicit and tested
-
pnpm lint,pnpm typecheck,pnpm testgreen - No secrets; no unrelated churn in the diff
- Any missing convention added to the right skill, not to this file
This is NOT the Turborepo you know
Turborepo configuration, task behavior, and CLI commands can vary between installed versions and may differ from your training data. Resolve the turbo package from this file's directory or relevant workspace; in monorepos, it may not be visible from the repository root. For example, run node -p "require.resolve('turbo/package.json')" from a workspace that depends on turbo.
Read docs/README.md inside that installed package first, then read the relevant pages from its docs/ directory before changing Turborepo configuration or commands. Heed deprecation notices. These bundled docs match the installed package version and are available without network access.
This block is written and re-added by turbo before repository-scoped commands when an AI agent is detected. In the Turborepo source repository, its template is defined in crates/turborepo-cli/src/cli/agent_guidance.rs. Removing the managed block while updates are enabled means a later qualifying invocation will add it again. Set "agentGuidance": false in the root turbo.json or turbo.jsonc to opt out; this does not remove an existing block. Keep the block committed with your work to avoid an uncommitted change on the next agent invocation.
