본문으로 건너뛰기
Skillpedia
문서화7.8k · #13043

create-skill-from-source-code

하는 일

이 스킬은 AI 에이전트가 소스 코드 파일을 읽고, 스킬 파일 형태로 교육용 문서를 쓰도록 안내합니다. 참고 구현을 가르치거나 문서화하려는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓참고 구현이 있고 그것으로 학습 자료를 만들고 싶을 때.
  • ✓코드가 어떻게 작동하는지 설명하는 재사용 가능한 문서가 필요할 때.
  • ✓아키텍처, 핵심 기법, 사용 예시를 적어 두고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/create-skill-from-source-code/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 소스 파일을 읽고 주요 패턴을 설명하며, 그 사용 방법을 보여 주는 명확한 안내서를 써 주세요.”

매주 새 스킬 5개. 읽는 데 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 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
자주 묻는 질문

에이전트는 코드에서 무엇을 찾나요?

디자인 패턴, 핵심 기법, 중요한 데이터 구조, 알고리즘, 연동 지점을 찾습니다.

안내서는 누구를 위한 것인가요?

스킬은 글을 쓰기 전에 의도한 독자를 고려하라고 에이전트에게 요구합니다.

코드 예시를 포함하나요?

네, 스킬은 결과물에 코드 템플릿과 사용 예시를 넣습니다.

상세 정보

작성자의 원본 설명

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
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