claude-task-master 0.1.5__tar.gz → 0.1.7__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 (102) hide show
  1. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/PKG-INFO +1 -1
  2. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/pyproject.toml +1 -1
  3. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/__init__.py +1 -1
  4. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/bin/claudetm +1 -1
  5. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/agent.py +3 -0
  6. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/agent_phases.py +3 -0
  7. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/config.py +3 -3
  8. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/prompts_planning.py +6 -2
  9. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/prompts_working.py +37 -6
  10. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/task_runner.py +78 -34
  11. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/workflow_stages.py +50 -8
  12. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master.egg-info/PKG-INFO +1 -1
  13. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/README.md +0 -0
  14. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/setup.cfg +0 -0
  15. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/__init__.py +0 -0
  16. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/models.py +0 -0
  17. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/routes.py +0 -0
  18. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/routes_config.py +0 -0
  19. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/routes_control.py +0 -0
  20. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/routes_repo.py +0 -0
  21. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/routes_webhooks.py +0 -0
  22. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/api/server.py +0 -0
  23. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/auth/__init__.py +0 -0
  24. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/auth/middleware.py +0 -0
  25. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/auth/password.py +0 -0
  26. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli.py +0 -0
  27. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/__init__.py +0 -0
  28. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/ci_helpers.py +0 -0
  29. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/config.py +0 -0
  30. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/control.py +0 -0
  31. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/fix_pr.py +0 -0
  32. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/fix_session.py +0 -0
  33. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/github.py +0 -0
  34. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/info.py +0 -0
  35. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/mailbox.py +0 -0
  36. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/cli_commands/workflow.py +0 -0
  37. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/__init__.py +0 -0
  38. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/agent_exceptions.py +0 -0
  39. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/agent_message.py +0 -0
  40. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/agent_models.py +0 -0
  41. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/agent_query.py +0 -0
  42. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/checkpoint.py +0 -0
  43. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/circuit_breaker.py +0 -0
  44. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/config_loader.py +0 -0
  45. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/console.py +0 -0
  46. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/context_accumulator.py +0 -0
  47. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/control.py +0 -0
  48. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/conversation.py +0 -0
  49. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/credentials.py +0 -0
  50. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/hooks.py +0 -0
  51. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/key_listener.py +0 -0
  52. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/logger.py +0 -0
  53. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/orchestrator.py +0 -0
  54. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/parallel.py +0 -0
  55. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/plan_updater.py +0 -0
  56. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/planner.py +0 -0
  57. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/pr_context.py +0 -0
  58. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/progress_tracker.py +0 -0
  59. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/prompts.py +0 -0
  60. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/prompts_base.py +0 -0
  61. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/prompts_plan_update.py +0 -0
  62. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/prompts_verification.py +0 -0
  63. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/rate_limit.py +0 -0
  64. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/shutdown.py +0 -0
  65. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/state.py +0 -0
  66. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/state_backup.py +0 -0
  67. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/state_exceptions.py +0 -0
  68. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/state_file_ops.py +0 -0
  69. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/state_pr.py +0 -0
  70. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/state_recovery.py +0 -0
  71. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/subagents.py +0 -0
  72. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/core/task_group.py +0 -0
  73. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/github/__init__.py +0 -0
  74. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/github/client.py +0 -0
  75. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/github/client_ci.py +0 -0
  76. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/github/client_pr.py +0 -0
  77. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/github/exceptions.py +0 -0
  78. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/github/pr_cycle.py +0 -0
  79. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mailbox/__init__.py +0 -0
  80. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mailbox/merger.py +0 -0
  81. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mailbox/models.py +0 -0
  82. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mailbox/storage.py +0 -0
  83. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mcp/__init__.py +0 -0
  84. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mcp/auth.py +0 -0
  85. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mcp/server.py +0 -0
  86. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/mcp/tools.py +0 -0
  87. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/server.py +0 -0
  88. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/utils/__init__.py +0 -0
  89. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/utils/debug_claude_md.py +0 -0
  90. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/utils/doctor.py +0 -0
  91. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/webhooks/__init__.py +0 -0
  92. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/webhooks/client.py +0 -0
  93. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/webhooks/config.py +0 -0
  94. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/webhooks/events.py +0 -0
  95. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master/wrapper.py +0 -0
  96. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master.egg-info/SOURCES.txt +0 -0
  97. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master.egg-info/dependency_links.txt +0 -0
  98. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master.egg-info/entry_points.txt +0 -0
  99. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master.egg-info/requires.txt +0 -0
  100. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/src/claude_task_master.egg-info/top_level.txt +0 -0
  101. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/tests/test_server.py +0 -0
  102. {claude_task_master-0.1.5 → claude_task_master-0.1.7}/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.5
