Skip to main content

Generate coding rules and skills for AI agents from your codebase. Core features (init, analyze) work offline; design and planning commands require an AI provider API key.

Project description

Project Rules Generator

Stop re-explaining your project to every AI agent. PRG scans your repo once and emits .clinerules/ — structured rules, skills, and conventions as portable Markdown. Cline reads .clinerules/ natively, --ide antigravity auto-registers them for Antigravity, and any agent (Claude, Cursor, Windsurf, Copilot) can load them as context. Works offline; LLM-augmented with a free API key.

Python 3.10+ License: MIT Tests

pip install project-rules-generator && cd your-project && prg init .

Screenshot: prg analyze running on a Python project, detecting the tech stack and writing rules.md, clinerules.yaml, and skills/ into .clinerules/


The Problem

Every AI agent you use — Claude, Cursor, Windsurf, Copilot — starts every conversation knowing nothing about your project.

You explain your stack. Again. You correct the same bad patterns. Again. You watch it generate code that ignores your architecture. Again.

The AI isn't dumb. It's context-blind.


The Solution

Project Rules Generator (PRG) generates structured memory artifacts for AI coding agents — rules, skills, plans, and specs that any agent (Claude, Cursor, Windsurf, Copilot) can consume.

Run it once. Every future AI session starts with project context: your stack, your conventions, your architecture, your do's and don'ts.

cd your-project
prg init .

Your .clinerules/ is now the memory your AI agents never had. Generate the artifacts, then let any agent consume them — or optionally run Ralph to execute autonomously on top of them.


Quick Start

No API key neededprg init and prg analyze work fully offline from your README and file structure:

pip install project-rules-generator
prg init .
prg analyze .

With a free API key — LLM-generated skills, richer analysis, and the planning commands:

export GROQ_API_KEY=gsk_...   # free at console.groq.com
prg analyze . --ai
prg design "Add OAuth2 login"   # requires API key
prg plan "Add OAuth2 login"     # requires API key
Command Offline Requires API key
prg init / prg analyze
prg watch
prg design / prg plan
prg review
prg analyze --ai

Optionally, run Ralph — an autonomous execution loop that reads your generated artifacts and iterates until the feature is done:

prg feature "Add OAuth2 login"         # Set up feature branch + state
prg ralph run FEATURE-001              # Autonomous loop (no per-task prompts)
prg ralph approve FEATURE-001          # Human approval → merge to main

See docs/quick-start.md for the full guide.


See It In Action

$ cd my-fastapi-project
$ prg init .
✓ Detected stack: Python · FastAPI · pytest · Docker
✓ Generated .clinerules/rules.md          (21 rules)
✓ Generated .clinerules/clinerules.yaml
→ Next: run `prg analyze . --ai` to add skills (free Groq key)

$ export GROQ_API_KEY=gsk_...
$ prg analyze . --ai
Analyzing project context...
✓ Rules updated                            (24 rules)
✓ Skills matched: test-driven-development, code-review, systematic-debugging
✓ Skill generated: fastapi-endpoints       (.clinerules/skills/learned/)
✓ Skill generated: pydantic-validation     (.clinerules/skills/learned/)
✓ Wrote .clinerules/clinerules.yaml        (project: 2 · learned: 2 · builtin: 3)

Cline & Antigravity load these automatically; point any agent at .clinerules/.
Ask it to "add a login endpoint" — it will use async SQLAlchemy,
Pydantic response models, and place the route in the right module.

PRG analyzing itself — real terminal output, no staging:

PRG Analyze Demo


What Gets Generated

PRG writes .clinerules/ (works with any agent) and optionally .agents/rules/<project-name>.md (for Antigravity IDE integration).

.clinerules/
├── rules.json      ← Machine-readable rules
├── constitution.md  ← Non-negotiable principles (--constitution)
├── clinerules.yaml  ← Skill index for agents
└── skills/
    ├── project/     ← AI-generated, tailored to YOUR project
    ├── learned/     ← Reusable patterns, shared across projects
    └── builtin/     ← Battle-tested best practices, bundled

See docs/structure.md for a full breakdown of every file and location.


AI Providers

PRG auto-detects the best available provider from your environment. Set one key, or set several — it routes intelligently.

Provider Model Best For Key
Anthropic Claude Sonnet 4.6 Highest quality rules & skills ANTHROPIC_API_KEY
OpenAI GPT-4o-mini Solid all-rounder OPENAI_API_KEY
Gemini Gemini 2.0 Flash Fast + high quality GEMINI_API_KEY
Groq Llama 3.1 8b Free tier, fastest GROQ_API_KEY

No provider? prg init and prg analyze still work offline. prg design, prg plan, and prg review require a key.

prg providers list       # See what's configured
prg providers test       # Live latency check
prg providers benchmark  # Side-by-side quality ranking

Key Concepts


Installation

From PyPI (recommended):

pip install project-rules-generator
prg --version

From source (contributors):

git clone https://github.com/Amitro123/project-rules-generator
cd project-rules-generator
pip install -e .
prg --version

Requirements: Python 3.10+, Git


Project Status

Alpha — core analysis, rules generation, and skill management are stable. The planning pipeline (prg plan, prg design) and autonomous loop (prg ralph) are in active development.

Area Status
prg init / prg analyze / prg create-rules ✅ Stable
prg skills * / prg agent ✅ Stable
prg plan / prg design / prg review 🚧 Beta
prg ralph / prg feature 🚧 Experimental
IDE registration (--ide antigravity) ✅ Implemented
IDE registration (cursor / windsurf / vscode) 📋 Planned — PRs welcome

Known limitations: See docs/KNOWN-ISSUES.md.


Contributing

See CONTRIBUTING.md for the full guide: dev setup, how to add a command, how the skill system works, and testing rules.

pytest                              # run tests
black . && ruff check . && isort .  # format (required before commit)

See docs/index.md for all documentation.


License

MIT — see LICENSE.


Full version history: CHANGELOG.md · Architecture: docs/architecture.md · Feature deep-dives: docs/features.md

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

project_rules_generator-0.3.1.tar.gz (351.7 kB view details)

Uploaded Source

Built Distribution

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

project_rules_generator-0.3.1-py3-none-any.whl (420.8 kB view details)

Uploaded Python 3

File details

Details for the file project_rules_generator-0.3.1.tar.gz.

File metadata

  • Download URL: project_rules_generator-0.3.1.tar.gz
  • Upload date:
  • Size: 351.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for project_rules_generator-0.3.1.tar.gz
Algorithm Hash digest
SHA256 234d27a1dd10f0ca6272c05d473473110ee5431f933401f8f552efef4e04b2ac
MD5 26948206af4796a9e4f0aca27cc347e9
BLAKE2b-256 dbc84b071e2585045e7bbd606c8accdfc45871b807be9c9a18da0e09f7b3bd8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_rules_generator-0.3.1.tar.gz:

Publisher: publish.yml on Amitro123/project-rules-generator

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

File details

Details for the file project_rules_generator-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for project_rules_generator-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8007ae9df03b8645f535a7ce233db01f18f183fa596e9e839647987558dda93
MD5 96a908a09cf886d49303c97e5e977105
BLAKE2b-256 0ffb96eddb5ebc2442e00b1337b480dd8bf932d53009a012fe23f3348ac5451a

See more details on using hashes here.

Provenance

The following attestation bundles were made for project_rules_generator-0.3.1-py3-none-any.whl:

Publisher: publish.yml on Amitro123/project-rules-generator

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