본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.8k · #13080

safe-css-append

하는 일

이 스킬은 한 스타일시트에서 다른 스타일시트로 스타일을 옮기는 신중한 방법을 제공합니다. 기존 규칙을 확인하고 변수 이름을 맞춥니다. 프로젝트 사이에서 스타일을 합치는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓오래된 프로젝트에서 구성 요소 스타일 몇 개를 새 프로젝트로 복사하고 싶을 때.
  • ✓이미 있는 규칙을 깨지 않고 CSS 규칙을 추가해야 할 때.
  • ✓복사할 스타일이 현재 프로젝트와 다른 변수 이름을 쓸 때.

스킬 링크

https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/safe-css-append/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/safe-css-append/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“예전 프로젝트의 카드 스타일을 이 프로젝트에 복사해 주실 수 있나요? 지금 있는 것은 깨지지 않게 해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 두 스타일시트를 읽고, 빠진 규칙을 찾은 다음 변수 이름을 맞추고, 그 규칙만 추가한 뒤 결과를 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Safe CSS Append Workflow

This skill provides a systematic approach for safely appending CSS styles from a source file to a destination file. The workflow ensures no content is overwritten, CSS variables are properly adapted, and all changes are verified.

When to Use This Skill

  • Migrating styles between projects
  • Copying component styles while preserving existing rules
  • Adding new CSS rules without duplicating or conflicting with existing styles
  • Adapting styles to use a different set of CSS variables

Workflow Steps

1. Read and Analyze Source CSS

First, examine the source CSS file to identify the selectors and rules you want to transfer:

# Read the source CSS file
cat /path/to/source/styles.css

# Identify specific selectors if needed
grep "selector-pattern" /path/to/source/styles.css

Document:

  • Target selectors (e.g., .panel-tab, .header-nav)
  • CSS variables used (e.g., --primary-color, --spacing-unit)
  • Complete rule sets for each selector

2. Read and Check Destination CSS

Examine the destination file to understand existing rules and avoid duplication:

# Read the destination CSS file
cat /path/to/destination/styles.css

# Check if specific selectors already exist
grep "selector-name" /path/to/destination/styles.css

# Check for existing CSS variables
grep "^[[:space:]]*--" /path/to/destination/styles.css | head -20

Identify:

  • Existing selectors that might conflict
  • CSS variable naming conventions in the destination
  • Any existing rules for the target selectors

3. Identify Missing Styles and Required Adaptations

Compare source and destination to determine:

  • Which selectors are completely missing
  • Which properties are missing from existing selectors
  • How CSS variables need to be mapped (source → destination)

Example variable mapping:

Source: --panel-bg → Destination: --background-secondary
Source: --text-primary → Destination: --color-text-primary
Source: --border-radius → Keep as-is (if already defined in destination)

4. Prepare Adapted CSS Content

Create the CSS content to append, adapting variables as needed:

/* Example adapted CSS */
.new-selector {
    background-color: var(--background-secondary);  /* was --panel-bg */
    color: var(--color-text-primary);               /* was --text-primary */
    border-radius: var(--border-radius);            /* unchanged */
    padding: 8px 16px;
}

.existing-selector {
    /* Only add missing properties, not the entire rule */
    new-property: value;
}

5. Safely Append to Destination

Use append operations (never overwrite) to add the new styles:

# Append new CSS rules
cat >> /path/to/destination/styles.css << 'EOF'

/* Added styles from source project */
.selector-name {
    property: value;
    variable-property: var(--adapted-variable);
}
EOF

Best practices:

  • Add a comment indicating the source or purpose
  • Include a blank line before the new content for readability
  • Use >> (append) never > (overwrite)

6. Verify the Changes

Confirm that the styles were added correctly:

# View the last N lines to see appended content
tail -n 20 /path/to/destination/styles.css

# Verify specific selectors were added
grep "new-selector-name" /path/to/destination/styles.css

# Check the complete file if needed
cat /path/to/destination/styles.css | tail -n 50

Complete Example

Here's a full example workflow:

# 1. Read source CSS and identify target
cat project-a/components.css | grep -A 10 ".button-primary"

# 2. Check destination for conflicts
grep ".button-primary" project-b/main.css
grep "^[[:space:]]*--btn-" project-b/main.css

# 3. Identify that .button-primary is missing, and variables need mapping:
#    --btn-color → --primary-color (exists in destination)
#    --btn-padding → create inline value

# 4. Append adapted styles
cat >> project-b/main.css << 'EOF'

/* Button styles from project-a */
.button-primary {
    background-color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
}
EOF

# 5. Verify
tail -n 10 project-b/main.css
grep ".button-primary" project-b/main.css

Safety Checklist

  • Source file read and analyzed
  • Destination file checked for existing rules
  • Missing styles identified
  • CSS variables mapped correctly
  • Append operation used (not overwrite)
  • Changes verified with tail/grep
  • No duplicate selectors created
  • [ ]
자주 묻는 질문

기존 스타일을 덮어쓰나요?

이 작업은 덮어쓰지 않도록 설계되어 있습니다. 추가하기 전에 어떤 선택자가 이미 있는지 확인합니다.

변수 이름이 다르면 어떻게 하나요?

스킬에는 복사된 스타일이 스타일시트와 맞도록 변수 이름을 바꾸는 단계가 있습니다.

사용하려면 코딩 기술이 필요한가요?

CSS에 대한 기본 지식이 도움이 되지만, 단계는 명확한 체크리스트로 쓰여 있습니다.

상세 정보

작성자의 원본 설명

Safely append CSS styles from one file to another by identifying missing rules, adapting CSS variables, and verifying changes

repo: HKUDS/AgentPilot

인기도

GitHub 스타
7.8k
순위
#13080
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