Skip to main content

The communication layer for AI agents. Route context between repos, devices, and tools.

Project description

writ

Better instructions. Connected agents.

PyPI License: MIT Python 3.11+ Tests

The quality and communication layer for AI coding agents. Lint your instructions, compose context across tools, and connect agents across repos and devices.

pip install enwrit
writ lint CLAUDE.md               # Instant quality score (0-100) for any instruction
writ init                         # Initialize writ in repo
writ search "code reviewer"       # Find instructions from Hub database
writ add code-review-agent        # Install instruction; from library, project or Hub

Try the live lint demo -- paste any instruction, get an instant quality score. Or browse 6000+ instructions on the Hub.


Lint Your Instructions

97% of AI instructions have quality defects. writ lint catches them.

writ lint .cursor/rules/my-rule.mdc
# Score: 34 / 100 (D)
# - 6 instances of vague language ("try to", "consider", "if possible")
# - No verification commands (agents can't check their own work)
# - No code examples
# Suggestions:
#   Replace vague phrases with imperative commands
#   Add backtick-wrapped test/build/lint commands (2-3x quality impact)
#   Add 1-3 code examples showing desired patterns

Scores 0-100 across 6 dimensions: Clarity, Verification, Coverage, Brevity, Structure, Examples. Works on any .md, .mdc, .txt, or YAML instruction file -- no writ init required.

writ lint CLAUDE.md                     # Score any file (ML-powered, local, free)
writ lint my-agent                      # Score a managed instruction
writ lint AGENTS.md --deep              # AI-powered analysis (Gemini, via enwrit.com)
writ lint AGENTS.md --deep-local        # Local AI analysis (writ-lint-0.8B, GPU-accelerated)
writ lint rules.mdc --json              # Machine-readable output for CI
writ lint --ci --min-score 60           # Exit 1 if score too low (CI gate)

Try it in your browser -- paste any instruction, get an instant score.


30-Second Quickstart

# 1. Install
pip install enwrit

# 2. Initialize in any repo (auto-detects your stack, installs writ-context rule)
writ init

# 3. Search and add from 6,000+ instructions on the Hub
writ search "code review"
writ add code-review-agent         # Fetches from Hub, saves to .writ/, writes to IDE dirs

That's it. Your IDE now has battle-tested instructions -- no copy-paste, no manual conversion.

What Makes writ Different

Capability What it means
Instruction linting 6-dimension quality scoring (0-100) for any AI instruction file. Code-based + AI-powered.
Context composition Layer project + team + agent + handoff context into one coherent instruction set
Multi-format export Cursor .mdc, Claude Code, Kiro steering (auto-detected); AGENTS.md, Copilot, Windsurf (opt-in)
Agent communication Structured conversations between agents across repos and devices
Personal library + cloud sync writ savewrit add --lib on any device. Your instructions follow you.
Hub with 6,000+ instructions Semantic search across rules, agents, programs (PRPM + enwrit). writ search <query> / writ add <name>
MCP server One line in your config and any agent can search/install from the Hub

How It Works

writ writes to native IDE files -- it does NOT call LLM APIs.

Tool writ writes to Mode
Cursor .cursor/rules/writ-*.mdc Auto-detected
Claude Code .claude/rules/writ-*.md Auto-detected
Kiro .kiro/steering/writ-*.md Auto-detected
AGENTS.md AGENTS.md Opt-in (--format)
GitHub Copilot .github/copilot-instructions.md Opt-in (--format)
Windsurf .windsurfrules Opt-in (--format)

When you run writ add reviewer, the tool composes all relevant context and writes it directly into the files your IDE already reads.

Context Composition

The core innovation. Each agent's context is composed from 4 layers:

Layer 4: Handoff context      ← Output from another agent
Layer 3: Agent's instructions  ← The agent's own role
Layer 2: Inherited context     ← From parent agents
Layer 1: Project context       ← Auto-detected (languages, frameworks, structure)
writ add implementer --with architect    # Compose with architect's context

MCP Server (One-Line Setup)

Give any MCP-compatible agent access to the Hub -- no CLI needed:

{
  "mcpServers": {
    "writ": {
      "command": "uvx",
      "args": ["enwrit", "mcp", "serve"]
    }
  }
}

This exposes 22 tools: search the Hub, install instructions, compose context, read files, start agent conversations, and more. Run writ mcp serve --help for the full list.

Hub: Browse & Install

The enwrit Hub has 50+ curated instructions across three tiers:

  • Rules -- passive context that shapes agent behavior (verification loops, commit hygiene, no-secrets)
  • Agents -- on-invocation workers (code review, git commit, documentation, security audit)
  • Programs -- autonomous metric-driven loops (test coverage optimizer, dependency freshness, dead code eliminator)
writ search "code review"          # Search from CLI
writ add code-review-agent         # Install into your project + activate in your IDE

Templates

Bootstrap an agent team in seconds:

writ init --template fullstack     # Architect + implementer + reviewer + tester
writ init --template python        # Python developer + reviewer
writ init --template typescript    # TypeScript developer + reviewer
writ init --template rules         # Project rule + coding standards

Personal Library & Cloud Sync

writ save my-reviewer              # Save to library (local + cloud)
writ login                         # Authenticate for cross-device sync
writ add my-reviewer --lib         # Load from library on any machine
writ list --library                # See everything (local + remote)

Cross-Project Memory

writ memory export research-insights     # Export from current project
writ memory import research-insights     # Import in another project

Agent-to-Agent Communication

Agents can have structured conversations across repos:

writ peers add partner-repo --path ../partner-repo
writ chat start --with partner-repo --goal "Review API design"
writ chat send <conv-id> "Here's my proposed schema..."
writ inbox                          # Check for responses

All Commands

Command Description
writ init Initialize in current repo (auto-installs writ-context rule)
writ add <name> Add instruction: project -> library -> Hub -> create new; auto-writes to IDE dirs
writ add <name> --lib Force fetch from personal library
writ add <name> --from prpm Install directly from PRPM registry
writ add <name> --format cursor Export to a specific format
writ add --file <path> Import markdown file(s) or directory
writ list List all instructions in project
writ list --library List personal library (local + remote)
writ remove <name> Remove instruction
writ save <name> Save to personal library
writ search <query> Semantic search across Hub (6,000+ instructions)
writ publish / unpublish Make publicly discoverable
writ login / logout Authenticate with enwrit.com
writ register Create account
writ lint [file|name] [--deep] [--deep-local] Quality score (0-100, 6 dimensions)
writ sync Bulk bidirectional library sync
writ mcp serve Start MCP server (22 tools, auto-installs deps)
writ chat start/send/inbox Agent-to-agent conversations (supports --file attachments)
writ memory export/import Cross-project memory
writ handoff create Create agent handoff
writ review <name> Browse/submit reviews
writ threads Knowledge threads
writ approvals Human-in-the-loop approval management

Instruction Format

Instructions are YAML files in .writ/, routed by task_type:

name: reviewer
description: "Code reviewer for TypeScript"
version: 1.0.0
task_type: agent    # agent | rule | context | program | template
tags: [typescript, review]
instructions: |
  You are a code reviewer specializing in TypeScript.
  Focus on: type safety, component composition, performance.
composition:
  inherits_from: [architect]
  project_context: true

Users interact primarily with markdown. Use writ add --file to import .md, .mdc, or .txt files directly.

Development

git clone https://github.com/enwrit/writ.git
cd writ
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -e ".[dev]"
pytest                    # 432+ tests
ruff check src/ tests/

License

MIT

Links

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

enwrit-0.4.9.tar.gz (7.3 MB view details)

Uploaded Source

Built Distribution

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

enwrit-0.4.9-py3-none-any.whl (7.7 MB view details)

Uploaded Python 3

File details

Details for the file enwrit-0.4.9.tar.gz.

File metadata

  • Download URL: enwrit-0.4.9.tar.gz
  • Upload date:
  • Size: 7.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for enwrit-0.4.9.tar.gz
Algorithm Hash digest
SHA256 33f3518bf9ece0d46b6cb531d22c0ca730b9b6abc87efd31e5f096852c10ff02
MD5 9a0d6b2f908e6c162b251da4adb223bd
BLAKE2b-256 89f464e61848860ff339dfb7ff2d48df278b34b84015352b0f97651addf5bf0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for enwrit-0.4.9.tar.gz:

Publisher: publish.yml on enwrit/writ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file enwrit-0.4.9-py3-none-any.whl.

File metadata

  • Download URL: enwrit-0.4.9-py3-none-any.whl
  • Upload date:
  • Size: 7.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for enwrit-0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f0634f37f0455a4abd063e92a40d6283dc44b464b77066cba2d720caeeadd290
MD5 c7912ce704c982d6a193bfd001d450aa
BLAKE2b-256 8f31d0ca95ccbe7265dacc77dd33b82b86603ae770053ccc038fb2daa8e98859

See more details on using hashes here.

Provenance

The following attestation bundles were made for enwrit-0.4.9-py3-none-any.whl:

Publisher: publish.yml on enwrit/writ

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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