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

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

pip install ai-forge

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

๐Ÿ“š 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

๐Ÿ› ๏ธ 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-0.1.0.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-0.1.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai_forge_collective-0.1.0.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-0.1.0.tar.gz
Algorithm Hash digest
SHA256 008b79331c66328c6f7bdc44fbf6f7566f46431b78bbac0bcfe74c1d27c52139
MD5 bafd46ea9aa3ceaa1fc6d13a86142cd8
BLAKE2b-256 523841599fe0c1986c8685ef4e0a856a1774b36742aa40da5c4802f825cd244c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_forge_collective-0.1.0.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-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_forge_collective-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 674dddb50cdc691f1e4b007a956ab60e8284c47d994454b2d3ece096c14fb7b0
MD5 44230aba72df2fc81caedd7065d7de3b
BLAKE2b-256 ea116bc8ab3bb7a9240ad241c03607cae68e3579cf628a561419d343ee15bb08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_forge_collective-0.1.0-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