mainline

Records AI agent coding intents and decisions as Git-native metadata for team review.

195|12|Updated Apr 25, 2026
One-click install
npx skills add https://github.com/mainline-org/mainline --skill mainline-mainline-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mainline
Source: https://github.com/mainline-org/mainline/tree/main/skills/mainline
Command: npx skills add https://github.com/mainline-org/mainline --skill mainline-mainline-org

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code history alone does not capture why AI agents made changes, so teams lose the reasoning, abandoned approaches, and constraints behind agent-written code. This Skill records agent intents, decisions, and trade-offs into Git alongside commits, and surfaces semantic conflicts between concurrent agent work before PR review. ## Core Features & Use Cases - Intent lifecycle management: Start, append, seal, and publish intent records that link goals, decisions, and rejected alternatives to the commits that carried the work. - Preflight conflict detection: Run a readiness gate that reports file overlaps, branch drift, and in-flight proposals from other agents before editing code. - Autonomy stop-lines: Enforce team-defined boundaries (assist, handoff, review) so agents stop before commits, pushes, PRs, merges, or deploys unless explicitly authorized. - PR body generation: Generate pull request descriptions from sealed intents so reviewers see the original goal and reasoning, not just the diff. - Use Case: Two agents are modifying the same billing logic on different branches. Before editing, each runs mainline preflight --json, sees the other's in-flight intent, and narrows scope or syncs instead of producing a semantic conflict Git cannot detect. ## Quick Start Ask the agent to run mainline preflight, start an intent for your task, and seal the work with a summary once the commit is ready.

Frequently Asked Questions about mainline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I record AI agent decisions in Git?

Use the mainline CLI to start an intent with the user's goal, append turns as the work progresses, and seal the intent once a commit exists. The sealed record stores decisions, rejected alternatives, and file fingerprints as Git-native metadata alongside the code.

How do I install the mainline CLI?

On macOS or Linux, run the install script from the mainline-org GitHub repository, or use go install with Go 1.22 or later. After installing, run mainline status --json to verify, then mainline init to set up the repository and hooks.

Does mainline require GitHub or pull requests?

No, mainline does not require a Git push, pull request, or GitHub. It preserves the repository's existing review and release workflow, and only generates PR descriptions from sealed intents when the user asks to open or update a PR.

What is the difference between mainline publish and git push?

mainline publish only publishes Mainline intent metadata and actor-log state, not code. Git branch push, PR creation, merge, and deployment are separate delivery steps governed by the agent_authority stop-line boundaries.

What should I do after a force-push or history rewrite?

Run mainline doctor --notes --json to diagnose notes drift, then preview recovery with mainline migrate notes --infer --dry-run --json. Only run the write or push migration after the user explicitly confirms the plan, since it changes the shared notes ref.