feat: add inherit-legacy-style — prevent AI code style drift in legac… - #2098
Conversation
…y projects - 4-dimension meta-architecture scan (File Anatomy, State & Control Flow, Infrastructure, Error Handling) - Scale-adaptive (small=full read, large=smart sampling) - Signal-threshold noise reduction with one-at-a-time grilling protocol - Generates .ai-style-rules.md with persistent CLAUDE.md hook - Language- and framework-agnostic
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new skill documentation file Changesinherit-legacy-style Skill Definition
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
skills/inherit-legacy-style/SKILL.md (1)
12-131:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd explicit
When to Use,How It Works, andExamplessections for skills docs consistency.This file is structurally strong, but it misses the exact section headings required for
skills/**/*.md. To avoid breaking auto-activation conventions, keep## When to Activateand add## When to Useas a short alias/cross-reference, then add explicit## How It Worksand## Examples.Suggested structure adjustment
## When to Activate ... +## When to Use + +Use this skill when you need to preserve legacy project style and prevent AI-generated style drift. +See **When to Activate** for trigger conditions. + +## How It Works + +This skill auto-detects first-time vs incremental mode, scans style signals across four dimensions, resolves strong-signal conflicts one at a time, and persists decisions into `.ai-style-rules.md` with optional enforcement hooks. + ... ## Related Skills ... + +## Examples + +1. **First-time onboarding** + - User: “Help me onboard AI to this older codebase without changing its style.” + - Action: Run full-scan branch, generate `.ai-style-rules.md`, offer hook strength. + +2. **Incremental update** + - User: “We added a new module; keep existing style rules intact.” + - Action: Run incremental sniff, compare deltas to rules, append evolution log.As per coding guidelines: "
skills/**/*.md: Skills should be formatted as Markdown with clear sections for When to Use, How It Works, and Examples."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@skills/inherit-legacy-style/SKILL.md` around lines 12 - 131, The doc is missing required headings; update SKILL.md to keep the existing "## When to Activate" then add a short alias "## When to Use" that cross-references that section, add a new "## How It Works" summarizing the Auto-Detect/Branch A/Branch B workflow in 3–5 bullets (referencing Auto-Detect Mode, Branch A — First-time Full-Scan, Branch B — Incremental Sniff), and add a concise "## Examples" section with 2–3 concrete usage examples (e.g., first-time onboarding of a legacy repo, incremental rule evolution after recent commits, and enforcing DONTs via CLAUDE.md); ensure the new headings are exact strings "## When to Use", "## How It Works", and "## Examples" so the auto-activation parser recognizes them.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/inherit-legacy-style/SKILL.md`:
- Line 5: The allowed-tools list at the top of SKILL.md is missing
AskUserQuestion while the workflow (the “Install the persistent hook” step and
the requirement referenced as AskUserQuestion) needs it; update the
allowed-tools entry (the line currently listing Read, Glob, Grep, Bash, Edit,
Write) to include AskUserQuestion so the skill runtime permits that tool during
the Install the persistent hook step.
---
Outside diff comments:
In `@skills/inherit-legacy-style/SKILL.md`:
- Around line 12-131: The doc is missing required headings; update SKILL.md to
keep the existing "## When to Activate" then add a short alias "## When to Use"
that cross-references that section, add a new "## How It Works" summarizing the
Auto-Detect/Branch A/Branch B workflow in 3–5 bullets (referencing Auto-Detect
Mode, Branch A — First-time Full-Scan, Branch B — Incremental Sniff), and add a
concise "## Examples" section with 2–3 concrete usage examples (e.g., first-time
onboarding of a legacy repo, incremental rule evolution after recent commits,
and enforcing DONTs via CLAUDE.md); ensure the new headings are exact strings
"## When to Use", "## How It Works", and "## Examples" so the auto-activation
parser recognizes them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e8823dea-0d2b-4463-9b29-4881a7bc3b43
📒 Files selected for processing (1)
skills/inherit-legacy-style/SKILL.md
There was a problem hiding this comment.
1 issue found across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…ks/Examples sections per bot review
affaan-m#2098) * feat: add inherit-legacy-style — prevent AI code style drift in legacy projects - 4-dimension meta-architecture scan (File Anatomy, State & Control Flow, Infrastructure, Error Handling) - Scale-adaptive (small=full read, large=smart sampling) - Signal-threshold noise reduction with one-at-a-time grilling protocol - Generates .ai-style-rules.md with persistent CLAUDE.md hook - Language- and framework-agnostic * fix: add AskUserQuestion to allowed-tools, add When to Use/How It Works/Examples sections per bot review --------- Co-authored-by: wulinzai <linsywu@gmail.com>
…y projects
What Changed
Why This Change
Testing Done
node tests/run-all.js)Type of Change
fix:Bug fixfeat:New featurerefactor:Code refactoringdocs:Documentationtest:Testschore:Maintenance/toolingci:CI/CD changesSecurity & Quality Checklist
Documentation
Summary by cubic
Adds
inherit-legacy-style, a skill that learns a legacy project's conventions and turns them into enforceable rules to prevent style drift. It scans the repo, resolves conflicts one at a time with the user, and writes.ai-style-rules.mdwith an optionalCLAUDE.mdhook.New Features
.ai-style-rules.md; optionally referenced fromCLAUDE.mdfor persistent enforcement.Bug Fixes
AskUserQuestiontoallowed-toolsto enable interactive conflict resolution.Written for commit 1f05d38. Summary will update on new commits.
Summary by CodeRabbit