Skip to main content

AI-Native Declarative Platform for B2B Applications

Project description

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/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:

  1. Manual-First (RCL Markdown):

    • Workflow: You write .rcl.md manually (see examples/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
  2. AI-First (Evolution Mode):

    • Workflow: You provide a natural language prompt, and Reclapp generates a contract.ai.json execution plan.
    • Best for: Rapid prototyping, complex logic generation, and automated iteration loops.
    • Command: reclapp evolve -p "Your prompt" -o ./output

Hybrid Integration:

  • Markdown โ†’ JSON: You can now embed or extract the AI execution plan (JSON) directly from an .rcl.md file. This allows you to have a human-readable spec that also controls the automated evolution process.
  • JSON โ†’ Markdown: Generated contract.ai.json can be converted back to .rcl.md for 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

  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

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

reclapp-2.2.4.tar.gz (102.3 kB view details)

Uploaded Source

Built Distribution

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

reclapp-2.2.4-py3-none-any.whl (116.7 kB view details)

Uploaded Python 3

File details

Details for the file reclapp-2.2.4.tar.gz.

File metadata

  • Download URL: reclapp-2.2.4.tar.gz
  • Upload date:
  • Size: 102.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for reclapp-2.2.4.tar.gz
Algorithm Hash digest
SHA256 5c81ba317c953c1b5df9932ae22401312af181a10a6f9e662287be432a2a9bbd
MD5 922aa2a6623e6776ab835ec468209b5f
BLAKE2b-256 5ad2953502099a997e007e8d701d86985e291cb1c711883564ba3270a3fd4bea

See more details on using hashes here.

File details

Details for the file reclapp-2.2.4-py3-none-any.whl.

File metadata

  • Download URL: reclapp-2.2.4-py3-none-any.whl
  • Upload date:
  • Size: 116.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for reclapp-2.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 22b4d6ea50a2b62735c77124297a1766600d85e6de02dc3a55c52b16b316584f
MD5 413f7b22414a772450d5914b7e848f9f
BLAKE2b-256 6b50b3af7b9a577d1cdfaff6fa27baff9c27bac2b18db4daf0b4e1c82e0ccc9d

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