Skip to content

Commit e816bdc

Browse files
committed
feat(ai): Simplify the skill to be more focused
1 parent de9eb79 commit e816bdc

File tree

1 file changed

+26
-68
lines changed

1 file changed

+26
-68
lines changed

.claude/skills/techdebt.md

Lines changed: 26 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,51 @@
11
# Techdebt Cleanup Skill
22

3-
Analyze and refactor changes on the current branch to reduce technical debt, eliminate code duplication, and remove unnecessary complexity.
3+
Analyze changes on the current branch to identify and fix technical debt, code duplication, and unnecessary complexity.
44

55
## Instructions
66

7-
You are a senior engineer performing a technical debt review of the changes introduced on this branch. Your goal is to refine the code to be cleaner, simpler, and more maintainable.
7+
### Step 1: Get Branch Changes
88

9-
### Step 1: Gather Context
10-
11-
Find the remote pointing to the upstream DataDog/dd-trace-java repository and get all changes:
9+
Find the upstream remote and compare against it:
1210

1311
```bash
14-
# Find upstream remote and get diff stats
15-
UPSTREAM=$(git remote -v | grep -E 'DataDog/dd-trace-java(.git)?\s' | head -1 | awk '{print $1}')
16-
echo "Upstream remote: $UPSTREAM"
12+
# Find upstream (DataDog org repo) and show changes
13+
UPSTREAM=$(git remote -v | grep -E 'DataDog/[^/]+(.git)?\s' | head -1 | awk '{print $1}')
14+
if [ -z "$UPSTREAM" ]; then
15+
echo "No DataDog upstream found, using origin"
16+
UPSTREAM="origin"
17+
fi
18+
echo "Comparing against: $UPSTREAM/master"
1719
git diff ${UPSTREAM}/master --stat
1820
git diff ${UPSTREAM}/master --name-status
1921
```
2022

21-
Then read the full diff to understand the changes:
23+
If no changes exist, inform the user and stop.
2224

23-
```bash
24-
UPSTREAM=$(git remote -v | grep -E 'DataDog/dd-trace-java(.git)?\s' | head -1 | awk '{print $1}')
25-
git diff ${UPSTREAM}/master
26-
```
25+
If changes exist, read the diff and the full content of modified source files (not test files) to understand context.
2726

28-
### Step 2: Analyze for Technical Debt
27+
### Step 2: Analyze for Issues
2928

30-
Review all changes looking for these specific issues:
29+
Look for:
3130

32-
#### Code Duplication
33-
- Similar code blocks that could be extracted into shared functions/methods
31+
**Code Duplication**
32+
- Similar code blocks that should be extracted into shared functions
3433
- Copy-pasted logic with minor variations
35-
- Repeated patterns that could use a common abstraction
3634

37-
#### Unnecessary Complexity
38-
- Over-engineered solutions (abstractions for single use cases)
35+
**Unnecessary Complexity**
36+
- Over-engineered solutions (abstractions used only once)
3937
- Excessive indirection or layers
4038
- Backward compatibility shims that aren't needed
4139

42-
#### Redundant Code
40+
**Redundant Code**
4341
- Dead code paths
44-
- Excessive null checks or error handling for impossible scenarios
45-
- Comments that just repeat what the code does
46-
47-
#### Verbose Patterns
48-
- Boilerplate that could be simplified
49-
- Explicit types where inference works
50-
- Unnecessarily defensive code
51-
52-
### Step 3: Report Findings
53-
54-
Present findings in this format:
55-
56-
```
57-
## Technical Debt Analysis
58-
59-
### Summary
60-
- Files analyzed: X
61-
- Issues found: Y
62-
63-
### Issues by Category
64-
65-
#### 1. Code Duplication
66-
[List each instance with file:line references and explanation]
67-
68-
#### 2. Unnecessary Complexity
69-
[List each instance with file:line references and explanation]
70-
71-
#### 3. Redundant Code
72-
[List each instance with file:line references and explanation]
73-
74-
### Recommended Refactorings
75-
[Prioritized list of specific changes to make]
76-
```
77-
78-
### Step 4: Implement Fixes (if requested)
79-
80-
If the user wants you to fix the issues:
42+
- Overly defensive checks for impossible scenarios
8143

82-
1. Start with the highest-impact, lowest-risk changes
83-
2. Make one logical change at a time
84-
3. Explain each change briefly
85-
4. Do NOT introduce new features or change behavior - only refactor
44+
### Step 3: Report and Fix
8645

87-
### Guidelines
46+
Present a concise summary of issues found with file:line references.
8847

89-
- **Be conservative**: Only flag clear issues, not stylistic preferences
90-
- **Preserve behavior**: Refactoring must not change functionality
91-
- **Stay focused**: Only analyze changes on this branch, not the entire codebase
92-
- **Be specific**: Always include file paths and line numbers
93-
- **Prioritize**: Focus on issues that matter, skip trivial ones
48+
Then ask the user if they want you to fix the issues. When fixing:
49+
- Make one logical change at a time
50+
- Do NOT change behavior, only refactor
51+
- Skip trivial or stylistic issues

0 commit comments

Comments
 (0)