Metadata-Version: 2.4
Name: agentlinter
Version: 0.2.0
Summary: Estimate costs and lint agent workflow YAML files
Author: AreteDriver
License: MIT
Project-URL: Homepage, https://github.com/AreteDriver/agent-lint
Project-URL: Repository, https://github.com/AreteDriver/agent-lint
Project-URL: Issues, https://github.com/AreteDriver/agent-lint/issues
Keywords: ai,agents,workflow,cost,linter,claude,openai,ollama
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.9.0
Requires-Dist: rich>=13.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# agent-lint

**CLI tool for cost estimation and anti-pattern detection in agent workflow YAML configs.**
Catch expensive, fragile, or ungoverned agent workflows before they hit production.

[![PyPI](https://img.shields.io/pypi/v/agentlinter.svg)](https://pypi.org/project/agentlinter/)
[![Python](https://img.shields.io/badge/python-3.11+-blue.svg)](https://python.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![CI](https://github.com/AreteDriver/agent-lint/actions/workflows/ci.yml/badge.svg)](https://github.com/AreteDriver/agent-lint/actions)

---

## The Problem

Agent workflows fail in predictable ways: unbounded loops, no retry limits, missing cost guards, parallel branches with no coordination. Most teams find these problems in production — after a $400 API bill or a stuck workflow that ran for six hours.

`agent-lint` finds them at config time.

---

## Install

```bash
pip install agentlinter
```

---

## Usage

```bash
# Lint a single workflow config
agent-lint lint workflow.yaml

# Lint all workflows in a directory, fail CI if score < 80
agent-lint lint workflows/ --fail-under 80

# Estimate token/cost exposure for a workflow
agent-lint estimate workflow.yaml --provider anthropic

# Generate a full audit report
agent-lint lint workflows/ --format markdown
```

---

## What It Detects

**Anti-patterns:**
- Unbounded retry loops (no max_retries or timeout)
- Missing cost guards on high-token operations
- Parallel agent branches with no merge strategy
- Hard-coded API keys in config (security)
- Missing checkpointing on long-running workflows
- Agents with no defined output schema

**Cost estimation:**
- Token budget projection per workflow step
- Worst-case / expected-case / best-case cost ranges
- Model-aware pricing (Claude, GPT-4, Gemini)

**Scoring:**
- 0-100 score per workflow
- Error (-15 pts), warning (-5 pts), info (-1 pt)
- CI integration: `--fail-under` threshold

---

## CI Integration

```yaml
# .github/workflows/agent-lint.yml
- name: Lint agent workflows
  run: agent-lint lint workflows/ --fail-under 80
```

Treat your agent configs like production code. Gate them the same way.

---

## Why Static Analysis

No LLM dependency. No API calls. No variance between runs.
Agent configs are deterministic artifacts — they should be audited deterministically.

---

## Status

- [x] Anti-pattern detection (17 rules)
- [x] Cost estimation (Claude, GPT-4)
- [x] CI integration with threshold gating
- [x] Markdown audit reports
- [ ] Gemini pricing model
- [ ] VS Code extension
- [ ] Auto-fix suggestions

---

*Part of the [AreteDriver](https://github.com/AreteDriver) AI tooling ecosystem.*
