मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)7.8k · #13080

safe-css-append

यह क्या करती है

यह स्किल एक स्टाइलशीट से दूसरी में स्टाइल ले जाने का सावधान तरीका देती है। यह मौजूदा नियम जाँचती है और वेरिएबल के नाम अनुकूल करती है। यह उन डेवलपर्स के लिए है जो प्रोजेक्ट के बीच स्टाइल मिलाते हैं।

कब इस्तेमाल करें

  • ✓जब आप पुराने प्रोजेक्ट से कुछ कंपोनेंट स्टाइल नए प्रोजेक्ट में कॉपी करना चाहते हैं।
  • ✓जब आपको मौजूदा नियम तोड़े बिना नए CSS नियम जोड़ने हैं।
  • ✓जब कॉपी की गई स्टाइल आपके मौजूदा प्रोजेक्ट से अलग CSS वेरिएबल नाम इस्तेमाल करती है।

Skill का लिंक

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

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/safe-css-append/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप मेरे पुराने प्रोजेक्ट से कार्ड की स्टाइल इस प्रोजेक्ट में कॉपी कर सकते हैं, बिना यहां की मौजूदा चीज़ें तोड़े?”

हर हफ़्ते 5 नई skills, 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
अपडेट की गई
1/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills