Skip to main content

LLM Development Framework - Spec-driven development for AI-assisted engineering

Project description

LDF - LLM Development Framework

Python 3.10+ License: MIT

A spec-driven development framework for AI-assisted software engineering. LDF enforces a structured approach where requirements, design, and tasks are approved before any code is written.

Attribution: LDF is a fork of the WDF (WTMI Development Framework/WTMI Internal Tool), created by Jay Dubinsky (@JayFromEpic). Made available to the community as part of the llm.info resource library.

Our Mission and Goal

Our Mission is to help developers build better software regardless of their experience level, and promote the continued sharing of knowledge for the betterment of all.

Our Goal is to make this mission a reality by providing a framework that any developer can leverage to build better code, in a structured and methodical way that won't give your product owner a heart attack ๐Ÿซถ.

Why LDF?

AI coding assistants are powerful but can produce inconsistent results. LDF solves this by:

  • Forcing structured thinking - No code until requirements โ†’ design โ†’ tasks are approved
  • Enforcing guardrails - 8 core constraints validated at every phase
  • Enabling multi-agent review - Use ChatGPT/Gemini to audit your AI's specs
  • Reducing token usage - MCP servers provide 90% token savings vs file reads

Quick Start

1. Install

# Install the CLI
pip install llm-ldf

# Or install from source
git clone https://github.com/LLMdotInfo/ldf.git
cd ldf
pip install -e .

2. Initialize Your Project

# Interactive setup (recommended for first-time users)
ldf init

# Or non-interactive with preset
ldf init --path ./my-project --preset saas -y

The interactive CLI guides you through:

  • Project path - Where to create your project
  • Preset selection - Choose domain-specific guardrails
  • Question packs - Pre-selected based on preset, customize as needed
  • MCP servers - AI integration tools

This creates:

my-project/
โ”œโ”€โ”€ .ldf/
โ”‚   โ”œโ”€โ”€ config.yaml           # Project configuration
โ”‚   โ”œโ”€โ”€ guardrails.yaml       # Active guardrails (8 core + preset)
โ”‚   โ”œโ”€โ”€ question-packs/       # Domain question templates
โ”‚   โ”œโ”€โ”€ answerpacks/          # Design decision storage
โ”‚   โ””โ”€โ”€ specs/                # Your feature specifications
โ”œโ”€โ”€ .agent/commands/          # Slash commands for AI
โ””โ”€โ”€ AGENT.md                  # AI assistant instructions

3. Create Your First Spec

In Claude Code (or any AI assistant with the AGENT.md instructions):

/project:create-spec user-authentication

LDF guides you through:

  1. Question-Packs - Answer critical questions about security, testing, API design
  2. Requirements - Generate user stories with acceptance criteria
  3. Design - Define architecture, data models, APIs
  4. Tasks - Break down into implementable steps with guardrail checklists

4. Validate & Implement

# Lint your specs
ldf lint user-auth           # Lint single spec
ldf lint --all               # Lint all specs

# Generate audit request for ChatGPT/Gemini review
ldf audit --type spec-review

# After approval, implement tasks
/project:implement-task user-auth 1.1

Core Features

Guardrails

8 core guardrails are enabled by default:

# Guardrail Severity Description
1 Testing Coverage Critical โ‰ฅ80% default, โ‰ฅ90% critical paths
2 Security Basics Critical OWASP Top 10 prevention
3 Error Handling High Consistent responses, no swallowed exceptions
4 Logging & Observability High Structured logging, correlation IDs
5 API Design High Versioning, pagination, error format
6 Data Validation Critical Input validation at boundaries
7 Database Migrations High Reversible, separate from backfills
8 Documentation Medium API docs, README, inline comments

Presets add domain-specific guardrails:

Preset Additional Guardrails
saas Multi-tenancy, RLS, subscription billing, audit logs
fintech Double-entry ledger, money precision, compliance, idempotency
healthcare HIPAA compliance, PHI handling, consent management
api-only Rate limiting, versioning, OpenAPI docs