3
+ Version: 0.1.7
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.5"
7
+ version = "0.1.7"
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.5"
6
+ __version__ = "0.1.7"
7
7
  __all__ = ["__version__"]
@@ -33,7 +33,7 @@ set -euo pipefail
33
33
 
34
34
  # Script version - synchronized with Python package version
35
35
  # This should be kept in sync using scripts/sync_version.py
36
- SCRIPT_VERSION="0.1.5"
36
+ SCRIPT_VERSION="0.1.6"
37
37
 
38
38
  # Configuration file location
39
39
  CONFIG_DIR=".claude-task-master"
@@ -189,6 +189,7 @@ class AgentWrapper:
189
189
  required_branch: str | None = None,
190
190
  create_pr: bool = True,
191
191
  pr_group_info: dict | None = None,
192
+ target_branch: str = "main",
192
193
  ) -> dict[str, Any]:
193
194
  """Run a work session with full tools.
194
195
 
@@ -201,6 +202,7 @@ class AgentWrapper:
201
202
  required_branch: Optional branch name the agent should be on.
202
203
  create_pr: If True, instruct agent to create PR. If False, commit only.
203
204
  pr_group_info: Optional dict with PR group context (name, completed_tasks, etc).
205
+ target_branch: The target branch for rebasing (default: "main").
204
206
 
205
207
  Returns:
206
208
  Dict with 'output', 'success', and 'model_used' keys.
@@ -215,6 +217,7 @@ class AgentWrapper:
215
217
  required_branch=required_branch,
216
218
  create_pr=create_pr,
217
219
  pr_group_info=pr_group_info,
220
+ target_branch=target_branch,
218
221
  )
219
222
 
220
223
  def verify_success_criteria(self, criteria: str, context: str = "") -> dict[str, Any]:
@@ -151,6 +151,7 @@ class AgentPhaseExecutor:
151
151
  required_branch: str | None = None,
152
152
  create_pr: bool = True,
153
153
  pr_group_info: dict | None = None,
154
+ target_branch: str = "main",
154
155
  ) -> dict[str, Any]:
155
156
  """Run a work session with full tools.
156
157
 
@@ -163,6 +164,7 @@ class AgentPhaseExecutor:
163
164
  required_branch: Optional branch name the agent should be on.
164
165
  create_pr: If True, instruct agent to create PR. If False, commit only.
165
166
  pr_group_info: Optional dict with PR group context (name, completed_tasks, etc).
167
+ target_branch: The target branch for rebasing (default: "main").
166
168
 
167
169
  Returns:
168
170
  Dict with 'output', 'success', and 'model_used' keys.
@@ -175,6 +177,7 @@ class AgentPhaseExecutor:
175
177
  required_branch=required_branch,
176
178
  create_pr=create_pr,
177
179
  pr_group_info=pr_group_info,
180
+ target_branch=target_branch,
178
181
  )
179
182
 
180
183
  # Run async query with optional model override
@@ -109,8 +109,8 @@ class ToolsConfig(BaseModel):
109
109
  """
110
110
 
111
111
  planning: list[str] = Field(
112
- default_factory=lambda: ["Read", "Glob", "Grep", "Bash"],
113
- description="Tools available during planning phase (read-only + bash for checks).",
112
+ default_factory=lambda: ["Read", "Glob", "Grep", "Bash", "WebFetch", "WebSearch"],
113
+ description="Tools available during planning phase (read-only + bash for checks + web tools for research).",
114
114
  )
115
115
  verification: list[str] = Field(
116
116
  default_factory=lambda: ["Read", "Glob", "Grep", "Bash"],
@@ -152,7 +152,7 @@ class ClaudeTaskMasterConfig(BaseModel):
152
152
  "auto_push": true
153
153
  },
154
154
  "tools": {
155
- "planning": ["Read", "Glob", "Grep", "Bash"],
155
+ "planning": ["Read", "Glob", "Grep", "Bash", "WebFetch", "WebSearch"],
156
156
  "verification": ["Read", "Glob", "Grep", "Bash"],
157
157
  "working": []
158
158
  }
@@ -36,14 +36,18 @@ testing strategy, and how all pieces fit together. Plan for success.
36
36
  - `Glob` - Find files by pattern
37
37
  - `Grep` - Search for code patterns
38
38
  - `Bash` - Run commands (git status, tests, lint checks, etc.)
39
+ - `WebSearch` - Search the web for current information (use FIRST to find URLs)
40
+ - `WebFetch` - Fetch full content from URLs (only URLs from search results or user-provided)
41
+
42
+ **Web Research Workflow:** Use `WebSearch` first to find relevant documentation/articles,
43
+ then use `WebFetch` to retrieve full content from specific URLs in the search results.
44
+ WebFetch can also retrieve PDFs for technical documentation.
39
45
 
40
46
  **FORBIDDEN TOOLS (NEVER use during planning):**
41
47
  - ❌ `Write` - Do NOT write any files
42
48
  - ❌ `Edit` - Do NOT edit any files
43
49
  - ❌ `Task` - Do NOT launch any agents
44
50
  - ❌ `TodoWrite` - Do NOT use todo tracking
45
- - ❌ `WebFetch` - Do NOT fetch web pages
46
- - ❌ `WebSearch` - Do NOT search the web
47
51
 
48
52
  **WHY**: The orchestrator will save your plan to `plan.md` automatically.
49
53
  You just need to OUTPUT the plan as TEXT in your response.
@@ -17,6 +17,7 @@ def build_work_prompt(
17
17
  required_branch: str | None = None,
18
18
  create_pr: bool = True,
19
19
  pr_group_info: dict | None = None,
20
+ target_branch: str = "main",
20
21
  ) -> str:
21
22
  """Build the work session prompt.
22
23
 
