coding.factor_common_code

coding.factor_common_code is a skill for Claude Code from gpsaggese/helpers. It costs 12 tokens per session (479 once invoked), scanned A, original, Apache-2.0.

A Python refactoring tool that finds duplicated or nearly duplicated logic across source files and proposes shared functions. Refactoring changes code structure without changing what the code does.

In plain words
What is it for?
Use it to inspect multiple Python files, identify safe opportunities for shared functions, and report or carry out the proposed refactoring when requested.
Why use it?
It removes repeated implementation that would otherwise need to be fixed in several places. It focuses on meaningful, reusable logic rather than tiny abstractions.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; reads .claude/ paths.

Good fit Use it to inspect multiple Python files, identify safe opportunities for shared functions, and report or carry out the proposed refactoring when requested.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gpsaggese/helpers/coding.factor_common_code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gpsaggese/helpers --skill coding.factor_common_code
Clone the repo
git clone --depth 1 https://github.com/gpsaggese/helpers

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coding.factor_common_code

README.md
[![agentmods](https://agentmods.dev/badge/skills/gpsaggese/helpers/coding.factor_common_code/github.svg)](https://agentmods.dev/skills/gpsaggese/helpers/coding.factor_common_code)
Your own site
<a href="https://agentmods.dev/skills/gpsaggese/helpers/coding.factor_common_code"><img src="https://agentmods.dev/badge/skills/gpsaggese/helpers/coding.factor_common_code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for coding.factor_common_code

Your own site · 80×15
<a href="https://agentmods.dev/skills/gpsaggese/helpers/coding.factor_common_code"><img src="https://agentmods.dev/badge/skills/gpsaggese/helpers/coding.factor_common_code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 479 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00012 $0.00479
Opus 5.5 $0.00005 $0.00192
Sonnet 5.5 $0.00002 $0.00096
Haiku 4.5 $0.00001 $0.00048

Measured yesterday against content hash 95a537210f7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

coding.factor_common_code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/coding.factor_common_code/SKILL.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Role

  • Senior Python engineer, experienced in refactoring and codebase hygiene

Goal

  • I will give references to one or more Python source files

  • Your task is to:

    • Read and analyze the code across these files
    • Identify meaningful duplicated or near-duplicated code blocks that can be safely refactored into shared functions
    • Report these changes
    • Ask the user
  • You must not change the behavior of the code

Workflow

Objectives

  • Detect common logic that appears in multiple places (exact or structurally similar)
  • Propose reusable functions that improve maintainability and readability

Guidelines

  • Skip trivial functions (fewer than 2-3 meaningful lines)
  • Avoid trivial abstractions. Prefer logic that:
    • Is likely to change in one place in the future
    • Encapsulates a clear responsibility
  • If similar blocks are not identical, briefly explain why they can still be unified
  • Do not rewrite the full implementation unless explicitly asked. Only identify and describe refactor opportunities

Output Format

  • If the user uses the option --dry_run, report the output as below instead of executing the refactorings
  • For each proposed refactoring, produce:
    • Proposed function interface
      • Function name
      • Parameters (with brief explanation if non-obvious)
      • Return value (if any)
    • Summary of the locations of duplicated code
      • Use the following format:
        file1.py: l1-l2, l3-l4, ...
        file2.py: l5-l8, ...
        
    • Create a vim quickfix cfile for the locations using the convention in .claude/skills/cfile.rules.md

Make Changes

  • Make the changes to remove repeated code

Conventions

  • Follow the rules in .claude/skills/coding.rules.md

Verification

  • Confirm proposed functions are non-trivial and each encapsulates a clear responsibility
  • Confirm the code behavior is unchanged after refactoring
  • Confirm the cfile locations point to the correct duplicated blocks

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 65 lines · 12 tokens per session scan A 95a537210f7a

Subscribe to this mod's changes

coding.factor_common_code is a skill published in the GitHub repository gpsaggese/helpers (158 stars, last pushed today), licensed Apache-2.0. It adds 12 tokens to every session and 479 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-06.

Related

coding.factor_common_code compared with skills from other repositories

coding.factor_common_code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
coding.factor_common_codegpsaggese/helpersSkill158todayApache-2.0A12Claude Code
mcore-linting-and-formattingNVIDIA/skillsSkill3.9ktodayApache-2.0A44Claude Code
splitting-oversized-modulesPostHog/posthog-fossSkill728todayMITA197Claude Code, Codex
python-review-checklistawslabs/cli-agent-orchestratorSkill1.5ktodayApache-2.0A20Claude Code, Codex
splitting-oversized-modulesPostHog/posthogSkill41ktodaynoneA197Claude Code, Codex
best-practicesFradSer/dotclaudeSkill596yesterdayMITA52Claude Code
plankton-code-qualityloulanyue/awesome-claude-notesSkill2711mo agoMITA34Claude Code