Agent skill

Refactor

by BUZZARDGTA in BUZZARDGTA/Session-Sniffer

Refactor Session Sniffer code to improve structure, readability, duplication, and maintainability while preserving existing behavior.

GPL-3.0Auto-check passedDevelopment

Install Refactor

skills CLI
$ npx skills add BUZZARDGTA/Session-Sniffer --skill refactor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install BUZZARDGTA/Session-Sniffer refactor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/BUZZARDGTA/Session-Sniffer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/refactor .claude/skills/refactor && rm -rf skills-src

Use ~/.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/

Facts

Skill name
refactor
GitHub stars
105
Token cost
~1.4k tokens
SKILL.md length
711 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
GPL-3.0

At a glance

Refactor Session Sniffer code to improve structure, readability, duplication, and maintainability while preserving existing behavior.

  • Works in 11 steps: Inspect the Git working tree and current… → Identify the user's target and desired… → Read the relevant implementation,… → …
  • The user invokes /refactor
  • SKILL.md covers Refactor Procedure, Behavior-Preservation…, Architecture and Performance and Code Quality, plus 3 more sections
  • Calls python

What it does

Refactor is an agent skill from BUZZARDGTA/Session-Sniffer. Refactor Session Sniffer code to improve structure, readability, duplication, and maintainability while preserving existing behavior. Use when the user invokes /refactor or explicitly requests code restructuring without a behavior change.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring and Plain language and style rules. The repository describes itself as: A packet sniffer (also known as an IP sniffer/puller) specifically designed for Peer-To-Peer (P2P) video games on PC and consoles (PlayStation and Xbox). The licence is GPL-3.0.

When your agent uses it

  • The user invokes /refactor
  • Explicitly requests code restructuring without a behavior change

Example prompts

  • “/refactor”

Requirements

  • Python 3

Workflow steps

