project-context
Before modifying any code in a project directory, read the project's PROJECT.md (if present) to learn its conventions, structure, and rules. This prevents the most common drift: the agent inventing a parallel implementation instead of editing the one that exists.
When to use
- The user references a directory or codebase ("the TUI", "the parser", "the lazartui").
- You're about to write code under
$LAZAR_HOME/workspace/<project>/ or similar.
- You need to know "where does X live?" or "what language/framework does this project use?"
How to use
Identify the project root. Usually it's:
- The deepest directory containing
PROJECT.md (or README.md if no PROJECT.md).
- The deepest directory containing a manifest like
go.mod, Cargo.toml, package.json.
Read the project pin:
cat <project-root>/PROJECT.md 2>/dev/null \
|| cat <project-root>/AGENTS.md 2>/dev/null \
|| ls <project-root> # fall back to listing files
Follow the conventions in PROJECT.md verbatim — language, file layout, build commands, "do not" rules.
If PROJECT.md says "always read X first", do that next.
If there is NO PROJECT.md, infer from the manifest and existing files. Read the entry point (main.go, src/lib.rs, index.ts) before suggesting changes.
Hard rules
- Never create parallel implementations. If
main.go exists, modify main.go. Don't write main2.go "to experiment". If you need to experiment, branch with git, not with file proliferation.
- Don't introduce new languages or frameworks unless PROJECT.md explicitly invites it. The presence of
go.mod means Go is the language; don't suddenly add Python.
- Read before writing. For any non-trivial edit, read the file you're about to modify in full. Patch in place; don't rewrite.
- Stay inside the project root. Don't create new directories at the workspace level "for organization" unless asked.
Anti-patterns to recognize in yourself
- "Let me scaffold a quick prototype to test this idea" — no, modify the existing code.
- "I'll create a separate utility for X" — usually X belongs in the existing entry point.
- "Let me set up a build system for this" — the build system already exists; use it.
- "I'll write a Python script to drive the Go program" — no, do it in the language the project is in.
Authoring a PROJECT.md
If a project doesn't have one and the user is iterating on it often, propose creating one. A good PROJECT.md is short — under 50 lines — and answers:
- What the project IS (one paragraph).
- Where the entry point lives.
- Language, framework, build/run commands.
- Conventions: "this is the ONLY X; don't create parallel ones."
- "Read these files first" when working here.
- Any external tool dependencies.
Pairing with create-skill
If you find yourself repeatedly fighting the same drift on the same project, that's a sign the PROJECT.md isn't strong enough. Edit the PROJECT.md (it lives in workspace/, you can write there) to encode the lesson.
1---2name: project-context3description: project-context4---5# project-context67Before modifying any code in a project directory, read the project's `PROJECT.md` (if present) to learn its conventions, structure, and rules. This prevents the most common drift: the agent inventing a parallel implementation instead of editing the one that exists.89## When to use1011- The user references a directory or codebase ("the TUI", "the parser", "the lazartui").12- You're about to write code under `$LAZAR_HOME/workspace/<project>/` or similar.13- You need to know "where does X live?" or "what language/framework does this project use?"1415## How to use16171. Identify the project root. Usually it's:18 - The deepest directory containing `PROJECT.md` (or `README.md` if no PROJECT.md).19 - The deepest directory containing a manifest like `go.mod`, `Cargo.toml`, `package.json`.20212. Read the project pin:2223 cat <project-root>/PROJECT.md 2>/dev/null \24 || cat <project-root>/AGENTS.md 2>/dev/null \25 || ls <project-root> # fall back to listing files26273. Follow the conventions in PROJECT.md verbatim — language, file layout, build commands, "do not" rules.28294. If PROJECT.md says "always read X first", do that next.30315. If there is NO PROJECT.md, infer from the manifest and existing files. Read the entry point (`main.go`, `src/lib.rs`, `index.ts`) before suggesting changes.3233## Hard rules3435- **Never create parallel implementations.** If `main.go` exists, modify `main.go`. Don't write `main2.go` "to experiment". If you need to experiment, branch with git, not with file proliferation.36- **Don't introduce new languages or frameworks** unless PROJECT.md explicitly invites it. The presence of `go.mod` means Go is the language; don't suddenly add Python.37- **Read before writing.** For any non-trivial edit, read the file you're about to modify in full. Patch in place; don't rewrite.38- **Stay inside the project root.** Don't create new directories at the workspace level "for organization" unless asked.3940## Anti-patterns to recognize in yourself4142- "Let me scaffold a quick prototype to test this idea" — no, modify the existing code.43- "I'll create a separate utility for X" — usually X belongs in the existing entry point.44- "Let me set up a build system for this" — the build system already exists; use it.45- "I'll write a Python script to drive the Go program" — no, do it in the language the project is in.4647## Authoring a PROJECT.md4849If a project doesn't have one and the user is iterating on it often, propose creating one. A good PROJECT.md is short — under 50 lines — and answers:5051- What the project IS (one paragraph).52- Where the entry point lives.53- Language, framework, build/run commands.54- Conventions: "this is the ONLY X; don't create parallel ones."55- "Read these files first" when working here.56- Any external tool dependencies.5758## Pairing with create-skill5960If you find yourself repeatedly fighting the same drift on the same project, that's a sign the PROJECT.md isn't strong enough. Edit the PROJECT.md (it lives in workspace/, you can write there) to encode the lesson.