Skip to content

Commit 775169c

Browse files
authored
Merge pull request #20264 from mozilla/tweak-simplify
chore(skills): scope fxa-simplify to only refine lines changed
2 parents ccbffde + d641c2f commit 775169c

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

.claude/skills/fxa-simplify/SKILL.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: fxa-simplify
33
description: Simplifies and refines code in the FXA monorepo using project-specific conventions. Use when asked to simplify, clean up, or refine recently written code. Focuses on recently modified code unless instructed otherwise.
4+
argument-hint: Optional file paths to scope the review (e.g. "packages/fxa-auth-server/lib/foo.ts")
45
context: fork
56
---
67

@@ -103,16 +104,22 @@ Avoid over-simplification that could:
103104

104105
## 7. Focus Scope
105106

106-
Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope.
107+
**Only refine lines that were actually changed in the diff.** Do not refine unchanged surrounding code, even if it could be improved. The goal is to keep the diff minimal and focused.
108+
109+
- If file paths are provided via `$ARGUMENTS`, scope to those files only
110+
- Otherwise, run `git diff HEAD~1..HEAD --name-only` to find changed files, then `git diff HEAD~1..HEAD` to see the line-level changes
111+
- Within each file, only refine the lines that appear in the diff (added or modified lines), not the entire file
112+
- Exception: if a changed line introduces an obvious bug or inconsistency with adjacent unchanged code, note it but do not fix the unchanged code without asking
107113

108114
## Refinement Process
109115

110-
1. Identify the recently modified code sections
111-
2. Determine which package/domain the code belongs to (auth-server, settings, libs, etc.)
112-
3. Apply the appropriate conventions for that domain
113-
4. Analyze for opportunities to improve elegance and consistency
114-
5. Ensure all functionality remains unchanged
115-
6. Verify the refined code is simpler and more maintainable
116-
7. Document only significant changes that affect understanding
116+
1. If `$ARGUMENTS` contains file paths, use those. Otherwise run `git diff HEAD~1..HEAD --name-only` to find changed files.
117+
2. Run `git diff HEAD~1..HEAD` to see the actual line-level changes
118+
3. For each changed file, only analyze and refine the lines that were added or modified in the diff
119+
4. Determine which package/domain the code belongs to (auth-server, settings, libs, etc.)
120+
5. Apply the appropriate conventions for that domain to the changed lines only
121+
6. Ensure all functionality remains unchanged
122+
7. Verify the refined code is simpler and more maintainable
123+
8. Document only significant changes that affect understanding
117124

118125
Your goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.

0 commit comments

Comments
 (0)