Three-Phase Workflow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 1: Requirements                                       โ”‚
โ”‚  - Answer question-packs (security, testing, API design)    โ”‚
โ”‚  - Generate user stories with EARS criteria                 โ”‚
โ”‚  - Create guardrail coverage matrix                         โ”‚
โ”‚  โ†’ Approval required before proceeding                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 2: Design                                             โ”‚
โ”‚  - Architecture diagrams                                    โ”‚
โ”‚  - Data models and schemas                                  โ”‚
โ”‚  - API endpoint definitions                                 โ”‚
โ”‚  - Guardrail implementation mapping                         โ”‚
โ”‚  โ†’ Approval required before proceeding                      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Phase 3: Tasks                                              โ”‚
โ”‚  - Numbered implementation steps                            โ”‚
โ”‚  - Per-task guardrail checklists                            โ”‚
โ”‚  - Dependencies and test requirements                       โ”‚
โ”‚  โ†’ Ready for implementation                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

MCP Servers

LDF includes MCP (Model Context Protocol) servers for real-time validation:

Server Purpose
spec_inspector Query spec status, guardrail coverage, task progress
coverage_reporter Test coverage metrics per service/guardrail

Token savings: 90% reduction compared to file reads.

# Generate MCP configuration for your project
mkdir -p .agent && ldf mcp-config > .agent/mcp.json

Multi-Agent Audit

Use ChatGPT and Gemini to review your AI's work:

# Generate audit request
ldf audit --type spec-review

# Copy the generated markdown to ChatGPT with the prompt
# from multi-agent/prompts/chatgpt/spec-review.md

# Import the feedback
ldf audit --import feedback.md

CLI Reference

# Project initialization
ldf init                        # Initialize LDF in current project
  --preset saas|fintech|healthcare|api-only
  --question-packs security,testing,billing
  --force                       # Force reinitialize, overwrite existing
  --repair                      # Fix missing files without overwriting

# Project status
ldf status                      # Show project state and recommendations
ldf status --format json        # JSON output for CI/scripts

# Add LDF to existing projects
ldf convert analyze             # Analyze codebase, generate AI prompt
ldf convert analyze -o file.md  # Save prompt to file
ldf convert import response.md  # Import AI-generated specs/answerpacks
ldf convert import response.md -n my-feature  # Custom spec name
ldf convert import response.md --dry-run      # Preview without creating

# Spec validation
ldf lint <spec-name>            # Lint single spec
ldf lint --all                  # Lint all specs
ldf lint --all --format ci      # CI-friendly output for GitHub Actions

# Multi-agent audit
ldf audit --type spec-review    # Generate spec review request
ldf audit --type code-audit     # Generate code audit request
ldf audit --import <file>       # Import audit feedback

# Coverage
ldf coverage                    # Show coverage summary
ldf coverage --spec auth        # Coverage for specific spec

# Framework updates
ldf update --check              # Check for framework updates
ldf update --dry-run            # Preview what would change
ldf update                      # Apply updates interactively
ldf update --only templates     # Update specific components

CI/CD Integration

LDF includes GitHub Actions and GitLab CI templates for automated spec validation:

# GitHub Actions
mkdir -p .github/workflows
cp integrations/ci-cd/github-actions.yaml .github/workflows/ldf.yaml

# GitLab CI
cp integrations/ci-cd/gitlab-ci.yaml .gitlab-ci.yml

The CI pipeline validates:

  • All specs pass ldf lint --all
  • Answerpacks have no template markers
  • Guardrail coverage matrices are complete
  • (Optional) Automated audits with OpenAI

See CI/CD Integration for configuration options.

Project Structure

