Skip to main content

A Python tool for programmatically building and validating Claude workflow instructions for AI Forge

Project description

AI Forge - Claude Collective Builder

PyPI version Python 3.12+ License: MIT Code style: ruff

AI Forge Logo

A CLI tool for initializing Claude Collective projects with comprehensive workflow instructions, settings, and validation hooks. Transform modular documentation snippets into complete, validated Claude workflows.

๐Ÿš€ Quick Start

Installation

# Install from PyPI (recommended)
pip install ai-forge-collective

# Install from GitHub (latest development version)
pip install git+https://github.com/ddlaws0n/ai-forge.git

# Install specific version
pip install ai-forge-collective==1.0.0

Note: The package is distributed as ai-forge-collective on PyPI, but the CLI command remains ai-forge for convenience.

Basic Usage

# Initialize a Claude Collective project (default: current directory)
ai-forge init

# Initialize in a specific directory
ai-forge init /path/to/project

# Initialize with custom snippets and templates
ai-forge init --snippets-dir my-snippets --templates-dir my-templates

๐Ÿ“‹ Commands

Command Description
ai-forge init [PATH] Initialize a Claude Collective project with all required files
ai-forge init --help Show help and available options

What ai-forge init Creates:

  • CLAUDE.md - Complete Claude workflow instructions
  • .claude/settings.json - Claude Code configuration with hooks
  • .claude/hooks/ - Python and shell hook scripts for workflow automation
  • .claude/commands/ - Custom slash commands for enhanced Claude interactions
  • artifacts/ - Directory for build outputs and state management
  • contracts/ - Directory for API specifications and data models
  • TASK_BOARD.md - Project task tracking board
  • PROJECT_CHARTER.md - Project goals and constraints

๐Ÿ“š Features

AI Forge Architecture Diagram

  • ๐ŸŽฏ Project Scaffolding: Complete Claude Collective project setup in one command
  • ๐Ÿ“ Flexible Sections: Numbered files with YAML frontmatter for dynamic document structure
  • ๐Ÿ”ง Multi-Target Building: Generate CLAUDE.md, settings.json, hooks, and commands
  • ๐ŸŽจ Template System: Jinja2-based templates with conditional section rendering
  • ๐Ÿช Hook System: Automated pre/post-tool execution with Python and shell scripts
  • โšก Custom Commands: Slash commands for enhanced Claude Code interactions
  • โœ… Built-in Validation: Structural integrity and reference consistency checks
  • ๐Ÿ”„ Backward Compatible: Supports both new numbered files and legacy snippet systems
  • ๐Ÿš€ CI/CD Ready: Integrates with automated workflows

๐Ÿ”ง Configuration

You can customize the initialization with command-line options:

Option Default Description
--snippets-dir snippets Directory containing snippet files
--templates-dir templates Directory containing Jinja2 templates
[PATH] . (current directory) Output directory for generated files

๐Ÿ” Generated File Validation

The generated CLAUDE.md includes built-in validation for:

  • โœ… Required sections present
  • โœ… Proper heading hierarchy
  • โœ… Agent and artifact references
  • โœ… Token budget consistency
  • โœ… Content structure integrity

๐ŸŽฏ Use Cases

Perfect for:

  • AI Teams: Standardize Claude workflows across projects
  • Documentation: Create consistent, validated Claude instructions
  • CI/CD: Integrate Claude workflow generation into build pipelines
  • Templates: Maintain reusable Claude workflow components
  • Project Scaffolding: Generate complete project structures with artifacts, contracts, and task boards

๐Ÿ› ๏ธ Development & Contributing

Prerequisites

  • Python 3.12+
  • Just command runner
  • uv package manager

Setup

# Clone the repository
git clone https://github.com/ddlaws0n/ai-forge.git
cd ai-forge

# Install dependencies
uv install --group dev

Repository Structure

ai-forge/
โ”œโ”€โ”€ src/ai_forge/           # Main package code
โ”‚   โ”œโ”€โ”€ builder.py          # Document building logic
โ”‚   โ”œโ”€โ”€ document_builder.py # Core document assembly
โ”‚   โ”œโ”€โ”€ project_builder.py  # Multi-target project building
โ”‚   โ”œโ”€โ”€ validator.py        # Validation logic
โ”‚   โ””โ”€โ”€ models.py           # Data models
โ”œโ”€โ”€ snippets/               # Modular documentation snippets
โ”‚   โ”œโ”€โ”€ 01-core-mission.md  # Core mission section
โ”‚   โ”œโ”€โ”€ 02-fundamental-principles.md  # Principles section
โ”‚   โ”œโ”€โ”€ 03-agent-specifications.md   # Agent definitions
โ”‚   โ”œโ”€โ”€ 04-communication-formats.md  # Communication patterns
โ”‚   โ”œโ”€โ”€ 05-execution-workflow.md     # Workflow execution
โ”‚   โ”œโ”€โ”€ hooks/              # Hook scripts (Python/shell)
โ”‚   โ”œโ”€โ”€ commands/           # Custom slash commands
โ”‚   โ””โ”€โ”€ logs/               # Generated logs directory
โ”œโ”€โ”€ templates/              # Jinja2 templates
โ”œโ”€โ”€ tests/                  # Test suite
โ””โ”€โ”€ output/                 # Generated files

Development Commands

Use the provided Justfile for all development tasks:

# Build and validate
just build-all              # Build final CLAUDE.md
just validate               # Validate output

# Testing
just test                   # Run tests

# Code quality
just format                 # Format code with ruff
just lint                   # Lint code with ruff
just typecheck              # Type check with mypy

You can also use the development CLI commands:

# Build commands (for development)
ai-forge dev build                    # Build CLAUDE.md only
ai-forge dev build --all-targets      # Build all targets

# Validation commands (for development)
ai-forge dev validate output/CLAUDE.md  # Validate generated file
ai-forge dev build-and-validate         # Build and validate in one step

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run just format lint typecheck test to ensure code quality
  5. Submit a pull request

Adding New Features

  • Document Sections: Create numbered .md files (e.g., 06-new-section.md) in snippets/ with YAML frontmatter:
    ---
    title: "Section Title"
    section_type: "content"  # content|core_mission|principles|agents
    order: 6
    ---
    Your content here...
    
  • Hooks: Add Python (.py) or shell (.sh) scripts to snippets/hooks/
  • Commands: Add custom slash commands as .md files to snippets/commands/
  • Templates: Modify Jinja2 templates in templates/ to handle new section types
  • Validation: Add new validation rules to validator.py
  • Tests: Include tests for all new functionality

Document Section System

The new system uses numbered files with frontmatter for flexible document generation:

  • Numbering: Files are processed in order (01-, 02-, 03-, etc.)
  • Frontmatter: YAML metadata controls rendering behavior
  • Section Types: core_mission, content, principles, agents
  • Backward Compatibility: Falls back to legacy hardcoded sections if no numbered files exist

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


AI Forge Banner

Built with โค๏ธ using uv

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

ai_forge_collective-1.0.1.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

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

ai_forge_collective-1.0.1-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file ai_forge_collective-1.0.1.tar.gz.

File metadata

  • Download URL: ai_forge_collective-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ai_forge_collective-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d90d2124f813becbb3d1ad03890dfd43384c54c9213abae58b8bb35d3ef1d7dd
MD5 c4b3e2579d53f1d10843f509bb12df1e
BLAKE2b-256 dfee2cf0e6f8da591b3d3274db989e68a79c5f6d8d59e14db5f3e21e3ea37e0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_forge_collective-1.0.1.tar.gz:

Publisher: release.yml on ddlaws0n/ai-forge

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

File details

Details for the file ai_forge_collective-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_forge_collective-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1468bdf22340e8afb9d6e59a2b9a4d551b72af31eb08dba025a1773b8049840c
MD5 9a022fa80f2bba0112988e1e5bde740d
BLAKE2b-256 b2ab410e1038a2ea13d40eadb768d76ae440424fb4cbf060d7429a7bfeac2d0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_forge_collective-1.0.1-py3-none-any.whl:

Publisher: release.yml on ddlaws0n/ai-forge

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