Langsung ke konten
Skillpedia
Dokumentasi7.8k · #13043

create-skill-from-source-code

Fungsinya

Skill ini memandu agent AI untuk membaca file kode sumber dan menulis dokumentasi edukatif darinya, dalam bentuk file skill. Skill ini ditujukan untuk orang yang ingin mengajarkan atau mendokumentasikan implementasi referensi.

Kapan dipakai

  • ✓Saat Anda memiliki implementasi referensi dan ingin dibuatkan materi pembelajaran darinya.
  • ✓Saat Anda memerlukan dokumentasi yang dapat digunakan kembali yang menjelaskan cara kerja sebuah kode.
  • ✓Saat Anda ingin arsitektur, teknik kunci, dan contoh penggunaan dituliskan.

Link skill

https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-skill-from-source-code/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-skill-from-source-code/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Baca file sumber ini dan tulis panduan jelas yang menjelaskan pola utamanya dan menunjukkan cara memakainya.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent membaca seluruh file sumber, mengidentifikasi pola arsitektur, struktur data, dan algoritma, lalu mencatat titik integrasinya. Setelah itu agent menulis materi dengan header yang tepat, analisis, templat kode, dan contoh.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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 spaces
  • description: 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 name and description fields
  • 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
Pertanyaan umum

Apa yang diidentifikasi agent dalam kode?

Agent mencari pola desain, teknik kunci, struktur data penting, algoritma, dan titik integrasi.

Untuk siapa panduan ini?

Skill ini meminta agent mempertimbangkan audiens yang dituju sebelum menulis.

Apakah ada contoh kode?

Ya. Skill ini menyertakan templat kode dan contoh penggunaan dalam keluaran.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
7.8k
Peringkat
#13043
Lisensi
MIT
Diperbarui
1/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa