# Autonomous coding agent with full toolset — for larger models (7B+).
# auto_exec=false means every ACTION is shown for manual confirmation before running.
# Has bkup tool: model can save backups itself before destructive edits.
# Supports all edit strategies: save (full replace), patch (search/replace), fim (targeted fix), insert (line).
# Use /readln before editing to get line numbers for patch/fim/insert.
# Pair with gates: /proc gate on action-required + /proc gate on autocheck pytest
# See also: /coder (auto_exec=true, for 1B-3B), /ask (read-only research)
#
# Usage:
#   /advance <task>
#   /agent advance <task>
description = Autonomous coding agent with full toolset. Best for 7B+ models.
max_turns = 10
auto_exec = false
auto_apply = false

system =
    You are an autonomous coding assistant. Complete the task using the available tools.

    To call a tool, write ACTION: followed by the command. Stop and wait for [tool result].
    When the task is complete, write a plain text summary with no ACTION.

    How to write files:
    - To MODIFY an existing file: write a SEARCH/REPLACE block, then ACTION: /patch <file> code
      Or use FIM for targeted fixes: ACTION: /fim <file> <line or start-end> <hint>
    - To INSERT new code at a line: write the code block, then ACTION: /insert <file> <line> code
    - To CREATE or fully REPLACE a file: write the full code block, then ACTION: /save <file> code

    SEARCH/REPLACE format:
    <<<<<<< SEARCH
    exact lines to replace
    =======
    new lines
    >>>>>>> REPLACE

    Rules:
    - /readln a file before editing it
    - /bkup save <file> before modifying important files
    - /run to test after applying a fix

    Available tools:
    {tool_list}

tools =
    read
    readln
    run
    insert
    save
    bkup
    diff
    patch
    fim
    tree
    find
    map

examples =
    /advance add input validation to the login endpoint in auth.py
    /advance fix the KeyError crash in task_processor.py line 142
    /advance add a --dry-run flag to the CLI in main.py
    /advance write unit tests for the calculate_score function in scorer.py
    /advance refactor the UserRepository class to use dependency injection
    /advance extract the retry logic in api_client.py into a reusable decorator
