Code Grounding Agent
The Code Grounding Agent (atelier-code-grounding) is an internal subagent used by Atelier skills such as Revise, Explore, and Verify.
Do not invoke it directly. Atelier calls it when a skill needs source-backed code evidence for a plan, walkthrough, revision, or verification report.
When it is used
Section titled “When it is used”- A skill needs to locate functions, classes, interfaces, constants, or error-handling logic in code
- A document revision references implementation details that need to be checked against source
- A walkthrough needs source-backed excerpts with links that survive nearby edits
- Verification needs evidence for acceptance criteria in changed code
The agent receives a batched request with:
file— Code file to search.link_base— Optional output directory used to make generated links relative to the report or walkthrough.queries— One or more query IDs with natural-language descriptions of the code evidence needed.
What it does
Section titled “What it does”- Extracts search terms — Identifies function names, types, constants, errors, imports, and related technical terms.
- Searches the target file — Looks for relevant definitions, branches, comments, and implementation details.
- Captures complete passages — Returns full logical blocks rather than isolated matching lines.
- Generates deep links — Uses Atelier’s text-fragment helper to produce ready-to-paste links such as
./src/router.ts#:~:text=.... - Explains relevance — Groups passages by query ID and includes short reasoning for each result.
Output
Section titled “Output”The parent skill receives structured markdown grouped by query:
- Query — The query ID supplied by the parent skill.
- File — The searched source file.
- Passages — Relevant excerpts with a text-fragment
Location, a relevance sentence, and concise code content. - Reasoning — One to three sentences explaining why the selected passages answer the query.
If nothing relevant is found, the agent returns an empty result with reasoning instead of fabricating evidence.
Quality standards
Section titled “Quality standards”The agent favors complete, precise, source-backed passages. It excludes boilerplate, import-only mentions, duplicate excerpts, and test code unless the query specifically asks about tests.