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 antigravityauto-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.
pip install project-rules-generator && cd your-project && prg init .
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 needed — prg 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:
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
- 3-Layer Skill System — project > learned > builtin priority. See
docs/skills.md. - All Commands — full CLI reference with examples. See
docs/cli.md. - How Analysis Works — strategy chain and quality gate. See
docs/architecture.md. - Ralph — autonomous feature loop. See
docs/ralph.md. - Two-Stage Planning —
prg design+prg plan. Seedocs/plan-and-design.md.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
234d27a1dd10f0ca6272c05d473473110ee5431f933401f8f552efef4e04b2ac
|
|
| MD5 |
26948206af4796a9e4f0aca27cc347e9
|
|
| BLAKE2b-256 |
dbc84b071e2585045e7bbd606c8accdfc45871b807be9c9a18da0e09f7b3bd8f
|
Provenance
The following attestation bundles were made for project_rules_generator-0.3.1.tar.gz:
Publisher:
publish.yml on Amitro123/project-rules-generator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
project_rules_generator-0.3.1.tar.gz -
Subject digest:
234d27a1dd10f0ca6272c05d473473110ee5431f933401f8f552efef4e04b2ac - Sigstore transparency entry: 1694625440
- Sigstore integration time:
-
Permalink:
Amitro123/project-rules-generator@f3a5b0d65e4dc586e0b7dbed9c316da79fd0f484 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Amitro123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f3a5b0d65e4dc586e0b7dbed9c316da79fd0f484 -
Trigger Event:
push
-
Statement type:
File details
Details for the file project_rules_generator-0.3.1-py3-none-any.whl.
File metadata
- Download URL: project_rules_generator-0.3.1-py3-none-any.whl
- Upload date:
- Size: 420.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8007ae9df03b8645f535a7ce233db01f18f183fa596e9e839647987558dda93
|
|
| MD5 |
96a908a09cf886d49303c97e5e977105
|
|
| BLAKE2b-256 |
0ffb96eddb5ebc2442e00b1337b480dd8bf932d53009a012fe23f3348ac5451a
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
project_rules_generator-0.3.1-py3-none-any.whl -
Subject digest:
e8007ae9df03b8645f535a7ce233db01f18f183fa596e9e839647987558dda93 - Sigstore transparency entry: 1694625832
- Sigstore integration time:
-
Permalink:
Amitro123/project-rules-generator@f3a5b0d65e4dc586e0b7dbed9c316da79fd0f484 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/Amitro123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f3a5b0d65e4dc586e0b7dbed9c316da79fd0f484 -
Trigger Event:
push
-
Statement type: