← ClaudeAtlas

code-complexity-stats-prlisted

Add a GitHub Actions workflow that posts code-size and cost statistics — lines of code, per-language breakdown, complexity, and a COCOMO "what would this cost to build" estimate — as a sticky comment on every pull request, using scc. Use when you want a per-PR code-stats or "worth of the codebase" comment, to show LOC / language breakdown or an estimated development cost/effort on PRs, to set up scc (Sloc Cloc and Code) in CI, to post or upsert a single self-updating bot comment from GitHub Actions, or to change the COCOMO salary/currency. Covers fork-PR token limits, runner architecture, version pinning, and comment pagination.
stealth-engine/skills · ★ 2 · AI & Automation · score 76
Install: claude install-skill stealth-engine/skills
# Code complexity / cost stats on every PR A GitHub Actions workflow that runs [`scc`](https://github.com/boyter/scc) (Sloc, Cloc and Code) over the repo on each pull request and posts the results — including a **COCOMO** estimated cost/effort to build the codebase — as a **single sticky comment** that updates in place on every push. Drop-in workflow: [`templates/code-complexity.yml`](./templates/code-complexity.yml). ## What you get `scc` prints a per-language table (files, lines, code, comments, blanks, complexity) plus, with `--avg-wage`, a **COCOMO** block: estimated person-months, schedule, people, and a **dollar cost to develop**. The workflow wraps that in a fenced block and posts it as a PR comment titled *📊 Code Complexity Analysis*. It reports the **whole codebase at the PR's head**, not the diff — it's a "what's this project worth / how big it is" signal, not a per-PR delta. ## Install Copy [`templates/code-complexity.yml`](./templates/code-complexity.yml) to `.github/workflows/code-complexity.yml`. It works as-is on `ubuntu-latest`; the only thing you'll likely change is the `AVG_WAGE` / `WAGE_LABEL` workflow env (see Customise). ## How it works (the parts that matter) - **Trigger:** `pull_request: [opened, synchronize, reopened]` — runs on open and every push. Kept as its **own workflow** so it always runs even when other workflows honour a `[skip ci]`-style marker; these stats are informational. - **Permissions:** a PR comment is posted via the *Iss