agentleFS
agenticlukeagenticluke/ecc-cost-guard-plus/skill/SKILL.md

ecc-tools-cost-audit

Skill0 starsChanged 2 months agoMITView on GitHub

Audit ECC Tools for high token cost, extra pull requests, quota bypass, premium model leaks, duplicate jobs, and costly retries. Use only for the sibling ECC-Tools repo.

5 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. gongyijie85/dsh-ecc★ 8same name
    2. Rojios/everything-claude-code★ 1same name
    3. SamuelNDCE/claude-super-skill-library★ 1same name
    4. davidanthonyn/claude-skills★ 0same name
    5. renepf/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

Show its rules and text

We split this skill into the rules it gives an agent

43 rules. 2 are common, 40 are distinctive, and 1 is very specific to this project.

  • 2

    Common

    Most of the 5 edited versions we read keep these.

  • 40

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when ECC Tools may waste tokens or money.

    line 11
  2. Distinctive:

    Do not add tracking, analytics, telemetry, or new calls to outside services.

    line 15
  3. Distinctive:

    Use these skills when they fit the task:

    line 19
  4. Distinctive:

    If a listed skill is not present, continue without it.

    line 29
  5. Distinctive:

    Use this skill when:

    line 33
  6. Distinctive:

    Do not use this skill for another repo unless the user says to do so.

    line 43
  7. Distinctive:

    Start with read-only checks.

    line 48
  8. Distinctive:

    Check the current branch and local changes first.

    line 50
  9. Distinctive:

    Keep unrelated user changes.

    line 51
  10. Distinctive:

    Do not change checkout, billing pages, or other UI unless the bug needs it.

    line 52
  11. Common:

    Do not push or deploy unless the user asks.

    line 53
  12. Distinctive:

    Do not expose keys, tokens, private data, or customer data.

    line 54
  13. Distinctive:

    Treat app-made branches and pull requests as a loop risk until proved safe.

    line 55
  14. Distinctive:

    Do not add analytics, telemetry, or outside network calls.

    line 56
  15. Distinctive:

    Keep these results separate:

    line 58
  16. Distinctive:

    Do not guess customer charges from code alone.

    line 64
  17. Distinctive:

    If key details are missing, trace the smallest likely path first.

    line 89
  18. Very specific:

    Read src/index.* or the real main entry file first.

    line 93
  19. Distinctive:

    Check whether these events can reach the same costly work:

    line 111
  20. Distinctive:

    Do not assume two event types are safe because they use different routes.

    line 120
  21. Distinctive:

    Check whether each job can:

    line 126
  22. Distinctive:

    Create or update a pull request.

    line 129
  23. Distinctive:

    Call a paid model.

    line 131
  24. Distinctive:

    If tokens are spent but no result is saved, label it:

    line 136
  25. Distinctive:

    Use one safe rule, such as:

    line 164
  26. Distinctive:

    Use a database lock or unique row.

    line 167
  27. Distinctive:

    Check what happens when enqueue fails, the worker stops, or the job is canceled.

    line 171
  28. Distinctive:

    Check model choice against:

    line 175
  29. Distinctive:

    Do not retry bad input, denied access, missing files, or other fixed errors without a clear change.

    line 198
  30. Distinctive:

    Check for paid work before:

    line 202
  31. Common:

    If the user asked for code changes, use this order:

    line 215
  32. Distinctive:

    Stop pull request loops and growth.

    line 217
  33. Distinctive:

    Stop paid model leaks.

    line 219
  34. Distinctive:

    Stop duplicate jobs and useless retries.

    line 220
  35. Distinctive:

    Do not clean up nearby code unless the fix needs it.

    line 225
  36. Distinctive:

    Run only the tests that prove the changed path.

    line 229
  37. Distinctive:

    Add a test for race bugs when practical.

    line 241
  38. Distinctive:

    If no test exists, use a small local test or a dry run.

    line 243
  39. Distinctive:

    Check the branch and local changes.

    line 255
  40. Distinctive:

    Check whether the worker looks for an open pull request before creating one.

    line 259
  41. Distinctive:

    Add a test that sends the same event twice.

    line 262
  42. Distinctive:

    Add a test for an event from an app-made branch.

    line 263
  43. Distinctive:

    Never say the cost bug is fixed until the narrow test passes.

    line 328

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ECC Tools Cost Audit

Original work by ECC. Credit belongs to the ECC authors.

Use this skill when ECC Tools may waste tokens or money. It checks for extra pull requests, quota bugs, paid model leaks, repeat jobs, and failed work that still costs money.

This skill is only for the sibling ECC-Tools repo. It is not a full code review or a general billing audit.

Do not add tracking, analytics, telemetry, or new calls to outside services.

Use Other ECC Skills

Use these skills when they fit the task:

  • autonomous-loops: Keep a long audit small and bounded.
  • agentic-engineering: Split the request path into clear steps.
  • customer-billing-ops: Keep code bugs and customer charges separate.
  • search-first: Find code that already exists before adding helpers.
  • security-review: Check auth, quota gates, access rights, and secrets.
  • verification-loop: Prove the fix is safe to run more than once.
  • tdd-workflow: Add a test when changing worker, router, or billing code.

If a listed skill is not present, continue without it.

When to Use

Use this skill when:

  • The user reports high ECC Tools cost.
  • The app creates too many pull requests.
  • A user can pass a usage limit.
  • A free user can reach a paid model.
  • One event starts the same work more than once.
  • The app spends tokens but gives no useful result.
  • The task covers webhooks, queues, workers, pull requests, usage, or model choice in ECC-Tools.

Do not use this skill for another repo unless the user says to do so.

Safety Rules

  • Work only in the sibling ECC-Tools repo.
  • Start with read-only checks.
  • Change code only when the user asks for a fix.
  • Check the current branch and local changes first.
  • Keep unrelated user changes.
  • Do not change checkout, billing pages, or other UI unless the bug needs it.
  • Do not push or deploy unless the user asks.
  • Do not expose keys, tokens, private data, or customer data.
  • Treat app-made branches and pull requests as a loop risk until proved safe.
  • Do not add analytics, telemetry, or outside network calls.

Keep these results separate:

  1. The code bug that caused the cost.
  2. The billing effect on users.
  3. A product rule that needs later work.

Do not guess customer charges from code alone. Use billing records only if the user gave access and asked for that check.

Audit Steps

1. Set the Scope

Go to the sibling ECC-Tools repo.

Check:

  • Current branch.
  • Local changes.
  • The event or user report being checked.
  • The time range, account, job ID, pull request, or event ID, if known.

Pick the exact paths to trace:

  • Webhook entry.
  • Queue sender.
  • Queue worker.
  • Pull request creation.
  • Usage check and usage save.
  • Model choice.
  • Retry code.

If key details are missing, trace the smallest likely path first. Ask the user only if the missing detail would change the audit in a major way.

2. Trace the Event

Read src/index.* or the real main entry file first.

Map the full path:

GitHub event -> route -> queue job -> worker -> model call -> saved result

For each step, record:

  • Event type.
  • Job name and unique ID.
  • Dedupe rule.
  • Quota check.
  • Usage hold or charge.
  • Model and user tier.
  • Side effects, such as a branch or pull request.

Check whether these events can reach the same costly work:

  • push
  • pull_request
  • pull_request.synchronize
  • comments
  • manual runs
  • retries

Do not assume two event types are safe because they use different routes. Follow both routes to the worker.

3. Check the Worker

Find what happens before and after the model call.

Check whether each job can:

  • Create a branch.
  • Create or update a pull request.
  • Change files.
  • Call a paid model.
  • Hold, add, or refund usage.
  • Retry after an error.
  • Save a result.

If tokens are spent but no result is saved, label it:

cost-with-no-output

Also check errors between the model call and the saved result. These errors may cause the same costly work to run again.

4. Check the Main Cost Risks

Pull Request Growth

Check:

  • Branch names are stable for the same task.
  • An open pull request is reused.
  • Sync events do not create a new pull request each time.
  • App-made branches cannot start the same analysis again.
  • Two workers cannot create two pull requests for one job.

An app that reads its own branch or pull request is a top-level loop risk.

Quota Bypass

Find where the quota is checked, held, charged, and refunded.

A check before enqueue is not enough. Two requests may pass before either worker saves usage.

Use one safe rule, such as:

  • Hold usage in one atomic step before enqueue.
  • Use a database lock or unique row.
  • Give each costly job a unique key.
  • Release the hold when safe work does not start.

Check what happens when enqueue fails, the worker stops, or the job is canceled.

Paid Model Leak

Check model choice against:

  • User plan.
  • Remaining quota.
  • Job type.
  • Feature access.
  • Provider keys being present.

A provider key must not grant access by itself. Free or capped users must be blocked or sent to the allowed low-cost path.

Also check fallback code. A cheap model failure must not silently switch a free user to a paid model.

Retry Cost

Check:

  • Retry count.
  • Delay between retries.
  • Which errors may retry.
  • Whether a retry uses the same job key.
  • Whether a finished job can run again.
  • Whether a dead-letter job can be started twice.

Do not retry bad input, denied access, missing files, or other fixed errors without a clear change.

Cost Before Safe Save

Check for paid work before:

  • Branch name checks.
  • Pull request reuse checks.
  • Write access checks.
  • File checks.
  • Quota holds.
  • Dedupe checks.

Move cheap safety checks before costly work when that does not change the product rule.

5. Fix in Cost Order

If the user asked for code changes, use this order:

  1. Stop pull request loops and growth.
  2. Stop quota bypass.
  3. Stop paid model leaks.
  4. Stop duplicate jobs and useless retries.
  5. Make reruns and updates safe.

Make one to three direct fixes. Change more files only when one root cause spans those files.

Do not clean up nearby code unless the fix needs it.

6. Test the Smallest Useful Case

Run only the tests that prove the changed path.

Prove at least one result:

  • The job is blocked before paid work.
  • Two matching events become one job.
  • An old pull request is reused.
  • A free user gets the allowed model.
  • A fixed error does not retry.
  • A failed enqueue releases its usage hold.
  • A rerun does not create a second charge or pull request.

Add a test for race bugs when practical. A single normal request does not prove a quota race is fixed.

If no test exists, use a small local test or a dry run. Do not call a real paid model or create a real pull request just to test.

Concrete Example

User request:

ECC Tools made three pull requests after one push. Find the cause and fix it.

Audit:

  1. Check the branch and local changes.
  2. Trace the push event from the webhook to the queue.
  3. Trace pull request events from app-made branches.
  4. Compare their job keys.
  5. Check whether the worker looks for an open pull request before creating one.
  6. Confirm whether the app's pull request starts another analysis.
  7. Fix the first loop point.
  8. Add a test that sends the same event twice.
  9. Add a test for an event from an app-made branch.
  10. Prove that one source change creates at most one open pull request.

Report:

Cause: The app handled its own branch push as a new user push.
Fix: App-made branches are now skipped before enqueue.
Proof: The focused webhook tests pass. Duplicate events create one job.
Status: Changed and verified locally. Not pushed or deployed.

Common Bad Patterns

One Job Type for Every Event

Pushes, pull request syncs, and manual runs all send the same job. The worker always creates a pull request. This can turn each analysis into pull request spam.

Usage Saved Too Late

The route checks quota, but the worker saves usage later. Many requests can pass the first check at the same time.

Free User on a Paid Model

The code sees a paid provider key and uses that model without checking the user's plan.

App Output Starts New Work

A branch push, sync event, or comment on an app-made pull request starts the app again.

Paid Work Before Safety Checks

The app calls a model before it checks branch names, open pull requests, write access, quota, or duplicate jobs.

Endless Fixed-Error Retries

The same bad input or denied request runs again even though waiting cannot fix it.

Missing Refund or Release

A usage hold stays in place after enqueue fails, a job is canceled, or the worker stops before paid work begins.

Final Report

Name exact file paths and code areas.

Report:

  • Root cause.
  • Cost path.
  • Customer effect, if proved.
  • Fixes, in cost order.
  • Tests or commands run.
  • Limits of the proof.
  • Any work still needed.

End with one exact status:

  • Read-only audit complete
  • Changed locally
  • Changed and verified locally
  • Pushed
  • Deployed
  • Blocked

Never say the cost bug is fixed until the narrow test passes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.