Skip to content

Commit 15e4532

Browse files
Claude Agentclaude
andcommitted
fix(skills): add git history regression checks to iteration and diagnosis skills
Agentic iteration loops lack git history context and can re-introduce patterns that were previously removed for good reasons (e.g. cy.reload() breaking dynamic plugin chunk loading). This caused a real regression during the OBSINTA-1290 consolidation. Added checks to three skills: - productize-iterations: Step 3 now flags REGRESSIVE overlaps where an iteration branch re-introduces a removed pattern - iterate-incident-tests: Fix Guidelines now require checking git log before applying any fix - diagnose-test-failure: Diagnosis output now includes a History Check section that flags previously reverted patterns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e96d764 commit 15e4532

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

.claude/commands/cypress/test-iteration/diagnose-test-failure.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,17 @@ Output your diagnosis in this exact format:
128128
- Change: [specific description of what to change]
129129
- [If multiple files need changing, list each]
130130
131+
**History Check**:
132+
- Run `git log origin/main -- <file>` for each file in the recommended fix
133+
- Look for prior commits that removed or replaced the pattern being proposed
134+
- If found, note: "WARNING: commit <sha> removed this pattern because <reason>"
135+
- Example: cy.reload() was removed from prepareIncidentsPageForSearch in e8d0007
136+
because it breaks dynamic plugin chunk loading. Do NOT re-introduce it.
137+
131138
**Risk Assessment**:
132139
- Will this fix affect other tests? [yes/no and why]
133140
- Could this mask a real bug? [yes/no and why]
141+
- Does this fix re-introduce a previously reverted pattern? [yes/no]
134142
135143
**Alternative Hypotheses**:
136144
- [If confidence is MEDIUM or LOW, list other possible causes]

.claude/commands/cypress/test-iteration/iterate-incident-tests.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,14 @@ You must NOT edit:
302302
- If fixing a fixture, validate it against the fixture schema
303303
(run /cypress:test-development:validate-incident-fixtures mentally or reference the schema)
304304
- If adding a page object method, follow existing naming conventions
305+
- **Before applying any fix, check git history** for the file being changed:
306+
`git log origin/main -- <file>` — look for prior commits that explicitly
307+
removed or replaced the pattern you are about to introduce. For example,
308+
`cy.reload()` was previously removed from prepareIncidentsPageForSearch
309+
because it breaks dynamic plugin chunk loading in headless CI. The iteration
310+
agent lacks git history context and will re-discover "fixes" that were
311+
already tried and reverted. If a prior commit removed the pattern for a
312+
documented reason, do NOT re-introduce it.
305313
```
306314

307315
After the Fix Agent returns, verify the fix makes sense:

.claude/commands/cypress/test-iteration/productize-iterations.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,20 @@ Also check for cross-file dependencies:
8686
- Does branch A add a function that branch B calls?
8787
- Does branch A change a signature that branch B depends on?
8888

89+
**Critical: Check git history for reverted patterns.** For each changed file, run
90+
`git log origin/main -- <file>` and read recent commit messages. Look for
91+
patterns where a prior commit explicitly removed or replaced something that the
92+
iteration branch is re-introducing. Common examples:
93+
- `cy.reload()` removed in favor of SPA navigation (dynamic plugin chunk loading
94+
breaks on full page reload)
95+
- Flattened selectors replaced with grouped selectors
96+
- Timeouts adjusted for a specific reason
97+
98+
If an iteration branch re-introduces a pattern that was previously removed, flag
99+
it as **REGRESSIVE** and investigate whether the original removal reason still
100+
applies. The iteration agent doesn't have git history context and will often
101+
re-discover a "fix" that was already tried and reverted.
102+
89103
Produce an evaluation report:
90104
```
91105
## Overlap Analysis

0 commit comments

Comments
 (0)