Repository navigation
Description
Problem or Motivation
The plan in PR #3277 (for #3204) adds a hand-written agent skill in .claude/skills/new-scaffold/SKILL.md only. The project commits its agent skills in each agent root: .claude/skills/, .agents/skills/ and .kilocode/skills/ all hold the OpenSpec skills (CONST_OPENSPEC_GENERATED_GLOBS in src/devops_cli/config/constants.py). An agent reads only its own root, so the skill of the plan reaches one agent. The plan cites the .claude path and no other, and no gate asked whether the same kind of file lives in a sibling place.
The same shape appeared in the plan for #3236: ai_ast_graph has a sibling target_dir option that the plan missed.
Proposed Solution & Architectural Design
- When a task creates a file whose name matches a glob that the repository already holds in more than one tree (for example
*/skills/*/SKILL.md), list the sibling trees that hold files of that glob. - Put the list in the context of the stage job, and ask the plan to create the file in each tree, or to say in the design why one tree is enough.
- Test with a plan that creates
.claude/skills/x/SKILL.mdalone: the stage context names.agents/skills/and.kilocode/skills/.
Target Subsystem
src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage.py (context of the stage job).
Source: #3277
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Proposed design
Problem statement
The stage context does not list the sibling trees of a file that a plan creates. A plan can add a skill under .claude/skills/ and miss .agents/skills/ and .kilocode/skills/. The change makes the stage context list the sibling trees. It asks the plan to cover each tree or give a reason. The same gap appeared for ai_ast_graph and target_dir.
Acceptance criteria
Requirement: Sibling trees of a created file
The stage context SHALL list every other sibling tree that holds a file matching the glob of a file that a plan creates.
Scenario: Skill tree siblings
- WHEN A plan creates
.claude/skills/new-scaffold/SKILL.md, and.agents/skills/openspec-x/SKILL.mdand.kilocode/skills/openspec-y/SKILL.mdexist. - THEN An offline unit test on a temporary tree asserts that the context names
.agents/skills/and.kilocode/skills/, and not.claude/skills/.
Requirement: No list for one tree
The stage context SHALL omit the sibling tree list when only one sibling tree holds a file that matches the glob.
Scenario: Single matching tree
- WHEN Only
.claude/skills/openspec-x/SKILL.mdexists, and a plan creates.claude/skills/new-scaffold/SKILL.md. - THEN An offline unit test asserts that the context holds no sibling tree list.
Requirement: Prompt asks for each tree or a reason
The stage prompt SHALL ask the plan to create the file in each listed sibling tree or to state in the design why one tree is enough.
Scenario: Prompt instruction
- WHEN The stage context lists one or more sibling trees.
- THEN An offline test asserts that the rendered prompt holds the list and that instruction.
Requirement: Only matching relative paths
The stage context SHALL list a sibling tree only when that tree holds a file whose relative path matches the same glob.
Scenario: Same basename, different path
- WHEN
.agents/notes/SKILL.mdexists and.agents/skills/openspec-x/SKILL.mddoes not. - THEN An offline unit test asserts that the context does not list
.agents/notes/.
Requirement: Sorted tree names
The stage context SHALL list sibling tree names in ascending alphabetical order.
Scenario: Sorted output
- WHEN The context lists
.kilocode/skills/and.agents/skills/. - THEN An offline test asserts that
.agents/skills/comes before.kilocode/skills/.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers the whole need. The Python standard library pathlib and glob cover path matching and tree search, but they lack the stage-context integration and the prompt text. The project adds that integration in its own code. The written cost is about 25,000 tokens to build, 5,000 tokens each year to keep and fix, and 1 day of elapsed time.
Key questions
- Which agent roots already hold the same kind of skill file?: The repository holds OpenSpec skills in
.claude/skills/,.agents/skills/and.kilocode/skills/. [sources: src/devops_cli/config/constants.py] - Which modules build the stage context and the path helpers?:
src/devops_cli/roadmap/stage.pybuilds the stage context.src/devops_cli/roadmap/stage_paths.pyholds the path helpers. [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_paths.py] - How does the stage context derive the glob for a created file?: Replace the first path segment and the directory segment before the file name with
*. Keep the other segments exact. Match candidate files withPurePath.full_match, and list the fixed prefix of each match. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/config/constants.py]- Rejected: Fixed list of known globs. It misses a new file family until a person edits the list.
- Rejected: Same basename anywhere. It lists unrelated files and uses context space.
- Chosen: Two-wildcard glob from the created path. It finds the
*/skills/*/SKILL.mdfamily and lists the fixed prefix as the sibling tree.
- Which module owns the sibling-tree detection?:
src/devops_cli/roadmap/stage_paths.pyowns the glob derivation and the match.src/devops_cli/roadmap/stage.pyonly renders the result in the context. (best practice) [sources: src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage.py]- Rejected: Inline in stage.py. It mixes path logic with context rendering and is harder to test.
- Chosen: Helper in stage_paths.py. The path module already owns path rules, and a unit test can call the helper.
- How does the stage context present the sibling trees and ask the plan to cover them?: The stage context adds a
Sibling treessection. The section holds the sorted tree roots. The prompt asks the plan to create the file in each tree or to give a design reason for one tree. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_paths.py]- Rejected: Inline in the stage prompt. It mixes a path fact with general instructions and is harder to test.
- Rejected: List only. The plan can ignore the list.
- Chosen: Separate section and instruction. The plan sees one list and one instruction, and a valid reason can keep one tree.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 3, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.It prevents a class of plan errors but affects only plans that create files matching multi-tree globs.It stops plans from creating a file in one agent root while missing the others.It adds a glob match and a tree listing to the stage context, a small targeted change.Both extend the stage context with information about related files, but 3252 names other open plans that edit the same files while the candidate lists sibling trees that hold files matching the same glob.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at 8e0a486 (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Staged: branch
feat/3318-the-stage-context-lists-the-sibling, draft pull request #3334. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
The plan run made 2 model request(s), and used 147335 input tokens and 925 output tokens. The model made no tool call.
A model review of the plan found these points. They stop no draft, and a person judges them:
criterion_droppedat group 1 and specs: The plan has no task for the prompt instruction, the single-tree omission, the relative-path match or the sorted order. The spec delta holds only one requirement. The group does not changestage.py, which renders the context and the prompt. Evidence: "The stage prompt SHALL ask the plan to create the file in each listed sibling tree or to state in the design why one tree is enough."verify_format group 1: The verify command checks the OpenSpec files only. It does not run any test of the new sibling-tree code instage_paths.py. Evidence: "uv run devops openspec check"otherat plan: The plan fields hold the textplaceholderinstead of real content: the group title, the implementation, the why and the feasibility. The group has no test task for new behavior. A reviewer cannot act on this plan. Evidence: ""implementation": "placeholder""docs(openspec): plan #3318 list sibling trees of a new file
[-]feat(roadmap): the stage context lists the sibling trees of a file that a plan creates[/-][+]feat(roadmap): the stage context lists sibling trees of a created file[/+]docs(openspec): plan #3318 list sibling trees of a new file (#3334)
8 remaining items
devops-cli-service commentedon Nov 4, 2026
The runner Job devops-cli-runner-20261104-102842-c74b ended: succeeded.
Image digest: sha256:68ba10ea2a5e3536c67a726812a8aaac645a24539797eb2a7cf907c8762cdf68
The last lines of its log:
devops-cli-service commentedon Nov 4, 2026
Cleared the stop at group 1 by the rule
digest: the runner image changed since the stop, from sha256:68ba10ea2a5e3536c67a726812a8aaac645a24539797eb2a7cf907c8762cdf68 to sha256:89bb522e53b2cf11cc1aa5746e87351306958e1be75ef01cc0bd1d203c8470f5. The item is Planned again, and the Service takes it in the next round. The Service clears a stop one time for each runner image. A new stop on this image waits for a commentimplement: retry.devops-cli-service commentedon Nov 5, 2026
Stopped at group 1.
Failure class:
parser.Action taken: none.
Action left:
change_tier: run the item with a stronger model tier.Reason:
Last message of the agent (a claim that no check verified): Now I have enough understanding to implement the feature. Let me start by implementing the
sibling_treesfunction instage_paths.py:The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.devops-cli-service commentedon Nov 5, 2026
The runner Job devops-cli-runner-20261105-010536-821f ended: succeeded.
Image digest: sha256:cb76ed2505fd18f54cfd33af3c7f966794d379f1da5b4b68340cd0bedfa3af29
The last lines of its log:
feat(roadmap): ask for a smaller edit after a parser failure (#3737)
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.