Skip to main content

Translate plain business-language descriptions into portable AI agent specifications

Project description

Writ

Give your agent a writ.

Writ turns plain business-language descriptions into portable AI agent specifications — through a friendly interview (for humans) or an MCP server (for other agents). No technical knowledge required.

What it does

Three ways to use it:

  1. Interactive TUI — a non-technical user runs writ, answers 5–8 questions, and gets compiled specs.
  2. CLIwrit compile, writ bundle, writ resolve operate on saved specs.
  3. MCP serverwrit mcp-serve exposes the whole pipeline to another agent. Agent-to-agent spec authoring.

Writ produces, from any of those three entry points:

  • AGENTS.md — human-readable spec (agentskills.io format)
  • claude.json — ready for Anthropic Messages API
  • openai.json — ready for OpenAI Responses API
  • gemini.json — ready for Google Gemini API
  • oas.yaml — Open Agent Spec v1

Quickstart

pip install writ-agents
export ANTHROPIC_API_KEY=sk-ant-...
writ

That's it — the TUI launches and guides you through the interview.

CLI

writ                                      # start an interview
writ create                                # same as `writ`
writ compile spec.json --to claude -o out.json
writ compile spec.json --to agents-md --resolve -o AGENTS.md
writ bundle  spec.json -o ./dist --resolve           # emit all 5 formats
writ resolve spec.json                                # list matched connectors
writ doctor                                           # env/config diagnostics
writ config  --set-key sk-ant-...                     # save API key
writ mcp-serve                                        # run as an MCP server
writ version

MCP server — agent-to-agent mode

Writ runs as an MCP server so other agents can build specs without a human in the loop:

writ mcp-serve              # stdio transport (default — for Claude Desktop, Cursor, etc.)
writ mcp-serve --transport http

Exposed tools:

Tool Purpose
writ_interview_start(initial_description?) Open a session, get the first question
writ_interview_answer(session_id, answer) Reply, get next question or final spec
writ_one_shot(description) Skip the interview — one call, full spec
writ_resolve_connectors(spec) Map business terms → connector catalog
writ_compile(spec, format) Compile to a single target format
writ_compile_all(spec) Compile to all 5 formats at once
writ_list_connectors() / writ_list_compilers() Introspect what's available
writ_get_session(id) / writ_end_session(id) Session lifecycle

Resources: writ://catalog (connector catalog), writ://schema (Spec JSON schema).

Example Claude Desktop config:

{
  "mcpServers": {
    "writ": {
      "command": "writ",
      "args": ["mcp-serve"],
      "env": { "ANTHROPIC_API_KEY": "sk-ant-..." }
    }
  }
}

See examples/mcp_client.py for a scripted agent-to-agent flow.

Example output

After a 6-question interview about a support triage agent, Writ produces:

# Support Triage Bot
> I help you route customer issues to the right team fast.

**Archetype:** triage

## Purpose
Automatically classify and route incoming customer support tickets.

## System Prompt

You are a support triage assistant. When a support email arrives, classify it by urgency (high/medium/low) and department (billing, technical, general). Route high-urgency tickets to the on-call lead via Slack immediately. Never close a ticket without human review.

Architecture

 Human via TUI ─┐
 CLI commands ──┼─► interview_step (core/step.py) ──► PartialSpec accumulated
 MCP server   ──┘                                               │
                                                                ▼
                                                        Connector resolution
                                                                │
                                                                ▼
                                                    5 compiled output formats

Every caller (TUI, CLI, MCP) sits on the same interview_step primitive in core/step.py. See docs/ARCHITECTURE.md for the full design.

Requirements

  • Python 3.11+
  • Anthropic API key

License

MIT. 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

writ_agents-0.2.0.tar.gz (137.4 kB view details)

Uploaded Source

Built Distribution

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

writ_agents-0.2.0-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file writ_agents-0.2.0.tar.gz.

File metadata

  • Download URL: writ_agents-0.2.0.tar.gz
  • Upload date:
  • Size: 137.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for writ_agents-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4370c007b35300a6a0d3dc40c3884a9f92fb315ba54fa32ff646b7dc33274068
MD5 eb8744dc5ab608013e34186cf4ca60ec
BLAKE2b-256 16f3abe8192d48db6ed2c361057d626f310377e857acb74afe7fa9b41d28ecf9

See more details on using hashes here.

File details

Details for the file writ_agents-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: writ_agents-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for writ_agents-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 959b83c9f889dae062ccf9f1d29ea309390530bee1457d51ad395cf8227cb7f7
MD5 33f4ae22ca8c03a64c048103a7cd5993
BLAKE2b-256 459dda030cae8d3b27809a1b9d37e2bdba64ccc362d5c50785467e6033be14dc

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