@texra-ai/cli 0.38.0

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 (37) hide show
  1. package/LICENSE.txt +6 -0
  2. package/README.md +218 -0
  3. package/dist/bin/texra.js +2407 -0
  4. package/dist/resources/agents/correct.yaml +52 -0
  5. package/dist/resources/agents/merge.yaml +74 -0
  6. package/dist/resources/agents/ocr.yaml +68 -0
  7. package/dist/resources/agents/polish.yaml +73 -0
  8. package/dist/resources/agents/transcribe_audio.yaml +76 -0
  9. package/dist/resources/agents/write/beamercolorthemempi.sty +59 -0
  10. package/dist/resources/agents/write/beamerthemeconfposter.sty +225 -0
  11. package/dist/resources/agents/write/paper2poster.yaml +104 -0
  12. package/dist/resources/agents/write/paper2slide.yaml +127 -0
  13. package/dist/resources/agents/write/template_poster.tex +56 -0
  14. package/dist/resources/agents/write/template_slide.tex +39 -0
  15. package/dist/resources/docs/agent-creation/execution_and_testing.md +79 -0
  16. package/dist/resources/docs/agent-creation/tool_catalog.md +127 -0
  17. package/dist/resources/docs/agent-creation/tooluse_schema.md +90 -0
  18. package/dist/resources/docs/agent-creation/workflow_schema.md +160 -0
  19. package/dist/resources/odyssey/odyssey.yaml +56 -0
  20. package/dist/resources/shared/latex_style_rules.txt +15 -0
  21. package/dist/resources/templates/agentCreatorToolUse.yaml +67 -0
  22. package/dist/resources/templates/agentCreatorWorkflow.yaml +128 -0
  23. package/dist/resources/templates/agentTemplate-toolUse.yaml +24 -0
  24. package/dist/resources/templates/agentTemplate-workflowSingle.yaml +66 -0
  25. package/dist/resources/templates/instructionPolish.yaml +17 -0
  26. package/dist/resources/tool_use_agents/chat.yaml +57 -0
  27. package/dist/resources/tool_use_agents/creator.yaml +141 -0
  28. package/dist/resources/tool_use_agents/latexDiff.yaml +42 -0
  29. package/dist/resources/tool_use_agents/latexFixer.yaml +70 -0
  30. package/dist/resources/tool_use_agents/lean.yaml +46 -0
  31. package/dist/resources/tool_use_agents/numerics.yaml +84 -0
  32. package/dist/resources/tool_use_agents/presenter.yaml +75 -0
  33. package/dist/resources/tool_use_agents/research.yaml +94 -0
  34. package/dist/resources/tool_use_agents/review.yaml +95 -0
  35. package/dist/resources/tool_use_agents/setup.yaml +378 -0
  36. package/dist/resources/tool_use_agents/template_slide.tex +39 -0
  37. package/package.json +75 -0
@@ -0,0 +1,104 @@
1
+ name: paper2poster
2
+ description: Converts a research paper into a LaTeX conference poster using a provided template.
3
+
4
+ settings:
5
+ agentCategory: workflow
6
+ documentTag: documents
7
+ endTag: </documents>
8
+ isRewrite: False
9
+ defaultOutputFiles:
10
+ - poster.tex
11
+ requiredFilesInternal:
12
+ TEMPLATE_POSTER: template_poster.tex
13
+ TEMPLATE_POSTER_STYLE: beamercolorthemempi.sty
14
+ TEMPLATE_POSTER_THEME: beamerthemeconfposter.sty
15
+
16
+ prompts:
17
+ systemPrompt: |
18
+ You are an expert scientist and scientific poster designer. Your task is to create a detailed, mathematically rich LaTeX Beamer poster based on a given research paper. The poster should be tailored for a scientific audience, highlighting the key points, methodology, results, and conclusions of the paper in a visually appealing A5 format.
19
+
20
+ When creating the poster:
21
+ - Use LaTeX Beamer syntax and commands
22
+ - Structure the poster with clear sections: Abstract, Introduction, Theoretical Framework, Methods, Results, Discussion, and Conclusions
23
+ - Include detailed mathematical equations, derivations, and explanations
24
+ - Use appropriate figures, tables, and diagrams to illustrate key concepts and results
25
+ - Maintain a professional and scientifically rigorous tone throughout the poster
26
+ - Use appropriate notation and terminology consistently
27
+ - Prioritize both mathematical depth and visual representations of key ideas
28
+ - Cite relevant key papers using biblatex
29
+ - Ensure the poster is visually appealing and readable at A5 size, despite the increased detail
30
+ - Use the provided color scheme and design elements from the template
31
+ - The poster must be self-contained: write as if the reader is a third party who has never read and will never read our conversations --- they should be able to understand and follow the poster on its own. Define all notations, abbreviations, and terminology before first use.
32
+
33
+ userPrefix: |
34
+ You are tasked with creating a detailed LaTeX Beamer poster based on the following research paper:
35
+
36
+ <documents>
37
+ {{ ALL_CONTEXTS }}
38
+ <document name="{{ TEMPLATE_POSTER_STYLE_FILE }}">
39
+ {{ TEMPLATE_POSTER_STYLE_CONTENT }}
40
+ </document>
41
+ <document name="{{ TEMPLATE_POSTER_THEME_FILE }}">
42
+ {{ TEMPLATE_POSTER_THEME_CONTENT }}
43
+ </document>
44
+ {{ ALL_INPUTS }}
45
+ </documents>
46
+
47
+ Please carefully review the provided research paper before creating the poster.
48
+
49
+ Your task is to create a professional, mathematically detailed LaTeX Beamer poster for a scientific audience in A5 format.
50
+
51
+ \begin{itemize}
52
+ \item Use LaTeX Beamer syntax and commands correctly.
53
+ \item Structure the poster with clear sections: Abstract, Introduction, Theoretical Framework, Methods, Results, Discussion, and Conclusions.
54
+ \item Include detailed mathematical equations, derivations, and explanations from the original paper.
55
+ \item Create appropriate figures, tables, and diagrams to illustrate key concepts and results.
56
+ \item Write concise yet informative explanations for each section.
57
+ \item Maintain a professional and scientifically rigorous tone throughout the poster.
58
+ \item Use appropriate notation and terminology consistently.
59
+ \item Prioritize both mathematical depth and visual representations of key ideas.
60
+ \item Ensure the poster is visually appealing and readable at A5 size, despite the increased detail.
61
+ \item Include author information, affiliations, and contact details.
62
+ \item End with a concise yet comprehensive conclusion summarizing the main findings and their implications.
63
+ \item Use the provided color scheme and design elements from the template to enhance readability and visual appeal.
64
+ \end{itemize}
65
+
66
+ {% if INSTRUCTION %}
67
+ Focus solely on the following specific instruction:
68
+ <instruction>
69
+ {{ INSTRUCTION }}
70
+ </instruction>
71
+ {% endif %}
72
+
73
+ userRequest:
74
+ - |
75
+ Create a detailed, mathematically rich LaTeX Beamer poster for a scientific audience in A5 format. The poster should be professional, mathematically detailed, and effectively highlight the main aspects of the research paper. Use the following format:
76
+
77
+ <documents>
78
+ <document name="{{ OUTPUT_FILES[0] }}">
79
+ {{ TEMPLATE_POSTER_CONTENT }}
80
+ </document>
81
+ </documents>
82
+ - |
83
+ Critically review your draft and output a revised version. Check these aspects and fix any issues found:
84
+ \begin{enumerate}
85
+ \item Mathematical Depth: sufficient mathematical detail, key equations, derivations, and explanations.
86
+ \item Content Coverage: effectively summarizes key points including theoretical framework and methodology.
87
+ \item Structure and Layout: clear sections, logical flow, visually appealing for A5 format.
88
+ \item Visual Representations: appropriate figures, tables, or diagrams illustrating key concepts and results.
89
+ \item Balance: good balance between textual explanations, mathematical content, and visual elements.
90
+ \item Conciseness vs Detail: content presented concisely and effectively for a poster format.
91
+ \item Physics Terminology: notation and terminology consistent and appropriate for the target audience.
92
+ \item Mathematical Rigor: equations and mathematical concepts presented clearly and accurately, properly formatted using LaTeX commands.
93
+ \item Readability: text size appropriate for A5 format; all content easily readable.
94
+ \item Color Usage: effective use of the provided color scheme to enhance readability and visual appeal, especially for mathematical content.
95
+ \item References: necessary citations in a compact format using biblatex.
96
+ \end{enumerate}
97
+
98
+ Output the revised poster based on the previous version, balancing detailed mathematical content with visual appeal:
99
+
100
+ <documents>
101
+ <document name="{{ OUTPUT_FILES[0] }}">
102
+ % Complete revised LaTeX Beamer poster here
103
+ </document>
104
+ </documents>
@@ -0,0 +1,127 @@
1
+ name: paper2slide
2
+ description: Converts a research paper into a LaTeX Beamer slide deck using a provided template.
3
+
4
+ settings:
5
+ agentCategory: workflow
6
+ documentTag: documents
7
+ endTag: </documents>
8
+ defaultOutputFiles:
9
+ - slides.tex
10
+ requiredFilesInternal:
11
+ TEMPLATE_SLIDE: template_slide.tex
12
+
13
+ prompts:
14
+ systemPrompt: |
15
+ You are an expert scientist and scientific presenter. Your task is to create a professional LaTeX Beamer presentation based on a given research paper. The presentation should be tailored for a scientific audience, highlighting the key points, methodology, results, and conclusions of the paper.
16
+
17
+ When creating the presentation:
18
+ - Use LaTeX Beamer syntax and commands
19
+ - Structure the presentation with a clear introduction, body, and conclusion
20
+ - Include appropriate equations, figures, and tables from the paper
21
+ - Use condensed bullet points to convey information effectively
22
+ - Maintain a professional and scientifically rigorous tone throughout the presentation
23
+ - Use appropriate notation and terminology consistently
24
+ - Prioritize visual representations and key takeaways over verbose descriptions
25
+ - Cite relevant key papers using commands like \cite{Author2020Title} (e.g., \cite{Smith2020Analysis}) which include the author, year, and first word of the paper title
26
+ - Output a complete, self-contained LaTeX file that can be compiled directly
27
+ - The document must be self-contained: write as if the reader is a third party who has never read and will never read our conversations --- they should be able to understand and follow the presentation on its own. Define all notations, abbreviations, and terminology before first use.
28
+
29
+ userPrefix: |
30
+ You are tasked with creating a LaTeX Beamer presentation based on the following research paper:
31
+
32
+ <documents>
33
+ {{ ALL_CONTEXTS }}
34
+ {{ ALL_INPUTS }}
35
+ </documents>
36
+
37
+ Please carefully review the provided research paper before creating the presentation.
38
+ userRequest:
39
+ - |
40
+ Your task is to create a professional LaTeX Beamer presentation for a scientific audience.
41
+
42
+ When creating the presentation, please follow these guidelines:
43
+ \begin{enumerate}
44
+ \item Use LaTeX Beamer syntax and commands correctly.
45
+ \item Structure the presentation with a clear introduction, body, and conclusion.
46
+ \item Include 10-15 slides, covering the main points of the paper.
47
+ \item Use appropriate equations, figures, and tables from the original paper.
48
+ \item Write condensed bullet points to convey information effectively.
49
+ \item Maintain a professional and scientifically rigorous tone throughout the presentation.
50
+ \item Use appropriate notation and terminology consistently.
51
+ \item Prioritize visual representations and key takeaways over verbose descriptions.
52
+ \item Include slide numbers for easy reference.
53
+ \item End with a conclusion slide summarizing the main findings and potential future work.
54
+ \end{enumerate}
55
+
56
+
57
+ {% if INSTRUCTION %}
58
+ Focus solely on the following specific instruction:
59
+ <instruction>
60
+ {{ INSTRUCTION }}
61
+ </instruction>
62
+ {% endif %}
63
+
64
+ Create a complete, self-contained LaTeX Beamer presentation that effectively communicates the paper's key findings in 10-15 slides. The presentation should be professional, condensed, and highlight the main aspects of the research paper. Use the following format:
65
+
66
+ <documents>
67
+ <document name="{{ OUTPUT_FILES[0] }}">
68
+ \documentclass{beamer}
69
+
70
+ \usetheme{metropolis}
71
+
72
+ \setbeamertemplate{navigation symbols}{}
73
+
74
+ \AtBeginSection[]
75
+ {
76
+ \begin{frame}<beamer>
77
+ \frametitle{Outline}
78
+ \tableofcontents[currentsection]
79
+ \end{frame}
80
+ }
81
+
82
+ \usepackage{amsmath}
83
+ \usepackage{amssymb}
84
+ \usepackage{graphicx}
85
+ \usepackage{physics}
86
+ \usepackage{hyperref}
87
+ \usepackage{natbib}
88
+
89
+ % Add any additional packages needed
90
+
91
+ % Title information
92
+ \title{...}
93
+ \author{...}
94
+ \institute{...}
95
+ \date{\today}
96
+
97
+ \begin{document}
98
+
99
+ % SLIDE CONTENT HERE
100
+
101
+ \begin{frame}[allowframebreaks]{References}
102
+ \bibliography{...}
103
+ \end{frame}
104
+
105
+ \end{document}
106
+ </document>
107
+ </documents>
108
+ - |
109
+ Critically review your draft and output a revised version. Check these aspects and fix any issues found:
110
+ \begin{enumerate}
111
+ \item Does the presentation effectively communicate the key findings and methodology?
112
+ \item Are the slides well-organized and logically structured?
113
+ \item Is the content appropriate for the target audience?
114
+ \item Are equations and mathematical content properly formatted and explained?
115
+ \item Are visual elements (figures, tables, diagrams) effectively used?
116
+ \item Is the text concise and focused, avoiding unnecessary details?
117
+ \item Are transitions between slides smooth and logical?
118
+ \item Is the overall presentation visually appealing and professional?
119
+ \end{enumerate}
120
+
121
+ Output the complete, self-contained revised version based on the previous version, maintaining its professional quality and technical accuracy. Use the following format:
122
+
123
+ <documents>
124
+ <document name="{{ OUTPUT_FILES[0] }}">
125
+ % Complete revised LaTeX Beamer presentation here
126
+ </document>
127
+ </documents>
@@ -0,0 +1,56 @@
1
+ \documentclass[final,a5paper]{beamer}
2
+ \usepackage[orientation=portrait,size=a5,scale=1.4,debug]{beamerposter}
3
+
4
+ \usetheme{confposter}
5
+ \usecolortheme{mpi}
6
+
7
+ \usepackage{amsmath}
8
+ \usepackage{amssymb}
9
+ \usepackage{graphicx}
10
+ \usepackage{physics}
11
+ \usepackage{hyperref}
12
+ \usepackage{soul}
13
+ \usepackage[backend=bibtex,style=numeric,sorting=none]{biblatex}
14
+
15
+ % Color definitions
16
+ \definecolor{lightgray}{HTML}{faf9f8}
17
+ \definecolor{blue}{HTML}{017e74}
18
+ \definecolor{darkblue}{HTML}{28495d}
19
+
20
+ % Font settings
21
+ \usefonttheme{professionalfonts}
22
+ \setbeamerfont{headline title}{size=\huge,series=\bfseries}
23
+ \setbeamerfont{headline author}{size=\large}
24
+ \setbeamerfont{headline institute}{size=\normalsize}
25
+ \setbeamerfont{block title}{size=\large,series=\bfseries}
26
+ \setbeamerfont{heading}{series=\bfseries}
27
+ \setbeamerfont{caption}{size=\small}
28
+
29
+ % Itemize settings
30
+ \setbeamertemplate{itemize item}{\raise0.5ex \hbox{\vrule width 0.5ex height 0.5ex}}
31
+ \setbeamertemplate{itemize subitem}{\raise0.3ex \hbox{\vrule width 0.5ex height 0.5ex}}
32
+ \setbeamertemplate{itemize subsubitem}{\raise0.2ex \hbox{\vrule width 0.5ex height 0.5ex}}
33
+
34
+ % Title and author information
35
+ \title{Your Detailed Poster Title}
36
+ \author{Authors of the Paper}
37
+ \institute{Your Institution}
38
+
39
+ \begin{document}
40
+
41
+ \begin{frame}[t]
42
+ \begin{columns}[t]
43
+ \begin{column}{.48\linewidth}
44
+
45
+ % POSTER_CONTENT_LEFT
46
+
47
+ \end{column}
48
+ \begin{column}{.48\linewidth}
49
+
50
+ % POSTER_CONTENT_RIGHT
51
+
52
+ \end{column}
53
+ \end{columns}
54
+ \end{frame}
55
+
56
+ \end{document}
@@ -0,0 +1,39 @@
1
+ \documentclass{beamer}
2
+
3
+ \usetheme{metropolis}
4
+
5
+ \setbeamertemplate{navigation symbols}{}
6
+
7
+ \AtBeginSection[]
8
+ {
9
+ \begin{frame}<beamer>
10
+ \frametitle{Outline}
11
+ \tableofcontents[currentsection]
12
+ \end{frame}
13
+ }
14
+
15
+ \usepackage{amsmath}
16
+ \usepackage{amssymb}
17
+ \usepackage{graphicx}
18
+ \usepackage{physics}
19
+ \usepackage{hyperref}
20
+ \usepackage{natbib}
21
+
22
+ % Include any other packages needed use \usepackage{...}
23
+ % Include any other external preamble in the paper using \input{...}
24
+
25
+ % Title information
26
+ \title{Title of the Presentation}
27
+ \author{Authors of the Paper}
28
+ \institute{Institution}
29
+ \date{\today}
30
+
31
+ \begin{document}
32
+
33
+ % SLIDE_CONTENT
34
+
35
+ \begin{frame}[allowframebreaks]{Reference}
36
+ \bibliography{the bib file used to generate the paper}
37
+ \end{frame}
38
+
39
+ \end{document}
@@ -0,0 +1,79 @@
1
+ # Execution & Testing Model
2
+
3
+ This note explains how TeXRA runs agents, and — more importantly — how the
4
+ `creator` agent can test a new agent before handing it back to the user.
5
+
6
+ ## How TeXRA runs agents
7
+
8
+ Every agent run flows through one entry point: `texra.execute` command →
9
+ `executeAgent(config, executionId?, options?)`. The runtime takes an
10
+ `AgentConfig` (agent name, model, instruction, and optional input / memory /
11
+ working-directory fields), resolves the YAML, and dispatches one of two
12
+ flow shapes:
13
+
14
+ - **Workflow flow** for `agentCategory: workflow`. Fixed rounds, each round
15
+ consumes `userRequest[i]`. Operates on `inputFiles` (or the active editor
16
+ selection). Emits LaTeX output files per `documentTag` /
17
+ `defaultOutputFiles`.
18
+ - **Tool-use flow** for `agentCategory: toolUse`. Multi-step loop invoking
19
+ declared tools. May WAIT for interim follow-ups, spawn subagents via
20
+ `delegate_workflow` / `delegate_agent`, and resume.
21
+
22
+ The creator agent does NOT need to call `executeAgent` directly. Instead it
23
+ delegates through tools that handle everything (including approval and the
24
+ follow-up queue) the way an ordinary user would.
25
+
26
+ ## Testing a new agent
27
+
28
+ Use the `delegate_*` tools in the `tools:` list of `creator.yaml`.
29
+
30
+ ### Testing a workflow agent
31
+
32
+ 1. Make a small test input in the workspace. Example:
33
+ ```
34
+ bash: mkdir -p test_inputs
35
+ write_file test_inputs/sample.tex with a 5–10 line LaTeX snippet
36
+ ```
37
+ 2. Call `delegate_workflow`:
38
+ ```
39
+ delegate_workflow(
40
+ agent: "my_new_polish",
41
+ model: "<a configured workflow model>",
42
+ instruction: "Tighten the abstract",
43
+ inputFiles: ["./test_inputs/sample.tex"]
44
+ )
45
+ ```
46
+ 3. When the follow-up arrives:
47
+ - Inspect the output file(s) the subagent produced.
48
+ - Confirm the agent wrapped output correctly and produced non-empty LaTeX
49
+ content.
50
+ - Report pass/fail to the user.
51
+
52
+ ### Testing a tool-use agent
53
+
54
+ 1. Call `delegate_agent`:
55
+ ```
56
+ delegate_agent(
57
+ agent: "my_new_tool_agent",
58
+ model: "<a configured tool-use model>",
59
+ instruction: "Do X (small end-to-end smoke test)"
60
+ )
61
+ ```
62
+ 2. When the subagent hits WAITING (or finishes), read the output and decide
63
+ whether the agent did what it was supposed to.
64
+ 3. If more iteration is needed, pass the returned `execution_id` back to
65
+ `delegate_agent` with a follow-up `instruction` — this resumes the same
66
+ session with full context.
67
+
68
+ ## When testing is not possible
69
+
70
+ Skip testing only if the user explicitly asks you to, or if the design
71
+ depends on live resources that are not available in the current workspace
72
+ (e.g. a real arXiv query that would burn API quota). In that case, state
73
+ plainly in the hand-off message that the agent has not been exercised.
74
+
75
+ ## Iterating
76
+
77
+ If a test fails — invalid YAML, missing tool, unclear prompt, wrong output
78
+ structure — use `edit_file` on the custom YAML and re-run the delegation
79
+ call. Both delegation tools pick up the updated file on the next invocation.
@@ -0,0 +1,127 @@
1
+ # Tool Catalog for Tool-Use Agents
2
+
3
+ Every tool available to tool-use agents, organised by group. When designing a
4
+ new agent, pick the smallest set of tools that covers its purpose — the
5
+ recommended groups at the bottom are a good starting point.
6
+
7
+ ## File operations
8
+
9
+ - `bash` — execute shell commands in the workspace directory. Use for
10
+ scripts, compilation, git, and anything else that needs a shell.
11
+ - `read_file` — read workspace files. Supports text files (with optional
12
+ line ranges), PDFs, and images (as attachments for vision-capable models).
13
+ - `write_file` — overwrite or create a workspace file. Writes under the
14
+ allowlisted agent directories go through the normal approval diff; writes
15
+ under read-only directories fail cleanly.
16
+ - `edit_file` — exact string replacement in a file. More surgical than
17
+ `write_file` for targeted changes.
18
+ - `ls` — list files and directories with optional glob filtering.
19
+ - `glob` — find files matching glob patterns (e.g. `**/*.tex`). Returns
20
+ paths sorted by modification time.
21
+ - `grep` — search file contents with regex. Supports content,
22
+ files-with-matches, and count output modes.
23
+
24
+ ## Web & search
25
+
26
+ - `web_search` — search the web and return top results.
27
+ - `web_fetch` — fetch a URL, convert HTML to Markdown, return cleaned text.
28
+
29
+ ## Academic research
30
+
31
+ - `arxiv_search` — search arXiv. Supports `field="author"` for author
32
+ searches.
33
+ - `arxiv_metadata` — fetch bibliographic metadata for an arXiv paper by ID.
34
+ - `download_arxiv_source` — download an arXiv paper's source archive into
35
+ the workspace.
36
+ - `crossref_search` — search Crossref works and return top matches.
37
+ - `crossref_doi` — look up detailed metadata for a DOI.
38
+
39
+ ## LaTeX processing
40
+
41
+ - `extract_figures` — list and resolve figure assets referenced in a LaTeX
42
+ document.
43
+ - `extract_bib_entries` — collect BibTeX records for citations.
44
+ - `extract_tikz_figures` — discover TikZ figures and optionally compile them
45
+ to PDF.
46
+ - `texcount` — count words in LaTeX files.
47
+
48
+ ## Citation management
49
+
50
+ - `zotero_search`, `zotero_add`, `zotero_export`, `zotero_collections` —
51
+ manage references with Zotero (requires Better BibTeX).
52
+
53
+ ## Computation
54
+
55
+ - `wolfram` — execute Wolfram Language code. Sessions do NOT persist
56
+ between calls.
57
+
58
+ ## Agent delegation
59
+
60
+ - `delegate_workflow` — delegate to a workflow agent for whole-document
61
+ operations. Pass `agent`, `model`, `instruction`, `inputFiles`. Returns
62
+ asynchronously via the follow-up queue.
63
+ - `delegate_agent` — delegate to another tool-use agent. Pass `agent`,
64
+ `model`, and `instruction` for a fresh run, or `execution_id` +
65
+ `instruction` to resume a WAITING subagent.
66
+ - `executions` — view execution history and manage running executions.
67
+ - `accept_run_files` — accept output files from a completed execution.
68
+
69
+ ## Lean 4
70
+
71
+ - `lean_diagnostics`, `lean_file`, `lean_project`, `lean_inspect`,
72
+ `lean_loogle` — Lean 4 proof assistant integration.
73
+
74
+ ## Utility
75
+
76
+ - `memory` — manage persistent memory files for cross-session knowledge.
77
+ - `todo_write` — track progress on complex tasks with structured checklists.
78
+ - `plan` — record structured plans.
79
+ - `diagnostics` — retrieve linter diagnostics for source files.
80
+
81
+ ## Recommended tool groups by use case
82
+
83
+ Most agents should include the file-operations set as a baseline.
84
+
85
+ **Research agent:**
86
+ `bash, read_file, write_file, glob, grep, ls, web_search, web_fetch,
87
+ arxiv_search, arxiv_metadata, download_arxiv_source, crossref_search,
88
+ crossref_doi`
89
+
90
+ **Code/editing agent:**
91
+ `bash, read_file, write_file, edit_file, glob, grep, ls, diagnostics`
92
+
93
+ **LaTeX analysis agent:**
94
+ `bash, read_file, write_file, glob, grep, ls, extract_figures,
95
+ extract_bib_entries, extract_tikz_figures, texcount`
96
+
97
+ **Literature review agent:**
98
+ `bash, read_file, write_file, glob, grep, ls, arxiv_search, arxiv_metadata,
99
+ crossref_search, crossref_doi, web_search, zotero_search, zotero_add,
100
+ zotero_export`
101
+
102
+ **Orchestrator agent:**
103
+ `bash, read_file, write_file, glob, grep, ls, delegate_workflow,
104
+ delegate_agent, executions, accept_run_files, todo_write`
105
+
106
+ **Computation agent:**
107
+ `bash, read_file, write_file, glob, grep, ls, wolfram`
108
+
109
+ **Lean 4 agent:**
110
+ `bash, read_file, write_file, edit_file, glob, grep, ls, lean_diagnostics,
111
+ lean_file, lean_project, lean_inspect, lean_loogle`
112
+
113
+ **Minimal chat agent:**
114
+ `bash, read_file, write_file, glob, grep, ls`
115
+
116
+ ## System prompt best practices
117
+
118
+ - Start with a clear role: "You are a [role]. Your task is to [objective]."
119
+ - Give tool usage guidance tailored to the agent's purpose.
120
+ - Structure complex workflows as numbered steps.
121
+ - Mention tool limitations (e.g. wolfram sessions don't persist; bash cwd is
122
+ the workspace).
123
+ - For agents with many tools, organise guidance by phase (discovery →
124
+ analysis → output).
125
+ - Keep prompts focused — describe only what this specific agent needs.
126
+ - Use `todo_write` for agents with multi-step verification or audit
127
+ workflows.
@@ -0,0 +1,90 @@
1
+ # Tool-Use Agent Schema & Reference
2
+
3
+ Tool-use agents are interactive, multi-turn conversational agents with tool
4
+ calling. They access files ONLY through their declared tools (`read_file`,
5
+ `write_file`, `bash`, `grep`, etc.) — no pre-loaded content. The only
6
+ template variable they receive is `{{ INSTRUCTION }}`.
7
+
8
+ ## YAML structure
9
+
10
+ ```yaml
11
+ name: agent_name
12
+ description: One-line description.
13
+
14
+ settings:
15
+ agentCategory: toolUse
16
+ temperature: 0.7 # 0.3-0.5 for precise tasks, 0.7-0.8 for creative
17
+ tools:
18
+ - bash
19
+ - read_file
20
+ - write_file
21
+ - glob
22
+ - grep
23
+ - ls
24
+
25
+ prompts:
26
+ systemPrompt: |
27
+ [Role, behaviour, tool usage guidance]
28
+ userRequest: |
29
+ {{ INSTRUCTION }}
30
+ ```
31
+
32
+ ## Critical rules
33
+
34
+ - `agentCategory` MUST be `"toolUse"` (not `"workflow"`).
35
+ - `userRequest` MUST be a single string (not an array) and MUST contain
36
+ `{{ INSTRUCTION }}`.
37
+ - Do NOT use `userPrefix` — tool-use agents do not receive pre-loaded file
38
+ content.
39
+ - The ONLY template variable is `{{ INSTRUCTION }}`. Do not use any
40
+ workflow-only variables (`INPUT_FILE`, `INPUT_CONTENT`, `ALL_INPUTS`,
41
+ `ALL_CONTEXTS`, `INPUT_FILES`, `OUTPUT_FILES`).
42
+ - `{% if IS_ANTHROPIC_MODEL %}...{% endif %}` works for model-specific
43
+ instructions.
44
+ - Agent names: lowercase with underscores or dashes.
45
+
46
+ ## Choosing tools
47
+
48
+ Pick only the tools the agent needs. See `tool_catalog.md` in this directory
49
+ for the full registry and recommended tool groups by use case. Most agents
50
+ want at least `read_file`, `write_file`, `ls`, `glob`, and `grep`; add
51
+ `bash` when the agent must run commands.
52
+
53
+ ## Example: the `research` agent
54
+
55
+ ```yaml
56
+ name: research
57
+ description: Searches academic literature and synthesises findings.
58
+
59
+ settings:
60
+ agentCategory: toolUse
61
+ temperature: 0.7
62
+ tools:
63
+ - bash
64
+ - read_file
65
+ - write_file
66
+ - glob
67
+ - grep
68
+ - ls
69
+ - web_search
70
+ - web_fetch
71
+ - arxiv_search
72
+ - arxiv_metadata
73
+ - download_arxiv_source
74
+ - crossref_search
75
+ - crossref_doi
76
+
77
+ prompts:
78
+ systemPrompt: |
79
+ You are a research assistant. Search academic literature, download
80
+ relevant papers, and synthesise findings for the user.
81
+
82
+ Use arxiv_search and crossref_search to find candidates.
83
+ Use arxiv_metadata and crossref_doi for detailed bibliographic data.
84
+ Use download_arxiv_source to fetch full paper sources.
85
+ Use web_search and web_fetch for broader context.
86
+ Use read_file and write_file to work with documents in the workspace.
87
+
88
+ userRequest: |
89
+ {{ INSTRUCTION }}
90
+ ```