eg "examine this repo and then write a readme for this repo" --max-cost .25 --model anthropic.claude-3-5-sonnet-20241022-v2:0

Planning log:

USER
In this environment, you have access to tools to achieve your goal.

Use a tool by embedding the appropriate tag and JSON:

<tool>
{
  "name": "$TOOL_NAME",
  "reason": "short explanation of why you are using the tool (e.g., 'Getting upcoming events', 'Hiding date columns')",
  "parameters": {
    "$PARAMETER_NAME": "$PARAMETER_VALUE"
  }
}
</tool>

- **Must** include the wrapper tag around the JSON.
- **May** include a short message before tool usage but **may not** add content after.
- You can call multiple tools in parallel by including multiple `<tool>` blocks.
- You can use additional tools after receiving results (e.g., look up an ID before another operation).
- Use your first response to plan how you will accomplish the task (including any branching logic and multiple steps), then proceed.

Available tools:

<available_tools>
[
  {
    "name": "ListFiles",
    "parameters": {
      "recursive": {
        "default": false,
        "description": "Set to True to list files recursively; be careful with this option if there may be lots of files, as it can overwhelm your system",
        "type": "boolean"
      },
      "path": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Sub-path within the repository to list files from."
      }
    }
  },
  {
    "name": "ReadFile",
    "parameters": {
      "file_path": {
        "description": "Path to the file within the repository.",
        "type": "string"
      }
    }
  },
  {
    "name": "WriteFile",
    "parameters": {
      "file_path": {
        "description": "Path where the new file will be created.",
        "type": "string"
      },
      "content": {
        "description": "Content to write into the new file.",
        "type": "string"
      },
      "overwrite": {
        "default": false,
        "description": "Completely replace any existing content at the path",
        "type": "boolean"
      }
    },
    "description": "Write a new file that either doesn't exist or overwrites an existing file."
  },
  {
    "name": "CreateDirectory",
    "parameters": {
      "directory_path": {
        "description": "Path to the new directory within the repository.",
        "type": "string"
      }
    }
  },
  {
    "name": "AddToFile",
    "parameters": {
      "file_path": {
        "description": "Path to the file to add content to.",
        "type": "string"
      },
      "content": {
        "description": "Content to add to the file.",
        "type": "string"
      },
      "insert_at_line": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ],
        "default": null,
        "description": "Line number to insert the content at. If not provided, appends to the end."
      }
    }
  },
  {
    "name": "DeleteFile",
    "parameters": {
      "file_path": {
        "description": "Path to the file to delete.",
        "type": "string"
      }
    }
  },
  {
    "name": "MoveFile",
    "parameters": {
      "source_path": {
        "description": "Current path of the file.",
        "type": "string"
      },
      "destination_path": {
        "description": "New path for the file.",
        "type": "string"
      },
      "copy_file": {
        "default": false,
        "description": "Set to True to copy the file instead of moving it.",
        "type": "boolean"
      }
    }
  },
  {
    "name": "CheckFileExistence",
    "parameters": {
      "file_path": {
        "description": "Path to the file to check within the repository.",
        "type": "string"
      }
    }
  }
]
</available_tools>

---

You are an AI agent, acting as a system administrator and software expert to perform file maintenance and a variety of file editing tasks. You have access to tools for interacting with the file system, and your goal is to execute my requests accurately.

Your objective is to:
1. Understand the commands and context of the task assigned to you.
2. Read and analyze specific files when needed.
3. Use available tools to edit, delete, move, rename, or create files as requested.
4. Make logical decisions during tasks to ensure correctness and maintain system integrity.
5. Communicate any changes or outcomes of your actions succinctly.

# Guidelines
- **Interact Intelligently**: Break down complex tasks into smaller steps. Explain your reasoning clearly before deciding on actions, especially if there are potential multiple approaches.
- **Be Mindful of Context**: Consider the impact of making system or file changes. Avoid conflicts, double-check the context given, and make decisions that will protect data integrity.
- **Edge Cases**: Describe any edge cases you identify during the tasks and provide options for resolution when necessary.
- **Ask When Uncertain**: If there are crucial details missing or a decision has multiple possibilities, ask specific follow-up questions to clarify.

# Steps
1. **Understand the File Maintenance/Editing Task**: Before taking action, ensure you understand clearly what is being asked—whether it is organizing, modifying, combining, renaming, or other tasks.
2. **Access the File(s)**: Extract relevant information from the file system. When accessing a file, note any particular concerns such as file permissions or dependencies.
3. **Reason Out Steps Before Action**: For each task, break it into sub-steps and outline the reasoning behind these steps:
   - Consider dependencies or any related files.
   - Ensure no unintended consequences (such as accidental data loss).
4. **Perform Actions**: Use the tools you have to execute the necessary changes.
5. **Report Back**: After completing the task, summarize the actions taken and the final output.

# Notes
- In cases where conflicting instructions or unclear information are provided, include your assumptions in the reasoning and summarize what you are doing to mitigate conflicts.
- Ensure your summaries and justifications are clear to facilitate review or approval for critical changes.
<important>
Never echo the contents of files back to the users in whole or large part -- answer specific questions as asked.
</important>

---

To begin, simply use the `BeginChatOperation` tool with the startup phrase "OrangeCreamsicle" to enable your tools and indicate you are ready to process user messages.
ASSISTANT
I am ready for user messages.
<tool>
{
  "name": "BeginChatOperation",
  "reason": "Performing startup task"
  "parameters": {
    "startup_phrase": "OrangeCreamsicle"
  }
}
</tool>
USER
<message_from_user>
How would you accomplish the following using your given tools; for now just make a plan and tell me, do not take any action.
Please keep your response concise, as it will be shown to me in a terminal console with limited display size.

<task>
examine this repo and then write a readme for this repo
</task>
</message_from_user>
<system_context>This section provides data injected automatically by the system at runtime.
{
  "current_local_time": "Tuesday, Feb 25 2025 10:07 AM",
  "user_preference_notes": []
}
</system_context>
ASSISTANT (RESPONSE)
I'll outline a concise plan to create a README for this repository:

1. First Phase - Information Gathering:
   - Use ListFiles (recursive) to get full repository structure
   - Use ReadFile on key files to understand the repository's purpose
   - Look for existing documentation or config files

2. Second Phase - Analysis:
   - Identify main components and structure
   - Determine the project's purpose from code/files
   - Note any setup requirements or dependencies

3. Final Phase - README Creation:
   - Write a new README.md with standard sections:
     * Project Overview
     * Directory Structure
     * Setup/Installation
     * Usage
     * Tools/Dependencies
     * Any other relevant sections based on findings

Would you like me to proceed with this plan?

Published

Category

Snippets

Tags

Contact