go-testing
यह क्या करती है
यह स्किल आपके AI को Go प्रोग्रामिंग भाषा में टेस्ट लिखते या समीक्षा करते समय मार्गदर्शन देती है। यह उन Go डेवलपर्स के लिए है जिन्हें केंद्रित और भरोसेमंद टेस्ट चाहिए, टर्मिनल इंटरफ़ेस के टेस्ट सहित।
कब इस्तेमाल करें
- ✓जब आप किसी Go फ़ंक्शन के लिए कई इनपुट मामलों वाले टेस्ट लिख रहे हों।
- ✓जब आप Bubbletea से बने टर्मिनल यूज़र इंटरफ़ेस का टेस्ट कर रहे हों।
- ✓जब आपको golden फ़ाइल टेस्ट या फ़ाइल सिस्टम को छूने वाले टेस्ट चाहिए।
Skill का लिंक
https://github.com/Gentleman-Programming/gentle-ai/blob/main/internal/assets/skills/go-testing/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस पार्सर के लिए table-driven Go टेस्ट लिखिए, जिनमें एरर मामले भी हों।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल लक्ष्य के हिसाब से टेस्ट पैटर्न चुनती है, जैसे फ़ंक्शन के लिए table-driven टेस्ट, या टर्मिनल इंटरफ़ेस के लिए सीधे model अपडेट। वह टेस्ट को निर्धारित रखती है और short मोड में धीमे बाहरी टेस्ट छोड़ देती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Activation Contract
Load this skill when writing or reviewing Go tests, adding coverage, testing Bubbletea/TUI flows, using teatest, or updating golden files.
Hard Rules
- Prefer table-driven tests for multiple cases; use
t.Run(tt.name, ...). - Test behavior and state transitions, not implementation trivia.
- Use
t.TempDir()for filesystem tests; never rely on a real home directory. - Keep integration tests skippable with
testing.Short()when they run external commands or slow flows. - For Bubbletea, test
Model.Update()directly for state changes; useteatestonly for interactive flows. - Golden files must be deterministic; update only through the repo's
-updatepath and rerun tests without-update. - Use small mocks/interfaces around system or command execution boundaries.
Decision Gates
| Target | Test pattern |
|---|---|
| Pure function or parser | Table-driven unit test. |
| Error behavior | Explicit success and failure cases. |
| File operations | t.TempDir() plus focused assertions. |
| TUI state transition | Direct Model.Update() call with tea.Msg. |
| Full TUI interaction | teatest.NewTestModel(). |
| Rendered output | Golden file test. |
| Real external command | Integration test; skip in -short. |
Execution Steps
- Identify behavior under test and the smallest public boundary that proves it.
- Choose the test pattern from the decision gate.
- Name cases by scenario, not input mechanics.
- Assert outputs, errors, state, and side effects explicitly.
- Run the narrow package test first, then the relevant broader suite.
- For golden updates: run with
-update, inspect diff, then rerun without-update.
Output Contract
Report test files changed, scenarios covered, commands executed, golden files updated, and any skipped integration scope.
References
- references/examples.md — compact table-driven, Bubbletea, teatest, golden, and command examples.
अक्सर पूछे जाने वाले सवाल
golden फ़ाइल क्या है?
यह एक सहेजा गया अपेक्षित आउटपुट है जिससे टेस्ट तुलना करते हैं, और स्किल इसे निर्धारित रखने की ज़रूरत बताती है।
टर्मिनल इंटरफ़ेस कैसे टेस्ट होता है?
यह राज्य परिवर्तनों को सीधे टेस्ट करती है, और पूरे इंटरैक्टिव प्रवाह के लिए ही teatest इस्तेमाल करती है।
क्या टेस्ट में असली होम फ़ोल्डर इस्तेमाल होता है?
नहीं। स्किल टेम्पररी फ़ोल्डर इस्तेमाल करने और असली होम डायरेक्टरी पर निर्भर न रहने को कहती है।
जानकारी
लेखक का मूल विवरण
Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.
लोकप्रियता
- GitHub स्टार
- 8.2k
- रैंकिंग में स्थान
- #12551
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
branch-pr
8.2kयह आपके एजेंट को ब्रांच और pull request ऐसे तैयार करने में मदद करती है जो गंतव्य प्रोजेक्ट के अपने योगदान नियमों का पालन करें, किसी सामान्य टेम्पलेट का नहीं।
chained-pr
8.2kयह आपके एजेंट को 400 लाइनों से बड़े बदलाव को छोटी, समीक्षा योग्य pull requests की श्रृंखला में बाँटने में मदद करती है, जिनमें से हर एक अपने आप में ठीक हो।
cognitive-doc-design
8.2kयह आपके एजेंट को गाइड, README और समीक्षाएँ ऐसे लिखना सिखाती है जिन्हें आसानी से पढ़ा और याद रखा जा सके, पहले जवाब देकर और विवरण समूहित करके।
comment-writer
8.2kयह आपके एजेंट को pull requests, समीक्षाओं, issue जवाबों और टीम चैट संदेशों के लिए छोटी, गर्मजोशी भरी और सीधी टिप्पणियाँ लिखने में मदद करती है।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।