feat: Add API to delete coding-style.md #82
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
delete_coding_style()method toFileOperationsMixinfor deleting coding-style.mdDELETE /coding-stylewithDeleteCodingStyleResponsemodeldelete_coding_stylewithDeleteCodingStyleResultresponse modelImplementation Details
This feature allows users to delete the generated coding-style.md file via both REST API and MCP tools. The file is automatically regenerated on the next planning phase if needed.
Test Results
All tests passing:
Related Files
src/claude_task_master/core/state_file_ops.py- Core delete methodsrc/claude_task_master/mcp/tools.py- MCP tool implementationsrc/claude_task_master/mcp/server.py- MCP tool wrappersrc/claude_task_master/api/models.py- REST API response modelsrc/claude_task_master/api/routes.py- REST API endpointtests/core/test_state_file_ops.py- Core teststests/mcp/test_tools_coding_style.py- MCP teststests/api/test_routes_status.py- API testsCLAUDE.md- Documentation🤖 Generated with Claude Task Master
Greptile Overview
Greptile Summary
Added API to delete the
coding-style.mdfile from the state directory, allowing users to force regeneration when project conventions change.Key Changes:
delete_coding_style()method inFileOperationsMixinreturns boolean indicating if file existedDELETE /coding-styleendpoint with proper error handling (404 for no task, 500 for errors)delete_coding_stylewithDeleteCodingStyleResultresponse modelImplementation:
The implementation follows existing patterns in the codebase with proper separation of concerns. The core method is simple and safe (just file deletion), the MCP tool wraps it with proper error handling, and the API endpoint follows REST conventions. The response models differ between API (
file_existed) and MCP (deleted) but both convey the same information. All tests pass including ruff, mypy, and 4551 existing tests.Confidence Score: 5/5
Important Files Changed
delete_coding_style()method that removes coding-style.md file and returns boolean statusDeleteCodingStyleResultmodel anddelete_coding_style()MCP tool with proper error handlingDELETE /coding-styleendpoint with proper 404/500 error handling and response modelsSequence Diagram
sequenceDiagram participant User participant API as REST API/MCP participant StateManager participant FileSystem User->>API: DELETE /coding-style OR delete_coding_style() API->>StateManager: Check if state exists alt No active task StateManager-->>API: exists() = False API-->>User: 404 Error (REST) / Error Response (MCP) else Active task exists StateManager-->>API: exists() = True API->>StateManager: delete_coding_style() StateManager->>FileSystem: Check if coding-style.md exists alt File exists FileSystem-->>StateManager: File found StateManager->>FileSystem: unlink() - delete file FileSystem-->>StateManager: Deleted StateManager-->>API: Return True API-->>User: Success (file_existed/deleted=True) else File does not exist FileSystem-->>StateManager: File not found StateManager-->>API: Return False API-->>User: Success (file_existed/deleted=False) end end Note over User,FileSystem: File regenerated automatically on next planning phaseContext used:
dashboard- CLAUDE.md (source)