agent-readiness 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_readiness-1.0.0/.devcontainer/devcontainer.json +5 -0
- agent_readiness-1.0.0/.env.example +2 -0
- agent_readiness-1.0.0/.github/ISSUE_TEMPLATE/bug_report.md +17 -0
- agent_readiness-1.0.0/.github/dependabot.yml +10 -0
- agent_readiness-1.0.0/.github/pull_request_template.md +5 -0
- agent_readiness-1.0.0/.github/workflows/ci.yml +18 -0
- agent_readiness-1.0.0/.github/workflows/release.yml +99 -0
- agent_readiness-1.0.0/.gitignore +12 -0
- agent_readiness-1.0.0/.pre-commit-config.yaml +14 -0
- agent_readiness-1.0.0/AGENTS.md +65 -0
- agent_readiness-1.0.0/CHANGELOG.md +149 -0
- agent_readiness-1.0.0/CLAUDE.md +41 -0
- agent_readiness-1.0.0/CODEOWNERS +2 -0
- agent_readiness-1.0.0/Makefile +26 -0
- agent_readiness-1.0.0/PKG-INFO +148 -0
- agent_readiness-1.0.0/README.md +109 -0
- agent_readiness-1.0.0/SECURITY.md +7 -0
- agent_readiness-1.0.0/docs/PLAN.md +256 -0
- agent_readiness-1.0.0/docs/RUBRIC.md +236 -0
- agent_readiness-1.0.0/docs/SANDBOX.md +192 -0
- agent_readiness-1.0.0/mypy.ini +3 -0
- agent_readiness-1.0.0/pyproject.toml +56 -0
- agent_readiness-1.0.0/src/agent_readiness/__init__.py +3 -0
- agent_readiness-1.0.0/src/agent_readiness/__main__.py +5 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/__init__.py +115 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/agent_docs.py +117 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/branch_rulesets.py +139 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/churn.py +238 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/ci_check.py +105 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/devcontainer.py +70 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/entry_points.py +90 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/env_parity.py +120 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/git_history.py +85 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/gitignore.py +114 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/headless.py +169 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/hooks.py +81 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/lint_check.py +94 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/manifest.py +136 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/naming.py +82 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/readme.py +97 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/repo_shape.py +175 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/repo_templates.py +101 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/secrets.py +123 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/security.py +140 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/setup_steps.py +126 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/test_command.py +187 -0
- agent_readiness-1.0.0/src/agent_readiness/checks/typecheck.py +91 -0
- agent_readiness-1.0.0/src/agent_readiness/cli.py +366 -0
- agent_readiness-1.0.0/src/agent_readiness/config.py +35 -0
- agent_readiness-1.0.0/src/agent_readiness/context.py +217 -0
- agent_readiness-1.0.0/src/agent_readiness/mcp_server.py +132 -0
- agent_readiness-1.0.0/src/agent_readiness/models.py +129 -0
- agent_readiness-1.0.0/src/agent_readiness/plugins.py +48 -0
- agent_readiness-1.0.0/src/agent_readiness/renderers/__init__.py +6 -0
- agent_readiness-1.0.0/src/agent_readiness/renderers/html_renderer.py +76 -0
- agent_readiness-1.0.0/src/agent_readiness/renderers/json_renderer.py +12 -0
- agent_readiness-1.0.0/src/agent_readiness/renderers/progress.py +143 -0
- agent_readiness-1.0.0/src/agent_readiness/renderers/sarif.py +55 -0
- agent_readiness-1.0.0/src/agent_readiness/renderers/terminal.py +143 -0
- agent_readiness-1.0.0/src/agent_readiness/sandbox.py +334 -0
- agent_readiness-1.0.0/src/agent_readiness/scaffold.py +145 -0
- agent_readiness-1.0.0/src/agent_readiness/scorer.py +95 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/AGENTS.md +35 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/CODEOWNERS +10 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/SECURITY.md +31 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/dependabot.yml +21 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/devcontainer.json +11 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/gitignore +34 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/issue_template_bug.md +29 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/issue_template_feature.md +19 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/pre-commit-config.yaml +25 -0
- agent_readiness-1.0.0/src/agent_readiness/templates/pull_request_template.md +17 -0
- agent_readiness-1.0.0/tests/__init__.py +0 -0
- agent_readiness-1.0.0/tests/fixtures/bare/README.md +8 -0
- agent_readiness-1.0.0/tests/fixtures/good/.devcontainer/devcontainer.json +4 -0
- agent_readiness-1.0.0/tests/fixtures/good/.env.example +1 -0
- agent_readiness-1.0.0/tests/fixtures/good/.github/ISSUE_TEMPLATE/bug_report.md +8 -0
- agent_readiness-1.0.0/tests/fixtures/good/.github/dependabot.yml +6 -0
- agent_readiness-1.0.0/tests/fixtures/good/.github/pull_request_template.md +4 -0
- agent_readiness-1.0.0/tests/fixtures/good/.github/workflows/ci.yml +12 -0
- agent_readiness-1.0.0/tests/fixtures/good/.gitignore +15 -0
- agent_readiness-1.0.0/tests/fixtures/good/.pre-commit-config.yaml +5 -0
- agent_readiness-1.0.0/tests/fixtures/good/AGENTS.md +16 -0
- agent_readiness-1.0.0/tests/fixtures/good/CLAUDE.md +1 -0
- agent_readiness-1.0.0/tests/fixtures/good/CODEOWNERS +2 -0
- agent_readiness-1.0.0/tests/fixtures/good/Makefile +13 -0
- agent_readiness-1.0.0/tests/fixtures/good/README.md +21 -0
- agent_readiness-1.0.0/tests/fixtures/good/SECURITY.md +3 -0
- agent_readiness-1.0.0/tests/fixtures/good/mypy.ini +3 -0
- agent_readiness-1.0.0/tests/fixtures/good/pyproject.toml +3 -0
- agent_readiness-1.0.0/tests/fixtures/good/ruff.toml +1 -0
- agent_readiness-1.0.0/tests/fixtures/good/src/__init__.py +0 -0
- agent_readiness-1.0.0/tests/fixtures/good/src/main.py +2 -0
- agent_readiness-1.0.0/tests/fixtures/good/uv.lock +1 -0
- agent_readiness-1.0.0/tests/test_phase1.py +114 -0
- agent_readiness-1.0.0/tests/test_phase2.py +100 -0
- agent_readiness-1.0.0/tests/test_phase3.py +114 -0
- agent_readiness-1.0.0/tests/test_phase35.py +194 -0
- agent_readiness-1.0.0/tests/test_phase4.py +120 -0
- agent_readiness-1.0.0/tests/test_phase5.py +93 -0
- agent_readiness-1.0.0/tests/test_phase6.py +164 -0
- agent_readiness-1.0.0/tests/test_phase7.py +137 -0
- agent_readiness-1.0.0/tests/test_phase9.py +140 -0
- agent_readiness-1.0.0/tests/test_progress.py +135 -0
- agent_readiness-1.0.0/uv.lock +281 -0
- agent_readiness-1.0.0/validate/README.md +64 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report a bug in agent-readiness
|
|
4
|
+
title: "[Bug] "
|
|
5
|
+
labels: bug
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Describe the bug**
|
|
9
|
+
|
|
10
|
+
**To reproduce**
|
|
11
|
+
```
|
|
12
|
+
PYTHONPATH=src python3 -m agent_readiness.cli scan <repo>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Expected behavior**
|
|
16
|
+
|
|
17
|
+
**Actual behavior**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
test:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
steps:
|
|
7
|
+
- uses: actions/checkout@v6
|
|
8
|
+
with:
|
|
9
|
+
fetch-depth: 0
|
|
10
|
+
- uses: actions/setup-python@v6
|
|
11
|
+
with:
|
|
12
|
+
python-version: "3.12"
|
|
13
|
+
- run: pip install -e ".[dev]"
|
|
14
|
+
- run: make lint
|
|
15
|
+
- run: make test
|
|
16
|
+
- run: python -m agent_readiness.cli scan . --json
|
|
17
|
+
env:
|
|
18
|
+
PYTHONPATH: src
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
name: Build distribution
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-python@v6
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
|
|
22
|
+
- name: Install build
|
|
23
|
+
run: pip install build
|
|
24
|
+
|
|
25
|
+
- name: Build wheel and sdist
|
|
26
|
+
run: python -m build
|
|
27
|
+
|
|
28
|
+
- name: Verify dist contents
|
|
29
|
+
run: ls -lh dist/
|
|
30
|
+
|
|
31
|
+
- uses: actions/upload-artifact@v7
|
|
32
|
+
with:
|
|
33
|
+
name: dist
|
|
34
|
+
path: dist/
|
|
35
|
+
if-no-files-found: error
|
|
36
|
+
|
|
37
|
+
publish-pypi:
|
|
38
|
+
name: Publish to PyPI
|
|
39
|
+
needs: build
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
environment:
|
|
42
|
+
name: pypi
|
|
43
|
+
url: https://pypi.org/p/agent-readiness
|
|
44
|
+
permissions:
|
|
45
|
+
id-token: write # Required for OIDC trusted publishing
|
|
46
|
+
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/download-artifact@v8
|
|
49
|
+
with:
|
|
50
|
+
name: dist
|
|
51
|
+
path: dist/
|
|
52
|
+
|
|
53
|
+
- name: Publish to PyPI
|
|
54
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
55
|
+
|
|
56
|
+
github-release:
|
|
57
|
+
name: Create GitHub Release
|
|
58
|
+
needs: build
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
permissions:
|
|
61
|
+
contents: write # Required to create releases and upload assets
|
|
62
|
+
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v6
|
|
65
|
+
|
|
66
|
+
- uses: actions/download-artifact@v8
|
|
67
|
+
with:
|
|
68
|
+
name: dist
|
|
69
|
+
path: dist/
|
|
70
|
+
|
|
71
|
+
- name: Create GitHub Release
|
|
72
|
+
uses: softprops/action-gh-release@v3
|
|
73
|
+
with:
|
|
74
|
+
generate_release_notes: true
|
|
75
|
+
files: dist/*
|
|
76
|
+
|
|
77
|
+
publish-github-packages:
|
|
78
|
+
name: Publish to GitHub Packages
|
|
79
|
+
needs: build
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
permissions:
|
|
82
|
+
packages: write
|
|
83
|
+
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/download-artifact@v8
|
|
86
|
+
with:
|
|
87
|
+
name: dist
|
|
88
|
+
path: dist/
|
|
89
|
+
|
|
90
|
+
- name: Install twine
|
|
91
|
+
run: pip install twine
|
|
92
|
+
|
|
93
|
+
- name: Publish to GitHub Packages
|
|
94
|
+
run: |
|
|
95
|
+
twine upload \
|
|
96
|
+
--repository-url https://upload.pkg.github.com/ \
|
|
97
|
+
--username ${{ github.actor }} \
|
|
98
|
+
--password ${{ secrets.GITHUB_TOKEN }} \
|
|
99
|
+
dist/*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v4.6.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
10
|
+
rev: v0.4.4
|
|
11
|
+
hooks:
|
|
12
|
+
- id: ruff
|
|
13
|
+
args: [--fix]
|
|
14
|
+
- id: ruff-format
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Agent guide
|
|
2
|
+
|
|
3
|
+
Conventions for AI coding agents working in this repository.
|
|
4
|
+
|
|
5
|
+
## Canonical commands
|
|
6
|
+
|
|
7
|
+
- Install dev deps: `make dev`
|
|
8
|
+
- Run tests: `make test`
|
|
9
|
+
- Lint: `make lint`
|
|
10
|
+
- Run the CLI: `PYTHONPATH=src python3 -m agent_readiness.cli scan .`
|
|
11
|
+
(or `agent-readiness scan .` after `make install`)
|
|
12
|
+
|
|
13
|
+
The tool itself is fully headless: stable JSON via `--json`, tab-separated
|
|
14
|
+
`list-checks`, prose `explain <check_id>`, and exit codes that mean
|
|
15
|
+
things. There are no required interactive prompts.
|
|
16
|
+
|
|
17
|
+
## Source of truth
|
|
18
|
+
|
|
19
|
+
- [`RUBRIC.md`](./RUBRIC.md) — what we benchmark and why. Every check
|
|
20
|
+
must justify itself against the pillars and the headless-first
|
|
21
|
+
principle here.
|
|
22
|
+
- [`SANDBOX.md`](./SANDBOX.md) — Docker execution model for `--run`
|
|
23
|
+
(Phase 2). Devcontainer-first, hard fail on docker-native repos,
|
|
24
|
+
no host-execution fallback.
|
|
25
|
+
- [`PLAN.md`](./PLAN.md) — phased roadmap.
|
|
26
|
+
|
|
27
|
+
If a behaviour is in the code but not in these three docs, the docs are
|
|
28
|
+
the bug.
|
|
29
|
+
|
|
30
|
+
## Adding a check
|
|
31
|
+
|
|
32
|
+
1. Create a module under `src/agent_readiness/checks/`.
|
|
33
|
+
2. Define a function decorated with `@register(...)` returning a
|
|
34
|
+
`CheckResult`.
|
|
35
|
+
3. Import the new module from `src/agent_readiness/checks/__init__.py`
|
|
36
|
+
inside `_ensure_loaded`.
|
|
37
|
+
4. Update `RUBRIC.md` and `PLAN.md` so the check has a name-able line
|
|
38
|
+
to an agent failure mode (the discipline that keeps us out of
|
|
39
|
+
linter creep).
|
|
40
|
+
5. Add or extend a fixture so the check actually fires; update
|
|
41
|
+
`tests/test_phase1.py` snapshots if expected scores shift.
|
|
42
|
+
|
|
43
|
+
## Do-not-touch (without a clear reason)
|
|
44
|
+
|
|
45
|
+
- Default pillar weights in `src/agent_readiness/scorer.py`.
|
|
46
|
+
Changing these moves every reported score; coordinate with a
|
|
47
|
+
rubric update.
|
|
48
|
+
- The JSON `schema` integer in `models.Report`. Bump only on
|
|
49
|
+
intentional breaking changes; downstream consumers will pin.
|
|
50
|
+
- `src/agent_readiness/sandbox.py` contracts (preflight, no host
|
|
51
|
+
fallback, two-phase execution). The hard rules live in SANDBOX.md.
|
|
52
|
+
|
|
53
|
+
## Style
|
|
54
|
+
|
|
55
|
+
- Stdlib + click + (optional) rich. No pydantic, no typer, no heavy
|
|
56
|
+
static-analysis libs in Phase 1 — those land per-phase as needed.
|
|
57
|
+
- Type-annotated, `from __future__ import annotations` at the top of
|
|
58
|
+
modules.
|
|
59
|
+
- Conservative regex/heuristic checks: false positives erode trust
|
|
60
|
+
faster than false negatives.
|
|
61
|
+
|
|
62
|
+
## Branch + commit conventions
|
|
63
|
+
|
|
64
|
+
- Feature branches: `feat/<short-description>`
|
|
65
|
+
- Conventional Commits style for messages where reasonable.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2026-04-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- `scan` shows a per-check progress visualizer on stderr (rich when
|
|
12
|
+
available, plain `\r` fallback otherwise). Auto-disabled for `--json`
|
|
13
|
+
and non-TTY stderr; opt-out with `--no-progress`. Stdout contract
|
|
14
|
+
(report / JSON) is unchanged.
|
|
15
|
+
- `ci.configured`: detect Earthly (`Earthfile`), Drone CI
|
|
16
|
+
(`.drone.yml` / `.drone.yaml`), and Woodpecker CI
|
|
17
|
+
(`.woodpecker.yml` / `.woodpecker.yaml` / `.woodpecker/`). Reported
|
|
18
|
+
by users running monorepos where the in-repo build recipe is Earthly
|
|
19
|
+
but the trigger lives in an external orchestrator.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- `ci.configured`: refactored to a data-driven detector list and a
|
|
23
|
+
unified message format: `"CI configuration detected: <label>."`
|
|
24
|
+
Previous per-detector ad-hoc messages are gone. Score behaviour is
|
|
25
|
+
unchanged for all previously-detected configs.
|
|
26
|
+
- First stable PyPI release. Version bumped to 1.0.0 to reflect
|
|
27
|
+
complete implementation of all nine phases (Plugin API, SARIF,
|
|
28
|
+
stable JSON schema v1).
|
|
29
|
+
|
|
30
|
+
## [0.9.0] - Phase 9: Plugin API, SARIF, stable contract
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- Custom check plugins via `.agent_readiness_checks/` directory (local plugins)
|
|
34
|
+
- Entry-point plugins via `agent_readiness.checks` group in `importlib.metadata`
|
|
35
|
+
- SARIF 2.1.0 export (`--sarif FILE`) for GitHub Code Scanning integration
|
|
36
|
+
- `Report.delta` field for baseline comparison
|
|
37
|
+
- `Report.schema=1` stability documentation (will bump to 2 on next breaking change)
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- Plugin loading happens before `_ensure_loaded()` so plugins register cleanly
|
|
41
|
+
- `models.py`: add `delta` field to Report for `--baseline` delta display
|
|
42
|
+
|
|
43
|
+
## [0.8.0] - Phase 8: Distribution
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
- PyPI classifiers and keywords in `pyproject.toml`
|
|
47
|
+
- `.github/workflows/ci.yml` for the project itself (lint + test + dogfood scan)
|
|
48
|
+
- `validate/README.md` describing the planned validation study methodology
|
|
49
|
+
|
|
50
|
+
## [0.7.0] - Phase 7: HTML report renderer and badge generation
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- `src/agent_readiness/renderers/html_renderer.py`: Jinja2-based HTML report
|
|
54
|
+
(optional dep: `pip install agent-readiness[report]`)
|
|
55
|
+
- `src/agent_readiness/renderers/sarif.py`: SARIF 2.1.0 export
|
|
56
|
+
- CLI `--report FILE`: write HTML report
|
|
57
|
+
- CLI `--badge FILE`: write shields.io-style SVG badge
|
|
58
|
+
- CLI `--sarif FILE`: write SARIF output
|
|
59
|
+
|
|
60
|
+
## [0.65.0] - Phase 6: CLI surface and configurability
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
- `init` command: writes `.agent-readiness.toml` with commented defaults
|
|
64
|
+
- `src/agent_readiness/config.py`: load and parse `.agent-readiness.toml`
|
|
65
|
+
- CLI `--weights FILE`: override pillar weights from a TOML file
|
|
66
|
+
- CLI `--only CHECKS`: filter to specific check IDs or pillar names
|
|
67
|
+
- CLI `--baseline FILE`: load previous JSON report and show score delta
|
|
68
|
+
- CLI `--fail-below N`: exit 1 when overall score < N (CI gate)
|
|
69
|
+
|
|
70
|
+
## [0.5.0] - Phase 5: Complexity and churn
|
|
71
|
+
|
|
72
|
+
### Added
|
|
73
|
+
- `git.churn_hotspots` check (CogLoad, weight=0.6): files changed >10 times
|
|
74
|
+
AND >200 lines are flagged as hotspots; `not_measured` if <5 commits
|
|
75
|
+
- `code.complexity` check (CogLoad, weight=0.7): cyclomatic complexity via
|
|
76
|
+
lizard; `not_measured` if lizard not installed
|
|
77
|
+
- Optional extras in `pyproject.toml`: `report`, `complexity`, `full`
|
|
78
|
+
|
|
79
|
+
## [0.4.0] - Phase 4: Feedback signals
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
- `typecheck.configured` check (Feedback, weight=0.9): mypy.ini, pyrightconfig.json,
|
|
83
|
+
tsconfig.json, or `[tool.mypy]` in pyproject.toml
|
|
84
|
+
- `lint.configured` check (Feedback, weight=0.9): ruff.toml, .eslintrc, .golangci.yml,
|
|
85
|
+
or `[tool.ruff]` in pyproject.toml
|
|
86
|
+
- `gitignore.covers_junk` check (Safety, weight=1.0): .gitignore covering
|
|
87
|
+
__pycache__, .env, node_modules, dist/
|
|
88
|
+
- Good fixture: mypy.ini, ruff.toml, .gitignore
|
|
89
|
+
|
|
90
|
+
## [0.35.0] - Phase 3.5: Flow completeness
|
|
91
|
+
|
|
92
|
+
### Added
|
|
93
|
+
- `entry_points.detected` check (CogLoad, weight=0.8): main.py, index.js, cmd/, etc.
|
|
94
|
+
- `env.example_parity` check (Flow, weight=0.9): .env.example when env vars used
|
|
95
|
+
- `ci.configured` check (Feedback, weight=0.9): GitHub Actions, CircleCI, etc.
|
|
96
|
+
- `setup.command_count` check (Flow, weight=0.7): ≤2 setup commands is ideal
|
|
97
|
+
- `naming.search_precision` check (CogLoad, weight=0.6): no utils/helpers/manager
|
|
98
|
+
- Good fixture: .github/workflows/ci.yml, src/main.py, src/__init__.py, .env.example
|
|
99
|
+
- Good fixture now scores 100.0 overall
|
|
100
|
+
|
|
101
|
+
## [0.3.0] - Phase 3: Context-window economics and repo shape
|
|
102
|
+
|
|
103
|
+
### Added
|
|
104
|
+
- `RepoContext.orientation_tokens` cached property (chars/4 heuristic)
|
|
105
|
+
- `repo_shape.top_level_count` check (CogLoad, weight=0.8)
|
|
106
|
+
- `repo_shape.large_files` check (CogLoad, weight=0.8)
|
|
107
|
+
- `repo_shape.token_budget` check (CogLoad, weight=0.7)
|
|
108
|
+
|
|
109
|
+
## [0.2.0] - Phase 2: Docker sandbox and static manifest checks
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
- `manifest.detected` check (Feedback, weight=1.0): pyproject.toml, package.json, etc.
|
|
113
|
+
- `manifest.lockfile_present` check (Feedback, weight=1.0): poetry.lock, uv.lock, etc.
|
|
114
|
+
- `git.has_history` check (Flow, weight=1.0): scores by commit count
|
|
115
|
+
- Full `DockerSandbox.run()`, `detect_docker_native()`, `resolve_image()` implementations
|
|
116
|
+
- `src/agent_readiness/config.py`: load `.agent-readiness.toml`
|
|
117
|
+
- `src/agent_readiness/plugins.py`: plugin discovery
|
|
118
|
+
- CLI `--run` flag fully implemented (preflight → docker-native check → run)
|
|
119
|
+
- Good fixture: pyproject.toml, uv.lock, CLAUDE.md
|
|
120
|
+
- Fixed `RepoContext.is_git_repo` to detect parent-repo git via `git rev-parse`
|
|
121
|
+
|
|
122
|
+
## [0.1.0] - Phase 1: Five static checks
|
|
123
|
+
|
|
124
|
+
### Added
|
|
125
|
+
- `readme.has_run_instructions` check (CogLoad, weight=1.0)
|
|
126
|
+
- `agent_docs.present` check (CogLoad, weight=1.0)
|
|
127
|
+
- `test_command.discoverable` check (Feedback, weight=1.0)
|
|
128
|
+
- `headless.no_setup_prompts` check (Flow, weight=1.0)
|
|
129
|
+
- `secrets.basic_scan` check (Safety, weight=1.0): caps overall at 30 on ERROR, 75 on WARN
|
|
130
|
+
- `RepoContext`: cached file inventory, git helpers
|
|
131
|
+
- `scorer.score()`: weighted pillar means + safety cap
|
|
132
|
+
- Terminal renderer (rich + plain-text fallback)
|
|
133
|
+
- JSON renderer (stable schema v1)
|
|
134
|
+
- `scan`, `list-checks`, `explain` CLI commands
|
|
135
|
+
- Good and bare test fixtures
|
|
136
|
+
- Safety cap behaviour tests
|
|
137
|
+
|
|
138
|
+
[Unreleased]: https://github.com/harrydaihaolin/agent-readiness/compare/v1.0.0...HEAD
|
|
139
|
+
[1.0.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.9.0...v1.0.0
|
|
140
|
+
[0.9.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.8.0...v0.9.0
|
|
141
|
+
[0.8.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.7.0...v0.8.0
|
|
142
|
+
[0.7.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.65.0...v0.7.0
|
|
143
|
+
[0.65.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.5.0...v0.65.0
|
|
144
|
+
[0.5.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.4.0...v0.5.0
|
|
145
|
+
[0.4.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.35.0...v0.4.0
|
|
146
|
+
[0.35.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.3.0...v0.35.0
|
|
147
|
+
[0.3.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.2.0...v0.3.0
|
|
148
|
+
[0.2.0]: https://github.com/harrydaihaolin/agent-readiness/compare/v0.1.0...v0.2.0
|
|
149
|
+
[0.1.0]: https://github.com/harrydaihaolin/agent-readiness/releases/tag/v0.1.0
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Claude Code guide
|
|
2
|
+
|
|
3
|
+
Conventions specific to Claude Code working in this repository.
|
|
4
|
+
For general agent conventions see [`AGENTS.md`](./AGENTS.md).
|
|
5
|
+
|
|
6
|
+
## Quick start
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
make dev # install dev deps (pip install -e ".[dev]")
|
|
10
|
+
make test # run tests (unittest discover, no pytest required)
|
|
11
|
+
make lint # ruff check src tests
|
|
12
|
+
PYTHONPATH=src python3 -m agent_readiness.cli scan . # dogfood the tool on itself
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Key invariants
|
|
16
|
+
|
|
17
|
+
- **Dogfood on every iteration.** Run `PYTHONPATH=src python3 -m agent_readiness.cli scan .`
|
|
18
|
+
after each change. The score should not regress. Fix friction before moving on.
|
|
19
|
+
- **Headless-first.** The CLI has no interactive prompts. `--json` output is stable
|
|
20
|
+
(schema-versioned). Exit codes mean things. Do not break these contracts.
|
|
21
|
+
- **Static checks only in Phase 1–3.** Checks that execute repo code are gated behind
|
|
22
|
+
`--run` and run inside Docker. Never shell out to target-repo code from a static check.
|
|
23
|
+
|
|
24
|
+
## Adding a check (summary)
|
|
25
|
+
|
|
26
|
+
1. `src/agent_readiness/checks/<name>.py` — `@register(...)` decorated function returning `CheckResult`
|
|
27
|
+
2. Import it inside `_ensure_loaded()` in `src/agent_readiness/checks/__init__.py`
|
|
28
|
+
3. Update `RUBRIC.md` and `PLAN.md` (check must have a name-able agent failure mode)
|
|
29
|
+
4. Add or extend a fixture; update snapshot assertions if scores shift
|
|
30
|
+
|
|
31
|
+
## Do-not-touch without a reason
|
|
32
|
+
|
|
33
|
+
- Default pillar weights in `scorer.py` — changing these shifts every reported score
|
|
34
|
+
- `Report.schema` integer in `models.py` — bump only on intentional breaking changes
|
|
35
|
+
- Sandbox contracts in `sandbox.py` — hard rules live in `SANDBOX.md`
|
|
36
|
+
|
|
37
|
+
## Commit and branch conventions
|
|
38
|
+
|
|
39
|
+
- Feature branches: `feat/<short-description>`
|
|
40
|
+
- Conventional Commits style where reasonable
|
|
41
|
+
- Run `make lint && make test` before committing
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.PHONY: install dev test lint clean build release
|
|
2
|
+
|
|
3
|
+
install:
|
|
4
|
+
pip install -e .
|
|
5
|
+
|
|
6
|
+
dev:
|
|
7
|
+
pip install -e ".[dev]"
|
|
8
|
+
|
|
9
|
+
test:
|
|
10
|
+
PYTHONPATH=src python3 -m unittest discover -s tests -v
|
|
11
|
+
|
|
12
|
+
lint:
|
|
13
|
+
ruff check src tests
|
|
14
|
+
|
|
15
|
+
clean:
|
|
16
|
+
rm -rf build dist *.egg-info src/*.egg-info .pytest_cache .ruff_cache
|
|
17
|
+
find . -type d -name __pycache__ -exec rm -rf {} +
|
|
18
|
+
|
|
19
|
+
build: clean
|
|
20
|
+
python -m build
|
|
21
|
+
|
|
22
|
+
release: build
|
|
23
|
+
@echo "Artifacts in dist/:"
|
|
24
|
+
@ls -lh dist/
|
|
25
|
+
@echo ""
|
|
26
|
+
@echo "Next: git tag v$$(python -c 'import agent_readiness; print(agent_readiness.__version__)') && git push origin --tags"
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-readiness
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Benchmark how agent-ready a code repository is for LLM coding agents.
|
|
5
|
+
Project-URL: Homepage, https://github.com/harrydaihaolin/agent-readiness
|
|
6
|
+
Project-URL: Repository, https://github.com/harrydaihaolin/agent-readiness
|
|
7
|
+
Project-URL: Changelog, https://github.com/harrydaihaolin/agent-readiness/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/harrydaihaolin/agent-readiness/issues
|
|
9
|
+
Project-URL: Documentation, https://github.com/harrydaihaolin/agent-readiness#readme
|
|
10
|
+
Author: agent-readiness contributors
|
|
11
|
+
License: MIT
|
|
12
|
+
Keywords: agents,ai,benchmark,code-quality,developer-experience
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: click>=8.1
|
|
23
|
+
Requires-Dist: rich>=13.7
|
|
24
|
+
Provides-Extra: complexity
|
|
25
|
+
Requires-Dist: lizard>=1.17; extra == 'complexity'
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: build; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
30
|
+
Provides-Extra: full
|
|
31
|
+
Requires-Dist: jinja2>=3.1; extra == 'full'
|
|
32
|
+
Requires-Dist: lizard>=1.17; extra == 'full'
|
|
33
|
+
Requires-Dist: mcp>=1.0; extra == 'full'
|
|
34
|
+
Provides-Extra: mcp
|
|
35
|
+
Requires-Dist: mcp>=1.0; extra == 'mcp'
|
|
36
|
+
Provides-Extra: report
|
|
37
|
+
Requires-Dist: jinja2>=3.1; extra == 'report'
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# agent-readiness
|
|
41
|
+
|
|
42
|
+
**A benchmark for AI agent readiness of a code repository.**
|
|
43
|
+
|
|
44
|
+
You bought the seats. Your team is using Claude Code, Cursor, Copilot, Cline.
|
|
45
|
+
And the agents keep going off the rails on *your* codebase.
|
|
46
|
+
|
|
47
|
+
The model is the variable you can't change. The repo is what you can.
|
|
48
|
+
|
|
49
|
+
`agent-readiness` scans a repository and scores how ready it is for AI
|
|
50
|
+
coding agents — across cognitive load, feedback loops, and flow — then
|
|
51
|
+
hands you a prioritised punchlist of fixes. Like Lighthouse, but for AI
|
|
52
|
+
agent readiness instead of page load.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
$ agent-readiness scan .
|
|
56
|
+
|
|
57
|
+
AI Readiness 62 / 100
|
|
58
|
+
|
|
59
|
+
Cognitive load 70 / 100
|
|
60
|
+
Feedback loops 40 / 100 ← biggest drag
|
|
61
|
+
Flow & reliability 75 / 100
|
|
62
|
+
Safety OK
|
|
63
|
+
|
|
64
|
+
Top friction (fix these first):
|
|
65
|
+
1. test_command.discoverable — no test invocation found in Makefile,
|
|
66
|
+
package.json, or pyproject.toml
|
|
67
|
+
2. agent_docs.present — no AGENTS.md / CLAUDE.md / .cursorrules at root
|
|
68
|
+
3. headless.no_setup_prompts — README mentions "log in to the dashboard"
|
|
69
|
+
during setup; agents can't traverse this
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Design principles
|
|
73
|
+
|
|
74
|
+
**Agents are headless.** We assume the agent has stdin / stdout / files /
|
|
75
|
+
git / HTTP and nothing else. No browser, no dashboard, no clickable
|
|
76
|
+
button. If important state is reachable only through a UI, it's invisible
|
|
77
|
+
to the agent — and the repo loses points wherever that's true.
|
|
78
|
+
|
|
79
|
+
This applies to our own tool, too. `agent-readiness` is fully headless:
|
|
80
|
+
no required interactive prompts, stable JSON via `--json`, exit codes
|
|
81
|
+
that mean things, machine-readable findings.
|
|
82
|
+
|
|
83
|
+
**Code quality counts only where it predicts agent success.** Mega-files,
|
|
84
|
+
ambiguous names, dead code, missing types — those have direct lines to
|
|
85
|
+
agent failure modes and get measured. We don't reproduce the full
|
|
86
|
+
SonarQube taxonomy. Other tools do that well.
|
|
87
|
+
|
|
88
|
+
**Run untrusted code in Docker, always.** Any check that executes code
|
|
89
|
+
from the target repo runs inside a sandboxed container. See
|
|
90
|
+
[`docs/SANDBOX.md`](./docs/SANDBOX.md).
|
|
91
|
+
|
|
92
|
+
## What gets measured
|
|
93
|
+
|
|
94
|
+
See [`docs/RUBRIC.md`](./docs/RUBRIC.md) for the full definition. Short version:
|
|
95
|
+
|
|
96
|
+
| Pillar | What it captures |
|
|
97
|
+
|---|---|
|
|
98
|
+
| **Cognitive load** | What the agent must absorb to make a correct change. |
|
|
99
|
+
| **Feedback loops** | How fast and clear is the signal after a change. |
|
|
100
|
+
| **Flow / reliability** | Headless walkability + how often friction outside the task blocks the agent. |
|
|
101
|
+
| **Safety & trust** | Secrets, destructive scripts, gitignore hygiene. (Cap, not weight.) |
|
|
102
|
+
|
|
103
|
+
## This repo's score
|
|
104
|
+
|
|
105
|
+
Dogfooding: `agent-readiness scan .` run against this repository itself.
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
╭─────────────────────────────╮
|
|
109
|
+
│ AI Readiness 100.0 / 100 │
|
|
110
|
+
╰─────────────────────────────╯
|
|
111
|
+
Cognitive load 100.0 ████████████████████
|
|
112
|
+
Feedback loops 100.0 ████████████████████
|
|
113
|
+
Flow & reliability 100.0 ████████████████████
|
|
114
|
+
Safety 100.0 ████████████████████
|
|
115
|
+
|
|
116
|
+
No findings. Looking good.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Score updated after each iteration as part of the development workflow.
|
|
120
|
+
|
|
121
|
+
## Usage
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
# Static scan (no Docker needed)
|
|
125
|
+
agent-readiness scan .
|
|
126
|
+
agent-readiness scan . --json
|
|
127
|
+
agent-readiness scan . --fail-below 70 # exit 1 if score < 70 (CI gate)
|
|
128
|
+
agent-readiness scan . --only feedback # filter to one pillar
|
|
129
|
+
agent-readiness scan . --baseline prev.json # diff against a previous run
|
|
130
|
+
agent-readiness scan . --report report.html # HTML report (requires jinja2)
|
|
131
|
+
agent-readiness scan . --badge badge.svg # score badge SVG
|
|
132
|
+
agent-readiness scan . --sarif findings.sarif # SARIF for GitHub code scanning
|
|
133
|
+
|
|
134
|
+
# Runtime scan (executes tests inside Docker)
|
|
135
|
+
agent-readiness scan . --run
|
|
136
|
+
|
|
137
|
+
# Other commands
|
|
138
|
+
agent-readiness list-checks
|
|
139
|
+
agent-readiness explain manifest.detected
|
|
140
|
+
agent-readiness init # write .agent-readiness.toml
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Status
|
|
144
|
+
|
|
145
|
+
All phases implemented (v0.1–v0.9). 22 checks across 4 pillars, Docker
|
|
146
|
+
sandbox, HTML + SARIF renderers, CLI surface, plugin API. See
|
|
147
|
+
[`docs/PLAN.md`](./docs/PLAN.md) for the full roadmap and
|
|
148
|
+
[`CHANGELOG.md`](./CHANGELOG.md) for per-phase release notes.
|