Metadata-Version: 2.4
Name: loopflow
Version: 0.2.2
Summary: Arrange LLMs to code in harmony
Author: Jack
License-Expression: MIT
Keywords: ai,claude,cli,coding,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Requires-Python: >=3.10
Requires-Dist: pathspec>=0.11.0
Requires-Dist: pydantic-ai-slim[anthropic]>=1.0.0
Requires-Dist: pydantic>=2.12.5
Requires-Dist: pyyaml>=6.0
Requires-Dist: tiktoken>=0.7.0
Requires-Dist: typer>=0.9.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Loopflow

Run LLM coding tasks from reusable prompt files.

macOS only. Currently uses Claude Code; other backends planned.

## Install

```bash
pip install loopflow
lf meta install    # installs Claude Code via npm
```

## Why Worktrees?

Loopflow is designed for running background agents while you work on something else. That means isolated branches - you can't have an agent committing to the branch you're actively editing.

The workflow: create a worktree, run tasks there, merge when ready. You can have multiple features in flight at once.

## Quick Start

```bash
lf wt create my-feature       # branch + worktree, opens IDEs
cd .lf/worktrees/my-feature

lf design                     # interactive: figure out what to build
lf ship                       # batch: implement, review, test, commit, open PR
```

`lf design` runs `.lf/design.lf`. `lf ship` runs the `ship` pipeline from `.lf/config.yaml`.

## Tasks

Tasks are prompt files in `.lf/`. Here's an example:

```markdown
# .lf/review.lf

Review the diff on the current branch against `main` and fix any issues found.

The deliverable is the fixes themselves, not a written review.

## What to look for

- Style guide violations (read STYLE.md)
- Bugs, logic errors, edge cases
- Unnecessary complexity
- Missing tests
```

Run tasks by name:

```bash
lf review                     # run .lf/review.lf
lf review -x src/utils.py     # add context files
lf : "fix the typo"           # inline prompt, no task file
```

All `.md` files at repo root (README, STYLE, etc.) are included as context automatically.

## Pipelines

Chain tasks in `.lf/config.yaml`:

```yaml
pipelines:
  ship:
    tasks: [implement, review, test, commit]
    pr: true    # open PR when done
```

```bash
lf ship    # runs each task, auto-commits between steps
```

## Worktrees

```bash
lf wt create auth             # .lf/worktrees/auth/, opens Warp + Cursor
lf wt list                    # show all worktrees
lf wt clean                   # remove merged branches
```

## Configuration

```yaml
# .lf/config.yaml
push: true        # auto-push after commits
pr: false         # open PR after pipelines

ide:
  warp: true
  cursor: true
```

## Options

| Option | Description |
|--------|-------------|
| `-p, --print` | Batch mode (non-interactive) |
| `-x, --context` | Add context files |
| `-w, --worktree` | Create worktree and run task there |
| `-c, --copy` | Copy prompt to clipboard, show token breakdown |

## Commands

| Command | Description |
|---------|-------------|
| `lf <task>` | Run a task from `.lf/` |
| `lf <pipeline>` | Run a pipeline |
| `lf : "prompt"` | Inline prompt |
| `lf wt create/list/clean` | Worktree management |
| `lf pr create` | Open GitHub PR |
| `lf pr land [-a]` | Squash-merge to main |
| `lf meta install` | Install Claude Code |
| `lf meta doctor` | Check dependencies |
