@@ -4,52 +4,100 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44
55## 🚨 IMPORTANT: Development Workflow Guidelines
66
7- ** Before starting any task, agents MUST assess if tests are needed for the work requested .**
7+ ** ALL coding agents MUST follow these mandatory guidelines for every task .**
88
9- ### Test-Driven Development (TDD) Approach
9+ ### 🔄 Fresh Start Protocol
1010
11- When working on this repository, follow these ** mandatory ** guidelines:
11+ ** BEFORE starting ANY new task or issue: **
1212
13- 1 . ** Assessment Phase** : Before writing any code, determine if the work requires tests:
14- - ✅ ** Tests Required** : New features, bug fixes, API changes, tool modifications
15- - ❌ ** Tests Optional** : Documentation updates, minor refactoring without behavior changes
13+ 1 . ** Always start from latest main** :
14+ ``` bash
15+ git checkout main
16+ git pull origin main # Ensure you have the latest changes
17+ git checkout -b feature/your-branch-name # Create new branch
18+ ```
1619
17- 2 . ** TDD Workflow ** (when tests are required) :
20+ 2 . ** Verify clean state ** :
1821 ``` bash
19- # 1. Write failing tests FIRST
20- python -m pytest tests/test_new_feature.py -v # Should fail
21-
22- # 2. Write minimal code to make tests pass
23- # Edit source files...
24-
25- # 3. Run tests to verify they pass
26- python -m pytest tests/test_new_feature.py -v # Should pass
27-
28- # 4. Refactor and repeat
22+ git status # Should show clean working directory
2923 ```
3024
31- 3 . ** Pre-commit Requirements** :
32- - ** ALWAYS run all tests locally** before committing any changes
33- - ** ALL tests must pass** before pushing to remote
34- - ** Format code** with Black before committing
35- - ** Work incrementally** with small, atomic commits
25+ 3 . ** Never carry over unrelated changes** from previous work
26+ 4 . ** Each task gets its own focused branch** from latest main
27+
28+ ### 🎯 Focused Development Rules
29+
30+ ** ONLY make changes directly related to the specific task/issue:**
31+
32+ - ✅ ** DO** : Add/modify code that solves the specific issue
33+ - ✅ ** DO** : Add focused tests for the specific functionality
34+ - ✅ ** DO** : Update documentation if specifically required
35+ - ❌ ** DON'T** : Include formatting changes to unrelated files
36+ - ❌ ** DON'T** : Add comprehensive test suites unless specifically requested
37+ - ❌ ** DON'T** : Refactor unrelated code
38+ - ❌ ** DON'T** : Include previous work from other branches
39+
40+ ### 📋 Task Assessment Phase
3641
37- 4 . ** Incremental Development** :
38- - Make small, focused changes
39- - Commit frequently with descriptive messages
40- - Each commit should represent a working state
41- - Push regularly to avoid conflicts
42+ Before writing any code, determine scope:
4243
43- ### Mandatory Test Execution
44+ 1 . ** Read the issue/task carefully** - understand exact requirements
45+ 2 . ** Identify minimal changes needed** - what files need modification?
46+ 3 . ** Plan focused tests** - only for the specific functionality being added
47+ 4 . ** Avoid scope creep** - resist urge to "improve" unrelated code
48+
49+ ### 🧪 Test-Driven Development (TDD) Approach
50+
51+ When tests are required for the specific task:
4452
4553``` bash
46- # Before ANY commit, run:
47- python -m pytest tests/ -v # All tests must pass
48- black src/ tests/ # Format code
49- python -m pytest --cov=src tests/ # Verify coverage
54+ # 1. Write failing tests FIRST (focused on the issue)
55+ python -m pytest tests/test_specific_issue.py -v # Should fail
56+
57+ # 2. Write minimal code to make tests pass
58+ # Edit ONLY files needed for the specific issue
59+
60+ # 3. Run tests to verify they pass
61+ python -m pytest tests/test_specific_issue.py -v # Should pass
62+
63+ # 4. Refactor if needed, but stay focused
5064```
5165
52- ** ⚠️ Never commit or push if tests are failing or not written for new functionality.**
66+ ### 📝 Commit Standards
67+
68+ ** Each commit should be atomic and focused:**
69+
70+ ``` bash
71+ # Format only the files you changed
72+ black src/specific_file.py tests/test_specific_file.py
73+
74+ # Run tests to ensure no regressions
75+ python -m pytest tests/ -v
76+
77+ # Commit with descriptive message
78+ git add src/specific_file.py tests/test_specific_file.py
79+ git commit -m " Fix issue #X: Brief description of what was fixed"
80+ ```
81+
82+ ### 🚫 What NOT to Include in PRs
83+
84+ - Formatting changes to files you didn't functionally modify
85+ - Test files not related to your specific task
86+ - Refactoring of unrelated code
87+ - Documentation updates not specifically requested
88+ - Code from previous branches or incomplete work
89+
90+ ### ✅ PR Quality Checklist
91+
92+ Before creating PR, verify:
93+ - [ ] Branch created from latest main
94+ - [ ] Only files related to the specific issue are modified
95+ - [ ] Tests pass and are focused on the issue
96+ - [ ] Commit messages are clear and specific
97+ - [ ] No unrelated formatting or code changes
98+ - [ ] PR description clearly links to the issue being solved
99+
100+ ** ⚠️ PRs with unrelated changes will be rejected and must be redone.**
53101
54102## Project Overview
55103
0 commit comments