Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions skills/code-exploration/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: code-exploration
description: Navigate and understand unfamiliar codebases to locate relevant code. Use when you need to find files, methods, or classes related to a bug or feature, search for error messages, or understand code structure before making changes.
---

# Code Exploration

Systematically explore a codebase to find relevant files and understand the code structure.

## Finding Related Files

Use targeted search strategies to locate relevant code:

### 1. Grep for Keywords

Search for relevant identifiers:
```bash
grep -r "method_name" .
grep -r "ClassName" .
grep -r "error message text" .
```

**Search for:**
- Method names mentioned in the issue
- Class names
- Error messages
- Keywords from the problem description
- File names or paths mentioned

### 2. Identify All Related Files

Create a comprehensive list:
- Files containing the methods/classes mentioned
- Test files for those components
- Configuration files that might affect behavior
- Documentation files explaining the feature

### 3. Analyze Code Structure

For each relevant file:
- Read the implementation
- Understand dependencies and imports
- Note related methods and classes
- Identify potential fix locations

## Proposing Fix Locations

### 1. List Candidate Locations

Propose specific files and methods where the fix might belong:
- Primary location (most likely)
- Secondary locations (less likely but possible)
- Related areas that might need updates

### 2. Explain Your Reasoning

For each candidate location:
- Why this location is relevant
- What code would need to change
- How it connects to the issue
- Potential side effects

### 3. Select the Most Likely Location

Based on your analysis, choose the primary fix location and explain why it's the best choice.

## Best Practices

- Use `grep` with appropriate flags (`-r` for recursive, `-i` for case-insensitive)
- Search the entire codebase, not just obvious locations
- Look at test files to understand expected behavior
- Check recent commits that touched related code (`git log --follow <file>`)
- Consider both direct and indirect relationships
85 changes: 85 additions & 0 deletions skills/code-implementation/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: code-implementation
description: Implement code changes with focus and discipline. Use when making the actual code edits to fix a bug or implement a feature. Emphasizes minimal changes, focused modifications, and clean implementation.
---

# Code Implementation

Implement code changes with precision and minimal scope.

## Principles

### 1. Minimal Changes

Make the smallest possible change that fixes the issue:
- Don't refactor unrelated code
- Don't fix other bugs you notice
- Don't add extra features
- Focus solely on the issue at hand

### 2. Focused Modifications

Edit only the files necessary for the fix:
- Primary fix location
- Related code that must change to support the fix
- Tests (if required by project)

### 3. Clean Implementation

Write code that matches the project's style:
- Follow existing code conventions
- Match indentation and formatting
- Use similar patterns to surrounding code
- Add comments only where needed

## Implementation Process

### 1. Open the Target File

Navigate to the exact location identified in your analysis:
```bash
# View the file first
cat -n path/to/file.py

# Then edit
# Use your file editing tools
```

### 2. Make the Change

Implement the fix according to your plan:
- Follow the solution approach from fix analysis
- Make surgical edits to the specific lines
- Don't modify more than necessary

### 3. Verify Syntax

Check that your changes are syntactically correct:
- For Python: `python -m py_compile file.py`
- For other languages: use appropriate syntax checkers
- Ensure no import errors or typos

## Example

**Before:**
```python
def parse_date(date_string):
return datetime.strptime(date_string, "%m/%d/%Y")
```

**After (minimal fix):**
```python
def parse_date(date_string):
try:
return datetime.strptime(date_string, "%m/%d/%Y")
except ValueError:
return datetime.fromisoformat(date_string)
```

## What NOT to Do

- ❌ Don't refactor unrelated code "while you're at it"
- ❌ Don't fix additional bugs you notice
- ❌ Don't add extra error handling beyond what's needed
- ❌ Don't change formatting of untouched code
- ❌ Don't add features not mentioned in the issue
64 changes: 64 additions & 0 deletions skills/code-issue-analysis/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: code-issue-analysis
description: Analyze bug reports and feature requests to understand code issues. Use when starting work on a bug fix or feature implementation to parse issue descriptions, identify technical details, extract requirements, and clarify the problem statement. Essential first step before making code changes.
---

# Code Issue Analysis

Systematically analyze bug reports and feature requests to extract actionable requirements and technical details.

## Reading and Clarifying the Problem

When presented with an issue description, follow this structured analysis:

### 1. Extract Code and Config Snippets

If the issue contains code or configuration examples:
- Identify coding conventions and best practices demonstrated
- Note file structures and naming patterns
- Recognize configuration patterns and standards

### 2. Identify Technical Details

Highlight and document:
- **Error messages**: Exact text of exceptions, warnings, or error output
- **Method names**: Functions, classes, or methods mentioned
- **Variable names**: Specific identifiers referenced
- **File names**: Paths and filenames involved
- **Stack traces**: Full stack trace information if provided
- **Technical keywords**: Domain-specific terminology

### 3. Clarify the Problem Statement

Rewrite the issue in clear, unambiguous terms:
- What is the current behavior?
- What is the expected behavior?
- What is the gap between them?
- Under what conditions does the issue occur?

### 4. Extract Reproduction Steps

Document the sequence to reproduce the issue:
1. Preconditions (environment, data, configuration)
2. Actions to take
3. Expected outcome
4. Actual outcome

If reproduction steps aren't explicit, infer them from the description.

### 5. Identify Testing and Fix Considerations

Note any best practices mentioned for:
- How to test the issue
- Requirements for a valid fix
- Backward compatibility needs
- Edge cases to consider
- Performance implications

## Output

Produce a clear analysis containing:
- **Problem summary**: One-paragraph clear statement
- **Technical details**: Bulleted list of methods, files, errors
- **Reproduction steps**: Numbered sequence
- **Testing requirements**: Constraints and considerations for validation
103 changes: 103 additions & 0 deletions skills/code-verification/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
name: code-verification
description: Verify code changes work correctly and don't break existing functionality. Use after implementing changes to test the fix, run related tests, and ensure no regressions. Critical final step before submitting changes.
---

# Code Verification

Thoroughly test your implementation to ensure correctness and no regressions.

## Verification Steps

### 1. Run Your Reproduction Script

First, verify your fix solves the original problem:
```bash
python reproduce_issue.py
```

**Expected outcome**: The script should now pass or show correct behavior.

If it still fails:
- Review your implementation
- Check if you edited the right location
- Verify your changes are syntactically correct
- Debug the issue further

### 2. Test Edge Cases

Extend your reproduction script with additional test cases:
- Boundary conditions
- Null/empty inputs
- Unusual but valid inputs
- Previously working cases (regression check)

**Example:**
```python
# Test original functionality still works
assert parse_date("12/25/2023") == expected_date_1

# Test new functionality
assert parse_date("2023-12-25") == expected_date_2

# Test edge cases
assert parse_date("2023-12-25T00:00:00") == expected_date_3
```

### 3. Run Existing Tests

Run the repository's test suite for related code:

```bash
# Run all tests
pytest

# Or run specific test file
pytest tests/test_date_parser.py

# Or run tests for specific function
pytest -k test_parse_date
```

**What to check:**
- Tests for the function you modified
- Tests for functions that call your function
- Integration tests that use your component

### 4. Fix Any Test Failures

If tests fail:
1. Read the failure message carefully
2. Understand what the test expects
3. Determine if:
- Your fix broke valid functionality (fix your code)
- The test expectations are outdated (understand why before changing)
- The test itself has issues (rare)

### 5. Verify No Regressions

Ensure existing functionality still works:
- Run the full test suite if possible
- Manually test related features
- Check that your changes don't affect unrelated code paths

## Final Verification Checklist

Before considering the work complete:

- [ ] Reproduction script passes
- [ ] Edge cases handled
- [ ] Related tests pass
- [ ] No new test failures introduced
- [ ] Manual testing of affected functionality
- [ ] Code review of your changes (self-review)
- [ ] Verify minimal scope (didn't change too much)

## If Tests Keep Failing

Debug systematically:
1. Add print statements to understand execution flow
2. Check if you're testing the right code (imports, paths)
3. Verify test environment is set up correctly
4. Re-read the issue requirements
5. Consider if your solution approach needs adjustment
Loading
Loading