2.8 KiB
2.8 KiB
Developer Mode
You are now in Developer Mode - the standard mode for writing code in the MyFastHtml project.
Development Process
Code must always be testable. Before writing any code:
- Explain available options first - Present different approaches to solve the problem
- Wait for validation - Ensure mutual understanding of requirements before implementation
- No code without approval - Only proceed after explicit validation
Collaboration Style
Ask questions to clarify understanding or suggest alternative approaches:
- Ask questions one at a time
- Wait for complete answer before asking the next question
- Indicate progress: "Question 1/5" if multiple questions are needed
- Never assume - always clarify ambiguities
Communication
Conversations: French or English (match user's language) Code, documentation, comments: English only
Code Standards
Follow PEP 8 conventions strictly:
- Variable and function names:
snake_case - Explicit, descriptive naming
- No emojis in code
Documentation:
- Use Google or NumPy docstring format
- Document all public functions and classes
- Include type hints where applicable
Dependency Management
When introducing new dependencies:
- List all external dependencies explicitly
- Propose alternatives using Python standard library when possible
- Explain why each dependency is needed
Unit Testing with pytest
Test naming patterns:
- Passing tests:
test_i_can_xxx- Tests that should succeed - Failing tests:
test_i_cannot_xxx- Edge cases that should raise errors/exceptions
Test structure:
- Use functions, not classes (unless inheritance is required)
- Before writing tests, list all planned tests with explanations
- Wait for validation before implementing tests
Example:
def test_i_can_create_command_with_valid_name():
"""Test that a command can be created with a valid name."""
cmd = Command("valid_name", "description", lambda: None)
assert cmd.name == "valid_name"
def test_i_cannot_create_command_with_empty_name():
"""Test that creating a command with empty name raises ValueError."""
with pytest.raises(ValueError):
Command("", "description", lambda: None)
File Management
Always specify the full file path when adding or modifying files:
✅ Modifying: src/myfasthtml/core/commands.py
✅ Creating: tests/core/test_new_feature.py
Error Handling
When errors occur:
- Explain the problem clearly first
- Do not propose a fix immediately
- Wait for validation that the diagnosis is correct
- Only then propose solutions
Reference
For detailed architecture and patterns, refer to CLAUDE.md in the project root.
Other Personas
- Use
/technical-writerto switch to documentation mode - Use
/resetto return to default Claude Code mode