Skip to content

feat(roadmap): stage prompt instructs model to name read files #3978

Description

@dan-petty

Problem

The prompt template src/devops_cli/ai/tasks/roadmap_stage_change.md instructs the model to list reads and changes, but does not state that tasks must name existing repository files in code spans.

When the model omits existing file paths from code spans of the tasks, named_files in src/devops_cli/roadmap/step_files.py resolves zero files. As a result, the implementation step starts with no packed files in context, reducing implementation effectiveness and grounding.

Expected

src/devops_cli/ai/tasks/roadmap_stage_change.md states the rule clearly: every task group that changes files must name the relevant source files in code spans within the task text, so named_files packs them for the implementation step.

Acceptance criteria

  • roadmap_stage_change.md explicitly instructs the model to name relevant source files in code spans of each task group.
  • The prompt instructs that each group changing files must pack at least one file from the repository.

Existing tool considered

Prompt template src/devops_cli/ai/tasks/roadmap_stage_change.md.

Related

Related: #3499, #3596, #3928.

Proposed design

Problem statement

The stage prompt does not tell the model to name existing repository files in code spans. When a task group omits those paths, named_files packs no files for the implementation step. The step then starts with weak context and poor grounding.

Acceptance criteria

Requirement: Changing group names an existing file

The roadmap stage change prompt SHALL require each task group that changes files to name one existing repository file in a code span.

Scenario: Changing group names an existing file

  • WHEN the prompt-rule test reads the file-naming rule in src/devops_cli/ai/tasks/roadmap_stage_change.md
  • THEN the test finds that the rule requires one existing repository file in a code span for each changing task group.

Requirement: Prompt explains the packed file

The roadmap stage change prompt SHALL state that named_files packs the existing repository files that the task text names in code spans.

Scenario: Prompt ties named files to packed files

  • WHEN the prompt-rule test reads the text around the file-naming rule
  • THEN the test finds that the prompt names named_files and the packed files of the implementation step.

Requirement: Prompt-rule test guards the rule

The prompt-rule test SHALL assert the file-naming rule and the packing statement in the roadmap stage change prompt.

Scenario: Prompt-rule test covers the new instruction

  • WHEN the prompt-rule test reads src/devops_cli/ai/tasks/roadmap_stage_change.md
  • THEN the test passes only when the file-naming rule and the packing statement are present.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers a prompt instruction. The existing prompt template src/devops_cli/ai/tasks/roadmap_stage_change.md covers the need and lacks the file-naming rule.

Key questions

  • Where does the stage prompt state the code-span rule for task paths?: src/devops_cli/ai/tasks/roadmap_stage_change.md states that every path of a task goes in a code span. The new file-naming rule goes beside that rule. [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md]
  • How does named_files choose the files that it packs?: named_files reads the code spans of the task text. It keeps only paths that are existing files inside the checkout. [sources: src/devops_cli/roadmap/step_files.py]
  • Which test checks the stage prompt rules?: tests/roadmap/stage/test_roadmap_stage_prompt_rules.py checks the stage prompt text. The stage prompt names this test as the verify command for a prompt change. [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]
  • Must every task group that changes files name an existing file?: Yes. The prompt requires one existing repository file in a code span for each group that changes files. The group may also name new files. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/step_files.py]
    • Chosen: Require one existing file per changing group. It gives named_files a file to pack and matches the issue.
    • Rejected: Require only the new files. named_files skips a new file, so the step gets no packed file.
  • Should this change add a plan-check validator for missing existing files?: No. The issue asks for a prompt instruction. A validator changes plan-check behavior and needs its own acceptance criteria and tests. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/step_files.py]
    • Chosen: Prompt instruction only. It fixes the model guidance with a small change and matches the issue.
    • Rejected: Add a plan-check validator. It changes validation behavior and needs separate acceptance criteria and tests.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-09: none.
Tool: none found.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Improves model output quality but does not block a critical path.
    • Value: Medium. Raises implementation grounding by ensuring files are packed for the step.
    • Effort: Low. A single prompt template edit with no code change.
    • Related: fix(roadmap): the stage prompt instructs the planner to write an action for group documentation #3327, which asks for a different change. Both modify roadmap_stage_change.md to add a prompt instruction, but #3327 adds an action verb for documentation while the candidate adds a rule to name files in code spans.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 1f03ee3 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: One search found no tool or library for this need. The issue asks for a wording change to the project's own prompt template, roadmap_stage_change.md, plus a test. That is project-specific text tied to the project's own named_files function, so no outside tool can cover it.

    Tool: none found

    Lacks:

    • No external tool edits this project's prompt template or knows its named_files packing rule

    Searches run:

    • LLM prompt instruct model to cite file paths in code spans for context packing planning tasks, results: 5

    Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.

  7. added
    status/in-review
    and removed
    status/ready
    on Nov 14, 2026
  8. removed
    status/in-review
    on Nov 14, 2026
  9. added a commit that references this issue on Nov 14, 2026
  10. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 UTC

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

    effort/lowpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions