ECC Tools Cost Audit
Use this skill when the user suspects the ECC Tools GitHub App is burning cost, over-creating PRs, bypassing usage limits, or routing free users into premium analysis paths.
This is a focused operator workflow for the sibling ECC-Tools repo. It is not a generic billing skill and it is not a repo-wide code review pass.
Skill Stack
Pull these ECC-native skills into the workflow when relevant:
autonomous-loops for bounded multi-step audits that cross webhooks, queues, billing, and retries
agentic-engineering for tracing the request path into discrete, provable units
customer-billing-ops when repo behavior and customer-impact math must be separated cleanly
search-first before inventing helpers or re-implementing repo-local utilities
security-review when auth, usage gates, entitlements, or secrets are touched
verification-loop for proving rerun safety and exact post-fix state
tdd-workflow when the fix needs regression coverage in the worker, router, or billing paths
When To Use
- user says ECC Tools burn rate, PR recursion, over-created PRs, usage-limit bypass, or premium-model leakage
- the task is in the sibling
ECC-Tools repo and depends on webhook handlers, queue workers, usage reservation, PR creation logic, or paid-gate enforcement
- a customer report says the app created too many PRs, billed incorrectly, or analyzed code without producing a usable result
Scope Guardrails
- work in the sibling
ECC-Tools repo, not in everything-claude-code
- start read-only unless the user clearly asked for a fix
- do not mutate unrelated billing, checkout, or UI flows while tracing analysis burn
- treat app-generated branches and app-generated PRs as red-flag recursion paths until proved otherwise
- separate three things explicitly:
- repo-side burn root cause
- customer-facing billing impact
- product or entitlement gaps that need backlog follow-up
Workflow
1. Freeze repo scope
- switch into the sibling
ECC-Tools repo
- check branch and local diff first
- identify the exact surface under audit:
- webhook router
- queue producer
- queue consumer
- PR creation path
- usage reservation / billing path
- model routing path
2. Trace ingress before theorizing
- inspect
src/index.* or the main entrypoint first
- map every enqueue path before suggesting a fix
- confirm which GitHub events share a queue type
- confirm whether push, pull_request, synchronize, comment, or manual re-run events can converge on the same expensive path
3. Trace the worker and side effects
- inspect the queue consumer or scheduled worker that handles analysis
- confirm whether a queued analysis always ends in:
- PR creation
- branch creation
- file updates
- premium model calls
- usage increments
- if analysis can spend tokens and then fail before output is persisted, classify it as burn-with-broken-output
4. Audit the high-signal burn paths
PR multiplication
- inspect PR helpers and branch naming
- check dedupe, synchronize-event handling, and existing-PR reuse
- if app-generated branches can re-enter analysis, treat that as a priority-0 recursion risk
Quota bypass
- inspect where quota is checked versus where usage is reserved or incremented
- if quota is checked before enqueue but usage is charged only inside the worker, treat concurrent front-door passes as a real race
Premium-model leakage
- inspect model selection, tier branching, and provider routing
- verify whether free or capped users can still hit premium analyzers when premium keys are present
Retry burn
- inspect retry loops, duplicate queue jobs, and deterministic failure reruns
- if the same non-transient error can spend analysis repeatedly, fix that before quality improvements
5. Fix in burn order
If the user asked for code changes, prioritize fixes in this order:
- stop automatic PR multiplication
- stop quota bypass
- stop premium leakage
- stop duplicate-job fanout and pointless retries
- close rerun/update safety gaps
Keep the pass bounded to one to three direct fixes unless the same root cause clearly spans multiple files.
6. Verify with the smallest proving steps
- rerun only the targeted tests or integration slices that cover the changed path
- verify whether the burn path is now:
- blocked
- deduped
- downgraded to cheaper analysis
- or rejected early
- state the final status exactly:
- changed locally
- verified locally
- pushed
- deployed
- still blocked
High-Signal Failure Patterns
1. One queue type for all triggers
If pushes, PR syncs, and manual audits all enqueue the same job and the worker always creates a PR, analysis equals PR spam.
2. Post-enqueue usage reservation
If usage is checked at the front door but only incremented in the worker, concurrent requests can all pass the gate and exceed quota.
3. Free tier on premium path
If free queued jobs can still route into Anthropic or another premium provider when keys exist, that is real spend leakage even if the user never sees the premium result.
4. App-generated branches re-enter the webhook
If pull_request.synchronize, branch pushes, or comment-triggered runs fire on app-owned branches, the app can recursively analyze its own output.
5. Expensive work before persistence safety
If the system can spend tokens and then fail on PR creation, file update, or branch collision, it is burning cost without shipping value.
Pitfalls
- do not begin with broad repo wandering; settle webhook -> queue -> worker first
- do not mix customer billing inference with code-backed product truth
- do not fix lower-value quality issues before the highest-burn path is contained
- do not claim burn is fixed until the narrow proving step was rerun
- do not push or deploy unless the user asked
- do not touch unrelated repo-local changes if they are already in progress
Verification
- root causes cite exact file paths and code areas
- fixes are ordered by burn impact, not code neatness
- proving commands are named
- final status distinguishes local change, verification, push, and deployment
1---
2name: ecc-tools-cost-audit
3description: 证据优先的ECC工具燃烧和计费审计工作流。用于调查ECC工具仓库中的失控PR创建、配额绕过、高级模型泄漏、重复作业或GitHub App成本激增。
4origin: ECC
5metadata:
6 source: https://skillmd.com/skills/azusagasaku/ecc-tools-cost-audit
7---
8
9# ECC Tools Cost Audit
10
11Use this skill when the user suspects the ECC Tools GitHub App is burning cost, over-creating PRs, bypassing usage limits, or routing free users into premium analysis paths.
12
13This is a focused operator workflow for the sibling [ECC-Tools](../../ECC-Tools) repo. It is not a generic billing skill and it is not a repo-wide code review pass.
14
15## Skill Stack
16
17Pull these ECC-native skills into the workflow when relevant:
18
19- `autonomous-loops` for bounded multi-step audits that cross webhooks, queues, billing, and retries
20- `agentic-engineering` for tracing the request path into discrete, provable units
21- `customer-billing-ops` when repo behavior and customer-impact math must be separated cleanly
22- `search-first` before inventing helpers or re-implementing repo-local utilities
23- `security-review` when auth, usage gates, entitlements, or secrets are touched
24- `verification-loop` for proving rerun safety and exact post-fix state
25- `tdd-workflow` when the fix needs regression coverage in the worker, router, or billing paths
26
27## When To Use
28
29- user says ECC Tools burn rate, PR recursion, over-created PRs, usage-limit bypass, or premium-model leakage
30- the task is in the sibling `ECC-Tools` repo and depends on webhook handlers, queue workers, usage reservation, PR creation logic, or paid-gate enforcement
31- a customer report says the app created too many PRs, billed incorrectly, or analyzed code without producing a usable result
32
33## Scope Guardrails
34
35- work in the sibling `ECC-Tools` repo, not in `everything-claude-code`
36- start read-only unless the user clearly asked for a fix
37- do not mutate unrelated billing, checkout, or UI flows while tracing analysis burn
38- treat app-generated branches and app-generated PRs as red-flag recursion paths until proved otherwise
39- separate three things explicitly:
40 - repo-side burn root cause
41 - customer-facing billing impact
42 - product or entitlement gaps that need backlog follow-up
43
44## Workflow
45
46### 1. Freeze repo scope
47
48- switch into the sibling `ECC-Tools` repo
49- check branch and local diff first
50- identify the exact surface under audit:
51 - webhook router
52 - queue producer
53 - queue consumer
54 - PR creation path
55 - usage reservation / billing path
56 - model routing path
57
58### 2. Trace ingress before theorizing
59
60- inspect `src/index.*` or the main entrypoint first
61- map every enqueue path before suggesting a fix
62- confirm which GitHub events share a queue type
63- confirm whether push, pull_request, synchronize, comment, or manual re-run events can converge on the same expensive path
64
65### 3. Trace the worker and side effects
66
67- inspect the queue consumer or scheduled worker that handles analysis
68- confirm whether a queued analysis always ends in:
69 - PR creation
70 - branch creation
71 - file updates
72 - premium model calls
73 - usage increments
74- if analysis can spend tokens and then fail before output is persisted, classify it as burn-with-broken-output
75
76### 4. Audit the high-signal burn paths
77
78#### PR multiplication
79
80- inspect PR helpers and branch naming
81- check dedupe, synchronize-event handling, and existing-PR reuse
82- if app-generated branches can re-enter analysis, treat that as a priority-0 recursion risk
83
84#### Quota bypass
85
86- inspect where quota is checked versus where usage is reserved or incremented
87- if quota is checked before enqueue but usage is charged only inside the worker, treat concurrent front-door passes as a real race
88
89#### Premium-model leakage
90
91- inspect model selection, tier branching, and provider routing
92- verify whether free or capped users can still hit premium analyzers when premium keys are present
93
94#### Retry burn
95
96- inspect retry loops, duplicate queue jobs, and deterministic failure reruns
97- if the same non-transient error can spend analysis repeatedly, fix that before quality improvements
98
99### 5. Fix in burn order
100
101If the user asked for code changes, prioritize fixes in this order:
102
1031. stop automatic PR multiplication
1042. stop quota bypass
1053. stop premium leakage
1064. stop duplicate-job fanout and pointless retries
1075. close rerun/update safety gaps
108
109Keep the pass bounded to one to three direct fixes unless the same root cause clearly spans multiple files.
110
111### 6. Verify with the smallest proving steps
112
113- rerun only the targeted tests or integration slices that cover the changed path
114- verify whether the burn path is now:
115 - blocked
116 - deduped
117 - downgraded to cheaper analysis
118 - or rejected early
119- state the final status exactly:
120 - changed locally
121 - verified locally
122 - pushed
123 - deployed
124 - still blocked
125
126## High-Signal Failure Patterns
127
128### 1. One queue type for all triggers
129
130If pushes, PR syncs, and manual audits all enqueue the same job and the worker always creates a PR, analysis equals PR spam.
131
132### 2. Post-enqueue usage reservation
133
134If usage is checked at the front door but only incremented in the worker, concurrent requests can all pass the gate and exceed quota.
135
136### 3. Free tier on premium path
137
138If free queued jobs can still route into Anthropic or another premium provider when keys exist, that is real spend leakage even if the user never sees the premium result.
139
140### 4. App-generated branches re-enter the webhook
141
142If `pull_request.synchronize`, branch pushes, or comment-triggered runs fire on app-owned branches, the app can recursively analyze its own output.
143
144### 5. Expensive work before persistence safety
145
146If the system can spend tokens and then fail on PR creation, file update, or branch collision, it is burning cost without shipping value.
147
148## Pitfalls
149
150- do not begin with broad repo wandering; settle webhook -> queue -> worker first
151- do not mix customer billing inference with code-backed product truth
152- do not fix lower-value quality issues before the highest-burn path is contained
153- do not claim burn is fixed until the narrow proving step was rerun
154- do not push or deploy unless the user asked
155- do not touch unrelated repo-local changes if they are already in progress
156
157## Verification
158
159- root causes cite exact file paths and code areas
160- fixes are ordered by burn impact, not code neatness
161- proving commands are named
162- final status distinguishes local change, verification, push, and deployment