Skip to content

machine-machine/dark-factory-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dark Factory Engine

Workflow-Driven Agentic Software Factory

Overview

The Dark Factory Engine converts human-readable workflow definitions (Markdown) into executable OpenClaw skills that can be deployed as Coolify apps.

Core Concept: workflow.md β†’ skill/ β†’ Coolify deployment β†’ Automated execution

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Workflow.md     β”‚ (Human-readable process definition)
β”‚ (Templates)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ Compile
         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ OpenClaw Skill  β”‚ (Executable code + metadata)
β”‚ (Generated)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ Deploy
         ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Coolify App     β”‚ (Running automation)
β”‚ (Auto-scaled)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

# 1. Compile a workflow template
./bin/compile workflow-templates/deploy-service.md

# 2. Dry-run β€” see what would happen
./bin/deploy output/deploy-service-skill/ --dry-run

# 3. Deploy to Coolify (git push + app create + deploy)
./bin/deploy output/deploy-service-skill/

# 4. Monitor deployed skills
./bin/monitor                          # list all df-* apps
./bin/monitor deploy-service           # specific skill status
./bin/monitor deploy-service --logs    # tail logs
./bin/monitor --registry               # local deployment registry

Workflow Template Format

Workflows are written in Markdown with structured sections:

# Workflow: Deploy Service

## Description
Deploys a service to Coolify with health checks and rollback capability.

## Inputs
- `service_name`: Name of the service to deploy
- `git_repo`: Repository URL
- `branch`: Git branch (default: main)

## Steps
1. **Clone Repository**
   - Checkout specified branch
   - Validate dockerfile exists

2. **Create Coolify App**
   - Generate app configuration
   - Set environment variables
   - Configure health checks

3. **Deploy & Verify**
   - Trigger deployment
   - Wait for healthy status
   - Run smoke tests

## Outputs
- `deployment_url`: Live service URL
- `health_status`: Service health check result
- `rollback_command`: Command to rollback if needed

## Guardrails
- Max deployment time: 10 minutes
- Auto-rollback on failure
- Requires manual approval for production

Directory Structure

dark-factory-engine/
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ bin/                        # Executable scripts
β”‚   β”œβ”€β”€ compile                 # Workflow β†’ Skill compiler
β”‚   β”œβ”€β”€ deploy                  # Skill β†’ Coolify deployer  
β”‚   └── monitor                 # Execution monitor
β”œβ”€β”€ workflow-templates/         # Sample workflows
β”‚   β”œβ”€β”€ deploy-service.md
β”‚   β”œβ”€β”€ run-tests.md
β”‚   β”œβ”€β”€ backup-data.md
β”‚   └── security-scan.md
β”œβ”€β”€ compiler/                   # Compiler implementation
β”‚   β”œβ”€β”€ parser.py              # Markdown parser
β”‚   β”œβ”€β”€ generator.py           # Skill generator
β”‚   └── templates/             # Code templates
β”œβ”€β”€ examples/                   # Example generated skills
└── docs/                      # Documentation

Features

Phase 1 (Current)

  • Workflow template parsing
  • Basic skill generation
  • Coolify integration (bin/deploy β€” git push + app create + deploy)
  • Deployment monitor (bin/monitor β€” live status + logs)
  • Execution engine (skill triggering via HTTP or cron)

Phase 2 (Planned)

  • Meta-agent monitoring
  • Multi-workflow orchestration
  • Visual workflow builder
  • Compliance evidence generation

Getting Started

  1. Install Dependencies

    pip install -r requirements.txt
  2. Test Compilation

    python compiler/compile.py workflow-templates/deploy-service.md
  3. Deploy First Workflow

    # TBD - Coolify integration

Integration with MachineMachine

This engine integrates with our existing infrastructure:

  • OpenClaw: Generated skills run as OpenClaw agents
  • Coolify: Auto-deployment and scaling
  • Memory System: Execution logs β†’ Qdrant vector memory
  • Agent Spawning: Multi-workflow parallel execution

Part of the MachineMachine Dark Software Factory initiative

About

Workflow-Driven Agentic Software Factory - Converts Markdown workflows to executable OpenClaw skills

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors