Skip to content

feat(research-guidance): prohibit target-codebase edits during research#20

Open
cdeutsch wants to merge 1 commit into
mainfrom
guardrails/no-target-edits-during-research
Open

feat(research-guidance): prohibit target-codebase edits during research#20
cdeutsch wants to merge 1 commit into
mainfrom
guardrails/no-target-edits-during-research

Conversation

@cdeutsch
Copy link
Copy Markdown

Adds a top-level Anti-Pattern and a dedicated "Handling Direct Edit Requests During Research" section. The rule: do not edit files in target codebases during research, even when the user requests it. Capture the change as a plan task (or a research amendment that names a future task) instead.

Why this rule exists:

During a recent research session (tailwind-app-marketing-sync, in a separate projects repo), the agent accepted a direct user instruction to edit globals.css in the target codebase mid-research. The user quickly reverted and captured the change as a Phase 1 task.

The failure mode: a user reacts to a research finding with an imperative instruction ("fix X", "update Y"), the agent dutifully executes it, and planning / dry-run / materialization get bypassed. This breaks the SDLC's front-loaded research-and-plan discipline. Auto mode does not authorize phase-skipping either.

What the section specifies:

  • Pause when the user gives a direct edit instruction during research.
  • Ask: amend research (capture as a named future task) or hold for planning?
  • If the user wants the edit executed out-of-band anyway, require explicit phase-skipping confirmation and log the deviation.

Explicit exception:

Files that ARE editable during research, because they are the SDLC authoring substrate, not target codebases:

  • features// — research docs, FEATURE_LOG.md
  • the SDLC projects directory's own CLAUDE.md (policy updates)
  • the drvr-sdlc-plugin's own files (skill prompts, hooks, templates)

A matching project-level principle has been added to the driver-sdlc-projects CLAUDE.md so the rule applies regardless of whether research-guidance is the active skill.

Adds a top-level Anti-Pattern and a dedicated "Handling Direct Edit
Requests During Research" section. The rule: do not edit files in
target codebases during research, even when the user requests it.
Capture the change as a plan task (or a research amendment that
names a future task) instead.

Why this rule exists:

During a recent research session (tailwind-app-marketing-sync, in
a separate projects repo), the agent accepted a direct user
instruction to edit globals.css in the target codebase mid-research.
The user quickly reverted and captured the change as a Phase 1 task.

The failure mode: a user reacts to a research finding with an
imperative instruction ("fix X", "update Y"), the agent dutifully
executes it, and planning / dry-run / materialization get bypassed.
This breaks the SDLC's front-loaded research-and-plan discipline.
Auto mode does not authorize phase-skipping either.

What the section specifies:

- Pause when the user gives a direct edit instruction during research.
- Ask: amend research (capture as a named future task) or hold for
  planning?
- If the user wants the edit executed out-of-band anyway, require
  explicit phase-skipping confirmation and log the deviation.

Explicit exception:

Files that ARE editable during research, because they are the SDLC
authoring substrate, not target codebases:
- features/<name>/ — research docs, FEATURE_LOG.md
- the SDLC projects directory's own CLAUDE.md (policy updates)
- the drvr-sdlc-plugin's own files (skill prompts, hooks, templates)

A matching project-level principle has been added to the
driver-sdlc-projects CLAUDE.md so the rule applies regardless of
whether research-guidance is the active skill.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- The drvr-sdlc-plugin's own files (skill prompts, hooks, templates)

These are not "target codebases" — they are the SDLC authoring substrate. The restriction applies to the codebases under research, named in `research/00-overview.md`'s Codebases table.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a bit verbose.

Basically just need something to prevent editing the codebase during research.

My prompt was something like:

let's update the .dark block from globals.css to be empty with a comment on how it works. Remove any other overrides that are outside the block in globals.css

The context was to update the research docs to say that.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant