Agent skill

Refactor Analysis

by Samsung in Samsung/TizenFX

Automatically scans the TizenFX codebase on a rotating schedule to discover .NET 8 / C 12+ refactoring targets and register them as GitHub Issues.

Apache-2.0Auto-check passedDevelopment

Install Refactor Analysis

skills CLI
$ npx skills add Samsung/TizenFX --skill refactor-analysis -a claude-code

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

GitHub CLI
$ gh skill install Samsung/TizenFX refactor-analysis --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/Samsung/TizenFX.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/refactor-analysis .claude/skills/refactor-analysis && 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-analysis
GitHub stars
214
Token cost
~2.6k tokens
SKILL.md length
1,018 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Automatically scans the TizenFX codebase on a rotating schedule to discover .NET 8 / C 12+ refactoring targets and register them as GitHub Issues.

  • Works in 5 steps: First run gh repo clone samsung/TizenFX,… → Collect the main namespace directories… → Check which directories have already… → …
  • Tasks that involve Refactoring
  • Calls gh and git

What it does

Refactor Analysis is an agent skill from Samsung/TizenFX. Automatically scans the TizenFX codebase on a rotating schedule to discover .NET 8 / C 12+ refactoring targets and register them as GitHub Issues.

Its SKILL.md is about 2.6k 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. It works with .NET, C# and GitHub. The repository describes itself as: C Device APIs for Tizen. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Refactoring

Example prompts

  • “/refactor-analysis”

Workflow steps

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

  1. First run gh repo clone samsung/TizenFX, or git pull the existing clone to sync
  2. Collect the main namespace directories under src/
  3. Check which directories have already been analyzed by inspecting existing ai-task labeled issues
  4. Prioritize directories that have not yet been scanned, but once every directory has been covered once, re-scan starting with the one…
  5. Scan only 1–2 directories per run (to allow for in-depth analysis)

What it can do on your machine

Read from SKILL.md and the folder at commit 0352388. 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:

    • gh
    • git

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

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com

    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 Analysis loads about 2.6k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 1,018 words of instructions outside code blocks.

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

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 Samsung/TizenFX at commit 0352388, republished under its Apache-2.0 licence (© Samsung). 1,018 words, ~2,612 tokens.

Download SKILL.mdSave it as .claude/skills/refactor-analysis/SKILL.md (or your agent's skills folder).
name
refactor-analysis
description
Automatically scans the TizenFX codebase on a rotating schedule to discover .NET 8 / C# 12+ refactoring targets and register them as GitHub Issues.

TizenFX Refactoring Target Discovery and Issue Registration Pipeline

Overview

A pipeline that scans the TizenFX codebase for .NET 8 and C# 12+ modernization/optimization opportunities, drafts concrete application plans, and automatically registers them as GitHub Issues. Each created issue explicitly states that it is a refactoring objective.

Repository
  • Repo: samsung/TizenFX (GitHub)
  • CLI: gh CLI (authenticated)

Pipeline Flow
① Auto-select target area and scan → ② Optimization feasibility analysis (Self-Reflection)
  → [Pass] ③ Draft refactoring application plan → ④ Auto-register GitHub Issue
  → [Reject] Discard (low ROI / high risk)

Stage ①: Auto-select Target Area and Scan

Automatic directory rotation logic: Because the scan scope is broad, the scan area is automatically rotated on every run.

  1. First run gh repo clone samsung/TizenFX, or git pull the existing clone to sync
  2. Collect the main namespace directories under src/:
    bash
    ls -d src/Tizen.*/
  3. Check which directories have already been analyzed by inspecting existing ai-task labeled issues:
    bash
    gh issue list --repo samsung/TizenFX --label "ai-task" --state all --json title --jq '.[].title' | grep -oP '\[Scope: [^\]]+\]'
  4. Prioritize directories that have not yet been scanned, but once every directory has been covered once, re-scan starting with the one scanned longest ago
  5. Scan only 1–2 directories per run (to allow for in-depth analysis)

Scan Philosophy — 4 Evaluation Lenses (lens-based, not category-based)

Rather than "hunting" for a fixed list of patterns, observe the code through 4 evaluation lenses. A single finding may hit multiple lenses at once; the more it overlaps, the higher its grade.

In priority order:

🚀 Lens 1: Performance (Highest Priority)

The most important lens. Target measurable performance improvements.

  • Reduce allocations: ToList/ToArray in hot paths, new inside loops, boxing/unboxing, closure allocation (lambda capture)
  • Buffer handling: opportunities to apply Span<T>/Memory<T>, ArrayPool<T>, stackalloc (small fixed size)
  • New .NET 8 types: FrozenDictionary/FrozenSet (read-only lookup), SearchValues<T> (char search), CollectionsMarshal
  • Task optimization: apply ValueTask (hot path), use IAsyncEnumerable, remove .Result/.Wait() (also prevents deadlocks)
  • LOH / GC pressure: allocation patterns for arrays ≥85KB, short-lived large objects
🆕 Lens 2: .NET 8 / C# 12 Modernization

Modernize with the latest language and runtime features.

  • C# 12: Collection expressions [1, 2, ..x], primary constructors (class/struct), ref readonly parameters
  • C# 11: required members, generic math, raw string literals """..."""
  • C# 10~9: file-scoped namespaces, record struct, switch expression, init accessor
  • .NET 8 APIs: ArgumentException.ThrowIfNull(x), ArgumentOutOfRangeException.ThrowIfNegative, TimeProvider
  • Nullable reference types: introduce #nullable enable, ensure NRT consistency
🧹 Lens 3: Clean Code

Improve readability and maintainability (within internal/private scope).

  • Eliminate duplication (DRY), extract common logic
  • Split methods that violate single responsibility (one method doing too much)
  • Reduce deep nesting / complexity (guard clauses, early return)
  • Remove dead code, unused private members
  • Improve naming — limited to internal/private only (public API renames forbidden)
📐 Lens 4: .NET Coding Guidelines

Adherence to official guidelines. Based on Microsoft Design Guidelines.

  • async/await consistency: remove .Result, .Wait() (cause deadlocks)
  • IDisposable pattern: using declaration, consistent propagation
  • Exception handling: overly broad catch (Exception), swallowed exceptions, mismatched exception types
  • Naming conventions (public APIs are immutable; only internals are in scope)

Lens overlap → grade ↑: if a finding hits both Performance and Modernization, it ranks higher than a single-lens finding (see Stage ②).

Quantitative heuristics (to minimize subjective judgment):

  • switch conversion candidates: 5+ case branches, each ≥ 3 lines
  • allocation inside loops: new or LINQ chain inside for/foreach
  • heavy methods: cyclomatic complexity ≥ 10, or ≥ 100 lines

Stage ②: Optimization Feasibility Analysis and Grade Assignment
2-1. Safety Gate

For each finding, self-verify against the following criteria:

  1. Can the Public API Signature be preserved? (no signature changes)
  2. Can the Public API Behavior be preserved? (no behavior changes)
  3. For Performance-lens findings, is a meaningful benchmark benefit expected?
  4. Does it avoid affecting Native Interop / P/Invoke marshalling?
  5. Does it maintain Tizen API Level 12+ compatibility? (when using new .NET APIs, confirm support per Tizen API Level)

→ Fails even one of these → discard (low ROI / high risk)

Show full SKILL.md (439 more words)Show less
2-2. Grade Assignment

For items passing the gate, assign a grade using this matrix.

GradeConditionAction
🔴 CriticalPerformance lens + hot path + measurable numerical improvement expected, OR bug risk (async deadlock, missing IDisposable, NullReferenceException path)Discover ✓ prioritize PR
🟡 ImprovementModernization / Clean Code / Coding Guidelines lens with clear readability/maintainability gains, OR a Performance improvement that is not on a hot pathDiscover ✓
🟢 Nice-to-haveStyle preference, plain naming taste, marginal theoretical improvement, weak lens matchExclude (do not register)

Grade tie-breaking rules:

  • If 🔴 Critical is claimed without measurable numerical evidence → downgrade to 🟡 Improvement
  • Two or more overlapping lenses can promote the grade by one step
    • e.g., Modernization only → 🟡, but Performance + Modernization → consider 🔴
  • Bug risk accompanied (async deadlock, swallowed exception, missing dispose, etc.) → auto-🔴
  • When in doubt, classify as 🟢 conservatively (exclude from discovery). Over-discovery is worse than under-discovery.

"Hot path" judgment guide:

  • Rendering loops, event handlers, frequently called property getters/setters
  • User interaction paths (touch/gesture/layout)
  • Initialization paths are not hot paths (avoid applying performance criteria to one-shot code)

Stage ③: Draft Refactoring Application Plan

For items that pass, author a Markdown plan.

Required plan structure:

markdown
[Type: Refactoring]
[Scope: {scanned directory name, e.g., src/Tizen.NUI}]
[Priority: 🔴 Critical | 🟡 Improvement]
[Lens: Performance, Modernization, Clean Code, Coding Guidelines] (list all applicable lenses)

## Observation
{Describe the current state of the code and the problem pattern}

## Problem
{Why refactoring is needed — describe from each applicable lens's perspective}

## Proposed Improvement
{Concrete refactoring approach with Before/After code snippets}

### Target Files
- `{file path 1}`
- `{file path 2}`

## Expected Impact (Quantitative Metrics)
{**Required** for 🔴 Critical; write if possible for 🟡 Improvement}
- e.g., `allocation per call: 3 → 0`, `execution time: ~120ns → ~80ns`, `LOH allocations: eliminated`
- For non-Performance lenses: readability/complexity metrics (cyclomatic complexity, LOC, etc.)

## API Compatibility Check
- Public API signature change: none / {description}
- Behavior change: none / {description}
- Tizen API Level floor: {maintained / raise required — specify}

## Impact Scope
- Number of call sites for the modified symbol (measured via rg): `approx. N locations`
- Distinguish impact within the same assembly vs. other assemblies
- If >100 sites, recommend splitting the scope

Important:

  • The top of the body must include [Type: Refactoring], [Priority: ...], and [Lens: ...] so that the downstream agent (refactor-execute) can recognize the mode/priority.
  • If 🔴 Critical has no quantitative metric in "Expected Impact", send it back to Stage ② for re-evaluation and downgrade to 🟡.

Stage ④: GitHub Issue Auto-Registration

Duplicate check (required before registration):

bash
gh issue list --repo samsung/TizenFX --label "ai-task" --state open --json title,body --jq '.[] | .title + " " + .body'

→ Skip registration if an issue for the same file/pattern already exists

Issue registration:

bash
gh issue create --repo samsung/TizenFX \
  --title "[AI Refactoring] {finding name} [Scope: {directory}]" \
  --body-file issue_plan.md \
  --label "ai-task"

Constraints
  • Create at most 5 issues per run (🔴 Critical first, then 🟡 Improvement)
  • 🟢 Nice-to-have items are not registered (excluded at discovery)
  • 🔴 Critical grade must include a quantitative metric (expected impact figures). Without one, downgrade to 🟡 or exclude.
  • Scan priority: Performance > Modernization > Clean Code > Coding Guidelines (lens order)
  • For items hitting multiple lenses, list all applicable lenses in [Lens: ...] in the issue body
  • Public API signature/behavior changes are forbidden (must pass the safety gate)
  • Tizen API Level 12+ compatibility must be maintained
  • Duplicate issues must not be registered (always verify existing issues before registering)
  • Include the scanned directory and date in the issue title so scans can be traced
Reporting
  • Scan info: directories scanned in this run, directories scheduled for the next run
  • Grade distribution: 🔴 Critical N / 🟡 Improvement M (registered counts)
  • Lens distribution: Performance X, Modernization Y, Clean Code Z, Coding Guidelines W (overlap counted)
  • Created issue list: number, title, link, grade, lenses
  • Discard summary:
    • Safety gate failures: N (classified by reason: API signature / behavior / Tizen API Level / interop / negligible impact)
    • 🟢 Nice-to-have classifications: M (brief reason)
  • Anomalies: number of items that claimed 🔴 Critical but were downgraded to 🟡 due to missing quantitative metrics (if any)

© Samsung, 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

Files

Just SKILL.md in .agents/skills/refactor-analysis of Samsung/TizenFX.

Open the folder on GitHubat commit 0352388

Compare with similar skills

Refactor Analysis 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 Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor Analysis this skillSamsung/TizenFX214—~2.6kAutomated safety check: PassApache-2.0
Code Reviewdotnet/macios2.9k—~1.7kAutomated safety check: PassCustom licence
Add Refactoringdotnet/roslynator3.5k—~946Automated safety check: PassCustom licence
Code Reviewjonathanpeppers/dotnes780—~2.1kAutomated safety check: PassMIT
Dynamo Dotnet ExpertDynamoDS/Dynamo2k—~909Automated safety check: PassApache-2.0
Release Roslynatordotnet/roslynator3.5k—~1kAutomated safety check: PassCustom licence

Similar skills

  • Code Review

    dotnet/macios

    Official

    Review dotnet/macios PRs against established rules. An agent skill from dotnet/macios.

    2.9k GitHub stars~1.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Add Refactoring

    dotnet/roslynator

    Official

    A skill your agent uses when adding a new RR refactoring in roslynator, editing Refactorings.xml, registering in RefactoringContext, or when refactorings-testing.md shows XunitRefactoringVerifier —…

    3.5k GitHub stars~946 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Code Review

    jonathanpeppers/dotnes

    Review dotnes pull requests against established repository rules.

    780 GitHub stars~2.1k tokensUpdated 13 days ago
    DevelopmentAuto-check passed
  • Dynamo Dotnet Expert

    DynamoDS/Dynamo

    Write and review C/.NET code in Dynamo following Dynamo coding standards, modern C patterns, and repo conventions.

    2k GitHub stars~909 tokensUpdated today
    DevelopmentAuto-check passed
  • Release Roslynator

    dotnet/roslynator

    Official

    A skill your agent uses when shipping a roslynator release, rolling CHANGELOG.md [Unreleased], updating the VS Code extension changelog, creating a GitHub v release, or optionally tagging cli-v.

    3.5k GitHub stars~1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Gh Stack

    dotnet/macios

    Official

    Manage stacked branches and pull requests with the gh-stack GitHub CLI extension.

    2.9k GitHub starsUsed in 2 repos~10k tokens
    DevelopmentAuto-check passed

More from Samsung/TizenFX

  • Issue Triage

    Samsung/TizenFX

    For TizenFX issues that lack the ai-task label and have no assignee, posts an English first-pass technical answer plus a CODEOWNERS-based reviewer mention.

    214 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • PR Code Review

    Samsung/TizenFX

    Performs code review on every open PR of TizenFX and replies with technical responses to new comments left by other reviewers.

    214 GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • PR Review Check

    Samsung/TizenFX

    For AI-generated PRs labeled ai-task in TizenFX, evaluates human/AI review feedback and either applies it to the code or responds.

    214 GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • Refactor Execute

    Samsung/TizenFX

    Automatically processes TizenFX ai-task issues (dispatching between refactoring/feature modes) and creates a PR.

    214 GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Refactor Analysis

What does Refactor Analysis do?

Automatically scans the TizenFX codebase on a rotating schedule to discover .NET 8 / C 12+ refactoring targets and register them as GitHub Issues. Refactor Analysis is an agent skill from Samsung/TizenFX.NET 8 / C 12+ refactoring targets and register them as GitHub Issues.

When should I use Refactor Analysis?

Refactor Analysis fits situations like: tasks that involve Refactoring.

How do I install Refactor Analysis in Claude Code?

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

How do I install Refactor Analysis in Codex?

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

Can I use Refactor Analysis 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 Samsung/TizenFX --skill refactor-analysis -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-analysis, .gemini/skills/refactor-analysis, .github/skills/refactor-analysis and .opencode/skills/refactor-analysis in your project.

What does Refactor Analysis need to run?

Going by SKILL.md and its folder, Refactor Analysis needs the command-line tools its instructions call (gh and git).

Does Refactor Analysis access the network?

SKILL.md names 1 domain. As links in the text: learn.microsoft.com. This is read from the text; nothing was executed.

Is Refactor Analysis 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 Analysis use?

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

How many tokens does Refactor Analysis use?

About 2.6k tokens (SKILL.md is roughly 10k 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 Analysis?

Skills that share tags, products or a category with Refactor Analysis: Code Review (dotnet/macios, 2.9k stars), Add Refactoring (dotnet/roslynator, 3.5k stars), Code Review (jonathanpeppers/dotnes, 780 stars) and Dynamo Dotnet Expert (DynamoDS/Dynamo, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactor Analysis?

Samsung (a GitHub organization) maintains it in Samsung/TizenFX, which has 214 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

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