LDF - LLM Development Framework

December 30, 2025 ยท View on GitHub

Python 3.10-3.14 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:

#GuardrailSeverityDescription
1Testing CoverageCriticalโ‰ฅ80% default, โ‰ฅ90% critical paths
2Security BasicsCriticalOWASP Top 10 prevention
3Error HandlingHighConsistent responses, no swallowed exceptions
4Logging & ObservabilityHighStructured logging, correlation IDs
5API DesignHighVersioning, pagination, error format
6Data ValidationCriticalInput validation at boundaries
7Database MigrationsHighReversible, separate from backfills
8DocumentationMediumAPI docs, README, inline comments

Presets add domain-specific guardrails:

PresetAdditional Guardrails
saasMulti-tenancy, RLS, subscription billing, audit logs
fintechDouble-entry ledger, money precision, compliance, idempotency
healthcareHIPAA compliance, PHI handling, consent management
api-onlyRate 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:

ServerPurpose
spec_inspectorQuery spec status, guardrail coverage, task progress
coverage_reporterTest 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:

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.