AI context
Vibecoding with Cursor and GitHub Copilot — what the CLI scaffolds and the recommended context layout.kl-nest new (prompt) or kl-nest add ai-context cursor / github / both. With -y, context is not generated — use add afterwards. The CLI does not overwrite existing files.
What it is for
Reduce hallucination in vibecoding: the agent reads the generated repository (DDD layers, template bases, docs-first via llms.txt) instead of inventing @koalarx/nest imports or APIs that are not in the project.
The core (AGENTS.md and editor rules) points at public docs and lists hard constraints (layers, Bun, Zod, API vs Worker, etc.). Domain/business content for your product should live separately — see recommended layout.
Supported IDEs and tools
| CLI target | Tool | What the CLI generates |
|---|---|---|
cursor |
Cursor | AGENTS.md + .cursor/rules/*.mdc |
github |
GitHub Copilot (VS Code / GitHub) | AGENTS.md + .github/copilot-instructions.md |
Aliases for github: copilot, github-copilot. You can install both in one command:
kl-nest add ai-context cursor
kl-nest add ai-context github
kl-nest add ai-context cursor github
What the CLI installs today
Files copied from libs/cli/assets/ai-context/ (in the published package):
| File | Role |
|---|---|
AGENTS.md |
Short entry — docs-first + hard constraints (read by Cursor and Copilot) |
.cursor/rules/koala-*.mdc |
Path-scoped rules per layer (host, application, domain, …) |
.github/copilot-instructions.md |
Copilot entry (same spirit as AGENTS.md) |
This covers the Koala Nest framework. It does not include your product requirements, business rules, or operational policies.
Recommended layout for future context
To grow context without duplicating sources of truth, use folders under .github/ (pattern used in production Koala Nest projects):
AGENTS.md # Cursor / agents entry (CLI)
.cursor/rules/ # path-scoped Cursor rules (CLI)
.github/
copilot-instructions.md # Copilot entry (CLI) — points at instructions/
instructions/ # canonical domain / business / ops context
README.md # index + reading order
... # requirements, business rules, policies, etc.
agents/ # (optional) specialized agents
README.md
prompts/ # (optional) reusable prompts
README.md
skills/ # (optional) domain skills / guides
README.md
Conventions
- One source of truth: domain and business live in
.github/instructions/; do not copy the same long text intoAGENTS.md, Copilot, and Cursor. - Short entries: keep
AGENTS.mdandcopilot-instructions.mdlean and link toinstructions/. agents/prompts/skills: optional folders for later evolution (the CLI does not create them today).- Cursor path-scoped: keep using
.cursor/rulesfor folder-level rules; long domain content belongs ininstructions/.
Example instructions/README.md index: reading order (policy → technical usage → requirements → business rules) and a quick “where to look” guide.
Next steps
- Installation guide —
new,-y, and theaddcatalog - Overview — optional features
- LLM indexes: llms.txt · llms-en.txt