Skip to content

Migrate .claude/ prompts for Claude Opus 4.7 (Phase 1)#4636

Draft
stuartc wants to merge 2 commits intomainfrom
chore/opus-4-7-agent-prompts-phase-1
Draft

Migrate .claude/ prompts for Claude Opus 4.7 (Phase 1)#4636
stuartc wants to merge 2 commits intomainfrom
chore/opus-4-7-agent-prompts-phase-1

Conversation

@stuartc
Copy link
Copy Markdown
Member

@stuartc stuartc commented Apr 17, 2026

Description

Migrates .claude/ prompts and guidelines for Claude Opus 4.7 per Anthropic's 4.6 → 4.7 prompt-migration guide.

Opus 4.7 follows instructions more literally than 4.6. Two behaviors matter most for our agent prompts:

  • Recall suppressors ("minimize false positives", "filter aggressively", "only flag high-severity") cause review/analysis agents to silently drop findings
  • Anti-laziness scaffolding (CRITICAL: / YOU MUST / ALWAYS / NEVER) and forced pre-action checklists cause overtriggering and over-reporting

This is Phase 1 of a two-phase audit. Phase 2 (pre-Opus-4 content redundancy review) will follow separately.

Commits

  • 2e95506 — Tier 1: relaxed recall suppressors in security-reviewer, codebase-analyzer, context-analyzer, validate-plan (+70/-59, 4 files). Added a CONCERN status tier and an "Other Security Observations" escape hatch to security-reviewer.
  • 64334b1 — Tier 2: softened anti-laziness scaffolding and collapsed forced checklists across 17 files (+113/-198).

Technical content preserved

Emphasis softened, hazard explanations kept verbatim:

  • VM deadlock explanation in yex-guidelines.md
  • Tailwind disabled:hover: mechanics in ui-patterns.md
  • Y.Doc transaction rules and CQS separation in react-collab-editor.md
  • Test file-size heuristics in testing-essentials.md
  • Git attribution safety rail (NEVER add co-author information) in commit.md

Scope

Out of scope for this PR (deferred to Phase 2):

  • Content redundancy — a lot of pre-Opus-4 guidance is now modern-Claude baseline knowledge
  • Nested testing guidelines (.claude/guidelines/testing/*.md) — audited as clean, no changes needed

Closes #__

Validation steps

  1. Spot-read the two commit diffs — changes are surgical text-level reframings, not behavioral
  2. Confirm the preserved-technical-content list above survives in the final state of each named file
  3. Over the next week or so, watch agent behavior for:
    • security-reviewer surfacing ambiguous findings as CONCERN rather than collapsing to PASS
    • codebase-analyzer noting observations at the end of analyses when relevant
    • Fewer duplicated progress/status messages mid-task
    • No scope drift — agents still stay within their stated purpose

Additional notes for the reviewer

  1. Phase 1 only. Phase 2 (pre-Opus-4 content redundancy audit) will strip redundant baseline knowledge in a separate PR
  2. A dedicated reviewer agent audited the Tier 2 diff for technical-content preservation and scope adherence before commit 2 landed — it signed off clean
  3. Tier 2 also cleaned up duplicate tail-end "What NOT to Do" + "REMEMBER" blocks in codebase-locator.md / codebase-pattern-finder.md that were partially undoing the top-of-file softening

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (reviewer agent — see Additional notes)
  • I have implemented and tested all related authorization policies (N/A — no application code changed; this PR touches agent prompt files only)
  • I have updated the changelog (N/A — internal agent tooling, not user-facing behavior)
  • I have ticked a box in "AI usage" in this PR

stuartc added 2 commits April 17, 2026 15:35
Opus 4.7 follows instructions more literally than 4.6. Phrases like
"minimize false positives", "filter aggressively", and "only flag
high-severity" — flagged in Anthropic's 4.7 migration guide — cause
measurable recall drops when the agent's job is review or analysis.

Reframe the four highest-impact prompts so agents surface uncertain or
scope-adjacent findings instead of silently dropping them:

- security-reviewer: add CONCERN status tier between PASS and FAIL, plus
  an "Other Security Observations" escape hatch for security-adjacent
  issues outside S0/S1/S2 (secret leaks, CSRF, injection, SSRF, etc.)
- codebase-analyzer: remove blanket "DO NOT identify bugs / performance /
  security concerns" suppression; add an Observations section for clearly
  broken or risky code spotted while tracing
- context-analyzer: replace "Filter Aggressively / Filter Ruthlessly"
  with prioritization framing that preserves rejected options and
  superseded workarounds when they carry decision rationale
- validate-plan: stop pre-filtering deviations; let the reader triage

Scope is intentionally narrow — only the Category C recall suppressors
from the 4.7 audit. The Category A anti-laziness scaffolding (CRITICAL /
MUST / ALWAYS / NEVER emphasis) and the broader pre-Opus-4 redundancy
review will be addressed in follow-up passes.
Phase 1 Tier 2 of the Opus 4.7 prompt-migration audit. Opus 4.7 follows
emphasis too literally — uppercase imperatives (CRITICAL / YOU MUST /
ALWAYS / NEVER) coerce overtriggering, and forced pre-action checklists
cause over-reporting. Anthropic's 4.7 migration guide flags these as the
highest-volume patterns to rewrite.

Reframe 17 files across four clusters, preserving all technical content
(VM deadlock explanations, Tailwind disabled:hover mechanics, Y.Doc
transaction rules, the git attribution safety rail):

- Core instructions (CLAUDE.md + 5 guidelines): drop ⚠️/uppercase
  wrappers on real hazards; collapse duplicate "Summary of Critical
  Rules" and pre-submission / pre-POM-edit checklists into prose
- Agent definitions (5 files): drop "You Must Follow" section headers
  and stacked DO-NOT/ONLY scope-suppression blocks (top and tail) in
  codebase-locator and codebase-pattern-finder; remove fixed time
  budgets from idea-machine steps
- Slash commands (4 files): drop CRITICAL/FRESH/EXTREMELY stacks and
  the duplicate REMEMBER block in research-codebase; make progress
  tracking advisory rather than mandatory; keep commit.md's NEVER
  attribution rail as a legitimate safety rail
- E2E nested guides (2 files): drop CRITICAL/MUST read-first block and
  6-item Research Checklist in page-objects; soften "Always wait for
  connection"

Tier 2 scope is intentionally limited to Category A (anti-laziness
scaffolding), B (forced progress/checklist scaffolding), and D (fixed
time/effort assumptions). Tier 1 (Category C recall suppressors) was
committed earlier on this branch. The broader pre-Opus-4 redundancy
audit is Phase 2.
@github-project-automation github-project-automation bot moved this to New Issues in Core Apr 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.61%. Comparing base (f8a1f0b) to head (64334b1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4636      +/-   ##
==========================================
- Coverage   89.63%   89.61%   -0.02%     
==========================================
  Files         444      444              
  Lines       21558    21558              
==========================================
- Hits        19324    19320       -4     
- Misses       2234     2238       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

1 participant