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
PR SummaryMedium Risk Overview Slice lifecycle / Petri net alignment: CLI / presenter / platform: Promotion errors emit Reviewed by Cursor Bugbot for commit d598bb0. Bugbot is set up for automated code reviews on this repo. Configure here. |
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>
433f0e2 to
c7ba5fd
Compare
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>

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.