AI-Native Declarative Platform for B2B Applications
Project description
Reclapp 2.2.0 - AI-Native Declarative Platform
AI-Native Declarative Platform for building autonomous B2B applications with causal reasoning, verification loops, and production-ready safety rails.
๐ Key Features
- Python CLI -
pip install -e .โreclappcommand - Full Lifecycle - Single command: prompt โ contract โ code โ service โ tests
- Contract AI 2.2 - 3-layer specification (Definition, Generation, Validation)
- 8-Stage Validation - Syntax, Schema, Assertions, Static Analysis, Tests, Quality, Security, Runtime
- Pydantic Contracts - Python-first contract definitions
- Auto-fix - Automatic package.json and tsconfig.json fixes
๐ Quick Start
Prerequisites
- Node.js 18+
- Docker & Docker Compose (optional)
- npm or yarn
Installation
# Clone repository
git clone https://github.com/wronai/contract.git
cd contract
# If npm is not available in your shell (e.g. non-interactive/CI), load NVM first:
source ~/.nvm/nvm.sh
# Install Node.js dependencies
npm install
# Install Python CLI (recommended)
pip install -e .
# Or with venv
python3 -m venv venv
source venv/bin/activate
pip install -e .
Python CLI
# After pip install -e .
reclapp --version # Show version
reclapp --help # Show help
reclapp --prompt "Create a notes app" # Full lifecycle
reclapp prompts # Show example prompts
reclapp validate # Validate Pydantic contracts
Code Analysis & Refactoring (NEW in 2.4)
# Analyze existing codebase
./bin/reclapp analyze ./src
# Refactor from GitHub (clone + analyze + generate contract)
./bin/reclapp refactor https://github.com/user/repo
# Refactor local directory
./bin/reclapp refactor ./my-project
# Output: refactoring_contract.json, analysis_report.md, todo_list.md
Evolution Mode (NEW in 2.4)
# Generate full application from prompt
./bin/reclapp evolve -p "Create a todo app" -o ./output2
# With CI/CD and Docker
./bin/reclapp evolve -p "Create a blog with cicd and docker" -o ./output
# Keep running (watch mode)
./bin/reclapp evolve -p "Create an inventory app" -o ./output -k
Full Lifecycle (NEW in 2.3)
# From prompt - generates contract, code, validates, and tests
./bin/reclapp-full-lifecycle.sh --prompt "Create a notes app"
# From contract file
./bin/reclapp-full-lifecycle.sh examples/crm/contracts/crm-human-readable.rcl.md
# With options
./bin/reclapp-full-lifecycle.sh --prompt "Create a CRM" -o ./my-app --port 4000
Contract AI Generation
# Generate from prompt
./bin/reclapp generate-ai --prompt "Create a todo app with tasks"
# Generate from contract
./bin/reclapp generate-ai examples/contract-ai/crm-contract.ts -o ./generated
Generate Application from Contract
# List available contracts
./bin/reclapp list
# Generate full application from contract (RCL format - recommended)
./bin/reclapp generate examples/crm/contracts/crm-human-readable.rcl.md
# Or from compact DSL
./bin/reclapp generate examples/crm/contracts/crm-compact-dsl.reclapp.rcl
# Or from TypeScript (with validation)
./bin/reclapp generate examples/crm/contracts/crm-typescript-validation.reclapp.ts
# Generate and run development servers
./bin/reclapp dev examples/crm/contracts/crm-human-readable.rcl.md
Workflow Strategies (NEW in 2.5)
Reclapp supports two complementary methods of working with contracts:
-
Manual-First (RCL Markdown):
- Workflow: You write
.rcl.mdmanually (seeexamples/b2b-onboarding/contracts/onboarding.rcl.md). - Best for: Clear documentation, human-readable specifications, and explicit control over entities and events.
- Command:
./bin/reclapp generate <file>.rcl.md
- Workflow: You write
-
AI-First (Evolution Mode):
- Workflow: You provide a natural language prompt, and Reclapp generates a
contract.ai.jsonexecution plan. - Best for: Rapid prototyping, complex logic generation, and automated iteration loops.
- Command:
reclapp evolve -p "Your prompt" -o ./output
- Workflow: You provide a natural language prompt, and Reclapp generates a
Hybrid Integration:
- Markdown โ JSON: You can now embed or extract the AI execution plan (JSON) directly from an
.rcl.mdfile. This allows you to have a human-readable spec that also controls the automated evolution process. - JSON โ Markdown: Generated
contract.ai.jsoncan be converted back to.rcl.mdfor documentation and manual refinement.
Contract Formats
| Format | Extension | Description | Use Case |
|---|---|---|---|
| RCL Markdown | .rcl.md |
Human-readable with documentation | Best for validation and collaboration |
| Mini-DSL | .reclapp.rcl |
Compact syntax (~87% less code) | Quick prototyping |
| TypeScript | .reclapp.ts |
Type-safe with validation | Production contracts |
| Full Deployment | .reclapp |
Complete deployment config | Full-stack apps |
Convert Between Formats
# Convert Mini-DSL to Markdown
./bin/reclapp convert contract.reclapp.rcl --format md
# Convert Markdown to TypeScript
./bin/reclapp convert contract.rcl.md --format ts
# Convert TypeScript to Mini-DSL
./bin/reclapp convert contract.reclapp.ts --format rcl
Note: contract.ai.json from reclapp evolve is an internal AI format and cannot be directly converted. Use the chat interface to generate RCL formats.
Run Generated Application
# After generation, start the servers
cd examples/crm/target/api && npm install && npm run dev # API on :8080
cd examples/crm/target/frontend && npm install && npm run dev # UI on :3000
Using Docker
# Start Docker services (with auto-diagnostics)
make auto-up
# Or use standard commands
make up # Start services
make logs # View logs
make down # Stop services
# Run tests
make test
Data Source: Example apps typically use JSON fixtures under data/ and the modules/data-provider module.
๐ Project Structure
reclapp/
โโโ bin/ # CLI Tools
โ โโโ reclapp # Main Node.js CLI (analyze, refactor, evolve)
โ
โโโ src/core/contract-ai/ # Contract AI Core
โ โโโ analysis/ # Code analysis & refactoring
โ โ โโโ code-analyzer.ts # Multi-language parser (9 languages)
โ โ โโโ refactoring-contract.ts # Contract generator
โ โโโ evolution/ # Evolution pipeline
โ โ โโโ evolution-manager.ts # Main orchestrator
โ โ โโโ task-handlers.ts # Task handlers
โ โ โโโ llm-orchestrator.ts # LLM integration
โ โโโ types/ # 3-Layer types
โ โโโ generator/ # Contract generator
โ โโโ validation/ # 8-stage validation pipeline
โ
โโโ examples/
โ โโโ prompts/ # Example prompts (10 files)
โ โโโ contract-ai/ # TypeScript contracts
โ โโโ pydantic-contracts/ # Python contracts
โ
โโโ pyproject.toml # Python package config
โโโ package.json # Node.js dependencies
โโโ AGENTS.md # Agent specification
๐ค Contract AI - 3-Layer Specification
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Layer 1: DEFINITION โ app, entities, api โ
โ Layer 2: GENERATION โ instructions, techStack โ
โ Layer 3: VALIDATION โ assertions, tests, acceptanceโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Workflow
PROMPT โ CONTRACT โ CODE โ VALIDATE โ SERVICE โ TESTS
(LLM) (LLM) (8 stages) (Express) (CRUD)
Example Prompts
# Simple prompts
reclapp --prompt "Create a notes app"
reclapp --prompt "Create a todo app with tasks"
reclapp --prompt "Create a CRM with contacts and deals"
# From prompt files (more detailed)
reclapp --prompt "$(cat examples/prompts/01-notes-app.txt)"
reclapp --prompt "$(cat examples/prompts/03-contacts-crm.txt)" -o ./my-crm
# Or use the helper script
./bin/reclapp-from-prompt.sh examples/prompts/02-todo-app.txt
Available Prompt Files
| Prompt | Description |
|---|---|
01-notes-app.txt |
Simple notes with CRUD |
02-todo-app.txt |
Tasks with priorities and categories |
03-contacts-crm.txt |
CRM with contacts, companies, deals |
04-inventory.txt |
Stock management system |
05-booking.txt |
Reservation system |
06-blog.txt |
Blog with posts and comments |
07-hr-system.txt |
Employee management |
08-invoices.txt |
Invoice system |
09-support-tickets.txt |
Support ticket system |
10-events.txt |
Event registration |
Example Contracts
| Contract | File |
|---|---|
| CRM | examples/contract-ai/crm-contract.ts |
| Notes | examples/pydantic-contracts/contracts.py |
| Todo | examples/full-lifecycle/02-todo-app.ts |
โ Reclapp - Full Lifecycle Working
๐ Status
| Component | Status |
|---|---|
Python CLI (reclapp) |
โ Working |
Shell CLI (reclapp-full-lifecycle.sh) |
โ Working |
| 8-Stage Validation | โ All Passing |
| Service Health Check | โ Working |
| CRUD Endpoint Tests | โ 2/2 Passing |
๐ Quick Test
# Install Python CLI
pip install -e .
# Run full lifecycle
reclapp --prompt "Create a todo app with tasks"
# Or use shell script
./bin/reclapp-full-lifecycle.sh --prompt "Create a notes app"
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RECLAPP 2.2.0 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ INPUT โ
โ โโโ Prompt ("Create a CRM system") โ
โ โโโ TypeScript Contract (*.ts) โ
โ โโโ Pydantic Contract (Python) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ CONTRACT AI (3 Layers) โ
โ โโโ Definition (app, entities, api) โ
โ โโโ Generation (instructions, techStack) โ
โ โโโ Validation (assertions, tests, acceptance) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ VALIDATION PIPELINE (8 Stages) โ
โ โโโ 1. Syntax 5. Tests โ
โ โโโ 2. Schema 6. Quality โ
โ โโโ 3. Assertions 7. Security โ
โ โโโ 4. Static 8. Runtime โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OUTPUT โ
โ โโโ Generated API (Express.js + TypeScript) โ
โ โโโ Health Check (/health) โ
โ โโโ CRUD Endpoints (/api/v1/items) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Documentation
| Document | Description |
|---|---|
| Project Status | Current status |
| Testing Guide | Testing procedures |
| LLM Configuration | Multi-provider LLM setup and routing |
| AGENTS.md | Agent specification |
๐ค Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing) - Open Pull Request
๐ License
Apache 2 License - see LICENSE for details.
๐ Links
Reclapp - AI-Native Declarative Platform for Autonomous B2B Applications
Made with โค๏ธ by Softreck
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
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 reclapp-2.2.1.tar.gz.
File metadata
- Download URL: reclapp-2.2.1.tar.gz
- Upload date:
- Size: 120.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b2920f65d172e795dc7f57ece9d802cb385c75b886f824f5e2e719d6575451d
|
|
| MD5 |
96aa8266082c1e3764e0067f7d43c7c8
|
|
| BLAKE2b-256 |
8c687fdd8d66cea9ac2f953cd2bda7d7f45a43400c88ba25a46ec32064d44caa
|
File details
Details for the file reclapp-2.2.1-py3-none-any.whl.
File metadata
- Download URL: reclapp-2.2.1-py3-none-any.whl
- Upload date:
- Size: 147.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646f72ab6bbcac8315e987b07a82238784097106f9500942990ed1a09850a885
|
|
| MD5 |
fc2a631b8fcde9ebb3d060d216a7903b
|
|
| BLAKE2b-256 |
7dd2ec2f15bfac54c83f56208f27e9075468b31c20e8c831552c45e7d9a66213
|