forge

module
v0.0.0-...-b44c02a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2026 License: MIT

README ΒΆ

Forge Logo Forge - The Spec-Driven Development Bot πŸ€–

Build and Release Go Report Card GitHub release (latest by date)

Forge is a stateless, autonomous coding agent that lives in your GitHub repository. He transforms Markdown Specifications into Working Code through an infinite loop of analysis, planning, and execution.

Unlike a typical CI/CD tool, Forge doesn't just run testsβ€”he writes the code that makes them pass.

🧠 Philosophy: Spec-Driven Development (SDD)

Forge enforces a strict workflow where Documentation leads Implementation. You never write code directly; you write the specs for the code you want.

  1. Specs are Source of Truth: docs/spec/*.md files define your application.
  2. Plan before Action: No code is written until an IMPLEMENTATION_PLAN.md exists.
  3. Stateless: Forge has no database. His memory is the repository itself (AGENTS.md, IMPLEMENTATION_PLAN.md).

πŸ”„ The OODA Loop

Forge implements a continuous Observe-Orient-Decide-Act loop:

1. Observe (The Trigger)

Forge watches your repository for changes to:

  • Specs (docs/spec/*.md): New requirements.
  • Plan (IMPLEMENTATION_PLAN.md): Status updates or new drafts.
2. Orient (Gap Analysis)

When Specs change, Forge wakes up:

  • Analyzes the difference between the Specs and the current Codebase.
  • Drafts an IMPLEMENTATION_PLAN.md detailing exactly what files need to change.
  • Opens a PR with this plan for review.
  • Auto-Approval: If he finds a Draft plan in the main branch, he assumes it is approved and actionable.
3. Decide (Resolution)

Once an Implementation Plan is present (Draft or Approved):

  • Executes the plan by writing/modifying code.
  • Opens a PR with the finished code.
4. Act (Cleanup)

After the Resolution PR is merged:

  • Deletes the IMPLEMENTATION_PLAN.md to indicate the cycle is complete.
  • Sleeps until new Specs or Plans appear.

πŸš€ Getting Started

We provide a comprehensive guide to setting up Forge and your first project.

πŸ‘‰ Read the Example Implementation Guide

βš™οΈ Configuration

Forge is configured via a YAML configuration file (default: config.yaml).

YAML Key Description Default
jules_api_key Google Jules API Key Required
github_pat GitHub PAT with Repo scope (per repo) Required
github_repo Owner/Repo (e.g. User/Repo) Required
check_interval_seconds Polling interval when idle 20
max_sessions_per_day Daily safety limit for Jules sessions 100
state_file_path Path to persistent state file forge_state.json
debug Enable verbose logging false
auto_merge Automatically merge PRs true
spec_path Path to Spec files docs/spec
impl_plan_path Path to Implementation Plan IMPLEMENTATION_PLAN.md
agents_prompt_path Path to Context Memory AGENTS.md
system_prompt_path Path to System Prompt SYSTEM_PROMPT.md
gap_analysis_template_path Override Gap Analysis Prompt (optional)
resolution_template_path Override Resolution Prompt (optional)

🎨 Advanced: Custom Prompts

Forge uses embedded prompt templates for Gap Analysis and Resolution. You can override these to customize his behavior (e.g., to enforce specific architectural patterns or change the planning format).

  1. Reference: See internal/prompts/templates for the default templates.
  2. Override: Copy a template to your server, modify it, and set the gap_analysis_template_path or resolution_template_path in your config.yaml to point to it.

πŸ’Ύ State Persistence

Forge automatically persists its state to disk (default: forge_state.json). This ensures that:

  • Active Jules sessions are tracked across restarts.
  • Daily usage limits are preserved per repository.
  • The application can be gracefully stopped and resumed without data loss.

πŸ” Diagnostics

If you're having trouble connecting to Jules or resolving your repository, use the built-in diagnostic mode:

# List all sources recognized by your Jules API Key
./forge --list-sources

πŸ“„ License

MIT License. See LICENSE.

Directories ΒΆ

Path Synopsis
cmd
forge command
Package main is the entry point for the Forge service.
Package main is the entry point for the Forge service.
internal
clients/github
Package github provides a wrapper around the go-github client for interacting with the GitHub API.
Package github provides a wrapper around the go-github client for interacting with the GitHub API.
clients/jules
Package jules provides a client for interacting with the Google Jules API.
Package jules provides a client for interacting with the Google Jules API.
prompts
Package prompts manages the loading of prompt templates.
Package prompts manages the loading of prompt templates.
stats
Package stats provides functionality for collecting and reporting application metrics.
Package stats provides functionality for collecting and reporting application metrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL