मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)15k · #10979

principle-make-operations-idempotent

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

यह स्किल असिस्टेंट को ऐसे ऑपरेशन बनाने का नियम देती है जो क्रैश के बाद दोबारा चलाना सुरक्षित हों। यह उन इंजीनियरों के लिए है जो कमांड, जॉब या प्रोसेसिंग लूप लिखते हैं।

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

  • ✓जब आप ऐसी कमांड या जॉब डिज़ाइन करते हैं जो विफलता के बाद फिर चल सकती है।
  • ✓जब रीस्टार्ट, रीट्राई या क्रैश से आधी-अधूरी स्थिति रह सकती है।
  • ✓जब आपको ऐसा प्रोसेसिंग लूप चाहिए जो सुरक्षित रूप से फिर से शुरू हो सके।

Skill का लिंक

https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-make-operations-idempotent/SKILL.md

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

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

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

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

इस skill से मेरी मदद करो: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-make-operations-idempotent/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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

“हमारे डेटा इम्पोर्ट जॉब को क्रैश के बाद दोबारा चलाना सुरक्षित बनाइए, ताकि रिकॉर्ड दोहराए न जाएँ।”

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

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

असिस्टेंट हर चरण को मौजूदा स्थिति से निकालता है और केवल गायब अंतर लागू करता है। वह lock या अस्थायी फ़ाइलों जैसे बचे हुए निशानों को पुराना पहचानने योग्य बनाता है, फिर जाँचता है कि जॉब दो बार चलने या हर बिंदु पर क्रैश होने पर क्या होता है।

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

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

Make Operations Idempotent

Design operations so they converge to the correct state regardless of how many times they run or where the previous run stopped. Every state-mutating operation should answer: "What happens if this runs twice? What happens if the previous run crashed halfway?"

Why: Commands, lifecycle operations, and processing loops run where crashes, restarts, and retries are normal. If partial state changes the next run's outcome, every restart becomes a debugging session.

The idea: derive each step from the state that exists, not from what the previous run meant to do. Read the current state, compare it to the goal, and apply only the difference. A step written this way is safe to repeat, because a repeat finds nothing left to do.

Anything a run leaves behind, such as a lock, a temporary file, a half-written record, or a claimed job, must be recognizable as stale by the next run. Judge staleness by evidence that stays true wherever the previous run could have stopped, not only in the common case. A marker that the next run cannot judge turns every crash into manual cleanup. For example, write to a temporary path and rename it into place, or compare artifacts by content instead of by creation order.

The test:

  1. What happens if this runs twice in a row?
  2. What happens if the previous run crashed at every possible point?
  3. Does re-execution converge to the same end state?

If any answer is "it depends on what state was left behind," the operation needs a reconciliation step.

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

मुख्य परीक्षण क्या है?

पूछें कि अगर ऑपरेशन लगातार दो बार चले तो क्या होगा, और अगर आखिरी रन हर संभव बिंदु पर क्रैश हो तो क्या होगा।

बचे हुए lock कैसे संभाले जाते हैं?

उन्हें ऐसे सबूत से पुराना माना जाना चाहिए जो हर उस बिंदु पर सच रहे जहाँ पिछला रन रुका हो सकता था।

क्या अस्थायी फ़ाइल में लिखना मदद करता है?

हाँ। अस्थायी पथ पर लिखकर उसे अपनी जगह पर रीनेम करना अधूरे नतीजों से बचने का एक तरीका है।

जानकारी

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

Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries. Converge to the same end state regardless of partial prior runs.

repo: cursor/plugins

लोकप्रियता

GitHub स्टार
15k
रैंकिंग में स्थान
#10979
लाइसेंस
—
अपडेट की गई
31/10/2026

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

0

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

कमेंट

  • …

इस repository की और skills

advisor

15k

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

AI और एजेंटएजेंट

check-agent-compatibility

15k

जाँचती है कि AI कोडिंग एजेंट किसी रिपॉज़िटरी को शुरू, सत्यापित और दस्तावेज़ित कर सकते हैं या नहीं, और एक अनुकूलता स्कोर के साथ मुख्य समस्याएँ लौटाती है।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

cli-for-agents

15k

आपके एजेंट को कमांड-लाइन टूल ऐसे डिज़ाइन या जाँचना सिखाती है कि AI एजेंट उन्हें बिना प्रॉम्प्ट चला सकें, साफ़ help टेक्स्ट और उदाहरणों के साथ।

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

continual-learning

15k

पिछली चैट की समीक्षा का काम एक समर्पित मेमोरी अपडेटर को सौंपकर आपकी AGENTS.md नोट्स को अद्यतन रखती है।

AI और एजेंटएजेंट

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