codecontext-setup
Original:🇺🇸 English
Translated
Set up or repair codecontext adoption in a project. Use this whenever the user wants to add @context annotations to a repo, install the codecontext toolchain, update AGENTS.md guidance, improve agent workflows around decision capture, or audit whether an existing codecontext setup is coherent. Prefer this skill over vague "document the tool" work: it is specifically for making a repo actually usable with codecontext.
3installs
Sourcerecallnet/codecontext
Added on
NPX Install
npx skill4agent add recallnet/codecontext codecontext-setupTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Codecontext Setup
Set up so agents can use it without guessing.
codecontextThe point of this skill is not just package installation. The real job is to
make the repo's agent contract coherent:
- the toolchain is installed where it belongs
- tells agents when and how to use it
AGENTS.md - inline is treated as the required structured layer
@context - supporting refs stay unconstrained and user-owned
Do not invent required sidecar document schemas. Do not require .
Refs can point to Markdown, HTML, text, diagrams, exported docs, or any other
resolvable file the repo uses.
.ctx.mdWhen to use
Use this skill when the user asks to:
- install or adopt
codecontext - update a repo's or agent guidance around
AGENTS.md@context - audit a project's current setup
codecontext - reconcile a mismatch between codecontext tooling and repo instructions
- improve how agents discover decisions, risks, assumptions, and history
Outcome
By the end of this workflow, the repo should have:
- a clear section for
AGENTS.mdcodecontext - a sane CLI workflow for agents
- the right enforcement surface for the repo's languages and toolchain
- no misleading guidance about structured sidecar docs
Workflow
1. Audit the current state
Inspect:
- package manager and workspace layout
- whether the repo already depends on
@recallnet/codecontext-cli - whether the repo already depends on
@recallnet/codecontext-eslint-plugin - whether the repo already has Python, Go, Rust, or other language-native
- whether the repo already has Python, Go, Ruby, Rust, or other language-native
checkers where enforcement belongs
codecontext - whether ESLint is present and where its shared config lives
- whether exists at repo root and in subtrees/worktrees
AGENTS.md - whether existing agent docs already mention ,
@context, ADRs,codecontext, or decision logscontexts/
Look for the two common failure modes:
- tool installed, but no agent workflow or guidance
- guidance exists, but it is stale, contradictory, or points to a policy that does not exist
2. Decide the installation surface
Install the minimum useful surface:
- when agents should run
@recallnet/codecontext-cli,--scope, or--diff--report - when the repo uses ESLint and wants comment validation
@recallnet/codecontext-eslint-plugin - a language-native checker or analyzer when the repo's main enforcement surface is Python, Go, Rust, or something else outside ESLint
- only if the repo has custom code that imports parser APIs directly
@recallnet/codecontext-parser
Do not add packages the repo is not going to use.
3. Fix AGENTS.md
before or alongside package changes
AGENTS.mdcodecontextEvery repo-level section should cover:
AGENTS.md- what is for
@context - when annotations are required
- a small preferred taxonomy
- the pre-edit and post-edit workflow
- what refs are and are not
- anti-patterns
If subtree files point to a repo-level policy, make sure that
policy actually exists.
AGENTS.mdRecommended AGENTS.md
contract
AGENTS.mdKeep it short. A good section usually fits in 8-14 bullets.
Use something close to this:
md
- **codecontext**: Use inline `@context` annotations for non-obvious,
high-value reasoning that future edits could easily erase.
- Required for:
- critical decision logic and invariants
- security-sensitive behavior and hard-won lessons
- external integration quirks and contract mismatches
- regression guards explaining why a simpler change would be wrong
- Preferred forms: `@context decision`, `@context risk`,
`@context requirement`, `@context history`
- Keep notes short and specific: what is true, why it matters, and what
would break if changed
- Use `{@link ...}` for supporting material when helpful, but refs are just pointers
to repo files or docs. Do not require any special doc schema.
- Before editing critical files, run:
`npx @recallnet/codecontext-cli --scope <file>`
- After editing, run:
`npx @recallnet/codecontext-cli --diff HEAD <file>`
- For broader orientation in larger repos, run:
`npx @recallnet/codecontext-cli --report`
- Do not use `@context` for obvious narration, duplicated ADR prose, or
generic comments.Adjust the taxonomy only if the repo clearly needs more than the baseline
(, , , ). Add extra categories sparingly.
decisionriskrequirementhistoryGuidance for repos with ADRs or large docs trees
If the repo already uses ADRs, plans, runbooks, or architecture docs:
- keep as the inline agent-facing layer
@context - treat refs as optional expansion targets
- do not tell agents to browse the entire docs tree by default
- do not mirror whole ADRs inline
The correct model is:
- carries the structured local signal
@context - refs point to arbitrary supporting material
- agents expand refs only when needed
Refs policy
Be explicit:
- refs are allowed to point to ,
.md,.html, diagrams, exports, or other repo artifacts.txt - refs are not required on every annotation
- refs should not impose a schema on the target file
Do not write guidance that implies:
- is required
.ctx.md - frontmatter is required
- the linked file must be machine-parseable
CLI workflow guidance
Recommend these commands in agent docs when the CLI is installed:
bash
npx @recallnet/codecontext-cli --scope path/to/file.ts
npx @recallnet/codecontext-cli --diff HEAD path/to/file.ts
npx @recallnet/codecontext-cli --reportUse for repo orientation and decision review. Use and
around concrete edits.
--report--scope--diffEnforcement guidance
If the repo already has a shared ESLint config, integrate the plugin there.
Prefer enforcing syntax and stale/invalid ref checks centrally rather than
telling agents to self-police.
If the repo does not use ESLint, do not force it just for .
Prefer the native enforcement surface for the repo's actual stack:
codecontext- Python repo: native checker or PyPI-distributed tool
- Go repo: analyzer / integration
golangci-lint - Ruby repo: native checker gem or RuboCop-style integration
- Rust repo: crate / Clippy-style integration
- mixed or tool-agnostic repo: CLI workflow may be enough initially
The important question is not "did we install the ESLint plugin?"
It is "what actually enforces correctness in this ecosystem?"
@contextWhat to look for in a review
Flag these as setup defects:
- child files pointing to a missing repo policy
AGENTS.md - instructions that mention but give no workflow
@context - workflow guidance that ignores in large repos
--report - guidance that treats linked docs as required structured sidecars
- package installs without corresponding agent documentation
- documentation that tells agents to read giant ADR/doc trees by default
Delivery
When you finish setup or audit work:
- state what was installed or changed
- call out any stale or contradictory guidance you fixed
AGENTS.md - mention any remaining gaps
- if you did not install an enforcement surface, explain why
Default recommendation
If the repo has no existing guidance, prefer creating a
section in the root rather than scattering
instructions across multiple child docs first.
codecontextcodecontext-setupAGENTS.md