Skip to main content

Policy Engine & Scaffolding for AI coding agents

Project description

EgoKit

PyPI version Python 3.13+ License: MIT

EgoKit is a stateless, file-based compiler that transforms organizational policies into AGENTS.md content and AI-native slash command prompts. EgoKit generates the rules; modern AI coding tools interpret and execute them.

Table of Contents

Overview

EgoKit addresses a fundamental challenge with AI coding assistants: they forget organizational standards between sessions and sometimes within the same conversation. Teams repeatedly re-explain the same requirements while each developer's AI produces code that drifts from established patterns.

EgoKit solves this by compiling your organization's policies into artifacts that AI coding tools consume natively. You define your standards once in a policy registry. EgoKit compiles them into AGENTS.md (the emerging standard for AI agent configuration) and a set of slash commands that reinforce those policies during development sessions.

The compilation model means EgoKit has no runtime component. It reads your policy files, generates output artifacts, and exits. The AI coding tools (Claude Code, Augment, Cursor, and others) read those artifacts and enforce your policies during their normal operation.

Installation

EgoKit requires Python 3.13 or later.

# Using UV (recommended)
uv add egokit

# Or using pip
pip install egokit

For development installation:

git clone https://github.com/brannn/egokit.git
cd egokit
uv sync --dev

Quick Start

Initialize a policy registry in your organization's configuration repository:

ego init --org "Your Organization"

This creates the policy registry structure:

.egokit/policy-registry/
├── charter.yaml          # Policy rules with severity and detectors
├── ego/
│   ├── global.yaml       # Organization-wide AI behavior settings
│   └── teams/            # Team-specific overrides
└── schemas/              # JSON Schema validation files

Define your policies in the charter and ego configuration files, then apply them to any project repository:

ego apply --repo /path/to/project --registry /path/to/policy-registry

After generating the initial registry, use your AI coding assistant to refine the charter rules and ego settings based on your team's specific requirements. You can use your AI assistant to help develop and maintain these files once it is aware of the EgoKit schema in the registry's schemas/ directory.

EgoKit generates AGENTS.md and slash commands in the target repository. AI coding tools read these files automatically.

For detailed configuration examples and advanced usage, see the User Guide.

Command Reference

Command Description
ego init Create a new policy registry with starter templates
ego apply Compile policies into AGENTS.md and slash commands
ego doctor Display current policy configuration and validation status
ego watch Monitor registry for changes and recompile automatically

Common Options

The apply command accepts these options:

Option Description
--repo PATH Target repository for generated artifacts
--registry PATH Source policy registry location
--dry-run Preview generated content without writing files
--force Overwrite existing AGENTS.md without confirmation

Generated Artifacts

EgoKit produces two categories of output:

AGENTS.md

The primary configuration file that AI coding tools read to understand your organizational policies. AGENTS.md contains policy rules organized by severity, behavioral guidelines, and security considerations. EgoKit manages a fenced section within AGENTS.md, allowing you to maintain custom content before and after the generated policies.

Slash Commands

EgoKit generates eight slash commands in both .claude/commands/ and .augment/commands/ directories:

Command Purpose
/ego-validate Check current work against policies defined in AGENTS.md
/ego-rules Display active policy rules and their severity levels
/ego-checkpoint Capture compliance state before making changes
/ego-review Run pre-commit review checklist
/ego-security Security-focused review of specified file or staged changes
/ego-refresh Re-read AGENTS.md to prevent policy drift
/ego-stats Analyze historical violation patterns
/ego-suggest Propose new rules based on codebase patterns
/ego-persona Switch working persona (developer, writer, reviewer, architect)

These commands are pure AI prompts that reference AGENTS.md. They contain no CLI invocations and work identically across Claude Code and Augment.

Further Reading

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

egokit-1.0.2.tar.gz (40.1 kB view details)

Uploaded Source

Built Distribution

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

egokit-1.0.2-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file egokit-1.0.2.tar.gz.

File metadata

  • Download URL: egokit-1.0.2.tar.gz
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for egokit-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e3196ca336f88f45c0fd6506890f6abba502e83d566270ef848c92858954fa0a
MD5 1c04535754e9fd3b76fa393cdda2304c
BLAKE2b-256 663b510b2ccec52c869b02e362d6deb5de20c3bebaf18763d9bc110c6f8c60a0

See more details on using hashes here.

File details

Details for the file egokit-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: egokit-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.12 {"installer":{"name":"uv","version":"0.9.12"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for egokit-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 01d6f1b328b10f084a29ccfdc6fba8012385ee226a3d4ce25a302aedc08db09d
MD5 08de2b07e9098ab801eb17247951b85a
BLAKE2b-256 cb6b5c614ed34e971c12ca8ed28e6de5044c2f3f0577f16fa5b0a7e464f3aa6f

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