Cyclomatic Complexity
saurabhkumar8112/cyclomatic-complexity-skill
Refactor code to reduce cyclomatic complexity so it stays readable, maintainable, and aligned with the long-term vision of the codebase, not just optimized for AI comprehension.
Restructure and improve Isabelle or Coq proofs to enhance readability, modularity, and maintainability without changing semantics.
$ npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ArabelaTso/Skills-4-SE proof-refactoring-assistant --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/proof-refactoring-assistant .claude/skills/proof-refactoring-assistant && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "proof-refactoring-assistant" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-refactoring-assistant into .claude/skills/proof-refactoring-assistant/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "proof-refactoring-assistant", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-refactoring-assistantType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ArabelaTso/Skills-4-SE proof-refactoring-assistant --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/proof-refactoring-assistant .agents/skills/proof-refactoring-assistant && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "proof-refactoring-assistant" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-refactoring-assistant into .agents/skills/proof-refactoring-assistant/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "proof-refactoring-assistant", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ArabelaTso/Skills-4-SE proof-refactoring-assistant --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/proof-refactoring-assistant .cursor/skills/proof-refactoring-assistant && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "proof-refactoring-assistant" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-refactoring-assistant into .cursor/skills/proof-refactoring-assistant/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "proof-refactoring-assistant", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ArabelaTso/Skills-4-SE.git --path skills/proof-refactoring-assistant--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ArabelaTso/Skills-4-SE proof-refactoring-assistant --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/proof-refactoring-assistant .gemini/skills/proof-refactoring-assistant && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "proof-refactoring-assistant" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-refactoring-assistant into .gemini/skills/proof-refactoring-assistant/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "proof-refactoring-assistant", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ArabelaTso/Skills-4-SE proof-refactoring-assistantInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/proof-refactoring-assistant .github/skills/proof-refactoring-assistant && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "proof-refactoring-assistant" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-refactoring-assistant into .github/skills/proof-refactoring-assistant/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "proof-refactoring-assistant", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ArabelaTso/Skills-4-SE proof-refactoring-assistant --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/proof-refactoring-assistant .opencode/skills/proof-refactoring-assistant && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "proof-refactoring-assistant" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/proof-refactoring-assistant into .opencode/skills/proof-refactoring-assistant/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "proof-refactoring-assistant", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
proof-refactoring-assistantRestructure and improve Isabelle or Coq proofs to enhance readability, modularity, and maintainability without changing semantics.
Proof Refactoring Assistant is an agent skill from ArabelaTso/Skills-4-SE. Restructure and improve Isabelle or Coq proofs to enhance readability, modularity, and maintainability without changing semantics. Use when proofs are long and monolithic, have repeated patterns, use unclear naming, lack documentation, or when the user asks to refactor, clean up, improve, or reorganize their formal proofs.
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/refactoring_patterns.md`).
It sits in Development, covering Refactoring and Plain language and style rules. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are coq and isabelle).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
isabelle.in.tum.decoq.inria.frFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Proof Refactoring Assistant loads about 3k tokens when it runs, and up to ~6.7k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 920 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 920 words, ~3,018 tokens.
.claude/skills/proof-refactoring-assistant/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Improve proof quality by restructuring Isabelle and Coq proofs for better readability, modularity, and maintainability while preserving semantics. This skill applies proven refactoring patterns to make proofs easier to understand and maintain.
Identify code smells and improvement opportunities:
Structure issues:
Naming issues:
Documentation issues:
Modularity issues:
Complexity issues:
Choose appropriate refactoring patterns:
Extract Helper Lemma:
Inline Trivial Lemma:
Break Down Long Proof:
Extract Common Pattern:
Simplify Proof Structure:
Improve Naming:
Add Documentation:
Strengthen Induction Hypothesis:
Generalize Lemma:
Replace Manual Proof with Automation:
Execute the refactoring safely:
Preserve semantics:
Make incremental changes:
Test continuously:
Document changes:
Ensure refactoring achieved goals:
Readability:
Modularity:
Maintainability:
Performance:
For detailed patterns and examples, see refactoring_patterns.md.
| Code Smell | Refactoring | When to Apply |
|---|---|---|
| Long proof (>20 lines) | Extract Helper Lemma | Complex subgoals, repeated reasoning |
| One-use trivial lemma | Inline Trivial Lemma | Proof is simple, used once |
| Many cases | Break Down Long Proof | Complex case analysis |
| Repeated pattern | Extract Common Pattern | Same proof multiple times |
| Complex tactics | Simplify Proof Structure | Simpler tactics available |
| Generic names | Improve Naming | Unclear what lemma proves |
| No comments | Add Documentation | Complex or non-obvious proof |
| Stuck induction | Strengthen Hypothesis | Need more general statement |
| Too specific | Generalize Lemma | Could be more reusable |
| Tedious manual proof | Use Automation | Standard tactics available |
Before (Coq):
Lemma complex_theorem : forall n m : nat,
n > 0 -> m > 0 -> n + m > 0 /\ n * m > 0.
Proof.
intros n m Hn Hm.
split.
- destruct n. inversion Hn.
destruct m. inversion Hm.
simpl. lia.
- destruct n. inversion Hn.
destruct m. inversion Hm.
simpl. apply Nat.mul_pos_pos; lia.
Qed.After (Coq):
Lemma add_pos : forall n m : nat,
n > 0 -> m > 0 -> n + m > 0.
Proof. intros. lia. Qed.
Lemma mul_pos : forall n m : nat,
n > 0 -> m > 0 -> n * m > 0.
Proof. intros. apply Nat.mul_pos_pos; lia. Qed.
Lemma complex_theorem : forall n m : nat,
n > 0 -> m > 0 -> n + m > 0 /\ n * m > 0.
Proof.
intros. split.
- apply add_pos; assumption.
- apply mul_pos; assumption.
Qed.Improvements:
Before (Coq):
Lemma add_comm : forall n m : nat, n + m = m + n.
Proof.
intros n m.
induction n.
- simpl. rewrite <- plus_n_O. reflexivity.
- simpl. rewrite IHn. rewrite <- plus_n_Sm. reflexivity.
Qed.After (Coq):
Lemma add_comm : forall n m : nat, n + m = m + n.
Proof.
intros. lia.
Qed.Improvements:
Before (Isabelle):
lemma l1: "length (xs @ ys) = length xs + length ys"
by (induction xs) auto
lemma l2: "length (rev xs) = length xs"
by (induction xs) auto
lemma thm: "length (xs @ ys) = length xs + length ys ∧
length (rev xs) = length xs"
using l1 l2 by simpAfter (Isabelle):
lemma append_length: "length (xs @ ys) = length xs + length ys"
by (induction xs) auto
lemma rev_length: "length (rev xs) = length xs"
by (induction xs) auto
lemma list_length_properties:
"length (xs @ ys) = length xs + length ys ∧
length (rev xs) = length xs"
using append_length rev_length by simpImprovements:
Before (Coq):
Lemma partition_spec : forall (A : Type) (f : A -> bool) (l : list A),
let (l1, l2) := partition f l in
filter f l = l1 /\ filter (fun x => negb (f x)) l = l2.
Proof.
(* Complex 20-line proof *)
Admitted.After (Coq):
(** Specification of list partition function.
Given a predicate f and a list l, partition splits l into two lists:
- l1 contains all elements satisfying f
- l2 contains all elements not satisfying f
This lemma proves that partition is equivalent to filtering twice.
Proof strategy: Induction on l, with case analysis on f(head).
*)
Lemma partition_spec : forall (A : Type) (f : A -> bool) (l : list A),
let (l1, l2) := partition f l in
filter f l = l1 /\ filter (fun x => negb (f x)) l = l2.
Proof.
(* Complex 20-line proof *)
Admitted.Improvements:
Before (Isabelle):
lemma complex_cases: "P x"
proof (cases x)
case (C1 a b c)
(* 15 lines of proof *)
then show ?thesis by auto
next
case (C2 d e)
(* 12 lines of proof *)
then show ?thesis by auto
next
case (C3 f)
(* 10 lines of proof *)
then show ?thesis by auto
qedAfter (Isabelle):
lemma case_C1: "⋀a b c. x = C1 a b c ⟹ P x"
(* 15 lines of proof *)
by auto
lemma case_C2: "⋀d e. x = C2 d e ⟹ P x"
(* 12 lines of proof *)
by auto
lemma case_C3: "⋀f. x = C3 f ⟹ P x"
(* 10 lines of proof *)
by auto
lemma complex_cases: "P x"
by (cases x) (auto simp: case_C1 case_C2 case_C3)Improvements:
Before (Coq):
Fixpoint sum (n : nat) : nat :=
match n with
| 0 => 0
| S n' => n + sum n'
end.
Lemma sum_formula : forall n : nat, 2 * sum n = n * (n + 1).
Proof.
induction n.
- reflexivity.
- simpl. (* Gets stuck - IH not strong enough *)
Admitted.After (Coq):
(* Strengthen by generalizing with accumulator *)
Lemma sum_formula_gen : forall n acc : nat,
2 * (sum n + acc) = n * (n + 1) + 2 * acc.
Proof.
induction n; intros.
- simpl. lia.
- simpl. rewrite IHn. lia.
Qed.
Lemma sum_formula : forall n : nat, 2 * sum n = n * (n + 1).
Proof.
intros. pose proof (sum_formula_gen n 0). lia.
Qed.Improvements:
Good times:
Bad times:
High priority:
Low priority:
Balance:
Guidelines:
Before:
During:
After:
© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in skills/proof-refactoring-assistant of ArabelaTso/Skills-4-SE.
Open the folder on GitHubat commit 4f38503
Proof Refactoring Assistant next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Proof Refactoring Assistant this skillArabelaTso/Skills-4-SE | 253 | — | ~3k | Automated safety check: Pass | Apache-2.0 | |
| Cyclomatic Complexitysaurabhkumar8112/cyclomatic-complexity-skill | 405 | — | ~761 | Automated safety check: Pass | Apache-2.0 | |
| Software Design Philosophyluoling8192/software-design-philosophy-skill | 346 | — | ~3.4k | Automated safety check: Pass | MIT | |
| Copilot Code Coachtimothywarner/chatgptclass | 143 | — | ~1.9k | Automated safety check: Pass | Custom licence | |
| Code Simplifiergetsentry/skills | 1k | 6 repos | ~991 | Automated safety check: Pass | Apache-2.0 | |
| Code Simplifiermeleantonio/ChernyCode | 516 | 1 repos | ~604 | Automated safety check: Pass | None |
saurabhkumar8112/cyclomatic-complexity-skill
Refactor code to reduce cyclomatic complexity so it stays readable, maintainable, and aligned with the long-term vision of the codebase, not just optimized for AI comprehension.
luoling8192/software-design-philosophy-skill
Software design philosophy guide based on John Ousterhout's "A Philosophy of Software Design." Use this skill during: code reviews, architecture discussions, API design, module decomposition…
timothywarner/chatgptclass
Socratic coding tutor powered by GitHub Copilot. An agent skill from timothywarner/chatgptclass.
getsentry/skills
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality.
meleantonio/ChernyCode
Simplify and clean up code after changes are complete. An agent skill from meleantonio/ChernyCode.
jd-solanki/slidev-theme-dracula
Write readable, maintainable code through disciplined naming, small functions, and clean error handling.
ArabelaTso/Skills-4-SE
Generate prioritized CVE watchlists and actionable security recommendations for repositories.
ArabelaTso/Skills-4-SE
Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).
ArabelaTso/Skills-4-SE
Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.
ArabelaTso/Skills-4-SE
Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.
ArabelaTso/Skills-4-SE
Automatically migrate Spring MVC applications to Spring Boot.
ArabelaTso/Skills-4-SE
Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.
Categories
Restructure and improve Isabelle or Coq proofs to enhance readability, modularity, and maintainability without changing semantics. Proof Refactoring Assistant is an agent skill from ArabelaTso/Skills-4-SE. Restructure and improve Isabelle or Coq proofs to enhance readability, modularity, and maintainability without changing semantics.
Proof Refactoring Assistant fits situations like: proofs are long and monolithic; have repeated patterns; use unclear naming; lack documentation.
Run `npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a claude-code`. Or copy the skill folder (skills/proof-refactoring-assistant in ArabelaTso/Skills-4-SE) into .claude/skills/proof-refactoring-assistant in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a codex`. Or copy the skill folder (skills/proof-refactoring-assistant in ArabelaTso/Skills-4-SE) into .agents/skills/proof-refactoring-assistant in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill proof-refactoring-assistant -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/proof-refactoring-assistant, .gemini/skills/proof-refactoring-assistant, .github/skills/proof-refactoring-assistant and .opencode/skills/proof-refactoring-assistant in your project.
SKILL.md names no scripts, command-line tools or credentials: Proof Refactoring Assistant is instructions for the agent only.
SKILL.md names 2 domains. As links in the text: isabelle.in.tum.de and coq.inria.fr. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Proof Refactoring Assistant is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.6k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Proof Refactoring Assistant: Cyclomatic Complexity (saurabhkumar8112/cyclomatic-complexity-skill, 405 stars), Software Design Philosophy (luoling8192/software-design-philosophy-skill, 346 stars), Copilot Code Coach (timothywarner/chatgptclass, 143 stars) and Code Simplifier (getsentry/skills, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.
Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.