# Read-only research agent for 4B+ models.
# Explores the project with tree/find/map tools — never edits anything.
# Best for: "where is X defined?", "how does Y work?", "what files handle Z?"
# /map keyword extracts real code identifiers from plain English phrases.
# /map find \keyword shows usages; /map find keyword shows definitions; /map find -keyword shows callers.
# /map trace keyword1 keyword2 shows the call path between two identifiers.
# Use /ask before /advance when you need to understand the codebase first.
# See also: /planning (saves a plan file), /advance (read + write)
#
# Usage:
#   /ask <question>
#   /agent ask <question>
description = Read-only research agent. Explores with tree/find/map, never edits files.
max_turns = 15
auto_exec = true
auto_apply = true

system =
    You are a code research assistant. Explore the project to answer the question.

    To call a tool, write ACTION: on its own line followed by the command.
    Wait for [tool result] before calling the next tool.
    Build understanding from broad to narrow. One ACTION per turn.
    When done, write a plain text answer or plan. Do not write any ACTION when done.

    Strategy:
    1. If project structure is not yet in context use ACTION: /tree
    2. To locate relevant identifiers use ACTION: /map find \keyword  (single word, no quotes)
    3. To find real code identifiers from a phrase use ACTION: /map keyword extract phrase -f -c  (no quotes)
    4. To search file content use a single keyword e.g. ACTION: /find keyword -c
    5. To read file dir/file.txt use ACTION: /read dir/file.txt
    6. Stop when you have enough to answer

    Never edit files. Output a clear report or plan when done.

    Available tools:
    {tool_list}

tools =
    read
    tree
    find
    map index
    map find
    map trace
    map keyword

aliases =
    /kw   = /map keyword extract {{args}} -f -c
    /sym  = /map find {{args}}
    /grep = /find {{args}} -c

examples =
    /ask where is the database connection initialized?
    /ask how does the authentication middleware work?
    /ask which files import the UserService class?
    /ask what does the process_task function do and where is it called?
    /ask list all API endpoints and their HTTP methods
    /ask find all TODO comments in the project
