FE-881: Cook agent loads the target repo's sandbox-scoped skills#227
FE-881: Cook agent loads the target repo's sandbox-scoped skills#227kostandinang wants to merge 4 commits into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR SummaryMedium Risk Overview Presenter / CLI: Other: Activity heartbeat tail truncation counts the ellipsis in the 56-char cap; Reviewed by Cursor Bugbot for commit a29e185. Bugbot is set up for automated code reviews on this repo. Configure here. |
433f0e2 to
c7ba5fd
Compare
d598bb0 to
b8a554a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b8a554a. Configure here.
7a7e1e5 to
b48901c
Compare
e8c3f2d to
fbd12b2
Compare
fbd12b2 to
c830824
Compare
c830824 to
a811396
Compare
Brownfield cook builds on the user's repo, so the agent should see that repo's own skills. buildSessionOptions previously stripped all skills for hermeticity; narrow that from "no skills" to "no skills from outside the repo": - cookResourceLoader points pi's discovery at the repo's .agents/skills / .claude/skills (deduped by realpath; pi's defaults scan <cwd>/<config>/skills + <agentDir>/skills, not the Agent-Skills dirs) and filters the result to paths under the sandbox via sandboxScopedSkills. - The skill catalog reaches the model through pi's custom-prompt path (formatSkillsForPrompt, gated on the read tool — every cook action has it). - Greenfield worktrees have no such dir, so skills resolve empty and behavior is unchanged (protecting invariant). Deferred follow-ons: AGENTS.md/conventions loading, a project-trust gate. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Keep retryable slice work non-terminal in the UI, emit completion on promotion failures, and clean up misleading verification/test signals reported by the stack review bots. Co-authored-by: Cursor <cursoragent@cursor.com>
Include the leading ellipsis in the heartbeat truncation budget so progress details respect the configured maximum length. Co-authored-by: Cursor <cursoragent@cursor.com>
Pass a directory link type when sharing node_modules on Windows so lazy slice seeding can link folder targets reliably. Co-authored-by: Cursor <cursoragent@cursor.com>
a811396 to
a29e185
Compare


Stack Context
Stacks on FE-864 (#224). A refinement of cook-codebase-mode + the cook-time grounding direction (D160-K intact -- this is run-time, not the emitter). FE-881.
What?
cookResourceLoader(sandboxDir, agentDir, systemPrompt)-- points pi's discovery at the repo's.agents/skills/.claude/skills(deduped by realpath, since brunch-style repos symlink the two), then filters the result to paths under the sandbox viasandboxScopedSkills. pi's default discovery scans<cwd>/<config>/skills+<agentDir>/skills, not the Agent-Skills dirs, so the explicitadditionalSkillPathsare required.sandboxScopedSkills(skills, sandboxDir)-- pure filter: keeps only skills whose path resolves under the sandbox; drops global, sibling-slice, and prefix-lookalike paths.formatSkillsForPrompt, gated on thereadtool -- every cook action has it), so the task-prompt override does not suppress it.Why?
Brownfield cook builds on the user's repo, so the agent should see that repo's own skills and conventions.
buildSessionOptionspreviously stripped all skills for hermeticity. This narrows the guarantee from "no skills" to "no skills from outside the repo" -- the cook agent gains the target codebase's configured skills while the developer's machine-global pi config still never leaks in.Behavior / scope
.agents/skills, so skills resolve empty and greenfield behavior is unchanged (protecting invariant).Tests
npm run verifygreen (2060 passed, 2 skipped, build OK). New unit test pinssandboxScopedSkills(under / sibling / prefix-lookalike / global); new fs-integration test pinscookResourceLoaderdiscovering the repo's.agents/skillsand excluding anagentDir(global) skill.