claude-task-master 0.1.7__tar.gz → 0.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/PKG-INFO +1 -1
  2. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/pyproject.toml +1 -1
  3. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/__init__.py +1 -1
  4. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/agent.py +25 -2
  5. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/agent_phases.py +53 -3
  6. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/orchestrator.py +4 -0
  7. claude_task_master-0.1.8/src/claude_task_master/core/planner.py +84 -0
  8. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/prompts.py +8 -0
  9. claude_task_master-0.1.8/src/claude_task_master/core/prompts_coding_style.py +160 -0
  10. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/prompts_planning.py +30 -6
  11. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/prompts_working.py +36 -13
  12. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/state_backup.py +11 -3
  13. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/state_file_ops.py +20 -0
  14. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/task_runner.py +8 -0
  15. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master.egg-info/PKG-INFO +1 -1
  16. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master.egg-info/SOURCES.txt +1 -0
  17. claude_task_master-0.1.7/src/claude_task_master/core/planner.py +0 -46
  18. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/README.md +0 -0
  19. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/setup.cfg +0 -0
  20. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/__init__.py +0 -0
  21. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/models.py +0 -0
  22. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/routes.py +0 -0
  23. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/routes_config.py +0 -0
  24. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/routes_control.py +0 -0
  25. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/routes_repo.py +0 -0
  26. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/routes_webhooks.py +0 -0
  27. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/api/server.py +0 -0
  28. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/auth/__init__.py +0 -0
  29. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/auth/middleware.py +0 -0
  30. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/auth/password.py +0 -0
  31. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/bin/claudetm +0 -0
  32. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli.py +0 -0
  33. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/__init__.py +0 -0
  34. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/ci_helpers.py +0 -0
  35. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/config.py +0 -0
  36. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/control.py +0 -0
  37. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/fix_pr.py +0 -0
  38. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/fix_session.py +0 -0
  39. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/github.py +0 -0
  40. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/info.py +0 -0
  41. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/mailbox.py +0 -0
  42. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/cli_commands/workflow.py +0 -0
  43. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/__init__.py +0 -0
  44. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/agent_exceptions.py +0 -0
  45. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/agent_message.py +0 -0
  46. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/agent_models.py +0 -0
  47. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/agent_query.py +0 -0
  48. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/checkpoint.py +0 -0
  49. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/circuit_breaker.py +0 -0
  50. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/config.py +0 -0
  51. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/config_loader.py +0 -0
  52. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/console.py +0 -0
  53. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/context_accumulator.py +0 -0
  54. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/control.py +0 -0
  55. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/conversation.py +0 -0
  56. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/credentials.py +0 -0
  57. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/hooks.py +0 -0
  58. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/key_listener.py +0 -0
  59. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/logger.py +0 -0
  60. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/parallel.py +0 -0
  61. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/plan_updater.py +0 -0
  62. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/pr_context.py +0 -0
  63. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/progress_tracker.py +0 -0
  64. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/prompts_base.py +0 -0
  65. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/prompts_plan_update.py +0 -0
  66. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/prompts_verification.py +0 -0
  67. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/rate_limit.py +0 -0
  68. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/shutdown.py +0 -0
  69. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/state.py +0 -0
  70. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/state_exceptions.py +0 -0
  71. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/state_pr.py +0 -0
  72. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/state_recovery.py +0 -0
  73. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/subagents.py +0 -0
  74. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/task_group.py +0 -0
  75. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/core/workflow_stages.py +0 -0
  76. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/github/__init__.py +0 -0
  77. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/github/client.py +0 -0
  78. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/github/client_ci.py +0 -0
  79. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/github/client_pr.py +0 -0
  80. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/github/exceptions.py +0 -0
  81. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/github/pr_cycle.py +0 -0
  82. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mailbox/__init__.py +0 -0
  83. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mailbox/merger.py +0 -0
  84. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mailbox/models.py +0 -0
  85. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mailbox/storage.py +0 -0
  86. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mcp/__init__.py +0 -0
  87. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mcp/auth.py +0 -0
  88. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mcp/server.py +0 -0
  89. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/mcp/tools.py +0 -0
  90. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/server.py +0 -0
  91. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/utils/__init__.py +0 -0
  92. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/utils/debug_claude_md.py +0 -0
  93. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/utils/doctor.py +0 -0
  94. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/webhooks/__init__.py +0 -0
  95. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/webhooks/client.py +0 -0
  96. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/webhooks/config.py +0 -0
  97. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/webhooks/events.py +0 -0
  98. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master/wrapper.py +0 -0
  99. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master.egg-info/dependency_links.txt +0 -0
  100. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master.egg-info/entry_points.txt +0 -0
  101. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master.egg-info/requires.txt +0 -0
  102. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/src/claude_task_master.egg-info/top_level.txt +0 -0
  103. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/tests/test_server.py +0 -0
  104. {claude_task_master-0.1.7 → claude_task_master-0.1.8}/tests/test_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: claude-task-master
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Autonomous task orchestration system that keeps Claude working until a goal is achieved
5
5
  Author: Claude Task Master Team
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "claude-task-master"
7
- version = "0.1.7"
7
+ version = "0.1.8"
8
8
  description = "Autonomous task orchestration system that keeps Claude working until a goal is achieved"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -3,5 +3,5 @@
3
3
  Uses Claude Agent SDK to keep Claude working until a goal is achieved.
4
4
  """
5
5
 
6
- __version__ = "0.1.7"
6
+ __version__ = "0.1.8"
7
7
  __all__ = ["__version__"]
@@ -170,15 +170,35 @@ class AgentWrapper:
170
170
  ValueError("query must be callable"),
171
171
  )
172
172
 
173
- def run_planning_phase(self, goal: str, context: str = "") -> dict[str, Any]:
173
+ def run_planning_phase(
174
+ self, goal: str, context: str = "", coding_style: str | None = None
175
+ ) -> dict[str, Any]:
174
176
  """Run planning phase with read-only tools.
175
177
 
176
178
  Always uses Opus (smartest model) for planning to ensure
177
179
  high-quality task breakdown and complexity classification.
178
180
 
181
+ Args:
182
+ goal: The goal to plan for.
183
+ context: Additional context for planning.
184
+ coding_style: Optional coding style guide to inject into prompt.
185
+
186
+ Delegates to AgentPhaseExecutor for implementation.
187
+ """
188
+ return self._phase_executor.run_planning_phase(goal, context, coding_style)
189
+
190
+ def generate_coding_style(self) -> dict[str, Any]:
191
+ """Generate a coding style guide by analyzing the codebase.
192
+
193
+ Analyzes CLAUDE.md, convention files, and codebase to create a
194
+ concise coding style guide with workflow and conventions.
195
+
196
+ Returns:
197
+ Dict with 'coding_style' and 'raw_output' keys.
198
+
179
199
  Delegates to AgentPhaseExecutor for implementation.
180
200
  """
181
- return self._phase_executor.run_planning_phase(goal, context)
201
+ return self._phase_executor.generate_coding_style()
182
202
 
183
203
  def run_work_session(
184
204
  self,
@@ -190,6 +210,7 @@ class AgentWrapper:
190
210
  create_pr: bool = True,
191
211
  pr_group_info: dict | None = None,
192
212
  target_branch: str = "main",
213
+ coding_style: str | None = None,
193
214
  ) -> dict[str, Any]:
194
215
  """Run a work session with full tools.
195
216
 
@@ -203,6 +224,7 @@ class AgentWrapper:
203
224
  create_pr: If True, instruct agent to create PR. If False, commit only.
204
225
  pr_group_info: Optional dict with PR group context (name, completed_tasks, etc).
205
226
  target_branch: The target branch for rebasing (default: "main").
227
+ coding_style: Optional coding style guide to inject into prompt.
206
228
 
207
229
  Returns:
208
230
  Dict with 'output', 'success', and 'model_used' keys.
@@ -218,6 +240,7 @@ class AgentWrapper:
218
240
  create_pr=create_pr,
219
241
  pr_group_info=pr_group_info,
220
242
  target_branch=target_branch,
243
+ coding_style=coding_style,
221
244
  )
222
245
 
223
246
  def verify_success_criteria(self, criteria: str, context: str = "") -> dict[str, Any]:
@@ -13,7 +13,13 @@ from typing import TYPE_CHECKING, Any, TypeVar
13
13
 
14
14
  from . import console
15
15
  from .agent_models import ModelType, get_tools_for_phase
16
- from .prompts import build_planning_prompt, build_verification_prompt, build_work_prompt
16
+ from .prompts import (
17
+ build_coding_style_prompt,
18
+ build_planning_prompt,
19
+ build_verification_prompt,
20
+ build_work_prompt,
21
+ extract_coding_style,
22
+ )
17
23
 
18
24
  if TYPE_CHECKING:
19
25
  from .agent_query import AgentQueryExecutor
@@ -104,7 +110,9 @@ class AgentPhaseExecutor:
104
110
  self.get_agents_func = get_agents_func
105
111
  self.process_message_func = process_message_func
106
112
 
107
- def run_planning_phase(self, goal: str, context: str = "") -> dict[str, Any]:
113
+ def run_planning_phase(
114
+ self, goal: str, context: str = "", coding_style: str | None = None
115
+ ) -> dict[str, Any]:
108
116
  """Run planning phase with read-only tools.
109
117
 
110
118
  Always uses Opus (smartest model) for planning to ensure
@@ -113,12 +121,17 @@ class AgentPhaseExecutor:
113
121
  Args:
114
122
  goal: The goal to plan for.
115
123
  context: Additional context for planning.
124
+ coding_style: Optional coding style guide to inject into prompt.
116
125
 
117
126
  Returns:
118
127
  Dict with 'plan', 'criteria', and 'raw_output' keys.
119
128
  """
120
129
  # Build prompt for planning
121
- prompt = build_planning_prompt(goal=goal, context=context if context else None)
130
+ prompt = build_planning_prompt(
131
+ goal=goal,
132
+ context=context if context else None,
133
+ coding_style=coding_style,
134
+ )
122
135
 
123
136
  # Always use Opus for planning (smartest model)
124
137
  console.info("Planning with Opus (smartest model)...")
@@ -152,6 +165,7 @@ class AgentPhaseExecutor:
152
165
  create_pr: bool = True,
153
166
  pr_group_info: dict | None = None,
154
167
  target_branch: str = "main",
168
+ coding_style: str | None = None,
155
169
  ) -> dict[str, Any]:
156
170
  """Run a work session with full tools.
157
171
 
@@ -165,6 +179,7 @@ class AgentPhaseExecutor:
165
179
  create_pr: If True, instruct agent to create PR. If False, commit only.
166
180
  pr_group_info: Optional dict with PR group context (name, completed_tasks, etc).
167
181
  target_branch: The target branch for rebasing (default: "main").
182
+ coding_style: Optional coding style guide to inject into prompt.
168
183
 
169
184
  Returns:
170
185
  Dict with 'output', 'success', and 'model_used' keys.
@@ -178,6 +193,7 @@ class AgentPhaseExecutor:
178
193
  create_pr=create_pr,
179
194
  pr_group_info=pr_group_info,
180
195
  target_branch=target_branch,
196
+ coding_style=coding_style,
181
197
  )
182
198
 
183
199
  # Run async query with optional model override
@@ -328,3 +344,37 @@ class AgentPhaseExecutor:
328
344
 
329
345
  # Default criteria if none specified
330
346
  return "All tasks in the task list are completed successfully."
347
+
348
+ def generate_coding_style(self) -> dict[str, Any]:
349
+ """Generate a coding style guide by analyzing the codebase.
350
+
351
+ Analyzes CLAUDE.md, convention files, and sample source files
352
+ to create a concise coding style guide.
353
+
354
+ Returns:
355
+ Dict with 'coding_style' and 'raw_output' keys.
356
+ """
357
+ # Build prompt for coding style generation
358
+ prompt = build_coding_style_prompt()
359
+
360
+ console.info("Generating coding style guide with Opus...")
361
+
362
+ # Run with planning tools (read-only) and Opus for quality
363
+ result = run_async_with_cleanup(
364
+ self.query_executor.run_query(
365
+ prompt=prompt,
366
+ tools=self.get_tools_for_phase("planning"),
367
+ model_override=ModelType.OPUS, # Use Opus for quality
368
+ get_model_name_func=self.get_model_name_func,
369
+ get_agents_func=self.get_agents_func,
370
+ process_message_func=self.process_message_func,
371
+ )
372
+ )
373
+
374
+ # Extract the coding style content
375
+ coding_style = extract_coding_style(result)
376
+
377
+ return {
378
+ "coding_style": coding_style,
379
+ "raw_output": result,
380
+ }
@@ -1337,11 +1337,15 @@ After fixing everything, run the tests again to confirm they pass.
1337
1337
  After completing your fixes, end with: TASK COMPLETE"""
1338
1338
 
1339
1339
  try:
1340
+ # Load coding style for consistent style in fix session
1341
+ coding_style = self.state_manager.load_coding_style()
1342
+
1340
1343
  self.agent.run_work_session(
1341
1344
  task_description=task_description,
1342
1345
  context=context,
1343
1346
  model_override=ModelType.OPUS,
1344
1347
  create_pr=True,
1348
+ coding_style=coding_style,
1345
1349
  )
1346
1350
  state.session_count += 1
1347
1351
  self.state_manager.save_state(state)
@@ -0,0 +1,84 @@
1
+ """Planner - Orchestrates initial planning phase (read-only tools)."""
2
+
3
+ from typing import Any
4
+
5
+ from . import console
6
+ from .agent import AgentWrapper
7
+ from .state import StateManager
8
+
9
+
10
+ class Planner:
11
+ """Handles the initial planning phase."""
12
+
13
+ def __init__(self, agent: AgentWrapper, state_manager: StateManager):
14
+ """Initialize planner."""
15
+ self.agent = agent
16
+ self.state_manager = state_manager
17
+
18
+ def ensure_coding_style(self) -> str | None:
19
+ """Ensure coding style guide exists, generating it if needed.
20
+
21
+ Checks if coding-style.md exists. If not, generates it by analyzing
22
+ CLAUDE.md and convention files in the codebase.
23
+
24
+ Returns:
25
+ The coding style guide content, or None if generation failed.
26
+ """
27
+ # Check if coding style already exists
28
+ coding_style = self.state_manager.load_coding_style()
29
+ if coding_style:
30
+ console.info("Using existing coding style guide")
31
+ return coding_style
32
+
33
+ # Generate coding style by analyzing codebase
34
+ console.info("Generating coding style guide from codebase...")
35
+ result = self.agent.generate_coding_style()
36
+
37
+ coding_style_content: str = result.get("coding_style", "")
38
+ if coding_style_content:
39
+ self.state_manager.save_coding_style(coding_style_content)
40
+ console.success("Coding style guide generated and saved")
41
+ return coding_style_content
42
+
43
+ console.warning("Could not generate coding style guide")
44
+ return None
45
+
46
+ def create_plan(self, goal: str) -> dict[str, Any]:
47
+ """Create initial task plan using read-only tools.
48
+
49
+ First generates coding style guide if it doesn't exist, then
50
+ runs planning phase with the coding style injected.
51
+ """
52
+ # Ensure coding style exists (generate if needed)
53
+ coding_style = self.ensure_coding_style()
54
+
55
+ # Load any existing context
56
+ context = self.state_manager.load_context()
57
+
58
+ # Run planning phase with Claude (with coding style)
59
+ result = self.agent.run_planning_phase(
60
+ goal=goal, context=context, coding_style=coding_style
61
+ )
62
+
63
+ # Extract plan and criteria from result
64
+ plan = result.get("plan", "")
65
+ criteria = result.get("criteria", "")
66
+
67
+ # Save to state
68
+ if plan:
69
+ self.state_manager.save_plan(plan)
70
+ if criteria:
71
+ self.state_manager.save_criteria(criteria)
72
+
73
+ return result
74
+
75
+ def update_plan_progress(self, task_index: int, completed: bool) -> None:
76
+ """Update task completion status in plan."""
77
+ plan = self.state_manager.load_plan()
78
+ if not plan:
79
+ return
80
+
81
+ # TODO: Parse markdown checkboxes and update status
82
+ # This will require parsing the plan.md file and toggling checkboxes
83
+
84
+ self.state_manager.save_plan(plan)
@@ -1,6 +1,7 @@
1
1
  """Prompt Templates - Centralized, maintainable prompt generation.
2
2
 
3
3
  This module provides structured prompt templates for different agent phases:
4
+ - Coding Style: Generate concise coding style guide from codebase analysis
4
5
  - Planning: Initial codebase analysis and task creation
5
6
  - Plan Update: Modifying existing plans based on change requests
6
7
  - Working: Task execution with verification
@@ -12,6 +13,7 @@ All prompts are designed to be concise, structured, and token-efficient.
12
13
  This module re-exports all prompt functions for backward compatibility.
13
14
  The actual implementations are in:
14
15
  - prompts_base.py: PromptSection, PromptBuilder
16
+ - prompts_coding_style.py: build_coding_style_prompt, extract_coding_style
15
17
  - prompts_planning.py: build_planning_prompt
16
18
  - prompts_plan_update.py: build_plan_update_prompt
17
19
  - prompts_working.py: build_work_prompt
@@ -24,6 +26,9 @@ from __future__ import annotations
24
26
  # Re-export base classes
25
27
  from .prompts_base import PromptBuilder, PromptSection
26
28
 
29
+ # Re-export coding style prompts
30
+ from .prompts_coding_style import build_coding_style_prompt, extract_coding_style
31
+
27
32
  # Re-export planning prompts
28
33
  from .prompts_plan_update import build_plan_update_prompt
29
34
  from .prompts_planning import build_planning_prompt
@@ -43,6 +48,9 @@ __all__ = [
43
48
  # Base classes
44
49
  "PromptSection",
45
50
  "PromptBuilder",
51
+ # Coding Style
52
+ "build_coding_style_prompt",
53
+ "extract_coding_style",
46
54
  # Planning
47
55
  "build_planning_prompt",
48
56
  "build_plan_update_prompt",
@@ -0,0 +1,160 @@
1
+ """Coding Style Generation Prompt for Claude Task Master.
2
+
3
+ This module contains the prompt for generating a concise coding style guide
4
+ by analyzing CLAUDE.md and convention files. The generated guide captures:
5
+ - Coding workflow (TDD, development process)
6
+ - Code style conventions (naming, formatting)
7
+ - Project-specific requirements
8
+
9
+ The guide is saved to coding-style.md and injected into planning and work
10
+ prompts to save tokens while ensuring consistent code quality.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from .prompts_base import PromptBuilder
16
+
17
+
18
+ def build_coding_style_prompt() -> str:
19
+ """Build the prompt for generating a coding style guide.
20
+
21
+ This prompt instructs Claude to analyze CLAUDE.md and convention files
22
+ to create a concise coding style guide that captures the project's
23
+ workflow (TDD, development process) and code conventions.
24
+
25
+ Returns:
26
+ Complete coding style generation prompt.
27
+ """
28
+ builder = PromptBuilder(
29
+ intro="""You are analyzing a codebase to extract its coding workflow and style guide.
30
+
31
+ Your mission: **Create a CONCISE coding guide (under 600 words).**
32
+
33
+ Focus on extracting:
34
+ 1. **Development workflow** (TDD, test-first, iteration patterns)
35
+ 2. **Code conventions** (naming, formatting, imports)
36
+ 3. **Project-specific requirements** (from CLAUDE.md)
37
+
38
+ This guide will be injected into every coding task, so keep it SHORT and ACTIONABLE.
39
+
40
+ ## TOOL RESTRICTIONS (MANDATORY)
41
+
42
+ **ALLOWED TOOLS (use ONLY these):**
43
+ - `Read` - Read files to understand patterns
44
+ - `Glob` - Find files by pattern
45
+ - `Grep` - Search for code patterns
46
+ - `Bash` - Run commands (check configs, linters, etc.)
47
+
48
+ **FORBIDDEN TOOLS (NEVER use):**
49
+ - `Write` - Do NOT write any files
50
+ - `Edit` - Do NOT edit any files
51
+ - `Task` - Do NOT launch any agents"""
52
+ )
53
+
54
+ builder.add_section(
55
+ "Step 1: Read CLAUDE.md (PRIORITY)",
56
+ """**Start by reading `CLAUDE.md` at the repository root.**
57
+
58
+ This file contains the project's coding requirements and workflow instructions.
59
+ Extract:
60
+ - Development workflow (TDD, test-driven, iteration patterns)
61
+ - Code quality requirements
62
+ - Testing approach (test first? mock patterns?)
63
+ - Any specific coding rules or constraints
64
+
65
+ Also check these if CLAUDE.md doesn't exist:
66
+ - `.claude/instructions.md`
67
+ - `CONTRIBUTING.md`
68
+ - `.cursorrules`, `.github/copilot-instructions.md`""",
69
+ )
70
+
71
+ builder.add_section(
72
+ "Step 2: Check Configs",
73
+ """Quickly scan linter/formatter configs for conventions:
74
+
75
+ - Python: `pyproject.toml` [tool.ruff], `ruff.toml`
76
+ - JS/TS: `.eslintrc`, `.prettierrc`, `biome.json`
77
+ - General: `.editorconfig`
78
+
79
+ Note line length, quote style, import ordering rules.""",
80
+ )
81
+
82
+ builder.add_section(
83
+ "Step 3: Generate Coding Guide",
84
+ """Create a CONCISE guide with these sections (skip if not applicable):
85
+
86
+ ```markdown
87
+ # Coding Style
88
+
89
+ ## Workflow
90
+ - [TDD approach? Test-first? Iteration pattern?]
91
+ - [Required checks before commit: tests, lint, types?]
92
+
93
+ ## Code Style
94
+ - [Naming: snake_case, camelCase, etc.]
95
+ - [Formatting: line length, quotes, indentation]
96
+ - [Imports: ordering, grouping]
97
+
98
+ ## Types
99
+ - [Type annotations required? Strictness level?]
100
+
101
+ ## Testing
102
+ - [Test file naming, location]
103
+ - [Assertion style, mock patterns]
104
+ - [Coverage requirements?]
105
+
106
+ ## Error Handling
107
+ - [Exception patterns, logging approach]
108
+
109
+ ## Project-Specific
110
+ - [Any unique requirements from CLAUDE.md]
111
+ ```
112
+
113
+ **Rules:**
114
+ - Each section: 2-4 bullet points MAX
115
+ - Be SPECIFIC and ACTIONABLE: "Run `pytest` before commit" not "Test your code"
116
+ - Capture the WORKFLOW, not just style
117
+ - Include actual commands where relevant
118
+ - Total guide: under 600 words""",
119
+ )
120
+
121
+ builder.add_section(
122
+ "Output Format",
123
+ """Output ONLY the coding guide in markdown format.
124
+
125
+ Start with `# Coding Style` and include only relevant sections.
126
+
127
+ Do NOT include explanations or meta-commentary - just the guide itself.
128
+
129
+ End with:
130
+ ```
131
+ CODING_STYLE_COMPLETE
132
+ ```""",
133
+ )
134
+
135
+ return builder.build()
136
+
137
+
138
+ def extract_coding_style(result: str) -> str:
139
+ """Extract the coding style guide from the generation result.
140
+
141
+ Args:
142
+ result: The raw output from the coding style generation.
143
+
144
+ Returns:
145
+ The extracted coding style guide content.
146
+ """
147
+ # Remove the completion marker if present
148
+ content = result.replace("CODING_STYLE_COMPLETE", "").strip()
149
+
150
+ # If it starts with markdown header, return as-is
151
+ if content.startswith("# Coding Style") or content.startswith("# coding style"):
152
+ return content
153
+
154
+ # Try to find the coding style section
155
+ if "# Coding Style" in content:
156
+ idx = content.index("# Coding Style")
157
+ return content[idx:].strip()
158
+
159
+ # Fallback: wrap the content
160
+ return f"# Coding Style\n\n{content}"
@@ -9,12 +9,15 @@ from __future__ import annotations
9
9
  from .prompts_base import PromptBuilder
10
10
 
11
11
 
12
- def build_planning_prompt(goal: str, context: str | None = None) -> str:
12
+ def build_planning_prompt(
13
+ goal: str, context: str | None = None, coding_style: str | None = None
14
+ ) -> str:
13
15
  """Build the planning phase prompt.
14
16
 
15
17
  Args:
16
18
  goal: The user's goal to achieve.
17
19
  context: Optional accumulated context from previous sessions.
20
+ coding_style: Optional coding style guide to inject.
18
21
 
19
22
  Returns:
20
23
  Complete planning prompt.
@@ -65,16 +68,37 @@ You just need to OUTPUT the plan as TEXT in your response.
65
68
  if context:
66
69
  builder.add_section("Previous Context", context.strip())
67
70
 
71
+ # Coding style section if available (generated from codebase analysis)
72
+ if coding_style:
73
+ builder.add_section(
74
+ "Project Coding Style",
75
+ f"""The following coding style guide was extracted from this codebase.
76
+ **Tasks you create MUST respect these conventions.**
77
+
78
+ {coding_style.strip()}""",
79
+ )
80
+
68
81
  # Exploration phase - READ ONLY
69
82
  builder.add_section(
70
83
  "Step 1: Explore Codebase (READ ONLY)",
71
84
  """Thoroughly analyze the codebase using READ-ONLY operations:
72
- 1. **Read** key files (README, configs, main modules)
73
- 2. **Glob** to find patterns (`**/*.py`, `src/**/*.ts`)
74
- 3. **Grep** for specific code (class definitions, imports)
75
- 4. **Identify** tests, CI config, and coding standards
76
85
 
77
- Understand the architecture before creating tasks.""",
86
+ **CRITICAL: Read Project Conventions FIRST**
87
+ 1. **Read `CLAUDE.md`** (if exists) - Contains coding requirements, project instructions,
88
+ and conventions that MUST be followed. This file defines how code should be written.
89
+ 2. Also check: `.claude/instructions.md`, `CONTRIBUTING.md`, `.cursorrules`, `.github/copilot-instructions.md`
90
+
91
+ **Then explore the codebase:**
92
+ 3. **Read** key files (README, configs, main modules)
93
+ 4. **Glob** to find patterns (`**/*.py`, `src/**/*.ts`)
94
+ 5. **Grep** for specific code (class definitions, imports)
95
+ 6. **Identify** tests, CI config, and existing code patterns
96
+
97
+ **Remember:** Any coding requirements found in `CLAUDE.md` or similar convention files
98
+ MUST be respected when creating tasks. Include relevant requirements in task descriptions
99
+ so the working phase follows project standards.
100
+
101
+ Understand the architecture AND coding standards before creating tasks.""",
78
102
  )
79
103
 
80
104
  # Task creation phase - organized by PR
@@ -18,6 +18,7 @@ def build_work_prompt(
18
18
  create_pr: bool = True,
19
19
  pr_group_info: dict | None = None,
20
20
  target_branch: str = "main",
21
+ coding_style: str | None = None,
21
22
  ) -> str:
