A Python tool for programmatically building and validating Claude workflow instructions for AI Forge
Project description
AI Forge - Claude Collective Builder
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
- ๐ฏ 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
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
- Fork the repository
- Create a feature branch
- Make your changes
- Run
just format lint typecheck testto ensure code quality - Submit a pull request
Adding New Features
- Document Sections: Create numbered
.mdfiles (e.g.,06-new-section.md) insnippets/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 tosnippets/hooks/ - Commands: Add custom slash commands as
.mdfiles tosnippets/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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
008b79331c66328c6f7bdc44fbf6f7566f46431b78bbac0bcfe74c1d27c52139
|
|
| MD5 |
bafd46ea9aa3ceaa1fc6d13a86142cd8
|
|
| BLAKE2b-256 |
523841599fe0c1986c8685ef4e0a856a1774b36742aa40da5c4802f825cd244c
|
Provenance
The following attestation bundles were made for ai_forge_collective-0.1.0.tar.gz:
Publisher:
release.yml on ddlaws0n/ai-forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_forge_collective-0.1.0.tar.gz -
Subject digest:
008b79331c66328c6f7bdc44fbf6f7566f46431b78bbac0bcfe74c1d27c52139 - Sigstore transparency entry: 287779907
- Sigstore integration time:
-
Permalink:
ddlaws0n/ai-forge@66a71513360261b3e2464f3ec88881c2af5ccbe0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ddlaws0n
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@66a71513360261b3e2464f3ec88881c2af5ccbe0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_forge_collective-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_forge_collective-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
674dddb50cdc691f1e4b007a956ab60e8284c47d994454b2d3ece096c14fb7b0
|
|
| MD5 |
44230aba72df2fc81caedd7065d7de3b
|
|
| BLAKE2b-256 |
ea116bc8ab3bb7a9240ad241c03607cae68e3579cf628a561419d343ee15bb08
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_forge_collective-0.1.0-py3-none-any.whl -
Subject digest:
674dddb50cdc691f1e4b007a956ab60e8284c47d994454b2d3ece096c14fb7b0 - Sigstore transparency entry: 287779935
- Sigstore integration time:
-
Permalink:
ddlaws0n/ai-forge@66a71513360261b3e2464f3ec88881c2af5ccbe0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/ddlaws0n
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@66a71513360261b3e2464f3ec88881c2af5ccbe0 -
Trigger Event:
push
-
Statement type: