Skip to main content

Translate canonical coding-agent definitions into platform-native agent artifacts.

Project description

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.

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. 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.
  • Definition 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.

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),
)

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.

License

MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_def_translator-0.1.2.tar.gz (85.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_def_translator-0.1.2-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file agent_def_translator-0.1.2.tar.gz.

File metadata

  • Download URL: agent_def_translator-0.1.2.tar.gz
  • Upload date:
  • Size: 85.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agent_def_translator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d16f99c855df02f352e75dfe8e1e0ca1ce7932f56bbdabece671f98c52bc88fd
MD5 72cf09885beb86ab3a05355a1670a879
BLAKE2b-256 caab403818179cf10334de31e3583f31064ee6200ae56da06c41cef3b425edf3

See more details on using hashes here.

File details

Details for the file agent_def_translator-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_def_translator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a520aa535b028a51ac759817a34c860269f0d0740d1b7e400dec45474a5efad
MD5 f6ed99c5038f2b42f7834c3d59bb9314
BLAKE2b-256 b54cc21d0f9139abb587f854ba428fd4bc77e1974c5531819fc7bf366e97381b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page