ldf/
โ”œโ”€โ”€ ldf/                        # CLI package (pip install llm-ldf)
โ”‚   โ”œโ”€โ”€ _framework/             # Bundled framework assets
โ”‚   โ”‚   โ”œโ”€โ”€ templates/          # Spec templates (requirements, design, tasks)
โ”‚   โ”‚   โ”œโ”€โ”€ guardrails/         # Core + preset guardrails
โ”‚   โ”‚   โ”œโ”€โ”€ question-packs/     # Domain question templates
โ”‚   โ”‚   โ””โ”€โ”€ macros/             # Enforcement macros
โ”‚   โ””โ”€โ”€ _mcp_servers/           # MCP server implementations
โ”‚       โ”œโ”€โ”€ spec_inspector/     # Spec status MCP server
โ”‚       โ”œโ”€โ”€ coverage_reporter/  # Coverage metrics MCP server
โ”‚       โ””โ”€โ”€ db_inspector/       # Database schema MCP server (template)
โ”œโ”€โ”€ multi-agent/
โ”‚   โ”œโ”€โ”€ prompts/                # ChatGPT & Gemini audit prompts
โ”‚   โ””โ”€โ”€ automation/             # Optional API integration
โ”œโ”€โ”€ integrations/               # IDE & CI/CD integrations
โ””โ”€โ”€ examples/
    โ”œโ”€โ”€ python-fastapi/         # Python/FastAPI example
    โ”œโ”€โ”€ typescript-node/        # TypeScript/Node example
    โ””โ”€โ”€ go-service/             # Go service example

Examples

See the examples/ directory for complete working examples:

Recommended Additional Examples

See examples/RECOMMENDATIONS.md for proposals on 5 additional framework examples (Rust, Java, Ruby, C#, PHP) to expand the collection to 10 total templates.

Each example includes:

  • .ldf/ configuration
  • Complete spec (requirements โ†’ design โ†’ tasks)
  • AGENT.md project instructions

Documentation

Choose Your Path

๐Ÿ†• New to LDF? Start here:

๐Ÿ“š Core Documentation

๐Ÿ“– Tutorial Series (125 minutes total)

  1. Your First LDF Spec - Create a simple spec (20 min)
  2. Understanding Guardrails - Deep dive into 8 core constraints (30 min)
  3. Working with Question-Packs - Answer questions effectively (25 min)
  4. Multi-Agent Review - Get AI feedback (30 min)
  5. MCP Setup - Integrate with AI assistants (20 min)

๐Ÿ“Š Visual Guides

๐Ÿ“‘ Reference

๐Ÿ”ง IDE Integration

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE for details.

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

llm_ldf-1.1.2.tar.gz (295.4 kB view details)

Uploaded Source

Built Distribution

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

llm_ldf-1.1.2-py3-none-any.whl (225.9 kB view details)

Uploaded Python 3

File details

Details for the file llm_ldf-1.1.2.tar.gz.

File metadata

  • Download URL: llm_ldf-1.1.2.tar.gz
  • Upload date:
  • Size: 295.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_ldf-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1b7f0c249ce74b537309e3655ef53a61a7d73e65d2d6e9e64909c776cdb51b07
MD5 ece66af0fb0823e5eddb8bd0ca6b7b38
BLAKE2b-256 151e9e9a6e56d0e3859173ab9febe6b1d38d590af3be5ac48f5d96744c895cdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_ldf-1.1.2.tar.gz:

Publisher: publish.yml on LLMdotInfo/ldf

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

File details

Details for the file llm_ldf-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: llm_ldf-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 225.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for llm_ldf-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e2118d3aa1d206c9c4ba62327d4fe46c7829f4c0f24c80e216fb3b725e6fe66c
MD5 9d2e0977288445209086fa9db2346cbd
BLAKE2b-256 e3f082a9e1d76b796c580a2d6c3d1833450b83fb47f27476101a0952cde1dbf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_ldf-1.1.2-py3-none-any.whl:

Publisher: publish.yml on LLMdotInfo/ldf

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