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 Activate security-focused analysis mode
/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

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.0.tar.gz (39.2 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.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: egokit-1.0.0.tar.gz
  • Upload date:
  • Size: 39.2 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.0.tar.gz
Algorithm Hash digest
SHA256 b8ecdab272df378f9d107e81bca8c375b65ee084644b7b6ca29585630096e803
MD5 2c128c0ca40ee3d768e8d805b7997945
BLAKE2b-256 e64b188fd6e0f218a8ae15764285772a919f0d0d5e3cbcc61c45eac1a4a0e204

See more details on using hashes here.

File details

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

File metadata

  • Download URL: egokit-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31077db7155ac1d6d41dd84e85725bb6bcaa3d380e463b6af1e926f782618c5b
MD5 c6698a3cb72dd853bc117b52e8d98d13
BLAKE2b-256 41ef795ec8dcba2f7d2d808a621d0747c707412e87985410864bbbf976930cc8

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