मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग6.2k · #14386

apply-patch

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

यह स्किल Git का उपयोग करके कोड के बदलावों के सेट को एक पैच के रूप में लागू करती है। यह उन डेवलपरों के लिए है जिनके एजेंट को कई फ़ाइलें बदलनी हैं या जिनके सरल संपादन बार-बार मेल नहीं खाते।

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

  • ✓जब एक बदलाव के लिए तीन या अधिक फ़ाइलों में संपादन चाहिए।
  • ✓जब सरल खोज-और-बदलाव संपादन बार-बार विफल हो रहे हैं क्योंकि टेक्स्ट मेल नहीं खाता।
  • ✓जब आप किसी pull request या git diff से आया पैच लागू करना चाहते हैं।

Skill का लिंक

https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/apply-patch/SKILL.md

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

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

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

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

इस skill से मेरी मदद करो: https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-codingagent/src/main/resources/workspace-templates/skills/apply-patch/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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

“इस मॉड्यूल की चार फ़ाइलों में एक ही नाम-परिवर्तन को एक पैच के रूप में लागू कीजिए, और पहले जाँचिए कि वह साफ़ तरीके से लगता है या नहीं।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल बदलावों का वर्णन करने वाला unified diff लिखती है, जाँचती है कि वह लगेगा या नहीं, और फिर Git से सब एक साथ लागू करती है। अगर पैच अस्वीकार होता है, तो एजेंट मौजूदा पंक्तियाँ फिर से पढ़ता है और पैच नए सिरे से बनाता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Apply Patch

The built-in edit_file does an exact string match on a single file and has no fuzzy tolerance. For multi-file changes, or when edit_file keeps failing to find the string, construct a unified diff and apply it atomically with git.

Procedure

  1. Write the unified diff to a file in the sandbox (use write_file or a heredoc via execute):

    diff --git a/path/to/file b/path/to/file
    --- a/path/to/file
    +++ b/path/to/file
    @@ -10,7 +10,7 @@ context line
    -old line
    +new line
    
  2. Validate before applying: git apply --check changes.patch

  3. Apply: git apply changes.patch (use -p0 if paths are not a/...b/...).

  4. If git apply rejects the hunk, the surrounding context is stale — read_file the exact lines again, regenerate the diff with correct context, and retry.

When to prefer this

  • Editing 3+ files for one logical change (atomic, all-or-nothing).
  • Repetitive or whitespace-sensitive edits where edit_file exact-match struggles.
  • Re-applying a patch produced elsewhere (e.g. from a PR or git diff).

Always run the verify-changes skill afterwards.

अक्सर पूछे जाने वाले सवाल

क्या स्किल पहले पैच जाँचती है?

हाँ, लागू करने से पहले स्किल पैच की जाँच करती है।

अगर पैच विफल हो जाए तो?

एजेंट मौजूदा फ़ाइल की पंक्तियाँ फिर से पढ़ता है और नया पैच बनाता है।

क्या यह सब या कुछ नहीं वाला है?

पैच एक ही बदलाव के रूप में लागू होता है, इसलिए इसका मकसद सब या कुछ नहीं है।

जानकारी

लेखक का मूल विवरण

Apply multi-file or tricky edits atomically with git apply instead of many fragile edit_file calls. Use when changing several files at once or when edit_file fails to match.

repo: agentscope-ai/agentscope-java

लोकप्रियता

GitHub स्टार
6.2k
रैंकिंग में स्थान
#14386
लाइसेंस
Apache-2.0
अपडेट की गई
2/11/2026

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

0

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

कमेंट

  • …

इस repository की और skills

agentscope-java

6.2k

आपके एजेंट को AgentScope के लिए नॉन-ब्लॉकिंग Java कोड लिखने में मदद करती है, जो Project Reactor पर बने मल्टी-एजेंट फ़्रेमवर्क के लिए है।

कोडिंगAPI और सर्वर (backend)

data-report

6.2k

आपके एजेंट को किसी डेटासेट का औसत, कुल, दायरा और रुझान के साथ सारांश रिपोर्ट बनाने में मदद करती है, जो Markdown फ़ाइल के रूप में सहेजी जाती है।

डेटाएनालिसिस और स्प्रेडशीट

data-transform

6.2k

आपके एजेंट को डेटा फ़ाइल को CSV और JSON जैसे फ़ॉर्मेट के बीच बदलने में मदद करती है, ताकि डेटा दूसरे टूल में इस्तेमाल हो सके।

डेटाएनालिसिस और स्प्रेडशीट

git-changelog

6.2k

आपके एजेंट को Git इतिहास से चेंजलॉग या रिलीज़ नोट्स लिखने में मदद करती है, जो फ़ीचर, सुधार और अन्य बदलावों में समूहित होते हैं।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

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