agent-roast 0.1.0 โ†’ 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +113 -47
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,82 +1,148 @@
1
- # agent-roast ๐Ÿค–๐Ÿ”ฅ
1
+ <div align="center">
2
2
 
3
- > **Zero-telemetry CLI scorecard auditing your git history for AI coding agent infractions, shortcuts, and panic loops.**
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/logo-dark.svg">
5
+ <img src="docs/assets/logo.svg" alt="agent-roast" width="460">
6
+ </picture>
4
7
 
5
- [![npm version](https://img.shields.io/npm/v/agent-roast?color=cb3837&label=npm)](https://www.npmjs.com/package/agent-roast)
6
- [![telemetry: zero](https://img.shields.io/badge/telemetry-zero%20(offline)-1f9d55)](#privacy--security)
7
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
+ ### Audit your git history for AI coding agent shortcuts, infractions, and panic loops
8
9
 
9
- Did your AI coding agent (Cursor, Claude Code, Aider) write clean software, or did it silently delete tests and slap `as any` everywhere to pretend everything compiles?
10
+ [![npm version](https://img.shields.io/npm/v/agent-roast?logo=npm&logoColor=white&color=cb3837&label=npm)](https://www.npmjs.com/package/agent-roast)
11
+ [![telemetry: zero (offline)](https://img.shields.io/badge/telemetry-zero%20(offline)-1f9d55)](#privacy--zero-telemetry)
12
+ [![speed: <200ms](https://img.shields.io/badge/speed-%3C200ms-blue)](#performance)
13
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
14
 
11
- Run in any git repository (100% local, zero tokens, zero telemetry):
15
+ <br/>
12
16
 
13
17
  ```bash
14
18
  npx agent-roast
15
19
  ```
16
20
 
21
+ </div>
22
+
23
+ ---
24
+
25
+ Did your AI coding assistant write clean, maintainable software โ€” or did it quietly delete failing tests, slap `as any` everywhere, and spam 6 panic commits in 8 minutes?
26
+
27
+ **`agent-roast`** is an offline, zero-telemetry CLI scorecard that parses git diffs to detect AI shortcuts and calculate an objective **Discipline Score (0โ€“100)** with a personality archetype.
28
+
29
+ <div align="center">
30
+ <img src="docs/assets/demo.svg" alt="agent-roast terminal audit demo" width="100%">
31
+ </div>
32
+
17
33
  ---
18
34
 
19
- ### What it looks like:
35
+ ## โšก๏ธ Quickstart
20
36
 
21
- ```text
22
- โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
23
- โ•‘ ๐Ÿค– AGENT ROAST DOSSIER โ•‘
24
- โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
37
+ Run directly in any repository (no install required):
25
38
 
26
- Repository: my-app
27
- Commits: 18 AI-attributed / 42 total
28
- Code Added: 4,210 lines (AI) / 12,480 lines (total)
39
+ ```bash
40
+ # Audit AI-attributed commits (Claude Code, Cursor, Aider, Devin, etc.)
41
+ npx agent-roast
29
42
 
30
- AGENT ARCHETYPE: The Any Architect
31
- Leans on compiler bypasses (`as any`, `@ts-ignore`) rather than strict type modeling.
43
+ # Audit ALL commits across repo history (including unverified human commits)
44
+ npx agent-roast --all
32
45
 
33
- DISCIPLINE SCORE: 68 / 100
34
- (100 = spotless discipline, 0 = complete shortcut addiction)
46
+ # Print exact commit SHAs and line snippets for all infractions
47
+ npx agent-roast --verbose
35
48
 
36
- ๐Ÿ“Š INFRACTIONS BREAKDOWN:
37
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
38
- โœ– Skipped tests: 4 (it.skip, describe.skip, xit)
39
- โ–ฒ Type escapes: 16 (as any, @ts-ignore, eslint-disable)
40
- โœ– Swallowed errors: 3 (empty catch {}, except: pass)
41
- โ†ป Panic fix loops: 2 (quick fixes < 15m apart)
49
+ # Audit a specific time window (default: last 90 days)
50
+ npx agent-roast --since "30 days ago"
42
51
 
43
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
44
- ๐Ÿ“ข Share your score on X: https://twitter.com/intent/tweet?text=...
45
- Tip: Run with --verbose to see exact commit SHAs and lines
52
+ # Output structured JSON for CI/CD pipelines
53
+ npx agent-roast --json
46
54
  ```
47
55
 
48
56
  ---
49
57
 
50
- ### What it detects (only added lines, zero false alarms from file renames):
58
+ ## ๐Ÿ” What It Detects
59
+
60
+ `agent-roast` analyzes **only added lines** (`+`) in source code files, eliminating false alarms from refactoring or file renames:
51
61
 
52
- 1. **Skipped Tests:** `it.skip`, `describe.skip`, `xit`, `test.todo` added when tests fail.
53
- 2. **Type Escapes:** `as any`, `// @ts-ignore`, `// @ts-expect-error`, `# type: ignore`, `eslint-disable`.
54
- 3. **Swallowed Errors:** Empty `catch {}` or `except: pass` blocks hiding production bugs.
55
- 4. **Panic Loops:** Consecutive quickfix/revert commits within 15 minutes by the agent.
62
+ | Infraction | Patterns Detected | Penalty Weight | Why It Matters |
63
+ | :--- | :--- | :---: | :--- |
64
+ | **Skipped Tests** | `it.skip`, `describe.skip`, `xit`, `pytest.skip`, `test.todo` | **15 pts** | Disabling failing tests instead of fixing the root bug. |
65
+ | **Swallowed Errors** | Empty `catch {}`, `except: pass` | **10 pts** | Silencing exceptions and sweeping runtime failures under the rug. |
66
+ | **Panic Fix Loops** | Consecutive quickfix commits within 15m by same author | **8 pts** | Frantic thrashing without reading stack traces or logs. |
67
+ | **Type Escapes** | `as any`, `// @ts-ignore`, `// @ts-expect-error`, `# type: ignore` | **3 pts** | Bypassing compiler guarantees to pretend code type-checks. |
68
+
69
+ > [!NOTE]
70
+ > String literals and regex patterns are automatically sanitized before analysis. Test fixtures containing pattern names as string data will never trigger false positives.
56
71
 
57
72
  ---
58
73
 
59
- ### Options
74
+ ## ๐ŸŽญ Agent Archetypes
60
75
 
61
- ```bash
62
- npx agent-roast # Audit AI-attributed commits (Co-Authored-By: Claude, Cursor, Aider, etc.)
63
- npx agent-roast --all # Audit ALL commits across the repository
64
- npx agent-roast --verbose # Print exact commit SHAs and code lines as proof
65
- npx agent-roast --since 30d # Audit last 30 days of git history
66
- npx agent-roast --json # Output raw JSON metrics for CI pipelines
67
- ```
76
+ Depending on the dominant infraction patterns, `agent-roast` assigns your agent an archetype:
77
+
78
+ | Archetype | Icon | Trigger Condition | Personality Dossier |
79
+ | :--- | :---: | :--- | :--- |
80
+ | **The Clean Coder** | ๐Ÿงผ | Score $\ge 90$, 0 infractions | Spotless discipline. No skipped tests, zero panic loops, clean type safety. |
81
+ | **The Pragmatic Builder** | ๐Ÿ› ๏ธ | Score $\ge 90$, minor compromises | Overwhelmingly disciplined. Only rare, isolated shortcuts across thousands of lines. |
82
+ | **The Panic Looper** | โ†ป | Dominant panic loops ($\ge 2$) | Prone to rapid-fire fix and revert thrashing cycles when wrestling stubborn bugs. |
83
+ | **The Silent Vandal** | โœ– | Dominant skipped tests ($\ge 3$) | When test suites push back, tends to disable or skip tests to keep pipelines green. |
84
+ | **The Any Architect** | โ–ฒ | Dominant type escapes ($\ge 5$) | Leans on compiler bypasses (`as any`, `@ts-ignore`) rather than strict type modeling. |
85
+ | **The Secret Keeper** | ๐Ÿค | Dominant empty catches ($\ge 2$) | Tends to silence errors with empty catch blocks, obscuring runtime failures. |
86
+ | **The Chaos Gremlin** | ๐Ÿ”ฅ | Score $< 50$, mixed infractions | Mixes multiple shortcuts: skipped tests, type bypasses, and quick patches under pressure. |
87
+
88
+ ---
89
+
90
+ ## ๐Ÿ“ How Scoring Works
91
+
92
+ 1. **Volume Dampening:** To prevent large repos from automatically scoring 99/100, penalties scale sub-linearly using a logarithmic volume curve:
93
+ $$\text{Volume Factor} = 1 + 1.2 \cdot \ln\left(\max\left(1, \frac{\text{LOC Added}}{1000}\right)\right)$$
94
+ 2. **Commit Caps:** Maximum 10 infractions counted per commit to prevent a single refactoring commit from dominating the entire audit.
95
+ 3. **Small Sample Protection:** Repositories with fewer than 200 lines of added code display `INSUFFICIENT DATA` instead of a premature score.
96
+
97
+ ---
98
+
99
+ ## ๐Ÿค– AI Attribution
100
+
101
+ `agent-roast` recognizes commits authored or co-authored by AI tools through:
102
+ - Git trailers (`Co-Authored-By: Claude <noreply@anthropic.com>`, Cursor, Aider, etc.)
103
+ - Commit messages (`generated by aider`, `authored by cursor`)
104
+ - Author emails and usernames containing recognized bot signatures
105
+
106
+ To audit all commits regardless of attribution, pass the `--all` flag.
68
107
 
69
108
  ---
70
109
 
71
- ### Privacy & Security
110
+ ## ๐Ÿ”’ Privacy & Zero Telemetry
111
+
112
+ - **100% Local Execution:** Runs streaming `git log` directly on your machine in under 200ms.
113
+ - **Zero Network Calls:** No external API requests, no telemetry, no analytics.
114
+ - **Hermetic:** Source code never leaves your computer.
72
115
 
73
- `agent-roast` is strictly **local and deterministic**:
74
- - Runs streaming `git log` on your machine in milliseconds.
75
- - **Zero network calls**, zero LLM APIs, zero tracking or analytics.
76
- - Your source code never leaves your terminal.
116
+ ---
117
+
118
+ ## ๐Ÿšฆ GitHub Actions CI Integration
119
+
120
+ Fail a PR if an agent's discipline score drops below 60:
121
+
122
+ ```yaml
123
+ name: Agent Audit
124
+ on: [pull_request]
125
+
126
+ jobs:
127
+ roast:
128
+ runs-on: ubuntu-latest
129
+ steps:
130
+ - uses: actions/checkout@v4
131
+ with:
132
+ fetch-depth: 0
133
+ - name: Run agent-roast
134
+ run: |
135
+ npx agent-roast --since "7 days ago" --json > roast.json
136
+ SCORE=$(jq '.score' roast.json)
137
+ echo "Discipline Score: $SCORE / 100"
138
+ if [ "$SCORE" -lt 60 ]; then
139
+ echo "โŒ Agent discipline score below 60!"
140
+ exit 1
141
+ fi
142
+ ```
77
143
 
78
144
  ---
79
145
 
80
- ### License
146
+ ## ๐Ÿ“„ License
81
147
 
82
148
  [MIT](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-roast",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Zero-telemetry CLI scorecard analyzing git history for AI coding agent infractions and panic loops",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -45,6 +45,7 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node": "^20.0.0",
48
+ "gifenc": "^1.0.3",
48
49
  "tsup": "^8.0.0",
49
50
  "typescript": "^5.0.0",
50
51
  "vitest": "^3.0.0"