11 steps, taken from the first numbered list in SKILL.md.

  1. Inspect the Git working tree and current diff before making changes. Preserve all unrelated user changes.
  2. Identify the user's target and desired outcome. If no target is specified, inspect the reported area or identify a small, high-value…
  3. Read the relevant implementation, callers, validation configuration, and applicable .agents/rules/*.md guidance before editing.
  4. Trace data flow, state ownership, lifecycle, error handling, and side effects for the code being changed.
  5. Identify a specific structural problem, such as
  6. Explain the intended structural change briefly when it is substantial; then make the smallest coherent refactor.
  7. Prefer existing project abstractions and conventions. Do not introduce a new manager, service layer, registry, wrapper, base class, or…
  8. Update all affected call sites together following the No Backward Compatibility rules in .agents/rules/core.md (do not leave compatibility…
  9. Review the complete diff for accidental behavior changes, unrelated edits, and formatting churn.
  10. Run the smallest relevant configured validation, then broaden it when the risk warrants it.
  11. Report the structural problem, the refactor, files changed, checks actually run, and any remaining risk.

What it can do on your machine

Read from SKILL.md and the folder at commit af4f862. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Refactor loads about 1.4k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 711 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from BUZZARDGTA/Session-Sniffer at commit af4f862, republished under its GPL-3.0 licence (© BUZZARDGTA). 711 words, ~1,417 tokens.

Download SKILL.mdSave it as .claude/skills/refactor/SKILL.md (or your agent's skills folder).
name
refactor
description
Refactor Session Sniffer code to improve structure, readability, duplication, and maintainability while preserving existing behavior. Use when the user invokes /refactor or explicitly requests code restructuring without a behavior change.

Session Sniffer Refactor

Use this skill when the user wants to refactor Session Sniffer.

The goal is to improve code structure and maintainability without changing externally observable behavior. Prefer small, justified changes that fit the existing architecture over broad rewrites.

Refactor Procedure

  1. Inspect the Git working tree and current diff before making changes. Preserve all unrelated user changes.
  2. Identify the user's target and desired outcome. If no target is specified, inspect the reported area or identify a small, high-value refactor supported by concrete evidence; do not refactor the entire repository opportunistically.
  3. Read the relevant implementation, callers, validation configuration, and applicable .agents/rules/*.md guidance before editing.
  4. Trace data flow, state ownership, lifecycle, error handling, and side effects for the code being changed.
  5. Identify a specific structural problem, such as:
    • duplicated logic with identical semantics;
    • a function or class combining separable responsibilities;
    • complex control flow that can be made clearer;
    • unclear naming or unnecessary indirection in the targeted code;
    • repeated conversion or setup logic that belongs in an existing abstraction.
  6. Explain the intended structural change briefly when it is substantial; then make the smallest coherent refactor.
  7. Prefer existing project abstractions and conventions. Do not introduce a new manager, service layer, registry, wrapper, base class, or helper module unless the code demonstrates a real need.
  8. Update all affected call sites together following the No Backward Compatibility rules in .agents/rules/core.md (do not leave compatibility aliases, shims, or duplicate implementations).
  9. Review the complete diff for accidental behavior changes, unrelated edits, and formatting churn.
  10. Run the smallest relevant configured validation, then broaden it when the risk warrants it.
  11. Report the structural problem, the refactor, files changed, checks actually run, and any remaining risk.

Behavior-Preservation Requirements

Unless the user explicitly asks for a behavior change, preserve:

  • public and internal behavior, return values, side effects, and error semantics;
  • execution order where order can affect results;
  • initialization and shutdown behavior;
  • ownership and lifetime of state;
  • signal/slot wiring and Qt thread boundaries;
  • configuration loading, settings persistence, and data formats;
  • logging meaning and severity;
  • network and packet-processing behavior;
  • resource cleanup and exception propagation.

Do not treat a refactor as permission to redesign APIs, change defaults, remove features, or modernize unrelated code. Do not combine performance optimization, bug fixes, dependency upgrades, or cosmetic cleanup with a structural refactor unless it is essential to the requested change; separate independent work.

Show full SKILL.md (314 more words)Show less

Architecture and Performance

  • Follow the existing architecture documented in .agents/rules/architecture.md and applicable subsystem rules.
  • Trace callers and consumers before moving code or changing ownership.
  • Preserve threading, queue, synchronization, and worker-lifecycle patterns.
  • Do not add allocations, repeated parsing, extra work in hot paths, or new blocking operations without a demonstrated reason.
  • Do not change polling intervals, timers, retry behavior, or event frequency as part of a behavior-preserving refactor.
  • Avoid abstractions that merely wrap a single simple operation or obscure a straightforward flow.
  • Follow the file sizing rules in .agents/rules/python.md ("File Sizing and Structural Warnings"): leave cohesive data tables, schemas, and defaults registries intact; do not split files solely to satisfy line-count metrics.

Code Quality

  • Follow the project's authoritative pyproject.toml and .agents/rules/ instructions.
  • Reuse existing types, utilities, and error-handling patterns.
  • Keep names precise and intent-revealing.
  • Do not silence lint or type diagnostics just to make the refactor pass.
  • Do not add dependencies unless the task explicitly requires them and existing functionality cannot reasonably be reused.
  • Do not perform repository-wide formatting or unrelated renames.

Validation

Follow the validation workflow and configured tooling in .agents/rules/testing.md.

  • Start narrowly with targeted linter and type-checker runs against the touched paths.
  • Broaden validation to the full suite (python code_quality_checks.py) when the risk warrants it.
  • Never claim a check passed unless it actually ran successfully.
  • Ensure all modified files retain CRLF (\r\n) line endings per .agents/rules/core.md.

Scope and Safety

Follow the Git and Change Discipline rules in .agents/rules/core.md.

  • Do not create commits or push changes unless explicitly requested.
  • Do not modify files merely to make validation pass.
  • Keep the diff focused and reviewable.

Final Report

Summarize:

  • Structural issue: what made the original code harder to maintain.
  • Refactor: what moved, was extracted, simplified, or deduplicated.
  • Behavior: why the observable behavior should remain unchanged, including any assumptions.
  • Files: files changed.
  • Validation: exact checks run and their results.
  • Remaining risks: anything that could not be verified.

© BUZZARDGTA, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/refactor of BUZZARDGTA/Session-Sniffer.

Open the folder on GitHubat commit af4f862

Compare with similar skills

Refactor 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.

Refactor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor this skillBUZZARDGTA/Session-Sniffer105—~1.4kAutomated safety check: PassGPL-3.0
Cyclomatic Complexitysaurabhkumar8112/cyclomatic-complexity-skill405—~761Automated safety check: PassApache-2.0
Software Design Philosophyluoling8192/software-design-philosophy-skill346—~3.4kAutomated safety check: PassMIT
Copilot Code Coachtimothywarner/chatgptclass143—~1.9kAutomated safety check: PassCustom licence
Code Simplifiergetsentry/skills1k6 repos~991Automated safety check: PassApache-2.0
Code Simplifiermeleantonio/ChernyCode5161 repos~604Automated safety check: PassNone

Similar skills

  • 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.

    405 GitHub stars~761 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Software Design Philosophy

    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…

    346 GitHub stars~3.4k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Copilot Code Coach

    timothywarner/chatgptclass

    Socratic coding tutor powered by GitHub Copilot. An agent skill from timothywarner/chatgptclass.

    143 GitHub stars~1.9k tokensUpdated 21 days ago
    DevelopmentAuto-check passed
  • Code Simplifier

    getsentry/skills

    Official

    Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality.

    1k GitHub starsUsed in 6 repos~991 tokens
    DevelopmentAuto-check passed
  • Code Simplifier

    meleantonio/ChernyCode

    Simplify and clean up code after changes are complete. An agent skill from meleantonio/ChernyCode.

    516 GitHub starsUsed in 1 repo~604 tokens
    DevelopmentAuto-check passed
  • Clean Code

    jd-solanki/slidev-theme-dracula

    Write readable, maintainable code through disciplined naming, small functions, and clean error handling.

    161 GitHub starsUsed in 1 repo~3.8k tokens
    DevelopmentAuto-check passed

More from BUZZARDGTA/Session-Sniffer

  • Fix

    BUZZARDGTA/Session-Sniffer

    Diagnose and fix Session Sniffer bugs, errors, tracebacks, logs, lint failures, static-analysis findings, and IDE-reported problems.

    105 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Commit

    BUZZARDGTA/Session-Sniffer

    Organize and commit current Git changes by committing a requested feature alone or splitting all unrelated changes into separate logical commits.

    105 GitHub stars~828 tokensUpdated today
    Auto-check passed
  • Release

    BUZZARDGTA/Session-Sniffer

    Prepare and commit a Session Sniffer release by updating the version in pyproject.toml with the current UTC build timestamp, incrementing the RC or final version as requested, synchronizing uv.lock…

    105 GitHub stars~1.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Refactor

What does Refactor do?

Refactor Session Sniffer code to improve structure, readability, duplication, and maintainability while preserving existing behavior. Refactor is an agent skill from BUZZARDGTA/Session-Sniffer. Refactor Session Sniffer code to improve structure, readability, duplication, and maintainability while preserving existing behavior.

When should I use Refactor?

Refactor fits situations like: the user invokes /refactor; explicitly requests code restructuring without a behavior change.

How do I install Refactor in Claude Code?

Run `npx skills add BUZZARDGTA/Session-Sniffer --skill refactor -a claude-code`. Or copy the skill folder (.agents/skills/refactor in BUZZARDGTA/Session-Sniffer) into .claude/skills/refactor in your project. Claude Code loads it when a task matches its description.

How do I install Refactor in Codex?

Run `npx skills add BUZZARDGTA/Session-Sniffer --skill refactor -a codex`. Or copy the skill folder (.agents/skills/refactor in BUZZARDGTA/Session-Sniffer) into .agents/skills/refactor in your project. Codex loads it when a task matches its description.

Can I use Refactor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add BUZZARDGTA/Session-Sniffer --skill refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactor, .gemini/skills/refactor, .github/skills/refactor and .opencode/skills/refactor in your project.

What does Refactor need to run?

Going by SKILL.md and its folder, Refactor needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Refactor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Refactor safe to install?

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.

What licence does Refactor use?

Refactor is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Refactor use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Refactor?

Skills that share tags, products or a category with Refactor: 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.

Who maintains Refactor?

BUZZARDGTA (a GitHub user) maintains it in BUZZARDGTA/Session-Sniffer, which has 105 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 11, 2026.

Source: BUZZARDGTA/Session-Sniffer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.