Skip to content

wronai/contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

reclapp.png

Reclapp 2.2.0 - AI-Native Declarative Platform

Version License TypeScript Node Python

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 . β†’ reclapp command
  • 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/contract-ai/crm-contract.ts

# 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
reclapp list

# Generate full application from contract
reclapp generate examples/crm/contracts/main.reclapp.ts

# Or generate and run development servers
reclapp dev examples/crm/contracts/main.reclapp.ts

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

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. 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

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published