22
23
  """Build the work session prompt.
23
24
 
@@ -33,6 +34,7 @@ def build_work_prompt(
33
34
  - completed_tasks: List of completed task descriptions in this group
34
35
  - remaining_tasks: Number of tasks remaining after current
35
36
  target_branch: The target branch for rebasing (default: "main").
37
+ coding_style: Optional coding style guide to follow.
36
38
 
37
39
  Returns:
38
40
  Complete work session prompt.
@@ -86,6 +88,15 @@ def build_work_prompt(
86
88
  if context:
87
89
  builder.add_section("Context", context.strip())
88
90
 
91
+ # Coding style section - concise guide to follow
92
+ if coding_style:
93
+ builder.add_section(
94
+ "Coding Style (MUST FOLLOW)",
95
+ f"""Follow these project conventions:
96
+
97
+ {coding_style.strip()}""",
98
+ )
99
+
89
100
  # File hints
90
101
  if file_hints:
91
102
  files_list = "\n".join(f"- `{f}`" for f in file_hints[:10]) # Limit to 10
@@ -194,12 +205,18 @@ git status
194
205
  - Check existing patterns
195
206
  - Identify tests to run
196
207
 
197
- **3. Make changes**
208
+ **3. Read project conventions FIRST**
209
+ - Check for `CLAUDE.md` at the repository root - it contains coding requirements
210
+ - Also check: `.claude/instructions.md`, `CONTRIBUTING.md`, `.cursorrules`
211
+ - These files define project-specific coding standards you MUST follow
212
+
213
+ **4. Make changes**
198
214
  - Edit existing files, Write new files
199
- - Follow project coding style
215
+ - Follow project coding style from `CLAUDE.md` and conventions files
200
216
  - Stay focused on current task
217
+ - Match existing patterns and code style in the codebase
201
218
 
202
- **4. Verify work**
219
+ **5. Verify work**
203
220
  ```bash
204
221
  # Common verification commands
205
222
  pytest # Python tests
@@ -208,7 +225,7 @@ ruff check . && mypy . # Python lint/types
208
225
  eslint . && tsc # JS lint/types
209
226
  ```
210
227
 
211
- **5. Commit properly**
228
+ **6. Commit properly**
212
229
  ```bash
213
230
  git add -A && git commit -m "$(cat <<'EOF'
214
231
  type: Brief description (50 chars)
@@ -224,7 +241,7 @@ EOF
224
241
  **Note:** The `.claude-task-master/` directory is automatically gitignored - it contains
225
242
  orchestrator state files that should never be committed.
226
243
 
227
- **6. Rebase onto {target_branch} BEFORE pushing** (CRITICAL!)
244
+ **7. Rebase onto {target_branch} BEFORE pushing** (CRITICAL!)
228
245
  ```bash
229
246
  git fetch origin {target_branch}
230
247
  git rebase origin/{target_branch}
@@ -249,7 +266,7 @@ while you were working. You MUST rebase before pushing.
249
266
  - **Package versions**: Usually take the newer version from {target_branch}
250
267
  - **Config files**: Merge both sets of changes carefully
251
268
 
252
- **7. Push and Create PR** (REQUIRED - DO NOT SKIP!)
269
+ **8. Push and Create PR** (REQUIRED - DO NOT SKIP!)
253
270
  ```bash
254
271
  git push -u origin HEAD
255
272
  gh pr create --title "type: description" --body "..." --label "claudetm"
@@ -269,7 +286,7 @@ If label doesn't exist, create it and retry.
269
286
 
270
287
  **The orchestrator handles CI/reviews/merge automatically.**
271
288
 
272
- **8. Log File Best Practices**
289
+ **9. Log File Best Practices**
273
290
  - For log/progress files, use APPEND mode (don't read entire file)
274
291
  - Example: `echo "message" >> progress.md` instead of Read + Write
275
292
  - This avoids context bloat from reading large log files"""
@@ -290,12 +307,18 @@ git status
290
307
  - Check existing patterns
291
308
  - Identify tests to run
292
309
 
293
- **3. Make changes**
310
+ **3. Read project conventions FIRST**
311
+ - Check for `CLAUDE.md` at the repository root - it contains coding requirements
312
+ - Also check: `.claude/instructions.md`, `CONTRIBUTING.md`, `.cursorrules`
313
+ - These files define project-specific coding standards you MUST follow
314
+
315
+ **4. Make changes**
294
316
  - Edit existing files, Write new files
295
- - Follow project coding style
317
+ - Follow project coding style from `CLAUDE.md` and conventions files
296
318
  - Stay focused on current task
319
+ - Match existing patterns and code style in the codebase
297
320
 
298
- **4. Verify work**
321
+ **5. Verify work**
299
322
  ```bash
300
323
  # Common verification commands
301
324
  pytest # Python tests
@@ -304,7 +327,7 @@ ruff check . && mypy . # Python lint/types
304
327
  eslint . && tsc # JS lint/types
305
328
  ```
306
329
 
