create-skill-from-source-code
यह क्या करती है
यह स्किल AI एजेंट को सोर्स कोड फ़ाइल पढ़कर उससे स्किल फ़ाइल के रूप में शैक्षिक दस्तावेज़ लिखने का मार्गदर्शन देती है। यह उन लोगों के लिए है जो किसी संदर्भ इम्प्लीमेंटेशन को सिखाना या दस्तावेज़ बनाना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आपके पास कोई संदर्भ इम्प्लीमेंटेशन है और उससे सीखने की सामग्री बनानी है।
- ✓जब आपको ऐसा दोबारा इस्तेमाल होने वाला दस्तावेज़ चाहिए जो समझाए कि कोड कैसे काम करता है।
- ✓जब आप आर्किटेक्चर, मुख्य तकनीकें और उपयोग के उदाहरण लिखवाना चाहते हैं।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-skill-from-source-code/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“यह सोर्स फ़ाइल पढ़िए और एक साफ़ गाइड लिखिए जो उसके मुख्य पैटर्न समझाए और दिखाए कि उन्हें कैसे इस्तेमाल करें।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पूरी सोर्स फ़ाइल पढ़ता है, आर्किटेक्चर पैटर्न, डेटा संरचनाएं, एल्गोरिदम और इंटीग्रेशन के बिंदु पहचानता है। फिर वह उचित हेडर, विश्लेषण, कोड टेम्पलेट और उदाहरणों के साथ सामग्री लिखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Create Skill from Source Code
This skill guides you through the process of analyzing an existing source code implementation and transforming it into comprehensive educational documentation in the form of a skill file.
Overview
When you have a reference implementation and need to create teaching materials or reusable documentation from it, follow this systematic workflow to extract patterns, analyze architecture, and generate well-structured educational content.
Prerequisites
- Access to the source code file(s) you want to document
- Understanding of the target audience for the skill
- Knowledge of the programming language/framework used
Workflow Steps
1. Read and Parse the Source Code
First, read the complete source file to understand its full scope:
# Read the source file
cat /path/to/source/file.ext
Or use file reading tools to access the content programmatically.
2. Identify Key Architectural Patterns
Analyze the code to identify:
- Core architectural patterns: What design patterns are used? (e.g., Observer, Factory, MVC)
- Key implementation techniques: How are specific challenges solved?
- Important data structures: What structures enable the functionality?
- Critical algorithms: What are the main algorithmic approaches?
- Integration points: How does the code interact with external systems?
Take notes on 3-5 major patterns that define the implementation.
3. Create the Skill Directory Structure
# Create skill directory
mkdir -p skills/skill-name
# If you need auxiliary files (examples, scripts, etc.)
mkdir -p skills/skill-name/examples
mkdir -p skills/skill-name/templates
4. Generate Comprehensive SKILL.md
Create a SKILL.md file with the following structure:
Required YAML Frontmatter
---
name: descriptive-skill-name
description: Brief one-sentence description of what the skill teaches
---
Frontmatter rules:
- Must be enclosed in
---fences name: lowercase, use hyphens for spacesdescription: concise but informative (1-2 sentences max)
Document Body Structure
Organize the content into clear sections:
# [Skill Title]
## Overview
Brief introduction to what pattern/technique is being taught.
## Key Patterns Identified
### Pattern 1: [Name]
**Purpose**: What problem does it solve?
**Implementation**: How is it implemented in the reference code?
**Key Code Elements**:
- Relevant classes/functions
- Important variables/structures
### Pattern 2: [Name]
[Same structure as Pattern 1]
[Continue for 3-5 main patterns]
## Complete Code Template
Provide a minimal but complete implementation:
\`\`\`[language]
// Simplified, well-commented version of the key code
// Include only essential elements
// Add explanatory comments
\`\`\`
## Usage Examples
### Example 1: Basic Usage
\`\`\`[language]
// Practical example showing how to use the pattern
\`\`\`
### Example 2: Advanced Usage
\`\`\`[language]
// More complex scenario
\`\`\`
## Best Practices
- List key recommendations
- Common pitfalls to avoid
- Performance considerations
- Testing strategies
## When to Use This Pattern
Explain scenarios where this pattern is appropriate and where it might not be the best choice.
## Related Patterns
Reference related techniques or alternative approaches.
## References
- Link to original source (if applicable)
- Related documentation
- Further reading
5. Verify File Creation and Frontmatter
After creating the skill file, verify:
# Check file exists
ls -la skills/skill-name/SKILL.md
# Verify frontmatter format
head -n 5 skills/skill-name/SKILL.md
# Should show:
# ---
# name: skill-name
# description: Description here
# ---
Ensure:
- File starts with
---on line 1 - YAML contains at least
nameanddescriptionfields - Frontmatter closes with
--- - Content follows immediately after
6. Add Auxiliary Files (Optional)
If the pattern benefits from additional resources:
Example script (examples/demo.sh):
#!/bin/bash
# Demonstration script showing the pattern in action
Template file (templates/starter.template):
# Ready-to-use template that users can copy
Configuration example (examples/config.example):
# Sample configuration demonstrating best practices
Tips for Creating Effective Skills
Make It Generalizable
- Abstract away specific variable names, file paths, or domain-specific detail
अक्सर पूछे जाने वाले सवाल
एजेंट कोड में क्या पहचानता है?
वह डिज़ाइन पैटर्न, मुख्य तकनीकें, ज़रूरी डेटा संरचनाएं, एल्गोरिदम और इंटीग्रेशन के बिंदु खोजता है।
गाइड किसके लिए है?
स्किल एजेंट से लिखने से पहले उद्दिष्ट पाठकों पर विचार करने को कहती है।
क्या इसमें कोड के उदाहरण होते हैं?
हां, स्किल आउटपुट में कोड टेम्पलेट और उपयोग के उदाहरण शामिल करती है।
जानकारी
लेखक का मूल विवरण
Analyze existing source code to identify key patterns and generate comprehensive educational skill documentation with proper YAML frontmatter, architectural analysis, code templates, and usage examples.
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #13043
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
technical-documentation
394kयह आपके एजेंट को साफ़ तकनीकी डॉक्स और एजेंट निर्देश फ़ाइलें लिखने और जांचने में मदद करती है, ताकि लोग और AI टूल उन्हें आसानी से समझ सकें।
architecture-decision-records
280kयह आपके एजेंट को project structure से जुड़े ज़रूरी फैसलों को दर्ज करने देता है। इससे पता चलता है कि कोई चुनाव क्यों किया गया, और बदलावों का साफ़ इतिहास बना रहता है।
code-tour
280kआपके एजेंट को exact file और line references के साथ step-by-step code walkthrough बनाने देता है। intro, explanations और reviews के लिए उपयोगी है।