Skip to content

Repository prompt overrides never reach Software Factory build steps #968

Open

Description

@RCheesley

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.md for either run. The only .druks prompt lookups are the profiler's (prompts/profile/repo_profiler.md) and prompts/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_context returns "repo": … at the top level, so profiler overrides work
  • Build.get_prompt_context returns {"verification": …, "build": BuildPromptContext(repo=…), …}. The repository is nested inside build, so repo reaches render_prompt as None and 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 repo key either, so review/review_pull_request.md can'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

  1. 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.repo to Build.get_prompt_context, and the repo to the review workflow's context.
  2. 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.
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions