Repository navigation
Description
I've been trying to tune Software Factory for a PHP project in a private test repo, and my repository prompt override for planning never showed up in the builds. It turns out builds never look for overrides at all, so I thought I'd write up what I found.
What happened
I added .druks/software_factory/prompts/build/generate_plan.md on the repo's default branch. It includes the built-in planner prompt and adds a couple of repo-specific sections after it, and it compiles fine in Druks' template environment. I then started two new builds.
- Both planners'
prompt.md(under the run's artifacts) start with the built-in "# Implementation Planner" and contain none of my sections - The web log shows no fetch of
.druks/software_factory/prompts/build/generate_plan.mdfor either run. The only.druksprompt lookups are the profiler's (prompts/profile/repo_profiler.md) andprompts/verification_block.md
Why
render_prompt(name, /, *, repo=None, **context) only checks <repo>/.druks/<app>/prompts/<rest> and <owner>/.druks when it receives a top-level repo, and Agent._run passes the whole prompt context with render_prompt(self.prompt, **prompt_context).
Profile.get_prompt_contextreturns"repo": …at the top level, so profiler overrides workBuild.get_prompt_contextreturns{"verification": …, "build": BuildPromptContext(repo=…), …}. The repository is nested insidebuild, soreporeachesrender_promptasNoneand every build step uses the built-in template (generate_plan, review_plan, implement, evaluate_implementation, triage_human_feedback and revise_contract)- The standalone review workflow's context has no
repokey either, soreview/review_pull_request.mdcan't be overridden
It's the same on main today.
This is the other side of #771. That issue covers a context key named repo turning overrides on when nobody meant it to, and this one is the Software Factory build, which is meant to use overrides, never turning them on. The direction in #771 (taking the repository from the workspace and having the agent declare that its prompt can be overridden) would fix both.
Suggested fix
- If A prompt context key named repo turns on prompt overrides #771's change is a bigger piece of work, a stopgap would be adding
"repo": work_item.repotoBuild.get_prompt_context, and the repo to the review workflow's context. - Add a test that a repository override reaches a build step's prompt (for example
build/generate_plan.md), so this can't quietly regress. - Document overrides once they work for builds. I'm opening a draft docs PR about the ways a repository can steer Software Factory, and I'll update its overrides section to match whatever lands here.
In the meantime, the only repo-level guidance that reaches builds is the checkout itself (AGENTS.md and CLAUDE.md), .druks/review/checklist.md for the code reviewer, and the ticket text and comments.
Happy to help test a fix!
Activity