Skip to content

SemanticTools/assetforge

Repository files navigation

AssetForge

An autonomous AI daemon that manages and executes goal-driven workflows. It schedules goals, uses Claude to brainstorm action tasks, and executes them inside sandboxed containers — continuously, 24/7.

NOTE: This repository is partly open source. All the crucial code is here, but the prompts are not stored in this repos.

Overview

AssetForge runs as a background daemon that balances two types of goals:

  • Life goals — strategic priorities scheduled by a fairness algorithm (priority-to-cost ratio)
  • Money goals — revenue-generating tasks managed by shelf-based stock control

For each goal, the system uses an LLM to brainstorm a concrete action task, then runs that task via Claude Code inside an isolated geniejars container. Actual costs are tracked, compared against budgets, and fed back to improve future estimates.

Architecture

Schedulers  →  Spawner (LLM)  →  Queue  →  Agent Pool  →  Ledger / Shelf
  1. Schedulers check available queue capacity and budget, then emit spawn requests
  2. Spawner calls Claude to brainstorm an action goal title, deducting LLM cost from budget
  3. Queue holds action goals (FIFO, fixed capacity) mirrored to disk for crash recovery
  4. Agent pool executes goals via Claude Code in geniejars containers
  5. Cost settlement records actual spend and updates per-goal budget estimates

Requirements

  • Node.js 18+
  • claude CLI in PATH (Claude Code)
  • geniejars sandbox pool initialized at /home/gjarcommon
  • ANTHROPIC_API_KEY set in your environment

Optional LLM providers (via llamiga): Gemini, OpenAI, Mistral, Grok, Ollama

Installation

npm install

Configuration

Environment

export ANTHROPIC_API_KEY=your-key

config.json

Key Description Default
queue_capacity Max goals in queue at once 6
agent_pool_size Concurrent execution agents 5
tick_interval_ms Main loop interval 5000
budget_threshold Minimum balance before pausing life scheduler 5.00
default_budget_per_goal.money Default cost estimate per action goal 0.50
default_budget_per_goal.time Default time estimate (seconds) 300
spawner.lm LLM used for brainstorming anthropic::claude-sonnet-4-...
executor.timeout_multiplier Hard timeout = budgeted_time × this 1.5
schedulers.life.enabled Enable life goal scheduler true
schedulers.money.enabled Enable money goal scheduler false

Life Goals (user/lifegoals/*.toml)

id = "my-goal"
name = "My Goal"
priority = 8
instructionPrompt = "Describe what tasks this goal involves..."

[budget_per_goal]
money = 0.50
time = 300

Money Goals (user/moneygoals/*.json)

{
  "id": "my-product",
  "name": "My Product",
  "shelf_target": 5,
  "description": "What this product involves..."
}

Running

# Run as a daemon
npm start

# Exit after completing one goal
node src/daemon.js --one-shot

# Exit after N goals
node src/daemon.js --limit-to 5

Logs are written as JSONL to data/log/YYYY-MM-DD-main.log and data/log/YYYY-MM-DD-spawner.log.

Project Structure

src/
├── daemon.js          # Main event loop
├── schedulers/
│   ├── life.js        # Ratio-based fairness scheduler
│   └── money.js       # Shelf-based stock scheduler
├── queue.js           # FIFO action goal queue
├── spawner.js         # LLM brainstormer
├── agents.js          # Agent pool
├── executor.js        # Claude Code runner
├── claudecode.mjs     # geniejars integration
└── loader.js          # File I/O for goals and budget

user/
├── lifegoals/         # TOML goal definitions
├── moneygoals/        # JSON goal definitions
├── prompts/           # System prompt templates
└── guidelines.md      # Global Claude guidelines

data/
├── state/             # Per-goal cost totals and learned budgets
├── queue/             # Queue mirror (crash recovery)
├── running/           # In-progress goals (crash recovery)
├── completed/         # Finished action goal results
├── discussions/       # LLM conversation history
├── log/               # Structured event logs
└── budget.json        # Current balance

Key Behaviors

Fairness scheduling — Life goals are picked by the largest gap between priority/total_priority and cost_spent/total_cost. High-priority neglected goals always rise to the top.

Cost learning — After each execution, the system compares actual vs. budgeted cost and adjusts budget_per_goal estimates for that goal over time.

Crash recovery — Queue and in-progress goals are persisted to disk. On restart, interrupted goals are re-queued automatically.

Conversation persistence — The spawner maintains a lean history of past brainstorming sessions per goal (user/assistant turns only) to avoid generating repeated tasks.

Revenue loop — Money goals increment a shelf counter on completion. Items are periodically "sold" with random revenue, which refills the budget.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages