codemaster-cli 2.2.0__py3-none-any.whl

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 (170) hide show
  1. codemaster_cli-2.2.0.dist-info/METADATA +645 -0
  2. codemaster_cli-2.2.0.dist-info/RECORD +170 -0
  3. codemaster_cli-2.2.0.dist-info/WHEEL +4 -0
  4. codemaster_cli-2.2.0.dist-info/entry_points.txt +3 -0
  5. vibe/__init__.py +6 -0
  6. vibe/acp/__init__.py +0 -0
  7. vibe/acp/acp_agent_loop.py +746 -0
  8. vibe/acp/entrypoint.py +81 -0
  9. vibe/acp/tools/__init__.py +0 -0
  10. vibe/acp/tools/base.py +100 -0
  11. vibe/acp/tools/builtins/bash.py +134 -0
  12. vibe/acp/tools/builtins/read_file.py +54 -0
  13. vibe/acp/tools/builtins/search_replace.py +129 -0
  14. vibe/acp/tools/builtins/todo.py +65 -0
  15. vibe/acp/tools/builtins/write_file.py +98 -0
  16. vibe/acp/tools/session_update.py +118 -0
  17. vibe/acp/utils.py +213 -0
  18. vibe/cli/__init__.py +0 -0
  19. vibe/cli/autocompletion/__init__.py +0 -0
  20. vibe/cli/autocompletion/base.py +22 -0
  21. vibe/cli/autocompletion/path_completion.py +177 -0
  22. vibe/cli/autocompletion/slash_command.py +99 -0
  23. vibe/cli/cli.py +188 -0
  24. vibe/cli/clipboard.py +69 -0
  25. vibe/cli/commands.py +116 -0
  26. vibe/cli/entrypoint.py +163 -0
  27. vibe/cli/history_manager.py +91 -0
  28. vibe/cli/plan_offer/adapters/http_whoami_gateway.py +67 -0
  29. vibe/cli/plan_offer/decide_plan_offer.py +87 -0
  30. vibe/cli/plan_offer/ports/whoami_gateway.py +23 -0
  31. vibe/cli/terminal_setup.py +323 -0
  32. vibe/cli/textual_ui/__init__.py +0 -0
  33. vibe/cli/textual_ui/ansi_markdown.py +58 -0
  34. vibe/cli/textual_ui/app.py +1546 -0
  35. vibe/cli/textual_ui/app.tcss +1020 -0
  36. vibe/cli/textual_ui/external_editor.py +32 -0
  37. vibe/cli/textual_ui/handlers/__init__.py +5 -0
  38. vibe/cli/textual_ui/handlers/event_handler.py +147 -0
  39. vibe/cli/textual_ui/widgets/__init__.py +0 -0
  40. vibe/cli/textual_ui/widgets/approval_app.py +192 -0
  41. vibe/cli/textual_ui/widgets/banner/banner.py +85 -0
  42. vibe/cli/textual_ui/widgets/banner/petit_chat.py +195 -0
  43. vibe/cli/textual_ui/widgets/braille_renderer.py +58 -0
  44. vibe/cli/textual_ui/widgets/chat_input/__init__.py +7 -0
  45. vibe/cli/textual_ui/widgets/chat_input/body.py +214 -0
  46. vibe/cli/textual_ui/widgets/chat_input/completion_manager.py +58 -0
  47. vibe/cli/textual_ui/widgets/chat_input/completion_popup.py +43 -0
  48. vibe/cli/textual_ui/widgets/chat_input/container.py +195 -0
  49. vibe/cli/textual_ui/widgets/chat_input/text_area.py +365 -0
  50. vibe/cli/textual_ui/widgets/compact.py +41 -0
  51. vibe/cli/textual_ui/widgets/config_app.py +171 -0
  52. vibe/cli/textual_ui/widgets/context_progress.py +30 -0
  53. vibe/cli/textual_ui/widgets/load_more.py +43 -0
  54. vibe/cli/textual_ui/widgets/loading.py +201 -0
  55. vibe/cli/textual_ui/widgets/messages.py +277 -0
  56. vibe/cli/textual_ui/widgets/no_markup_static.py +11 -0
  57. vibe/cli/textual_ui/widgets/path_display.py +28 -0
  58. vibe/cli/textual_ui/widgets/proxy_setup_app.py +127 -0
  59. vibe/cli/textual_ui/widgets/question_app.py +496 -0
  60. vibe/cli/textual_ui/widgets/spinner.py +194 -0
  61. vibe/cli/textual_ui/widgets/status_message.py +76 -0
  62. vibe/cli/textual_ui/widgets/teleport_message.py +31 -0
  63. vibe/cli/textual_ui/widgets/tool_widgets.py +371 -0
  64. vibe/cli/textual_ui/widgets/tools.py +201 -0
  65. vibe/cli/textual_ui/windowing/__init__.py +29 -0
  66. vibe/cli/textual_ui/windowing/history.py +105 -0
  67. vibe/cli/textual_ui/windowing/history_windowing.py +71 -0
  68. vibe/cli/textual_ui/windowing/state.py +105 -0
  69. vibe/cli/update_notifier/__init__.py +47 -0
  70. vibe/cli/update_notifier/adapters/filesystem_update_cache_repository.py +59 -0
  71. vibe/cli/update_notifier/adapters/github_update_gateway.py +101 -0
  72. vibe/cli/update_notifier/adapters/pypi_update_gateway.py +107 -0
  73. vibe/cli/update_notifier/ports/update_cache_repository.py +16 -0
  74. vibe/cli/update_notifier/ports/update_gateway.py +53 -0
  75. vibe/cli/update_notifier/update.py +139 -0
  76. vibe/cli/update_notifier/whats_new.py +49 -0
  77. vibe/core/__init__.py +5 -0
  78. vibe/core/agent_loop.py +1075 -0
  79. vibe/core/agents/__init__.py +31 -0
  80. vibe/core/agents/manager.py +165 -0
  81. vibe/core/agents/models.py +122 -0
  82. vibe/core/auth/__init__.py +6 -0
  83. vibe/core/auth/crypto.py +137 -0
  84. vibe/core/auth/github.py +178 -0
  85. vibe/core/autocompletion/__init__.py +0 -0
  86. vibe/core/autocompletion/completers.py +257 -0
  87. vibe/core/autocompletion/file_indexer/__init__.py +10 -0
  88. vibe/core/autocompletion/file_indexer/ignore_rules.py +156 -0
  89. vibe/core/autocompletion/file_indexer/indexer.py +179 -0
  90. vibe/core/autocompletion/file_indexer/store.py +169 -0
  91. vibe/core/autocompletion/file_indexer/watcher.py +71 -0
  92. vibe/core/autocompletion/fuzzy.py +189 -0
  93. vibe/core/autocompletion/path_prompt.py +108 -0
  94. vibe/core/autocompletion/path_prompt_adapter.py +149 -0
  95. vibe/core/config.py +673 -0
  96. vibe/core/config_PATCH_INSTRUCTIONS.md +77 -0
  97. vibe/core/llm/__init__.py +0 -0
  98. vibe/core/llm/backend/anthropic.py +630 -0
  99. vibe/core/llm/backend/base.py +38 -0
  100. vibe/core/llm/backend/factory.py +7 -0
  101. vibe/core/llm/backend/generic.py +425 -0
  102. vibe/core/llm/backend/mistral.py +381 -0
  103. vibe/core/llm/backend/vertex.py +115 -0
  104. vibe/core/llm/exceptions.py +195 -0
  105. vibe/core/llm/format.py +184 -0
  106. vibe/core/llm/message_utils.py +24 -0
  107. vibe/core/llm/types.py +120 -0
  108. vibe/core/middleware.py +209 -0
  109. vibe/core/output_formatters.py +85 -0
  110. vibe/core/paths/__init__.py +0 -0
  111. vibe/core/paths/config_paths.py +68 -0
  112. vibe/core/paths/global_paths.py +40 -0
  113. vibe/core/programmatic.py +56 -0
  114. vibe/core/prompts/__init__.py +32 -0
  115. vibe/core/prompts/cli.md +111 -0
  116. vibe/core/prompts/compact.md +48 -0
  117. vibe/core/prompts/dangerous_directory.md +5 -0
  118. vibe/core/prompts/explore.md +50 -0
  119. vibe/core/prompts/project_context.md +8 -0
  120. vibe/core/prompts/tests.md +1 -0
  121. vibe/core/proxy_setup.py +65 -0
  122. vibe/core/session/session_loader.py +222 -0
  123. vibe/core/session/session_logger.py +318 -0
  124. vibe/core/session/session_migration.py +41 -0
  125. vibe/core/skills/__init__.py +7 -0
  126. vibe/core/skills/manager.py +132 -0
  127. vibe/core/skills/models.py +92 -0
  128. vibe/core/skills/parser.py +39 -0
  129. vibe/core/system_prompt.py +466 -0
  130. vibe/core/telemetry/__init__.py +0 -0
  131. vibe/core/telemetry/send.py +185 -0
  132. vibe/core/teleport/errors.py +9 -0
  133. vibe/core/teleport/git.py +196 -0
  134. vibe/core/teleport/nuage.py +180 -0
  135. vibe/core/teleport/teleport.py +208 -0
  136. vibe/core/teleport/types.py +54 -0
  137. vibe/core/tools/base.py +336 -0
  138. vibe/core/tools/builtins/ask_user_question.py +134 -0
  139. vibe/core/tools/builtins/bash.py +357 -0
  140. vibe/core/tools/builtins/grep.py +310 -0
  141. vibe/core/tools/builtins/prompts/__init__.py +0 -0
  142. vibe/core/tools/builtins/prompts/ask_user_question.md +84 -0
  143. vibe/core/tools/builtins/prompts/bash.md +73 -0
  144. vibe/core/tools/builtins/prompts/grep.md +4 -0
  145. vibe/core/tools/builtins/prompts/read_file.md +13 -0
  146. vibe/core/tools/builtins/prompts/search_replace.md +43 -0
  147. vibe/core/tools/builtins/prompts/task.md +24 -0
  148. vibe/core/tools/builtins/prompts/todo.md +199 -0
  149. vibe/core/tools/builtins/prompts/write_file.md +42 -0
  150. vibe/core/tools/builtins/read_file.py +222 -0
  151. vibe/core/tools/builtins/search_replace.py +456 -0
  152. vibe/core/tools/builtins/task.py +154 -0
  153. vibe/core/tools/builtins/todo.py +134 -0
  154. vibe/core/tools/builtins/write_file.py +160 -0
  155. vibe/core/tools/manager.py +341 -0
  156. vibe/core/tools/mcp.py +397 -0
  157. vibe/core/tools/ui.py +68 -0
  158. vibe/core/trusted_folders.py +86 -0
  159. vibe/core/types.py +405 -0
  160. vibe/core/utils.py +396 -0
  161. vibe/setup/onboarding/__init__.py +39 -0
  162. vibe/setup/onboarding/base.py +14 -0
  163. vibe/setup/onboarding/onboarding.tcss +134 -0
  164. vibe/setup/onboarding/screens/__init__.py +5 -0
  165. vibe/setup/onboarding/screens/api_key.py +200 -0
  166. vibe/setup/onboarding/screens/provider_selection.py +87 -0
  167. vibe/setup/onboarding/screens/welcome.py +136 -0
  168. vibe/setup/trusted_folders/trust_folder_dialog.py +180 -0
  169. vibe/setup/trusted_folders/trust_folder_dialog.tcss +83 -0
  170. vibe/whats_new.md +5 -0
@@ -0,0 +1,84 @@
1
+ Use `ask_user_question` to gather information from the user when you need clarification, want to validate assumptions, or need help making a decision. **Don't hesitate to use this tool** - it's better to ask than to guess wrong.
2
+
3
+ ## When to Use
4
+
5
+ - **Clarifying requirements**: Ambiguous instructions, unclear scope
6
+ - **Technical decisions**: Architecture choices, library selection, tradeoffs
7
+ - **Preference gathering**: UI style, naming conventions, approach options
8
+ - **Validation**: Confirming understanding before starting significant work
9
+ - **Multiple valid paths**: When several approaches could work and you want user input
10
+
11
+ ## Question Structure
12
+
13
+ Each question has these fields:
14
+
15
+ - `question`: The full question text (be specific and clear)
16
+ - `header`: A short label displayed as a chip (max 12 characters, e.g., "Auth", "Database", "Approach")
17
+ - `options`: 2-4 choices (an "Other" option is automatically added for free text)
18
+ - `multi_select`: Set to `true` if user can pick multiple options (default: `false`)
19
+
20
+ ### Options Structure
21
+
22
+ Each option has:
23
+ - `label`: Short display text (1-5 words)
24
+ - `description`: Brief explanation of what this choice means or its implications
25
+
26
+ ## Examples
27
+
28
+ **Single question with recommended option:**
29
+ ```json
30
+ {
31
+ "questions": [{
32
+ "question": "Which authentication method should we use?",
33
+ "header": "Auth",
34
+ "options": [
35
+ {"label": "JWT tokens (Recommended)", "description": "Stateless, scalable, works well with APIs"},
36
+ {"label": "Session cookies", "description": "Traditional approach, requires session storage"},
37
+ {"label": "OAuth 2.0", "description": "Third-party auth, more complex setup"}
38
+ ],
39
+ "multi_select": false
40
+ }]
41
+ }
42
+ ```
43
+
44
+ **Multiple questions (displayed as tabs):**
45
+ ```json
46
+ {
47
+ "questions": [
48
+ {
49
+ "question": "Which database should we use?",
50
+ "header": "Database",
51
+ "options": [
52
+ {"label": "PostgreSQL", "description": "Relational, ACID compliant"},
53
+ {"label": "MongoDB", "description": "Document store, flexible schema"}
54
+ ],
55
+ "multi_select": false
56
+ },
57
+ {
58
+ "question": "Which features should be included in v1?",
59
+ "header": "Features",
60
+ "options": [
61
+ {"label": "User auth", "description": "Login, signup, password reset"},
62
+ {"label": "Search", "description": "Full-text search across content"},
63
+ {"label": "Export", "description": "CSV and PDF export"}
64
+ ],
65
+ "multi_select": true
66
+ }
67
+ ]
68
+ }
69
+ ```
70
+
71
+ ## Key Constraints
72
+
73
+ - **Header max length**: 12 characters (keeps UI clean)
74
+ - **Options count**: 2-4 per question (plus automatic "Other")
75
+ - **Questions count**: 1-4 per call
76
+ - **Label length**: Keep to 1-5 words for readability
77
+
78
+ ## Tips
79
+
80
+ 1. **Put recommended option first** and add "(Recommended)" to its label
81
+ 2. **Use descriptive headers** that categorize the question type
82
+ 3. **Keep descriptions concise** but informative about tradeoffs
83
+ 4. **Use multi_select** when choices aren't mutually exclusive (e.g., features to include)
84
+ 5. **Ask early** - it's better to clarify before starting than to redo work
@@ -0,0 +1,73 @@
1
+ Use the `bash` tool to run one-off shell commands.
2
+
3
+ **Key characteristics:**
4
+ - **Stateless**: Each command runs independently in a fresh environment
5
+
6
+ **Timeout:**
7
+ - The `timeout` argument controls how long the command can run before being killed
8
+ - When `timeout` is not specified (or set to `None`), the config default is used
9
+ - If a command is timing out, do not hesitate to increase the timeout using the `timeout` argument
10
+
11
+ **IMPORTANT: Use dedicated tools if available instead of these bash commands:**
12
+
13
+ **File Operations - DO NOT USE:**
14
+ - `cat filename` → Use `read_file(path="filename")`
15
+ - `head -n 20 filename` → Use `read_file(path="filename", limit=20)`
16
+ - `tail -n 20 filename` → Read with offset: `read_file(path="filename", offset=<line_number>, limit=20)`
17
+ - `sed -n '100,200p' filename` → Use `read_file(path="filename", offset=99, limit=101)`
18
+ - `less`, `more`, `vim`, `nano` → Use `read_file` with offset/limit for navigation
19
+ - `echo "content" > file` → Use `write_file(path="file", content="content")`
20
+ - `echo "content" >> file` → Read first, then `write_file` with overwrite=true
21
+
22
+ **Search Operations - DO NOT USE:**
23
+ - `grep -r "pattern" .` → Use `grep(pattern="pattern", path=".")`
24
+ - `find . -name "*.py"` → Use `bash("ls -la")` for current dir or `grep` with appropriate pattern
25
+ - `ag`, `ack`, `rg` commands → Use the `grep` tool
26
+ - `locate` → Use `grep` tool
27
+
28
+ **File Modification - DO NOT USE:**
29
+ - `sed -i 's/old/new/g' file` → Use `search_replace` tool
30
+ - `awk` for file editing → Use `search_replace` tool
31
+ - Any in-place file editing → Use `search_replace` tool
32
+
33
+ **APPROPRIATE bash uses:**
34
+ - System information: `pwd`, `whoami`, `date`, `uname -a`
35
+ - Directory listings: `ls -la`, `tree` (if available)
36
+ - Git operations: `git status`, `git log --oneline -10`, `git diff`
37
+ - Process info: `ps aux | grep process`, `top -n 1`
38
+ - Network checks: `ping -c 1 google.com`, `curl -I https://example.com`
39
+ - Package management: `pip list`, `npm list`
40
+ - Environment checks: `env | grep VAR`, `which python`
41
+ - File metadata: `stat filename`, `file filename`, `wc -l filename`
42
+
43
+ **Example: Reading a large file efficiently**
44
+
45
+ WRONG:
46
+ ```bash
47
+ bash("cat large_file.txt") # May hit size limits
48
+ bash("head -1000 large_file.txt") # Inefficient
49
+ ```
50
+
51
+ RIGHT:
52
+ ```python
53
+ # First chunk
54
+ read_file(path="large_file.txt", limit=1000)
55
+ # If was_truncated=true, read next chunk
56
+ read_file(path="large_file.txt", offset=1000, limit=1000)
57
+ ```
58
+
59
+ **Example: Searching for patterns**
60
+
61
+ WRONG:
62
+ ```bash
63
+ bash("grep -r 'TODO' src/") # Don't use bash for grep
64
+ bash("find . -type f -name '*.py' | xargs grep 'import'") # Too complex
65
+ ```
66
+
67
+ RIGHT:
68
+ ```python
69
+ grep(pattern="TODO", path="src/")
70
+ grep(pattern="import", path=".")
71
+ ```
72
+
73
+ **Remember:** Bash is best for quick system checks and git operations. For file operations, searching, and editing, always use the dedicated tools when they are available.
@@ -0,0 +1,4 @@
1
+ Use `grep` to recursively search for a regular expression pattern in files.
2
+
3
+ - It's very fast and automatically ignores files that you should not read like .pyc files, .venv directories, etc.
4
+ - Use this to find where functions are defined, how variables are used, or to locate specific error messages.
@@ -0,0 +1,13 @@
1
+ Use `read_file` to read the content of a file. It's designed to handle large files safely.
2
+
3
+ - By default, it reads from the beginning of the file.
4
+ - Use `offset` (line number) and `limit` (number of lines) to read specific parts or chunks of a file. This is efficient for exploring large files.
5
+ - The result includes `was_truncated: true` if the file content was cut short due to size limits.
6
+
7
+ **Strategy for large files:**
8
+
9
+ 1. Call `read_file` with a `limit` (e.g., 1000 lines) to get the start of the file.
10
+ 2. If `was_truncated` is true, you know the file is large.
11
+ 3. To read the next chunk, call `read_file` again with an `offset`. For example, `offset=1000, limit=1000`.
12
+
13
+ This is more efficient than using `bash` with `cat` or `wc`.
@@ -0,0 +1,43 @@
1
+ Use `search_replace` to make targeted changes to files using SEARCH/REPLACE blocks. This tool finds exact text matches and replaces them.
2
+
3
+ Arguments:
4
+ - `file_path`: The path to the file to modify
5
+ - `content`: The SEARCH/REPLACE blocks defining the changes
6
+
7
+ The content format is:
8
+
9
+ ```
10
+ <<<<<<< SEARCH
11
+ [exact text to find in the file]
12
+ =======
13
+ [exact text to replace it with]
14
+ >>>>>>> REPLACE
15
+ ```
16
+
17
+ You can include multiple SEARCH/REPLACE blocks to make multiple changes to the same file:
18
+
19
+ ```
20
+ <<<<<<< SEARCH
21
+ def old_function():
22
+ return "old value"
23
+ =======
24
+ def new_function():
25
+ return "new value"
26
+ >>>>>>> REPLACE
27
+
28
+ <<<<<<< SEARCH
29
+ import os
30
+ =======
31
+ import os
32
+ import sys
33
+ >>>>>>> REPLACE
34
+ ```
35
+
36
+ IMPORTANT:
37
+
38
+ - The SEARCH text must match EXACTLY (including whitespace, indentation, and line endings)
39
+ - The SEARCH text must appear exactly once in the file - if it appears multiple times, the tool will error
40
+ - Use at least 5 equals signs (=====) between SEARCH and REPLACE sections
41
+ - The tool will provide detailed error messages showing context if search text is not found
42
+ - Each search/replace block is applied in order, so later blocks see the results of earlier ones
43
+ - Be careful with escape sequences in string literals - use \n not \\n for newlines in code
@@ -0,0 +1,24 @@
1
+ Use `task` to delegate work to a subagent for independent execution.
2
+
3
+ ## When to Use This Tool
4
+
5
+ - **Context management**: Delegate tasks that would consume too much main conversation context
6
+ - **Specialized work**: Use the appropriate subagent for the type of task (exploration, research, etc.)
7
+ - **Parallel execution**: Launch multiple subagents for independent tasks
8
+ - **Autonomous work**: Tasks that don't require back-and-forth with the user
9
+
10
+ ## Best Practices
11
+
12
+ 1. **Write clear, detailed task descriptions** - The subagent works autonomously, so provide enough context for it to succeed independently
13
+
14
+ 2. **Choose the right subagent** - Match the subagent to the task type (see available subagents in system prompt)
15
+
16
+ 3. **Prefer direct tools for simple operations** - If you know exactly which file to read or pattern to search, use those tools directly instead of spawning a subagent
17
+
18
+ 4. **Trust the subagent's judgment** - Let it explore and find information without micromanaging the approach
19
+
20
+ ## Limitations
21
+
22
+ - Subagents cannot write or modify files
23
+ - Subagents cannot ask the user questions
24
+ - Results are returned as text when the subagent completes
@@ -0,0 +1,199 @@
1
+ Use the `todo` tool to manage a simple task list. This tool helps you track tasks and their progress.
2
+
3
+ ## How it works
4
+
5
+ - **Reading:** Use `action: "read"` to view the current todo list
6
+ - **Writing:** Use `action: "write"` with the complete `todos` list to update. You must provide the ENTIRE list - this replaces everything.
7
+
8
+ ## Todo Structure
9
+ Each todo item has:
10
+ - `id`: A unique string identifier (e.g., "1", "2", "task-a")
11
+ - `content`: The task description
12
+ - `status`: One of: "pending", "in_progress", "completed", "cancelled"
13
+ - `priority`: One of: "high", "medium", "low"
14
+
15
+ ## When to Use This Tool
16
+
17
+ **Use proactively for:**
18
+ - Complex multi-step tasks (3+ distinct steps)
19
+ - Non-trivial tasks requiring careful planning
20
+ - Multiple tasks provided by the user (numbered or comma-separated)
21
+ - Tracking progress on ongoing work
22
+ - After receiving new instructions - immediately capture requirements
23
+ - When starting work - mark task as in_progress BEFORE beginning
24
+ - After completing work - mark as completed and add any follow-up tasks discovered
25
+
26
+ **Skip this tool for:**
27
+ - Single, straightforward tasks
28
+ - Trivial operations (< 3 simple steps)
29
+ - Purely conversational or informational requests
30
+ - Tasks that provide no organizational benefit
31
+
32
+ ## Task Management Best Practices
33
+
34
+ 1. **Status Management:**
35
+ - Only ONE task should be `in_progress` at a time
36
+ - Mark tasks `in_progress` BEFORE starting work on them
37
+ - Mark tasks `completed` IMMEDIATELY after finishing
38
+ - Keep tasks `in_progress` if blocked or encountering errors
39
+
40
+ 2. **Task Completion Rules:**
41
+ - ONLY mark as `completed` when FULLY accomplished
42
+ - Never mark complete if tests are failing, implementation is partial, or errors are unresolved
43
+ - When blocked, create a new task describing what needs resolution
44
+
45
+ 3. **Task Organization:**
46
+ - Create specific, actionable items
47
+ - Break complex tasks into manageable steps
48
+ - Use clear, descriptive task names
49
+ - Remove irrelevant tasks entirely (don't just mark cancelled)
50
+
51
+ ## Examples
52
+
53
+ **Example 1: Reading todos**
54
+ ```json
55
+ {
56
+ "action": "read"
57
+ }
58
+ ```
59
+
60
+ **Example 2: Initial task creation (user requests multiple features)**
61
+ ```json
62
+ {
63
+ "action": "write",
64
+ "todos": [
65
+ {
66
+ "id": "1",
67
+ "content": "Add dark mode toggle to settings",
68
+ "status": "pending",
69
+ "priority": "high"
70
+ },
71
+ {
72
+ "id": "2",
73
+ "content": "Implement theme context/state management",
74
+ "status": "pending",
75
+ "priority": "high"
76
+ },
77
+ {
78
+ "id": "3",
79
+ "content": "Update components for theme switching",
80
+ "status": "pending",
81
+ "priority": "medium"
82
+ },
83
+ {
84
+ "id": "4",
85
+ "content": "Run tests and verify build",
86
+ "status": "pending",
87
+ "priority": "medium"
88
+ }
89
+ ]
90
+ }
91
+ ```
92
+
93
+ **Example 3: Starting work (marking one task in_progress)**
94
+ ```json
95
+ {
96
+ "action": "write",
97
+ "todos": [
98
+ {
99
+ "id": "1",
100
+ "content": "Add dark mode toggle to settings",
101
+ "status": "in_progress",
102
+ "priority": "high"
103
+ },
104
+ {
105
+ "id": "2",
106
+ "content": "Implement theme context/state management",
107
+ "status": "pending",
108
+ "priority": "high"
109
+ },
110
+ {
111
+ "id": "3",
112
+ "content": "Update components for theme switching",
113
+ "status": "pending",
114
+ "priority": "medium"
115
+ },
116
+ {
117
+ "id": "4",
118
+ "content": "Run tests and verify build",
119
+ "status": "pending",
120
+ "priority": "medium"
121
+ }
122
+ ]
123
+ }
124
+ ```
125
+
126
+ **Example 4: Completing task and adding discovered subtask**
127
+ ```json
128
+ {
129
+ "action": "write",
130
+ "todos": [
131
+ {
132
+ "id": "1",
133
+ "content": "Add dark mode toggle to settings",
134
+ "status": "completed",
135
+ "priority": "high"
136
+ },
137
+ {
138
+ "id": "2",
139
+ "content": "Implement theme context/state management",
140
+ "status": "in_progress",
141
+ "priority": "high"
142
+ },
143
+ {
144
+ "id": "3",
145
+ "content": "Update components for theme switching",
146
+ "status": "pending",
147
+ "priority": "medium"
148
+ },
149
+ {
150
+ "id": "4",
151
+ "content": "Fix TypeScript errors in theme types",
152
+ "status": "pending",
153
+ "priority": "high"
154
+ },
155
+ {
156
+ "id": "5",
157
+ "content": "Run tests and verify build",
158
+ "status": "pending",
159
+ "priority": "medium"
160
+ }
161
+ ]
162
+ }
163
+ ```
164
+
165
+ **Example 5: Handling blockers (keeping task in_progress)**
166
+ ```json
167
+ {
168
+ "action": "write",
169
+ "todos": [
170
+ {
171
+ "id": "1",
172
+ "content": "Deploy to production",
173
+ "status": "in_progress",
174
+ "priority": "high"
175
+ },
176
+ {
177
+ "id": "2",
178
+ "content": "BLOCKER: Fix failing deployment pipeline",
179
+ "status": "pending",
180
+ "priority": "high"
181
+ },
182
+ {
183
+ "id": "3",
184
+ "content": "Update documentation",
185
+ "status": "pending",
186
+ "priority": "low"
187
+ }
188
+ ]
189
+ }
190
+ ```
191
+
192
+ ## Common Scenarios
193
+
194
+ **Multi-file refactoring:** Create todos for each file that needs updating
195
+ **Performance optimization:** List specific bottlenecks as individual tasks
196
+ **Bug fixing:** Track reproduction, diagnosis, fix, and verification as separate tasks
197
+ **Feature implementation:** Break down into UI, logic, tests, and documentation tasks
198
+
199
+ Remember: When writing, you must include ALL todos you want to keep. Any todo not in the list will be removed. Be proactive with task management to demonstrate thoroughness and ensure all requirements are completed successfully.
@@ -0,0 +1,42 @@
1
+ Use `write_file` to write content to a file.
2
+
3
+ **Arguments:**
4
+ - `path`: The file path (relative or absolute)
5
+ - `content`: The content to write to the file
6
+ - `overwrite`: Must be set to `true` to overwrite an existing file (default: `false`)
7
+
8
+ **IMPORTANT SAFETY RULES:**
9
+
10
+ - By default, the tool will **fail if the file already exists** to prevent accidental data loss
11
+ - To **overwrite** an existing file, you **MUST** set `overwrite: true`
12
+ - To **create a new file**, just provide the `path` and `content` (overwrite defaults to false)
13
+ - If parent directories don't exist, they will be created automatically
14
+
15
+ **BEST PRACTICES:**
16
+
17
+ - **ALWAYS** use the `read_file` tool first before overwriting an existing file to understand its current contents
18
+ - **ALWAYS** prefer using `search_replace` to edit existing files rather than overwriting them completely
19
+ - **NEVER** write new files unless explicitly required - prefer modifying existing files
20
+ - **NEVER** proactively create documentation files (*.md) or README files unless explicitly requested
21
+ - **AVOID** using emojis in file content unless the user explicitly requests them
22
+
23
+ **Usage Examples:**
24
+
25
+ ```python
26
+ # Create a new file (will error if file exists)
27
+ write_file(
28
+ path="src/new_module.py",
29
+ content="def hello():\n return 'Hello World'"
30
+ )
31
+
32
+ # Overwrite an existing file (must read it first!)
33
+ # First: read_file(path="src/existing.py")
34
+ # Then:
35
+ write_file(
36
+ path="src/existing.py",
37
+ content="# Updated content\ndef new_function():\n pass",
38
+ overwrite=True
39
+ )
40
+ ```
41
+
42
+ **Remember:** For editing existing files, prefer `search_replace` over `write_file` to preserve unchanged portions and avoid accidental data loss.