lift-up-conditional

lift-up-conditional is a skill for Claude Code from msbaek/msbaek-claude-plugins. It costs 114 tokens per session (1,902 once invoked), scanned A, original, MIT.

A code-refactoring method that moves duplicated conditions into a higher-level part of the code so several lower-level parts can share one decision.

In plain words
What is it for?
Use it when the same condition appears in multiple related locations and should be handled before those paths diverge.
Why use it?
It removes repeated conditional logic and keeps the shared decision in one place.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the msbaek-tdd plugin — 28 skills, 10 agents, 2 hooks shipped together

Good fit Use it when the same condition appears in multiple related locations and should be handled before those paths diverge.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/msbaek/msbaek-claude-plugins/lift-up-conditional
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 msbaek/msbaek-claude-plugins --skill lift-up-conditional
Clone the repo
git clone --depth 1 https://github.com/msbaek/msbaek-claude-plugins

Made for: Claude Code.

Or install msbaek-tdd, the plugin that ships this one along with the rest of its 28 skills, 10 agents, 2 hooks.

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 lift-up-conditional

README.md
[![agentmods](https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/lift-up-conditional/github.svg)](https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/lift-up-conditional)
Your own site
<a href="https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/lift-up-conditional"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/lift-up-conditional/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 lift-up-conditional

Your own site · 80×15
<a href="https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/lift-up-conditional"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/lift-up-conditional.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,902 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.00114 $0.01902
Opus 5.5 $0.00046 $0.00761
Sonnet 5.5 $0.00023 $0.00380
Haiku 4.5 $0.00011 $0.00190

Measured 2mo ago against content hash c73656359b0c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lift-up-conditional 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 2mo ago.

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.

msbaek-tdd/skills/lift-up-conditional/SKILL.md · 218 lines

How it starts

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

Lift Up Conditional Skill

여러 곳에 중복된 조건문을 상위로 끌어올려 중복을 제거하고 코드 의도를 명확히 한다.

GOAL

  • 성공 = 중복 조건문이 상위로 끌어올려져 커밋 완료됨
  • 동일한 조건문이 여러 메서드/블록에서 반복됨
  • 조건에 따라 다른 처리가 필요한 패턴 식별됨
  • 후보 보고 후 조건문 끌어올리기 적용 (Tidy 계열 — 승인 없이)
  • 모든 테스트 통과

CONSTRAINTS

  • 계열: Tidy — 후보 보고 후 승인 없이 적용 (../../references/refactoring-procedure.md §0·§3-A)

Hard Rules

  • 동작 변경 금지 — 구조 개선만 수행
  • 테스트 수정 금지 — 구조 변경이 테스트를 실패시키면 되돌리기
  • 커밋 단위 — 1파일 x 1기법 = 1커밋 (논리적으로 연결된 파일은 함께)
  • git add -A 금지 — 변경된 파일만 명시적으로 추가

적용 패턴

Lift Up Conditional 리팩토링 단계:

  1. 중복 조건문 식별

    • 동일한 조건식이 여러 곳에서 반복
    • 조건에 따라 다른 동작 수행
  2. 조건을 변수로 추출

    • 중복된 조건식을 boolean 변수로 추출
    • 의미 있는 변수명으로 조건 의도 명확히
  3. 조건을 메서드로 추출 (선택적)

    • 복잡한 조건은 별도 메서드로
    • 메서드명으로 조건의 비즈니스 의미 표현
  4. 조건을 상위로 끌어올림

    • Surround with if-else로 조건을 한 곳으로 모음
    • 조건 내부에서 각 메서드 호출
    • 불필요한 중간 변수 제거 (inline)

Before/After 예시

// Before: 동일 조건 중복
public class ProductService {
    public double calculatePrice(Product product) {
        if (product.isOnSale()) {
            return product.getPrice() * 0.9;  // 10% 할인
        }
        return product.getPrice();
    }
    
    public String formatLabel(Product product) {
        if (product.isOnSale()) {
            return "SALE: " + product.getName();
        }
        return product.getName();
    }
    
    public String getBadgeColor(Product product) {
        if (product.isOnSale()) {
            return "red";
        }
        return "blue";
    }
}

// After: 조건을 상위로 끌어올림
public class ProductService {
    public ProductDisplay createDisplay(Product product) {
        if (product.isOnSale()) {
            return createSaleDisplay(product);
        }
        return createNormalDisplay(product);
    }
    
    private ProductDisplay createSaleDisplay(Product product) {
        double price = product.getPrice() * 0.9;
        String label = "SALE: " + product.getName();
        String badgeColor = "red";
        return new ProductDisplay(price, label, badgeColor);
    }
    
    private ProductDisplay createNormalDisplay(Product product) {
        double price = product.getPrice();
        String label = product.getName();
        String badgeColor = "blue";
        return new ProductDisplay(price, label, badgeColor);
    }
}

Read the full file on GitHub · 218 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. 2mo ago Changed · -4 lines · +79 tokens per session c73656359b0c
  2. 2mo ago Changed 29e17ab1151a
  3. 3mo ago First seen · 222 lines · 35 tokens per session scan A db78c00eec5f

Subscribe to this mod's changes

lift-up-conditional is a skill published in the GitHub repository msbaek/msbaek-claude-plugins (8 stars, last pushed 1mo ago), licensed MIT. It adds 114 tokens to every session and 1,902 once invoked, about $0.0005 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-08-31.

Related

lift-up-conditional compared with skills from other repositories

lift-up-conditional next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lift-up-conditionalmsbaek/msbaek-claude-pluginsSkill81mo agoMITA114Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill82ktodayMITA200Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill102ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill396ktodayMITA36Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15ktodayCC0-1.0A113Claude Code, Codex
systematic-debuggingobra/superpowersSkill333k7d agoMITA21Claude Code