Metadata-Version: 2.4
Name: gtg
Version: 0.3.0
Summary: Deterministic PR readiness detection for AI coding agents
Author-email: David Sifry <david@sifry.com>
License: MIT
Project-URL: Homepage, https://github.com/dsifry/goodtogo
Project-URL: Repository, https://github.com/dsifry/goodtogo
Project-URL: Issues, https://github.com/dsifry/goodtogo/issues
Keywords: pr-readiness,github,ai-agents,code-review,ci-cd,automation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: httpx>=0.25.0
Provides-Extra: redis
Requires-Dist: redis>=5.0.0; extra == "redis"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: hypothesis>=6.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# Good To Go

**Deterministic PR readiness detection for AI coding agents**

Good To Go helps AI agents (like Claude Code) know exactly when a PR is ready to merge. No guessing, no polling indefinitely, no missing comments.

## The Problem

AI agents creating PRs face a common challenge: **How do I know when I'm actually done?**

- CI is still running... is it done yet?
- CodeRabbit left 12 comments... which ones need action?
- A reviewer requested changes... did I address them all?
- There are 3 unresolved threads... are they blocking?

Without deterministic answers, agents either wait too long, miss comments, or keep asking "is it ready yet?"

## The Solution

Good To Go provides **deterministic PR state analysis** via a simple CLI:

```bash
gtg check owner/repo 123
```

Returns:
- **Exit code 0**: Ready to merge - good to go!
- **Exit code 1**: Action required (actionable comments need fixes)
- **Exit code 2**: Unresolved threads exist
- **Exit code 3**: CI failing
- **Exit code 4**: Error fetching data

## Installation

```bash
pip install gtg
```

That's it. No other dependencies required.

## Usage

### Basic Check

```bash
# Check if PR #123 in myorg/myrepo is ready to merge
gtg check myorg/myrepo 123

# With JSON output for programmatic use
gtg check myorg/myrepo 123 --json
```

### Authentication

Set your GitHub token:

```bash
export GITHUB_TOKEN=ghp_your_token_here
```

Or pass it directly:

```bash
gtg check myorg/myrepo 123 --token ghp_your_token_here
```

### Exit Codes

| Code | Status | Meaning |
|------|--------|---------|
| 0 | READY | All clear - good to go! |
| 1 | ACTION_REQUIRED | Actionable comments need fixes |
| 2 | UNRESOLVED | Unresolved review threads |
| 3 | CI_FAILING | CI/CD checks failing |
| 4 | ERROR | Error fetching PR data |

### JSON Output

```bash
gtg check myorg/myrepo 123 --json
```

Returns structured data including:
- CI status (passed/failed/pending checks)
- Thread summary (resolved/unresolved counts)
- Classified comments (actionable vs non-actionable)
- Action items list

## Supported Automated Reviewers

Good To Go recognizes and classifies comments from:

- **CodeRabbit** - Critical/Major/Minor/Trivial severity
- **Greptile** - Actionable comment detection
- **Claude Code** - Must/should/error/bug patterns
- **Cursor/Bugbot** - Severity-based classification
- **Generic** - Fallback for unknown reviewers

## For AI Agents

If you're an AI agent, use Good To Go in your PR workflow:

```python
import subprocess
import json

result = subprocess.run(
    ["gtg", "check", "owner/repo", "123", "--json"],
    capture_output=True,
    text=True
)

if result.returncode == 0:
    print("Good to go! Ready to merge.")
elif result.returncode == 1:
    data = json.loads(result.stdout)
    print(f"Action required: {data['action_items']}")
```

Or use the Python API directly:

```python
from goodtogo import PRAnalyzer, Container

container = Container.create_default(github_token="ghp_...")
analyzer = PRAnalyzer(container)

result = analyzer.analyze("owner", "repo", 123)
if result.status == "READY":
    print("Good to go!")
else:
    for item in result.action_items:
        print(f"- {item}")
```

## Documentation

- [USAGE.md](USAGE.md) - Detailed CLI usage and examples
- [CONTRIBUTING.md](CONTRIBUTING.md) - Development setup and contribution guide

## License

MIT License - see [LICENSE](LICENSE) for details.

## Credits

Created by [David Sifry](https://github.com/dsifry) with Claude Code.

---

**Made with Claude Code**
