Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Claude CodeNot declared
CursorNot declared
CodexNot declared
GitHub CopilotNot declared
WindsurfNot declared
Gemini CLINot declared
ClineNot declared
OpenCodeNot declared
Repository health
Stars4
Default branchmain
Open issues0
Status
Archived
Package contents
Files included with this skill beyond the listing page.
skill mdSKILL.md3,850 B
docsSUMMARY.md307 B
History
First seen on skills.sh
First recorded snapshot · 5 installs
SKILL.md
Setup CRAP Check
One-time guided setup. Adds CRAP score enforcement at both CI and pre-commit hook level. Defaults to setting up both -- confirms with user before proceeding.
Workflow
Step 1 -- Detect project setup
Identify primary language(s) from file extensions and config files
Identify test framework (pytest, jest, vitest, go test, maven, gradle, etc.)
Identify existing coverage config (.coveragerc, jest.config, nyc in package.json, jacoco in pom.xml, etc.)
Identify source directories (e.g. src/, lib/, app/, . for Go)
Check if .github/workflows/ already exists
Present findings to user for confirmation before proceeding.
If detection is ambiguous, use AskUserQuestion to clarify:
If no test framework detected: ask what test runner they use (CRAP scoring requires coverage data -- if there are no tests yet, inform user and offer to set up the hook anyway for when they add tests)
If multiple languages detected: ask which to configure CRAP checks for
If no source directories are obvious: ask which directories contain production code
Step 2 -- Ask user preferences
Use AskUserQuestion for each:
Where to enforce -- default is both, confirm with user:
- Both CI and pre-commit hook (recommended) - CI only -- GitHub Actions workflow - Pre-commit hook only -- local enforcement
CRAP threshold -- max acceptable score per function
- Suggest 30 (the standard threshold from the CRAP paper) - User can raise/lower
CI enforcement mode (if CI selected) -- what happens when threshold is exceeded?
- Fail the check (recommended) -- PR cannot merge - Warn only -- post a comment but don't block
CI trigger events (if CI selected):
- pullrequest targeting main/master (recommended default) - push to main/master - schedule (e.g. weekly) - workflowdispatch (manual) - User can pick multiple
Step 3 -- Generate files
If CI selected: run python3 scripts/generate_workflow.py with the collected parameters to produce the workflow YAML
Write output to .github/workflows/crap-check.yml
Copy crapscore.py from the cut-the-crap skill into the repo at scripts/crapscore.py
If pre-commit hook selected: write the hook script to .git/hooks/pre-commit (or append to existing) and make it executable
If .crapignore doesn't exist, ask user if they want one and create it with sensible defaults for their language (e.g. node_modules/, dist/, .venv/, test fixtures)
Confirm test + coverage commands match the detected framework
Show the user what was generated for review
Suggest a dry-run: act locally or push a test branch
Key rules
Never overwrite existing workflow files or hooks without asking
Always confirm detected test/coverage commands with user before generating
The crap_score.py committed to the repo must be self-contained (no external deps beyond Python stdlib)
If the project uses a monorepo or multiple languages, generate separate jobs per language
Script
The bundled scripts/generate_workflow.py produces the workflow YAML deterministically. See [REFERENCE.md](REFERENCE.md) for per-language CI snippets and coverage tool details.