Skip to main content

agent-def-translator

Coverage

agent-def-translator translates canonical agent resource definitions into platform-native files for Claude Code, OpenAI Codex, and GitHub Copilot.

Use it when you want to keep subagent roles, descriptions, and instructions in one reviewable TOML file, then generate the files each coding-agent product expects. It can also translate skill definitions, MCP config definitions, and plugin bundle definitions. It is a translator only: it does not run agents, manage sessions, resume tasks, or provide an orchestration runtime.

flowchart LR
    source["Canonical subagent definition"]
    claude["Definitions for Claude Code"]
    codex["Definitions for Codex"]
    copilot["Definitions for GitHub Copilot"]

    source --> claude
    source --> codex
    source --> copilot

Status

This project is currently alpha software. The core translation model is usable, but the canonical definition shape and target-specific output formats may change before a stable release.

Canonical definition files (subagent, skill, MCP config, and plugin) accept an optional schema_version integer field. It defaults to the current schema version, so existing 0.x definitions keep loading unchanged. A definition whose schema_version this version of agent-def-translator does not support fails to load with an explicit migration error instead of a generic parse or unknown-field failure. See docs/release.md for how definition-format changes are called out in release notes.

Quick Start

Create a definition directory:

agents/
  repo-explorer.toml
prompts/
  repo-explorer.claude.md

Write a canonical definition:

name = "repo-explorer"
description = "Read repository context and summarize relevant files."
instructions = """
Inspect repository rules, locate the relevant files, and report concise findings
with file paths. Do not edit files.
"""

[targets.claude]
tools = ["Read", "Grep", "Glob"]
permission_mode = "plan"
model = "haiku"
prompt_append_file = "../prompts/repo-explorer.claude.md"

[targets.codex]
model = "gpt-5.4-mini"
sandbox_mode = "read-only"

[targets.copilot]
tools = ["search", "fetch"]
target = "vscode"

Validate and generate artifacts:

uvx agent-def-translator subagent validate --definitions-dir agents
uvx agent-def-translator subagent translate \
  --definitions-dir agents \
  --output-dir generated

This writes:

generated/
  claude/agents/repo-explorer.md
  codex/agents/repo-explorer.toml
  copilot/agents/repo-explorer.agent.md

Check generated files in CI without rewriting them:

uvx agent-def-translator subagent diff \
  --definitions-dir agents \
  --output-dir generated

diff exits with 0 when generated files are current, and 1 when any target file is missing or stale.

Bundle generated resources into target-native plugin directories:

uvx agent-def-translator plugin translate \
  --definitions-dir plugins \
  --output-dir generated

Top-level commands such as translate and the older agent resource remain as deprecated aliases for compatibility. They are scheduled for removal no earlier than agent-def-translator 1.0.0. Prefer the resource-oriented command:

uvx agent-def-translator subagent translate \
  --definitions-dir agents \
  --output-dir generated

The CLI is organized as resource + predicate commands. Subagent, skill, MCP config, and plugin bundle translation are implemented today.

uvx agent-def-translator subagent translate \
  --definitions-dir agents \
  --output-dir generated
uvx agent-def-translator skill validate --definitions-dir skills
uvx agent-def-translator skill translate --definitions-dir skills --output-dir generated
uvx agent-def-translator mcp validate --definitions-dir mcp
uvx agent-def-translator mcp translate --definitions-dir mcp --output-dir generated
uvx agent-def-translator plugin validate --definitions-dir plugins
uvx agent-def-translator plugin translate \
  --definitions-dir plugins \
  --output-dir generated

Documentation

  • CLI usage: command reference and common workflows.
  • Subagent format: TOML fields, target tables, prompt composition, and output paths.
  • MCP config format: TOML fields and generated MCP config fragments for Claude Code, Codex, and GitHub Copilot.
  • Skill format: TOML fields and generated skill directories for Claude Code, Codex, and GitHub Copilot.
  • Plugin bundle format: TOML fields and generated plugin bundle directories, manifests, MCP bundle files, and Codex marketplace metadata.
  • Platform references: official documentation used to ground target-specific output formats, plus adjacent future-scope concepts such as MCP.
  • Development: local setup, tests, checks, and optional E2E smoke tests.
  • Release process: version policy, release checklist, prerelease flow, and publish failure notes.

Python API

The command line interface is the recommended integration point for downstream repositories because it keeps callers dependent on the public command contract. A Python API is available for advanced embedding:

from pathlib import Path

from agent_def_translator import Target, generate

generated = generate(
    definitions_dir=Path("agents"),
    output_dir=Path("generated"),
    targets=(Target.CLAUDE, Target.CODEX, Target.COPILOT),
)

Target is a plain Enum, not a str subtype. Pass Target.parse("claude") or an explicit target name string to public helper functions when you need to coerce user input at the boundary.

Scope

  • Canonical definitions live in TOML files.
  • Platform-specific differences live in [targets.<target>] tables.
  • Generated files are deterministic and disposable.
  • The canonical format captures shared role intent; native platform files are generated as target-specific projections.
  • MCP server implementation is out of scope, but MCP config definitions can be translated into target-specific config fragments.
  • Plugin definitions package generated subagents, skills, and MCP config fragments into target-specific plugin bundles. They do not define new agent behavior.
  • Concrete workflow skill examples are intentionally tiny, such as examples/skills/hello/SKILL.md.

Development

This repository uses lefthook to run the same checks as CI locally, so problems surface before they reach CI.

# Install dependencies
uv sync

# Install the Git hooks (once; requires lefthook on your PATH)
lefthook install

Once installed, the hooks run automatically:

  • pre-commit: uv run poe check
  • pre-push: uv run poe check and uv run poe test

You can also run the checks manually:

uv run poe check
uv run poe test
uv run poe coverage-xml

uv run poe coverage-xml now runs the deterministic e2e smoke test in the same job that produces the coverage badge, so a regression in the installed-CLI and generated-artifact path fails that job. The e2e smoke test invokes the CLI as a subprocess, so it does not raise the reported line-coverage percentage; only the job's pass/fail status reflects it. The opt-in live and model_live checks stay outside both the coverage job and the published badge/gates.

CI still runs the full matrix (see .github/workflows/); the hooks only bring that feedback earlier on your machine.

License

MIT License. See LICENSE.

Metadata

Release files for agent-def-translator 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-def-translator 0.2.0
File Size Uploaded Provenance Actions
agent_def_translator-0.2.0.tar.gz 109.8 kB With provenance Details for agent_def_translator-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-def-translator 0.2.0
File Interpreter ABI Platform Actions
agent_def_translator-0.2.0-py3-none-any.whl Python 3 none any Details for agent_def_translator-0.2.0-py3-none-any.whl

Total release size: 142.1 kB

Release files / agent_def_translator-0.2.0.tar.gz

Download URL agent_def_translator-0.2.0.tar.gz
Size 109.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c3fbcb60165840d33e585c2880cd631f9b2583dad483c0d0e803a9ffe3fd4a4b
BLAKE2b-256 checksum
How to use checksums
8b3e22b977c9c92a30978ebd5d21dfa9939799223fb047a35a26cba2c2a653df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / agent_def_translator-0.2.0-py3-none-any.whl

Download URL agent_def_translator-0.2.0-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
402c6bcde80498fb9e30e754051c02581540e67004d38d209f1293cf4713b2c5
BLAKE2b-256 checksum
How to use checksums
b57981b5f77b60c564b6dfa6d8f6a2b241cb5b14e316eeecfc2b22e31917ad80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for agent-def-translator 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_def_translator-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page