@@ -31,6 +32,7 @@ def build_work_prompt(
31
32
  - name: PR group name
32
33
  - completed_tasks: List of completed task descriptions in this group
33
34
  - remaining_tasks: Number of tasks remaining after current
35
+ target_branch: The target branch for rebasing (default: "main").
34
36
 
35
37
  Returns:
36
38
  Complete work session prompt.
@@ -119,7 +121,7 @@ def build_work_prompt(
119
121
 
120
122
  # Execution guidelines - conditional based on create_pr flag
121
123
  if create_pr:
122
- execution_content = _build_full_workflow_execution()
124
+ execution_content = _build_full_workflow_execution(target_branch=target_branch)
123
125
  else:
124
126
  execution_content = _build_commit_only_execution()
125
127
 
@@ -173,9 +175,13 @@ TASK COMPLETE
173
175
  return builder.build()
174
176
 
175
177
 
176
- def _build_full_workflow_execution() -> str:
177
- """Build execution instructions for full workflow (commit + push + PR)."""
178
- return """**1. Check git status first**
178
+ def _build_full_workflow_execution(target_branch: str = "main") -> str:
179
+ """Build execution instructions for full workflow (commit + push + PR).
180
+
181
+ Args:
182
+ target_branch: The target branch to rebase onto (e.g., main, master, develop).
183
+ """
184
+ return f"""**1. Check git status first**
179
185
  ```bash
180
186
  git status
181
187
  ```
@@ -218,7 +224,32 @@ EOF
218
224
  **Note:** The `.claude-task-master/` directory is automatically gitignored - it contains
219
225
  orchestrator state files that should never be committed.
220
226
 
221
- **6. Push and Create PR** (REQUIRED - DO NOT SKIP!)
227
+ **6. Rebase onto {target_branch} BEFORE pushing** (CRITICAL!)
228
+ ```bash
229
+ git fetch origin {target_branch}
230
+ git rebase origin/{target_branch}
231
+ ```
232
+
233
+ ⚠️ **This step prevents merge conflicts in the PR!** Other PRs may have been merged
234
+ while you were working. You MUST rebase before pushing.
235
+
236
+ **If rebase has conflicts:**
237
+ 1. Check which files have conflicts: `git status`
238
+ 2. For each conflicted file:
239
+ - Open the file and look for conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`)
240
+ - Resolve by keeping the correct code (often you need BOTH changes)
241
+ - Remove the conflict markers
242
+ - `git add <file>`
243
+ 3. Continue the rebase: `git rebase --continue`
244
+ 4. If you get stuck, you can abort and retry: `git rebase --abort` then try again
245
+ 5. After resolving all conflicts, run tests again to verify nothing broke
246
+
247
+ **Common conflict resolution patterns:**
248
+ - **mod.rs / index.ts imports**: Keep BOTH the new import from {target_branch} AND your import
249
+ - **Package versions**: Usually take the newer version from {target_branch}
250
+ - **Config files**: Merge both sets of changes carefully
251
+
252
+ **7. Push and Create PR** (REQUIRED - DO NOT SKIP!)
222
253
  ```bash
223
254
  git push -u origin HEAD
224
255
  gh pr create --title "type: description" --body "..." --label "claudetm"
@@ -238,7 +269,7 @@ If label doesn't exist, create it and retry.
238
269
 
239
270
  **The orchestrator handles CI/reviews/merge automatically.**
240
271
 
241
- **7. Log File Best Practices**
272
+ **8. Log File Best Practices**
242
273
  - For log/progress files, use APPEND mode (don't read entire file)
243
274
  - Example: `echo "message" >> progress.md` instead of Read + Write
244
275
  - This avoids context bloat from reading large log files"""
@@ -15,6 +15,7 @@ from typing import TYPE_CHECKING
15
15
  from . import console
16
16
  from .agent import ModelType
17
17
  from .agent_exceptions import AgentError
18
+ from .config_loader import get_config
18
19
  from .console import clear_task_context, set_task_context
19
20
  from .task_group import (
20
21
  ParsedTask,
@@ -157,6 +158,62 @@ class TaskRunner:
157
158
  self._parsed_groups_cache = None
158
159
  self._plan_hash = None
159
160
 
161
+ def _get_group_context(self, state: TaskState, plan: str | None = None) -> dict | None:
162
+ """Get PR group context for the current task.
163
+
164
+ Computes information about the current task's PR group including:
165
+ - Group name and ID
166
+ - Whether this is the last task in the group
167
+ - Remaining tasks in the group
168
+ - Completed tasks in the group
169
+
170
+ Args:
171
+ state: Current task state.
172
+ plan: Optional plan content. If not provided, loads from state manager.
173
+
174
+ Returns:
175
+ Dict with group context, or None if no plan or task out of range.
176
+ Keys: group_id, group_name, is_last_in_group, remaining_in_group,
177
+ completed_tasks, tasks_in_group
178
+ """
179
+ if plan is None:
180
+ plan = self.state_manager.load_plan()
181
+ if not plan:
182
+ return None
183
+
184
+ parsed_tasks, _ = self._get_parsed_tasks(plan)
185
+ if state.current_task_index >= len(parsed_tasks):
186
+ return None
187
+
188
+ current_task = parsed_tasks[state.current_task_index]
189
+ group_id = current_task.group_id
190
+ group_name = current_task.group_name
191
+
192
+ # Get all tasks in this group
193
+ tasks_in_group = [t for t in parsed_tasks if t.group_id == group_id]
194
+
195
+ # Find the current task's position within the group
196
+ current_task_in_group_idx = next(
197
+ (i for i, t in enumerate(tasks_in_group) if t.index == state.current_task_index),
198
+ 0,
199
+ )
200
+
201
+ # Calculate remaining tasks
202
+ remaining_in_group = len(tasks_in_group) - current_task_in_group_idx - 1
203
+ is_last_in_group = remaining_in_group == 0
204
+
205
+ # Get completed tasks in this group (for context)
206
+ completed_tasks = [t.cleaned_description for t in tasks_in_group if t.is_complete]
207
+
208
+ return {
209
+ "group_id": group_id,
210
+ "group_name": group_name,
211
+ "is_last_in_group": is_last_in_group,
212
+ "remaining_in_group": remaining_in_group,
213
+ "completed_tasks": completed_tasks,
214
+ "tasks_in_group": tasks_in_group,
215
+ }
216
+
160
217
  def run_work_session(self, state: TaskState) -> None:
161
218
  """Run a single work session.
162
219
 
@@ -204,25 +261,19 @@ class TaskRunner:
204
261
  complexity, cleaned_task = parse_task_complexity(current_task)
205
262
  target_model = TaskComplexity.get_model_for_complexity(complexity)
206
263
 
207
- # Get PR/group info for this task
208
- parsed_tasks, groups = self._get_parsed_tasks(plan)
209
- pr_name = "Default"
210
- pr_group_id = "default"
211
- if state.current_task_index < len(parsed_tasks):
212
- pr_name = parsed_tasks[state.current_task_index].group_name
213
- pr_group_id = parsed_tasks[state.current_task_index].group_id
214
-
215
- # Determine if this is the last task in the PR group
216
- tasks_in_group = [t for t in parsed_tasks if t.group_id == pr_group_id]
217
- current_task_in_group_idx = next(
218
- (i for i, t in enumerate(tasks_in_group) if t.index == state.current_task_index),
219
- 0,
220
- )
221
- remaining_in_group = len(tasks_in_group) - current_task_in_group_idx - 1
222
- is_last_in_group = remaining_in_group == 0
223
-
224
- # Get completed tasks in this group (for context)
225
- completed_in_group = [t.cleaned_description for t in tasks_in_group if t.is_complete]
264
+ # Get PR/group context for this task (reuses _get_group_context for DRY)
265
+ group_context = self._get_group_context(state, plan)
266
+ if group_context:
267
+ pr_name = group_context["group_name"]
268
+ is_last_in_group = group_context["is_last_in_group"]
269
+ remaining_in_group = group_context["remaining_in_group"]
270
+ completed_in_group = group_context["completed_tasks"]
271
+ else:
272
+ # Fallback for edge cases (shouldn't happen in normal operation)
273
+ pr_name = "Default"
274
+ is_last_in_group = True
275
+ remaining_in_group = 0
276
+ completed_in_group = []
226
277
 
227
278
  # Load context safely
228
279
  try:
@@ -277,6 +328,9 @@ Please complete this task."""
277
328
  try:
278
329
  # Convert string model name to ModelType enum
279
330
  model_type = ModelType(target_model)
331
+ # Get target branch from config for rebase instructions
332
+ config = get_config()
333
+ target_branch = config.git.target_branch
280
334
  result = self.agent.run_work_session(
281
335
  task_description=task_description,
282
336
  context=context,
@@ -284,6 +338,7 @@ Please complete this task."""
284
338
  required_branch=current_branch,
285
339
  create_pr=should_create_pr,
286
340
  pr_group_info=pr_group_info,
341
+ target_branch=target_branch,
287
342
  )
288
343
  except AgentError:
289
344
  if self.logger:
@@ -480,19 +535,8 @@ Please complete this task."""
480
535
  Returns:
481
536
  True if this is the last task in the PR group.
482
537
  """
483
- plan = self.state_manager.load_plan()
484
- if not plan:
485
- return True
486
-
487
- parsed_tasks, _ = self._get_parsed_tasks(plan)
488
- if state.current_task_index >= len(parsed_tasks):
538
+ group_context = self._get_group_context(state)
539
+ if group_context is None:
540
+ # No plan or task out of range - treat as last task
489
541
  return True
490
-
491
- current_group_id = parsed_tasks[state.current_task_index].group_id
492
- tasks_in_group = [t for t in parsed_tasks if t.group_id == current_group_id]
493
- current_task_in_group_idx = next(
494
- (i for i, t in enumerate(tasks_in_group) if t.index == state.current_task_index),
495
- 0,
496
- )
497
- remaining_in_group = len(tasks_in_group) - current_task_in_group_idx - 1
498
- return remaining_in_group == 0
542
+ return bool(group_context["is_last_in_group"])
@@ -9,6 +9,7 @@ from typing import TYPE_CHECKING
9
9
 
10
10
  from . import console
11
11
  from .agent import ModelType
12
+ from .config_loader import get_config
12
13
  from .shutdown import interruptible_sleep
13
14
 
14
15
  if TYPE_CHECKING:
@@ -438,6 +439,10 @@ class WorkflowStageHandler:
438
439
  else ".claude-task-master/debugging/resolve-comments.json"
439
440
  )
440
441
 
442
+ # Get target branch from config for rebase instructions
443
+ config = get_config()
444
+ target_branch = config.git.target_branch
445
+
441
446
  # Build the appropriate task description based on what feedback exists
442
447
  if has_ci and has_comments:
443
448
  # Both CI failures and comments - handle together!
@@ -467,12 +472,24 @@ Use Glob to find all .txt files in both directories, then Read each one.
467
472
  - Make the requested change, OR
468
473
  - Explain why it's not needed
469
474
 
470
- ## Step 4: Verify and Commit
475
+ ## Step 4: Verify, Commit, Rebase, and Push
471
476
 
472
477
  1. Run tests/lint locally to verify ALL passes
473
478
  2. Commit all fixes together with a descriptive message
474
- 3. Push the fixes
475
- 4. Create a resolution summary file at: `{resolve_json_path}`
479
+ 3. **Rebase onto {target_branch} before pushing** (CRITICAL - prevents merge conflicts!):
480
+ ```bash
481
+ git fetch origin {target_branch}
482
+ git rebase origin/{target_branch}
483
+ ```
484
+ If conflicts occur during rebase:
485
+ - Check `git status` to see conflicted files
486
+ - Open each file and resolve conflicts (look for `<<<<<<<` markers)
487
+ - Usually you need BOTH changes (yours AND from {target_branch})
488
+ - `git add <file>` after resolving each file
489
+ - `git rebase --continue` to proceed
490
+ - Run tests again after resolving conflicts
491
+ 4. Push the fixes: `git push --force-with-lease`
492
+ 5. Create a resolution summary file at: `{resolve_json_path}`
476
493
 
477
494
  **Resolution file format:**
478
495
  ```json
@@ -511,7 +528,14 @@ Please:
511
528
  2. Understand ALL error messages (lint, tests, types, etc.)
512
529
  3. Fix everything that's failing - don't skip anything
513
530
  4. Run tests/lint locally to verify ALL passes
514
- 5. Commit and push the fixes
531
+ 5. Commit fixes with a descriptive message
532
+ 6. **Rebase onto {target_branch} before pushing** (CRITICAL - prevents merge conflicts!):
533
+ ```bash
534
+ git fetch origin {target_branch}
535
+ git rebase origin/{target_branch}
536
+ ```
537
+ If conflicts occur: resolve them, `git add`, `git rebase --continue`, run tests again.
538
+ 7. Push the fixes: `git push --force-with-lease`
515
539
 
516
540
  After fixing, end with: TASK COMPLETE"""
517
541
 
@@ -529,8 +553,15 @@ Please:
529
553
  - Make the requested change, OR
530
554
  - Explain why it's not needed
531
555
  3. Run tests to verify
532
- 4. Commit and push the fixes
533
- 5. Create a resolution summary file at: `{resolve_json_path}`
556
+ 4. Commit fixes with a descriptive message
557
+ 5. **Rebase onto {target_branch} before pushing** (CRITICAL - prevents merge conflicts!):
558
+ ```bash
559
+ git fetch origin {target_branch}
560
+ git rebase origin/{target_branch}
561
+ ```
562
+ If conflicts occur: resolve them, `git add`, `git rebase --continue`, run tests again.
563
+ 6. Push the fixes: `git push --force-with-lease`
564
+ 7. Create a resolution summary file at: `{resolve_json_path}`
534
565
 
535
566
  **Resolution file format:**
536
567
  ```json
@@ -669,6 +700,10 @@ After verifying, end with: TASK COMPLETE"""
669
700
  else ".claude-task-master/debugging/resolve-comments.json"
670
701
  )
671
702
 
703
+ # Get target branch from config for rebase instructions
704
+ config = get_config()
705
+ target_branch = config.git.target_branch
706
+
672
707
  task_description = f"""PR #{state.current_pr} has review comments to address.
673
708
 
674
709
  **Read the review comments from:** `{comments_path}`
@@ -681,8 +716,15 @@ Please:
681
716
  - Make the requested change, OR
682
717
  - Explain why it's not needed
683
718
  3. Run tests to verify
684
- 4. Commit and push the fixes
685
- 5. Create a resolution summary file at: `{resolve_json_path}`
719
+ 4. Commit fixes with a descriptive message
720
+ 5. **Rebase onto {target_branch} before pushing** (CRITICAL - prevents merge conflicts!):
721
+ ```bash
722
+ git fetch origin {target_branch}
723
+ git rebase origin/{target_branch}
724
+ ```
725
+ If conflicts occur: resolve them, `git add`, `git rebase --continue`, run tests again.
726
+ 6. Push the fixes: `git push --force-with-lease`
727
+ 7. Create a resolution summary file at: `{resolve_json_path}`
686
728
 
687
729
  **Resolution file format:**
688
730
  ```json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: claude-task-master
3
- Version: 0.1.5
3
+ Version: 0.1.7
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