본문으로 건너뛰기
cccskills
무료GitHub에 공개

create-skill-from-source-code

Turn existing source code into reusable learning materials. This skill identifies architectural patterns and implementation techniques, then organizes them into a SKILL.md with structured metadata, explanatory code templates, practical examples, and validation steps.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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.

설치 방법 보기

이럴 때 유용합니다

  • Create teaching materials from reference code
  • Document reusable implementation patterns
  • Prepare code templates with usage examples
  • Check a skill file's structure and metadata

포함된 파일(2)

  • SKILL.md7.0 KB
  • .skill_id43 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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 details
  • Focus on the pattern, not the specific implementation
  • Use placeholders like [your-project], [input-file] for context-specific values

Keep It Actionable

  • Use imperative language: "Create...", "Implement...", "Configure..."
  • Provide concrete code examples
  • Include expected outputs or results
  • Add verification steps

Structure for Clarity

  • Use hierarchical headings (##, ###, ####)
  • Break complex steps into numbered sub-steps
  • Use code blocks with appropriate syntax highlighting
  • Add tables or lists for comparing options

Balance Detail and Brevity

  • Be comprehensive but concise
  • Focus on the "what" and "why", not just the "how"
  • Link to external resources for deep dives
  • Include only code essential to understanding the pattern

Example: Transforming a Virtual List Component

Given a VirtualList.ts source file implementing virtual scrolling:

  1. Read: Load the complete TypeScript source
  2. Identify patterns:
    • Chunk-based rendering for performance
    • Scroll event listeners for viewport tracking
    • DOM manipulation for dynamic updates
    • State management for visible items
  3. Create structure: skills/virtual-scrolling-pattern/
  4. Generate SKILL.md:
    • Frontmatter with name: virtual-scrolling-pattern
    • Sections explaining each of the 4 patterns
    • Simplified code template showing core logic
    • Examples of basic and advanced usage
  5. Verify: Check file format and frontmatter validity

Common Pitfalls to Avoid

  • Too specific: Don't tie the skill to one particular codebase
  • Missing frontmatter: Always include valid YAML frontmatter
  • No examples: Abstract patterns need concrete examples
  • Incomplete templates: Code templates should be runnable or near-runnable
  • Poor organization: Use clear sections with descriptive headings

Validation Checklist

Before finalizing the skill:

  • YAML frontmatter is present and valid
  • Name is lowercase with hyphens
  • Description is concise (1-2 sentences)
  • Key patterns are clearly identified (3-5 patterns)
  • Code examples are provided and well-commented
  • Usage examples demonstrate practical application
  • Content is generalized beyond the specific source
  • File structure follows conventions
  • No task-specific details remain
  • Instructions are actionable and clear

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Prepare audio stems, the separate parts of a track, for mixing by matching their durations with silence, loops, or crossfades. Verify each generated and processed file before moving to the next production step.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Match audio parts with different durations
  • Extend drums and melodic parts using suitable methods
  • Check audio specifications before mixing
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Produce audio in separate stems, meaning individual instrument tracks, and verify each output as you go. Align track lengths with silence, loops, or crossfades, then apply effects, mix a master, and package the files.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Align instrument tracks to a reference audio file
  • Choose how to extend tracks that are too short
  • Verify audio properties after generation and effects
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Build serverless endpoints that relay external API requests for a dashboard while keeping API keys on the server. Includes Vercel examples for input checks, caching, cross-origin access, and consistent JSON responses.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Connect a dashboard to external APIs without exposing API keys
  • Create endpoints for stock quotes and news
  • Standardize API responses and error handling
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Produce a master track and separate audio parts through a structured Python workflow. Apply filters and reverb, export WAV files with consistent settings, package them in a ZIP archive, and check that the deliverables meet the requested specifications.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Export a master track with separate audio parts
  • Apply filters and reverb to audio
  • Check duration and format across deliverables
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

Keep document creation moving when web searches and page retrieval repeatedly fail. The skill preserves the original task, uses the model’s existing knowledge, and clearly identifies information that could not be checked against external sources.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Continue drafting after repeated web retrieval failures
  • Preserve task requirements during network errors
  • Mark information that could not be externally verified
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

When Python execution repeatedly fails in execute_code_sandbox, use a file-based alternative: save the script, run it through the shell, and capture results or errors. The guidance covers paths, imports, timeouts, structured output, and optional cleanup.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Retry Python work through the shell after repeated sandbox failures
  • Run longer tasks with an adjusted timeout
  • Execute Python work that needs multiple files or system utilities
HKUDS/OpenSpace7.8천2026년 8월 13일 업데이트

HKUDS의 스킬 모두 보기

이 스킬의 문제 신고