Automated summary
Automatically lowers cognitive-complexity and function-length thresholds by refactoring ESLint violations, then validates and opens a pull request.
Strengths
- Updates eslint.thresholds.json and refactors functions that exceed the new thresholds.
- Checks the max-lines limit and recommends companion files to avoid introducing new violations.
- Runs the formatter, lint, tsc, and tests before committing.
- Creates a conventional commit and a pull request via gh.
Limitations
- Relies on the caller to provide thresholds, package manager, and scripts.
- Assumes the project already has ESLint, TypeScript, tests, and GitHub CLI configured.
- Automated edits may still need human review, especially for structural refactors.
Use it for a scheduled, validated reduction of complexity thresholds in an established TypeScript/JavaScript codebase.
Avoid it when the project lacks ESLint thresholds or reliable tests, or when the reduction requires manual architectural redesign.
Security analysis
CautionThe skill is a legitimate refactoring workflow, but it uses powerful tools: arbitrary project scripts, Bash, git commits, and GitHub PR creation. There are no destructive or exfiltration instructions, but the execution and remote-write capabilities make it more than a passive/safe instruction set.
- •Uses Bash to run project-defined lint/test/format scripts and `npx tsc`, which execute repository code and installed dependencies.
- •Autonomously runs git commit and `gh pr create`, performing repository and remote GitHub actions without an in-skill approval gate.
- •Relies on caller-provided package manager and thresholds, so a malicious or mistaken caller could direct it to run unintended commands/scripts.
Examples
Run the nightly complexity reduction with npm: lower cognitiveComplexity from 15 to 12 and maxLinesPerFunction from 80 to 70, refactor the violations, then commit and open a PR.Using bun, reduce the cognitive complexity threshold to 10, fix the resulting ESLint violations, run lint, tsc, and tests, and create a refactor PR.Use yarn to tighten maxLinesPerFunction to 60 while keeping max-lines unchanged; fix only the new violations and open a PR.name: lisa-nightly-lower-code-complexity description: "Nightly direct-execution skill for reducing code complexity thresholds. Receives pre-computed threshold data, refactors violations, updates thresholds, commits, and creates a PR." allowed-tools: ["Edit", "MultiEdit", "Write", "Read", "Glob", "Grep", "Bash"]
Nightly Code Complexity Reduction
The caller provides pre-computed context:
- Package manager (
npm,yarn, orbun) - Current thresholds (cognitiveComplexity, maxLinesPerFunction from eslint.thresholds.json)
- Proposed thresholds (each metric decreased toward target minimums)
- Metrics being reduced (which metrics are above target)
Instructions
- Update eslint.thresholds.json with the proposed new threshold values (do NOT change the maxLines threshold)
- Run the project's lint script with the provided package manager (e.g.,
npm run lint,yarn lint, orbun run lint) to find functions that violate the new stricter thresholds - Before editing, check each violating file's total line count (
wc -l). If a file is within 20 lines of itsmax-linesESLint limit (typically 300), extract helpers into a separate companion file (e.g.,fooHelpers.ts) instead of adding them to the same file. Extracting functions into the same file adds net lines and can create new max-lines violations. - Fix violations one file at a time. Read only the specific function that violates — do not pre-read all files upfront. Fix it, then move to the next.
- For cognitive complexity violations: use early returns, extract helper functions, replace conditionals with lookup tables
- For max-lines-per-function violations: split large functions, extract helper functions, separate concerns
- After each file edit, run the project's formatter (e.g.,
bun run formatornpx prettier --write <file>) to ensure line counts reflect the final formatted state before moving on - Re-run the lint script with the provided package manager to verify all violations are resolved (both the target metric AND max-lines)
- Run the TypeScript compiler to catch type errors early:
npx tsc --noEmit 2>&1 | head -30. If there are type errors, fix them now — do NOT wait until the commit step. Pre-commit hooks run type checking, and discovering errors at commit time wastes turns. - Run the project's test script with the provided package manager (e.g.,
npm run test,yarn test, orbun run test) to verify no tests are broken by the refactoring - Commit all changes (refactored code + updated eslint.thresholds.json) with conventional commit messages
- Create a PR with
gh pr createwith a title like "refactor: reduce code complexity: [metrics being reduced]" summarizing the changes
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/nightly-code-complexity-reduction-ms9wnymq/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/nightly-code-complexity-reduction-ms9wnymq' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/nightly-code-complexity-reduction-ms9wnymq/download' --output '.skill-downloads/nightly-code-complexity-reduction-ms9wnymq/SKILL.md.part' && mv '.skill-downloads/nightly-code-complexity-reduction-ms9wnymq/SKILL.md.part' '.skill-downloads/nightly-code-complexity-reduction-ms9wnymq/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/nightly-code-complexity-reduction-ms9wnymq/SKILL.md' && test -s '.skill-downloads/nightly-code-complexity-reduction-ms9wnymq/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/lisa-nightly-lower-code-complexity' && cp -R '.skill-downloads/nightly-code-complexity-reduction-ms9wnymq' '.claude/skills/lisa-nightly-lower-code-complexity'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/nightly-code-complexity-reduction-ms9wnymq'openskills read 'nightly-code-complexity-reduction-ms9wnymq'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/nightly-code-complexity-reduction-ms9wnymq/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.