04_code_generator

A coding agent that builds a complete Python repository from a detailed plan based on a research paper. Python is a programming language commonly used for scientific computing.

In plain words
What is it for?
It is for creating the project structure, configuration, source modules, documentation, and other files needed for a reproducible research repository.
Why use it?
It turns a specified design into runnable code while keeping the implementation tied to the paper and the approved architecture.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/qosi-org/arxivist/04_code_generator
Clone the repo
git clone --depth 1 https://github.com/qosi-org/arxivist
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,732 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01732
Opus 5 $0.00000 $0.00866
Sonnet 5 $0.00000 $0.00346
Haiku 4.5 $0.00000 $0.00173

Measured 2d ago against content hash 3c7b53f3d99c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

04_code_generator scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks the agent to reveal its instructionsmediumSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

- Handle the case where data is not publicly available (print instructions)

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

RUN apt-get update && apt-get install -y git wget && rm -rf /var/lib/apt/lists/*

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

RUN apt-get update && apt-get install -y git wget && rm -rf /var/lib/apt/lists/*
skill/agents/04_code_generator.md · 204 lines

How it starts

The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sub-Agent 04 — Code Generator (Architecture Plan → Full Repository)

Role: You are a research engineer who writes production-quality, reproducible Python code from a detailed architecture plan. You implement exactly what is specified in the plan — no freelancing, no adding unrequested features. Your code must be runnable, well-documented, and faithful to the paper.


Input Contract

You receive:

  • architecture_plan.json (from Stage 3)
  • architecture_plan_summary.md
  • sir.json (for implementation details and equations)
  • paper_id
  • templates/repo_structure.txt (load this first — it defines the exact repo layout)

Output Contract

A complete Git repository written to paper-repos/{paper_id}/ with the structure defined in the architecture plan, plus the standard ArXivist repo additions below.


Repository Generation Order

Generate files in this strict order to ensure each file can reference the ones before it:

  1. Project scaffold (directories, __init__.py files, .gitignore, README.md stub)
  2. configs/config.yaml (from architecture plan config schema)
  3. src/{project_name}/utils/config.py (config loading utilities)
  4. src/{project_name}/models/ (all model files, bottom-up: smallest modules first)
  5. src/{project_name}/data/ (dataset and transforms)
  6. src/{project_name}/training/ (losses first, then trainer)
  7. src/{project_name}/evaluation/ (metrics, then eval script)
  8. train.py, evaluate.py, inference.py (entrypoints)
  9. docker/Dockerfile, docker/docker-compose.yml
  10. data/download.sh or data/download.py
  11. requirements.txt, requirements-dev.txt, environment.yaml
  12. README.md (full, generated last when you know everything that was built)

Code Quality Standards

Every Python file must have:

  • Module-level docstring explaining its purpose and which paper section it implements
  • Type annotations on all function signatures
  • Inline comments for non-obvious operations, referencing the paper section or equation
  • Example: # Eq. 3 in Section 3.2: scaled dot-product attention

Read the full file on GitHub · 204 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 204 lines · 0 tokens per session scan D 3c7b53f3d99c

Subscribe to this mod's changes

04_code_generator is an agent published in the GitHub repository qosi-org/arxivist (19 stars, last pushed 28d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,732 tokens. A static security scan graded it D with 3 findings (asks the agent to reveal its instructions, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

OmicVerse Expert

Specialized execution agent for OmicVerse-based analysis. Uses OmicVerse lookup helpers from the same Python runtime as notebook execution, avoiding dependency on a separate Pantheon omicverse toolset.

aristoteleo/PantheonOS · 46 tokens

coder

Specialized sub-agent for the AI co-mathematician system. Implements Python code for computational exploration, numerical verification, and search — with mandatory tests and golden values. Cannot mark its work complete until tests pass and a reviewer accepts the golden values. Use when the project-coordinator…

morankor/theorist-toolbox · 78 tokens

atlas-data-plotter

Use this agent when a user requests Python code to access ATLAS data, extract specific items, and generate plots. The agent will run the generated script with nfiles=1 to make sure it compiles and generates output. The results will be best if the agent can star with a specification generated by the…

iris-hep/marketplace · 461 tokens

python-environment-manager

Automated setup and management of Python environments for ras-commander. Use when: users need help setting up Python environments, troubleshooting import errors, upgrading ras-commander, or configuring Jupyter kernels. Trigger phrases: "set up environment", "install ras-commander", "conda create", "import error"…

gpt-cmdr/ras-commander · 130 tokens

iris-hep-coder

This agent will write python code that will access ATLAS data, extract some items, and then make one or more plots. If the user's prompt doesn't fit that request, please complain. Generate code using ServiceX to fetch the data, Awkward array to manipulate the data that comes back (with vector for doing any physics…

iris-hep/marketplace · 0 tokens

vedix-code-generator

Generates a runnable Python experiment script (experiment.py) plus its requirements.txt, implementing the methodology from hypothesis.md using only the domain template's preferred libraries.

danilkotelnikov/vedix · 36 tokens