307
- **5. Commit properly**
330
+ **6. Commit properly**
308
331
  ```bash
309
332
  git add -A && git commit -m "$(cat <<'EOF'
310
333
  type: Brief description (50 chars)
@@ -320,13 +343,13 @@ EOF
320
343
  **Note:** The `.claude-task-master/` directory is automatically gitignored - it contains
321
344
  orchestrator state files that should never be committed.
322
345
 
323
- **6. DO NOT create PR yet**
346
+ **7. DO NOT create PR yet**
324
347
 
325
348
  ⚠️ **More tasks remain in this PR group. Just commit, do NOT push or create PR.**
326
349
 
327
350
  The orchestrator will tell you when to create the PR (after all tasks in this group are done).
328
351
 
329
- **7. Log File Best Practices**
352
+ **8. Log File Best Practices**
330
353
  - For log/progress files, use APPEND mode (don't read entire file)
331
354
  - Example: `echo "message" >> progress.md` instead of Read + Write
332
355
  - This avoids context bloat from reading large log files"""
@@ -121,7 +121,11 @@ class BackupRecoveryMixin:
121
121
  return self._create_backup(self.state_file)
122
122
 
123
123
  def cleanup_on_success(self, run_id: str) -> None:
124
- """Clean up all state files except logs on success.
124
+ """Clean up all state files except logs and coding-style.md on success.
125
+
126
+ Preserves:
127
+ - logs/ directory (keeps last 10 log files)
128
+ - coding-style.md (reusable across runs to save tokens)
125
129
 
126
130
  Args:
127
131
  run_id: The run ID (used for identifying which log file belongs to this run).
@@ -129,10 +133,14 @@ class BackupRecoveryMixin:
129
133
  # Release session lock first
130
134
  self.release_session_lock()
131
135
 
132
- # Delete all files in state directory except logs/
136
+ # Files to preserve (besides logs/ directory)
137
+ preserved_files = {"coding-style.md"}
138
+
139
+ # Delete all files in state directory except preserved ones and logs/
133
140
  for item in self.state_dir.iterdir():
134
141
  if item.is_file():
135
- item.unlink()
142
+ if item.name not in preserved_files:
143
+ item.unlink()
136
144
  elif item.is_dir() and item != self.logs_dir:
137
145
  shutil.rmtree(item)
138
146
 
@@ -126,6 +126,26 @@ class FileOperationsMixin:
126
126
  return context_file.read_text()
127
127
  return ""
128
128
 
129
+ def save_coding_style(self, coding_style: str) -> None:
130
+ """Save coding style guide to coding-style.md.
131
+
132
+ Args:
133
+ coding_style: The coding style guide content.
134
+ """
135
+ coding_style_file = self.state_dir / "coding-style.md"
136
+ coding_style_file.write_text(coding_style)
137
+
138
+ def load_coding_style(self) -> str | None:
139
+ """Load coding style guide from coding-style.md.
140
+
141
+ Returns:
142
+ The coding style guide content, or None if not found.
143
+ """
144
+ coding_style_file = self.state_dir / "coding-style.md"
145
+ if coding_style_file.exists():
146
+ return coding_style_file.read_text()
147
+ return None
148
+
129
149
  def _parse_plan_tasks(self, plan: str) -> list[str]:
130
150
  """Parse tasks from plan markdown.
131
151
 
@@ -324,6 +324,13 @@ Please complete this task."""
324
324
  # Set task context for Claude prefix display [claude HH:MM:SS N/M]
325
325
  set_task_context(state.current_task_index + 1, len(tasks))
326
326
 
327
+ # Load coding style guide for token-efficient style injection
328
+ try:
329
+ coding_style = self.state_manager.load_coding_style()
330
+ except Exception as e:
331
+ console.warning(f"Could not load coding style: {e}")
332
+ coding_style = None
333
+
327
334
  # Run work session with model routing based on task complexity
328
335
  try:
329
336
  # Convert string model name to ModelType enum
@@ -339,6 +346,7 @@ Please complete this task."""
339
346
  create_pr=should_create_pr,
340
347
  pr_group_info=pr_group_info,
341
348
  target_branch=target_branch,
349
+ coding_style=coding_style,
342
350
  )
343
351
  except AgentError:
344
352
  if self.logger:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: claude-task-master
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Autonomous task orchestration system that keeps Claude working until a goal is achieved
5
5
  Author: Claude Task Master Team
6
6
  License-Expression: MIT
@@ -59,6 +59,7 @@ src/claude_task_master/core/pr_context.py
59
59
  src/claude_task_master/core/progress_tracker.py
60
60
  src/claude_task_master/core/prompts.py
61
61
  src/claude_task_master/core/prompts_base.py
62
+ src/claude_task_master/core/prompts_coding_style.py
62
63
  src/claude_task_master/core/prompts_plan_update.py
63
64
  src/claude_task_master/core/prompts_planning.py
64
65
  src/claude_task_master/core/prompts_verification.py
@@ -1,46 +0,0 @@
1
- """Planner - Orchestrates initial planning phase (read-only tools)."""
2
-
3
- from typing import Any
4
-
5
- from .agent import AgentWrapper
6
- from .state import StateManager
7
-
8
-
9
- class Planner:
10
- """Handles the initial planning phase."""
11
-
12
- def __init__(self, agent: AgentWrapper, state_manager: StateManager):
13
- """Initialize planner."""
14
- self.agent = agent
15
- self.state_manager = state_manager
16
-
17
- def create_plan(self, goal: str) -> dict[str, Any]:
18
- """Create initial task plan using read-only tools."""
19
- # Load any existing context
20
- context = self.state_manager.load_context()
21
-
22
- # Run planning phase with Claude
23
- result = self.agent.run_planning_phase(goal=goal, context=context)
24
-
25
- # Extract plan and criteria from result
26
- plan = result.get("plan", "")
27
- criteria = result.get("criteria", "")
28
-
29
- # Save to state
30
- if plan:
31
- self.state_manager.save_plan(plan)
32
- if criteria:
33
- self.state_manager.save_criteria(criteria)
34
-
35
- return result
36
-
37
- def update_plan_progress(self, task_index: int, completed: bool) -> None:
38
- """Update task completion status in plan."""
39
- plan = self.state_manager.load_plan()
40
- if not plan:
41
- return
42
-
43
- # TODO: Parse markdown checkboxes and update status
44
- # This will require parsing the plan.md file and toggling checkboxes
45
-
46
- self.state_manager.save_plan(plan)