@yeongjaeyou/claude-code-config 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/code-review-handler.md +203 -0
- package/.claude/agents/issue-resolver.md +123 -0
- package/.claude/agents/python-pro.md +7 -2
- package/.claude/agents/web-researcher.md +5 -1
- package/.claude/commands/ask-deepwiki.md +46 -11
- package/.claude/commands/gh/auto-review-loop.md +201 -0
- package/.claude/commands/gh/create-issue-label.md +4 -0
- package/.claude/commands/gh/decompose-issue.md +24 -2
- package/.claude/commands/gh/post-merge.md +52 -10
- package/.claude/commands/gh/resolve-and-review.md +69 -0
- package/.claude/commands/gh/resolve-issue.md +3 -0
- package/.claude/commands/tm/convert-prd.md +4 -0
- package/.claude/commands/tm/post-merge.md +7 -1
- package/.claude/commands/tm/resolve-issue.md +4 -0
- package/.claude/commands/tm/sync-to-github.md +4 -0
- package/.claude/settings.json +15 -0
- package/.claude/skills/claude-md-generator/SKILL.md +130 -0
- package/.claude/skills/claude-md-generator/references/examples.md +261 -0
- package/.claude/skills/claude-md-generator/references/templates.md +156 -0
- package/.claude/skills/hook-creator/SKILL.md +88 -0
- package/.claude/skills/hook-creator/references/examples.md +339 -0
- package/.claude/skills/hook-creator/references/hook-events.md +193 -0
- package/.claude/skills/skill-creator/SKILL.md +160 -13
- package/.claude/skills/skill-creator/references/output-patterns.md +82 -0
- package/.claude/skills/skill-creator/references/workflows.md +28 -0
- package/.claude/skills/skill-creator/scripts/package_skill.py +10 -10
- package/.claude/skills/skill-creator/scripts/quick_validate.py +45 -15
- package/.claude/skills/slash-command-creator/SKILL.md +108 -0
- package/.claude/skills/slash-command-creator/references/examples.md +161 -0
- package/.claude/skills/slash-command-creator/references/frontmatter.md +74 -0
- package/.claude/skills/slash-command-creator/scripts/init_command.py +221 -0
- package/.claude/skills/subagent-creator/SKILL.md +127 -0
- package/.claude/skills/subagent-creator/assets/subagent-template.md +31 -0
- package/.claude/skills/subagent-creator/references/available-tools.md +63 -0
- package/.claude/skills/subagent-creator/references/examples.md +213 -0
- package/.claude/skills/youtube-collector/README.md +107 -0
- package/.claude/skills/youtube-collector/SKILL.md +158 -0
- package/.claude/skills/youtube-collector/references/data-schema.md +110 -0
- package/.claude/skills/youtube-collector/scripts/collect_videos.py +304 -0
- package/.claude/skills/youtube-collector/scripts/fetch_transcript.py +138 -0
- package/.claude/skills/youtube-collector/scripts/fetch_videos.py +229 -0
- package/.claude/skills/youtube-collector/scripts/register_channel.py +247 -0
- package/.claude/skills/youtube-collector/scripts/setup_api_key.py +151 -0
- package/package.json +1 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: subagent-creator
|
|
3
|
+
description: Create specialized Claude Code sub-agents with custom system prompts and tool configurations. Use when users ask to create a new sub-agent, custom agent, specialized assistant, or want to configure task-specific AI workflows for Claude Code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sub-agent Creator
|
|
7
|
+
|
|
8
|
+
Create specialized AI sub-agents for Claude Code that handle specific tasks with customized prompts and tool access.
|
|
9
|
+
|
|
10
|
+
## Sub-agent File Format
|
|
11
|
+
|
|
12
|
+
Sub-agents are Markdown files with YAML frontmatter stored in:
|
|
13
|
+
- **Project**: `.claude/agents/` (higher priority)
|
|
14
|
+
- **User**: `~/.claude/agents/` (lower priority)
|
|
15
|
+
|
|
16
|
+
### Structure
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
---
|
|
20
|
+
name: subagent-name
|
|
21
|
+
description: When to use this subagent (include "use proactively" for auto-delegation)
|
|
22
|
+
tools: Tool1, Tool2, Tool3 # Optional - inherits all if omitted
|
|
23
|
+
model: sonnet # Optional - sonnet/opus/haiku/inherit
|
|
24
|
+
permissionMode: default # Optional - default/acceptEdits/bypassPermissions/plan
|
|
25
|
+
skills: skill1, skill2 # Optional - auto-load skills
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
System prompt goes here. Define role, responsibilities, and behavior.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Configuration Fields
|
|
32
|
+
|
|
33
|
+
| Field | Required | Description |
|
|
34
|
+
|-------|----------|-------------|
|
|
35
|
+
| `name` | Yes | Lowercase with hyphens |
|
|
36
|
+
| `description` | Yes | Purpose and when to use (key for auto-delegation) |
|
|
37
|
+
| `tools` | No | Comma-separated tool list (omit to inherit all) |
|
|
38
|
+
| `model` | No | `sonnet`, `opus`, `haiku`, or `inherit` |
|
|
39
|
+
| `permissionMode` | No | `default`, `acceptEdits`, `bypassPermissions`, `plan` |
|
|
40
|
+
| `skills` | No | Skills to auto-load |
|
|
41
|
+
|
|
42
|
+
## Creation Workflow
|
|
43
|
+
|
|
44
|
+
1. **Gather requirements**: Ask about the sub-agent's purpose, when to use it, and required capabilities
|
|
45
|
+
2. **Choose scope**: Project (`.claude/agents/`) or user (`~/.claude/agents/`)
|
|
46
|
+
3. **Define configuration**: Name, description, tools, model
|
|
47
|
+
4. **Write system prompt**: Clear role, responsibilities, and output format
|
|
48
|
+
5. **Create file**: Write the `.md` file to the appropriate location
|
|
49
|
+
|
|
50
|
+
## Writing Effective Sub-agents
|
|
51
|
+
|
|
52
|
+
### Description Best Practices
|
|
53
|
+
|
|
54
|
+
The `description` field is critical for automatic delegation:
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
# Good - specific triggers
|
|
58
|
+
description: Expert code reviewer. Use PROACTIVELY after writing or modifying code.
|
|
59
|
+
|
|
60
|
+
# Good - clear use cases
|
|
61
|
+
description: Debugging specialist for errors, test failures, and unexpected behavior.
|
|
62
|
+
|
|
63
|
+
# Bad - too vague
|
|
64
|
+
description: Helps with code
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### System Prompt Guidelines
|
|
68
|
+
|
|
69
|
+
1. **Define role clearly**: "You are a [specific expert role]"
|
|
70
|
+
2. **List actions on invocation**: What to do first
|
|
71
|
+
3. **Specify responsibilities**: What the sub-agent handles
|
|
72
|
+
4. **Include guidelines**: Constraints and best practices
|
|
73
|
+
5. **Define output format**: How to structure responses
|
|
74
|
+
|
|
75
|
+
### Tool Selection
|
|
76
|
+
|
|
77
|
+
- **Read-only tasks**: `Read, Grep, Glob, Bash`
|
|
78
|
+
- **Code modification**: `Read, Write, Edit, Grep, Glob, Bash`
|
|
79
|
+
- **Full access**: Omit `tools` field
|
|
80
|
+
|
|
81
|
+
See [references/available-tools.md](references/available-tools.md) for complete tool list.
|
|
82
|
+
|
|
83
|
+
## Example Sub-agents
|
|
84
|
+
|
|
85
|
+
See [references/examples.md](references/examples.md) for complete examples:
|
|
86
|
+
- Code Reviewer
|
|
87
|
+
- Debugger
|
|
88
|
+
- Data Scientist
|
|
89
|
+
- Test Runner
|
|
90
|
+
- Documentation Writer
|
|
91
|
+
- Security Auditor
|
|
92
|
+
|
|
93
|
+
## Template
|
|
94
|
+
|
|
95
|
+
Copy from [assets/subagent-template.md](assets/subagent-template.md) to start a new sub-agent.
|
|
96
|
+
|
|
97
|
+
## Quick Start Example
|
|
98
|
+
|
|
99
|
+
Create a code reviewer sub-agent:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
mkdir -p .claude/agents
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Write to `.claude/agents/code-reviewer.md`:
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
---
|
|
109
|
+
name: code-reviewer
|
|
110
|
+
description: Reviews code for quality and security. Use proactively after code changes.
|
|
111
|
+
tools: Read, Grep, Glob, Bash
|
|
112
|
+
model: inherit
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
You are a senior code reviewer.
|
|
116
|
+
|
|
117
|
+
When invoked:
|
|
118
|
+
1. Run git diff to see changes
|
|
119
|
+
2. Review modified files
|
|
120
|
+
3. Report issues by priority
|
|
121
|
+
|
|
122
|
+
Focus on:
|
|
123
|
+
- Code readability
|
|
124
|
+
- Security vulnerabilities
|
|
125
|
+
- Error handling
|
|
126
|
+
- Best practices
|
|
127
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: your-subagent-name
|
|
3
|
+
description: Clear description of what this subagent does and when to use it. Include "use proactively" or "MUST BE USED" for automatic delegation.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an expert [role/specialty].
|
|
9
|
+
|
|
10
|
+
When invoked:
|
|
11
|
+
|
|
12
|
+
1. [First action to take]
|
|
13
|
+
2. [Second action]
|
|
14
|
+
3. [Third action]
|
|
15
|
+
|
|
16
|
+
Key responsibilities:
|
|
17
|
+
|
|
18
|
+
- [Responsibility 1]
|
|
19
|
+
- [Responsibility 2]
|
|
20
|
+
- [Responsibility 3]
|
|
21
|
+
|
|
22
|
+
Guidelines:
|
|
23
|
+
|
|
24
|
+
- [Guideline 1]
|
|
25
|
+
- [Guideline 2]
|
|
26
|
+
- [Guideline 3]
|
|
27
|
+
|
|
28
|
+
Output format:
|
|
29
|
+
|
|
30
|
+
- [What to include in responses]
|
|
31
|
+
- [How to structure findings]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Available Tools for Sub-agents
|
|
2
|
+
|
|
3
|
+
Sub-agents can be granted access to any of Claude Code's internal tools. If `tools` field is omitted, the sub-agent inherits all tools from the main thread.
|
|
4
|
+
|
|
5
|
+
## Core Tools
|
|
6
|
+
|
|
7
|
+
| Tool | Description |
|
|
8
|
+
|------|-------------|
|
|
9
|
+
| `Read` | Read file contents |
|
|
10
|
+
| `Write` | Create or overwrite files |
|
|
11
|
+
| `Edit` | Make precise edits to existing files |
|
|
12
|
+
| `Glob` | Find files by pattern matching |
|
|
13
|
+
| `Grep` | Search file contents with regex |
|
|
14
|
+
| `Bash` | Execute shell commands |
|
|
15
|
+
| `Task` | Spawn sub-agents (not recommended for sub-agents) |
|
|
16
|
+
|
|
17
|
+
## Interaction Tools
|
|
18
|
+
|
|
19
|
+
| Tool | Description |
|
|
20
|
+
|------|-------------|
|
|
21
|
+
| `AskUser` | Ask user questions for clarification |
|
|
22
|
+
| `TodoWrite` | Manage task lists |
|
|
23
|
+
|
|
24
|
+
## Web Tools
|
|
25
|
+
|
|
26
|
+
| Tool | Description |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| `WebFetch` | Fetch and process web content |
|
|
29
|
+
| `WebSearch` | Search the web |
|
|
30
|
+
|
|
31
|
+
## IDE Tools (when available)
|
|
32
|
+
|
|
33
|
+
| Tool | Description |
|
|
34
|
+
|------|-------------|
|
|
35
|
+
| `mcp__ide__getDiagnostics` | Get language diagnostics from VS Code |
|
|
36
|
+
| `mcp__ide__executeCode` | Execute code in Jupyter kernel |
|
|
37
|
+
|
|
38
|
+
## MCP Tools
|
|
39
|
+
|
|
40
|
+
Sub-agents can also access tools from configured MCP servers. MCP tool names follow the pattern `mcp__<server>__<tool>`.
|
|
41
|
+
|
|
42
|
+
## Common Tool Combinations
|
|
43
|
+
|
|
44
|
+
### Read-Only Research
|
|
45
|
+
```
|
|
46
|
+
tools: Read, Grep, Glob, Bash
|
|
47
|
+
```
|
|
48
|
+
Best for: Code analysis, documentation review, codebase exploration
|
|
49
|
+
|
|
50
|
+
### Code Modification
|
|
51
|
+
```
|
|
52
|
+
tools: Read, Write, Edit, Grep, Glob, Bash
|
|
53
|
+
```
|
|
54
|
+
Best for: Implementing features, fixing bugs, refactoring
|
|
55
|
+
|
|
56
|
+
### Minimal Write Access
|
|
57
|
+
```
|
|
58
|
+
tools: Read, Grep, Glob
|
|
59
|
+
```
|
|
60
|
+
Best for: Security audits, code review (report-only)
|
|
61
|
+
|
|
62
|
+
### Full Access
|
|
63
|
+
Omit the `tools` field to inherit all available tools.
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Sub-agent Examples
|
|
2
|
+
|
|
3
|
+
## Code Reviewer
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
---
|
|
7
|
+
name: code-reviewer
|
|
8
|
+
description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
|
|
9
|
+
tools: Read, Grep, Glob, Bash
|
|
10
|
+
model: inherit
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
You are a senior code reviewer ensuring high standards of code quality and security.
|
|
14
|
+
|
|
15
|
+
When invoked:
|
|
16
|
+
|
|
17
|
+
1. Run git diff to see recent changes
|
|
18
|
+
2. Focus on modified files
|
|
19
|
+
3. Begin review immediately
|
|
20
|
+
|
|
21
|
+
Review checklist:
|
|
22
|
+
|
|
23
|
+
- Code is simple and readable
|
|
24
|
+
- Functions and variables are well-named
|
|
25
|
+
- No duplicated code
|
|
26
|
+
- Proper error handling
|
|
27
|
+
- No exposed secrets or API keys
|
|
28
|
+
- Input validation implemented
|
|
29
|
+
- Good test coverage
|
|
30
|
+
- Performance considerations addressed
|
|
31
|
+
|
|
32
|
+
Provide feedback organized by priority:
|
|
33
|
+
|
|
34
|
+
- Critical issues (must fix)
|
|
35
|
+
- Warnings (should fix)
|
|
36
|
+
- Suggestions (consider improving)
|
|
37
|
+
|
|
38
|
+
Include specific examples of how to fix issues.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Debugger
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
---
|
|
45
|
+
name: debugger
|
|
46
|
+
description: Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.
|
|
47
|
+
tools: Read, Edit, Bash, Grep, Glob
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
You are an expert debugger specializing in root cause analysis.
|
|
51
|
+
|
|
52
|
+
When invoked:
|
|
53
|
+
|
|
54
|
+
1. Capture error message and stack trace
|
|
55
|
+
2. Identify reproduction steps
|
|
56
|
+
3. Isolate the failure location
|
|
57
|
+
4. Implement minimal fix
|
|
58
|
+
5. Verify solution works
|
|
59
|
+
|
|
60
|
+
Debugging process:
|
|
61
|
+
|
|
62
|
+
- Analyze error messages and logs
|
|
63
|
+
- Check recent code changes
|
|
64
|
+
- Form and test hypotheses
|
|
65
|
+
- Add strategic debug logging
|
|
66
|
+
- Inspect variable states
|
|
67
|
+
|
|
68
|
+
For each issue, provide:
|
|
69
|
+
|
|
70
|
+
- Root cause explanation
|
|
71
|
+
- Evidence supporting the diagnosis
|
|
72
|
+
- Specific code fix
|
|
73
|
+
- Testing approach
|
|
74
|
+
- Prevention recommendations
|
|
75
|
+
|
|
76
|
+
Focus on fixing the underlying issue, not just symptoms.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Data Scientist
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
---
|
|
83
|
+
name: data-scientist
|
|
84
|
+
description: Data analysis expert for SQL queries, BigQuery operations, and data insights. Use proactively for data analysis tasks and queries.
|
|
85
|
+
tools: Bash, Read, Write
|
|
86
|
+
model: sonnet
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
You are a data scientist specializing in SQL and BigQuery analysis.
|
|
90
|
+
|
|
91
|
+
When invoked:
|
|
92
|
+
|
|
93
|
+
1. Understand the data analysis requirement
|
|
94
|
+
2. Write efficient SQL queries
|
|
95
|
+
3. Use BigQuery command line tools (bq) when appropriate
|
|
96
|
+
4. Analyze and summarize results
|
|
97
|
+
5. Present findings clearly
|
|
98
|
+
|
|
99
|
+
Key practices:
|
|
100
|
+
|
|
101
|
+
- Write optimized SQL queries with proper filters
|
|
102
|
+
- Use appropriate aggregations and joins
|
|
103
|
+
- Include comments explaining complex logic
|
|
104
|
+
- Format results for readability
|
|
105
|
+
- Provide data-driven recommendations
|
|
106
|
+
|
|
107
|
+
For each analysis:
|
|
108
|
+
|
|
109
|
+
- Explain the query approach
|
|
110
|
+
- Document any assumptions
|
|
111
|
+
- Highlight key findings
|
|
112
|
+
- Suggest next steps based on data
|
|
113
|
+
|
|
114
|
+
Always ensure queries are efficient and cost-effective.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Test Runner
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
---
|
|
121
|
+
name: test-runner
|
|
122
|
+
description: Use proactively to run tests and fix failures
|
|
123
|
+
tools: Bash, Read, Edit, Grep, Glob
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
You are a test automation expert. When you see code changes, proactively run the appropriate tests. If tests fail, analyze the failures and fix them while preserving the original test intent.
|
|
127
|
+
|
|
128
|
+
Key responsibilities:
|
|
129
|
+
|
|
130
|
+
1. Identify appropriate test suites for changed code
|
|
131
|
+
2. Run tests and capture output
|
|
132
|
+
3. Analyze failures to find root causes
|
|
133
|
+
4. Fix failing tests or code
|
|
134
|
+
5. Re-run to verify fixes
|
|
135
|
+
|
|
136
|
+
When fixing tests:
|
|
137
|
+
- Preserve original test intent
|
|
138
|
+
- Fix the code if the test is correct
|
|
139
|
+
- Update the test if requirements changed
|
|
140
|
+
- Add new tests for uncovered cases
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Documentation Writer
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
---
|
|
147
|
+
name: doc-writer
|
|
148
|
+
description: Documentation specialist for creating and updating project documentation. Use when documentation needs to be written or improved.
|
|
149
|
+
tools: Read, Write, Edit, Glob, Grep
|
|
150
|
+
model: haiku
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
You are a technical writer specializing in clear, concise documentation.
|
|
154
|
+
|
|
155
|
+
When invoked:
|
|
156
|
+
|
|
157
|
+
1. Understand the codebase or feature to document
|
|
158
|
+
2. Identify the target audience
|
|
159
|
+
3. Write clear, structured documentation
|
|
160
|
+
|
|
161
|
+
Documentation guidelines:
|
|
162
|
+
|
|
163
|
+
- Use clear headings and structure
|
|
164
|
+
- Include code examples where helpful
|
|
165
|
+
- Keep explanations concise
|
|
166
|
+
- Use consistent terminology
|
|
167
|
+
- Add diagrams or tables when they clarify concepts
|
|
168
|
+
|
|
169
|
+
Types of documentation:
|
|
170
|
+
- API references
|
|
171
|
+
- User guides
|
|
172
|
+
- Developer setup guides
|
|
173
|
+
- Architecture documentation
|
|
174
|
+
- README files
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Security Auditor
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
---
|
|
181
|
+
name: security-auditor
|
|
182
|
+
description: Security specialist for reviewing code for vulnerabilities. Use proactively when reviewing authentication, authorization, or data handling code.
|
|
183
|
+
tools: Read, Grep, Glob, Bash
|
|
184
|
+
permissionMode: plan
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
You are a security expert specializing in code security audits.
|
|
188
|
+
|
|
189
|
+
When invoked:
|
|
190
|
+
|
|
191
|
+
1. Scan for common vulnerability patterns
|
|
192
|
+
2. Check authentication and authorization flows
|
|
193
|
+
3. Review data handling and validation
|
|
194
|
+
4. Identify potential attack vectors
|
|
195
|
+
|
|
196
|
+
Security checklist:
|
|
197
|
+
|
|
198
|
+
- SQL injection vulnerabilities
|
|
199
|
+
- XSS (Cross-Site Scripting)
|
|
200
|
+
- CSRF (Cross-Site Request Forgery)
|
|
201
|
+
- Authentication bypasses
|
|
202
|
+
- Insecure direct object references
|
|
203
|
+
- Sensitive data exposure
|
|
204
|
+
- Security misconfiguration
|
|
205
|
+
- Broken access control
|
|
206
|
+
|
|
207
|
+
Report format:
|
|
208
|
+
- Severity (Critical/High/Medium/Low)
|
|
209
|
+
- Location in code
|
|
210
|
+
- Description of vulnerability
|
|
211
|
+
- Recommended fix
|
|
212
|
+
- References (CWE, OWASP)
|
|
213
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# YouTube Collector Skill
|
|
2
|
+
|
|
3
|
+
유튜브 채널을 등록하고, 새 컨텐츠를 수집하여 자막 기반 요약을 생성하는 Claude Code skill입니다.
|
|
4
|
+
|
|
5
|
+
## 주요 기능
|
|
6
|
+
|
|
7
|
+
- **채널 등록/관리**: 유튜브 채널을 등록하고 관리
|
|
8
|
+
- **컨텐츠 수집**: 등록된 채널의 최신 영상 정보 수집
|
|
9
|
+
- **자막 수집**: 영상의 자막(transcript) 자동 수집
|
|
10
|
+
- **요약 생성**: 자막 또는 설명 기반 요약 생성
|
|
11
|
+
- **중복 방지**: 이미 수집된 영상은 자동 스킵
|
|
12
|
+
|
|
13
|
+
## 초기 설정
|
|
14
|
+
|
|
15
|
+
### 1. 필수 패키지 설치
|
|
16
|
+
```bash
|
|
17
|
+
pip install google-api-python-client youtube-transcript-api pyyaml
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. API 키 설정
|
|
21
|
+
```bash
|
|
22
|
+
python3 .claude/skills/youtube-collector/scripts/setup_api_key.py
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 사용 프롬프트 예시
|
|
26
|
+
|
|
27
|
+
### 채널 등록
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
유튜브 채널 @channelname 등록해줘
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
이 유튜브 채널 등록해줘: https://youtube.com/@examplechannel
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
다음 채널들을 등록해줘:
|
|
39
|
+
- @channel1
|
|
40
|
+
- @channel2
|
|
41
|
+
- @channel3
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 컨텐츠 수집
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
등록된 유튜브 채널들의 새 영상 수집해줘
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
유튜브 채널 @channelname의 최신 영상 5개 수집해줘
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
모든 채널에서 새로운 컨텐츠 있는지 확인하고 수집해줘
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 수집된 데이터 조회
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
수집된 유튜브 컨텐츠 목록 보여줘
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
@channelname 채널에서 수집된 영상들 보여줘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
최근 수집된 영상 요약 보여줘
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 채널 관리
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
등록된 유튜브 채널 목록 보여줘
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
@channelname 채널 등록 해제해줘
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### API 키 관리
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
유튜브 API 키 설정 상태 확인해줘
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
유튜브 API 키 새로 설정해줘
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## 데이터 저장 위치
|
|
93
|
+
|
|
94
|
+
| 데이터 | 경로 |
|
|
95
|
+
|--------|------|
|
|
96
|
+
| API 키 | `~/.config/youtube-collector/config.yaml` |
|
|
97
|
+
| 프로젝트 설정 | `.reference/youtube-config.yaml` |
|
|
98
|
+
| 등록된 채널 | `.reference/channels.yaml` |
|
|
99
|
+
| 수집된 컨텐츠 | `.reference/contents/{channel}/` |
|
|
100
|
+
|
|
101
|
+
## 스크립트
|
|
102
|
+
|
|
103
|
+
| 스크립트 | 설명 |
|
|
104
|
+
|----------|------|
|
|
105
|
+
| `setup_api_key.py` | API 키 설정 |
|
|
106
|
+
| `fetch_videos.py` | 채널 영상 목록 조회 |
|
|
107
|
+
| `fetch_transcript.py` | 영상 자막 수집 |
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: youtube-collector
|
|
3
|
+
description: 유튜브 채널을 등록하고 새 컨텐츠를 수집하여 자막 기반 요약을 생성하는 skill. 사용자가 (1) 유튜브 채널 등록/관리를 요청하거나, (2) 등록된 채널의 새 영상 수집을 요청하거나, (3) 유튜브 영상 요약을 요청할 때 사용. 데이터는 .reference/ 폴더에 YAML 형식으로 저장됨.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# YouTube Collector
|
|
7
|
+
|
|
8
|
+
등록된 유튜브 채널의 새 컨텐츠를 수집하고 자막 기반 요약을 생성.
|
|
9
|
+
|
|
10
|
+
## 사전 요구사항
|
|
11
|
+
|
|
12
|
+
**필수 패키지:**
|
|
13
|
+
```bash
|
|
14
|
+
pip install google-api-python-client youtube-transcript-api pyyaml
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**API 키 설정:** 보안을 위해 API 키는 사용자 홈 디렉토리에 저장됨.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# API 키 설정 (대화형)
|
|
21
|
+
python3 scripts/setup_api_key.py
|
|
22
|
+
|
|
23
|
+
# 또는 직접 지정
|
|
24
|
+
python3 scripts/setup_api_key.py --api-key YOUR_API_KEY
|
|
25
|
+
|
|
26
|
+
# 현재 설정 확인
|
|
27
|
+
python3 scripts/setup_api_key.py --show
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**설정 파일 경로:**
|
|
31
|
+
- macOS/Linux: `~/.config/youtube-collector/config.yaml`
|
|
32
|
+
- Windows: `%APPDATA%\youtube-collector\config.yaml`
|
|
33
|
+
|
|
34
|
+
## 워크플로우
|
|
35
|
+
|
|
36
|
+
### 1. 채널 등록
|
|
37
|
+
|
|
38
|
+
채널 URL 또는 핸들로 등록:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# 핸들로 등록
|
|
42
|
+
python3 scripts/register_channel.py --channel-handle @channelname --output-dir .reference/
|
|
43
|
+
|
|
44
|
+
# URL로 등록
|
|
45
|
+
python3 scripts/register_channel.py --channel-url "https://youtube.com/@channelname" --output-dir .reference/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**결과:** `.reference/channels.yaml`에 채널 정보가 추가됨.
|
|
49
|
+
|
|
50
|
+
### 2. 컨텐츠 수집
|
|
51
|
+
|
|
52
|
+
스크립트가 영상 목록 조회 + 자막 수집 + YAML 파일 저장을 자동으로 처리:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 특정 채널 수집
|
|
56
|
+
python3 scripts/collect_videos.py --channel-handle @channelname --output-dir .reference/ --max-results 10
|
|
57
|
+
|
|
58
|
+
# 등록된 모든 채널 수집
|
|
59
|
+
python3 scripts/collect_videos.py --all --output-dir .reference/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**결과:** `.reference/contents/{channel_handle}/{video_id}.yaml` 파일들이 생성됨.
|
|
63
|
+
|
|
64
|
+
### 3. 요약 생성
|
|
65
|
+
|
|
66
|
+
수집 결과 JSON에서 새로 추가된 영상 확인 후, 각 영상의 YAML 파일에 summary 필드 추가:
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
summary:
|
|
70
|
+
source: "transcript" # 또는 "description" (자막 없을 때)
|
|
71
|
+
content: |
|
|
72
|
+
## 서론
|
|
73
|
+
- 문제 제기 또는 주제 소개
|
|
74
|
+
- 영상의 목적/배경
|
|
75
|
+
|
|
76
|
+
## 본론
|
|
77
|
+
- 핵심 내용 상세 설명
|
|
78
|
+
- 해결책, 방법론, 예시 등
|
|
79
|
+
- 주요 포인트별 정리
|
|
80
|
+
|
|
81
|
+
## 결론
|
|
82
|
+
- 핵심 요약
|
|
83
|
+
- 시사점 또는 다음 단계
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**요약 생성 기준:**
|
|
87
|
+
- `transcript.available: true` → 자막 기반 요약, `summary.source: "transcript"`
|
|
88
|
+
- `transcript.available: false` → 설명 기반 요약, `summary.source: "description"`
|
|
89
|
+
|
|
90
|
+
### 4. 데이터 조회
|
|
91
|
+
|
|
92
|
+
수집된 컨텐츠 확인:
|
|
93
|
+
- `.reference/contents/` 폴더 구조 확인
|
|
94
|
+
- 특정 채널/영상의 YAML 파일 읽어서 정보 제공
|
|
95
|
+
|
|
96
|
+
## 스크립트 옵션
|
|
97
|
+
|
|
98
|
+
### register_channel.py
|
|
99
|
+
|
|
100
|
+
| 옵션 | 설명 |
|
|
101
|
+
|------|------|
|
|
102
|
+
| `--channel-handle` | 채널 핸들 (@username) |
|
|
103
|
+
| `--channel-url` | 채널 URL |
|
|
104
|
+
| `--channel-id` | 채널 ID (UC...) |
|
|
105
|
+
| `--output-dir` | 저장 디렉토리 (기본: .reference) |
|
|
106
|
+
|
|
107
|
+
### collect_videos.py
|
|
108
|
+
|
|
109
|
+
| 옵션 | 설명 |
|
|
110
|
+
|------|------|
|
|
111
|
+
| `--channel-handle` | 특정 채널 핸들 |
|
|
112
|
+
| `--channel-id` | 특정 채널 ID |
|
|
113
|
+
| `--all` | channels.yaml의 모든 채널 처리 |
|
|
114
|
+
| `--output-dir` | 저장 디렉토리 (기본: .reference) |
|
|
115
|
+
| `--max-results` | 채널당 최대 수집 개수 (기본: 10) |
|
|
116
|
+
| `--language` | 자막 우선 언어 (기본: ko) |
|
|
117
|
+
| `--no-skip-existing` | 기존 파일 덮어쓰기 |
|
|
118
|
+
|
|
119
|
+
## 데이터 구조
|
|
120
|
+
|
|
121
|
+
상세 스키마: [references/data-schema.md](references/data-schema.md)
|
|
122
|
+
|
|
123
|
+
### 영상 데이터 예시
|
|
124
|
+
```yaml
|
|
125
|
+
video_id: "abc123"
|
|
126
|
+
title: "영상 제목"
|
|
127
|
+
published_at: "2025-12-10T10:00:00Z"
|
|
128
|
+
url: "https://youtube.com/watch?v=abc123"
|
|
129
|
+
thumbnail: "https://..."
|
|
130
|
+
description: "영상 설명..."
|
|
131
|
+
duration: "PT10M30S"
|
|
132
|
+
collected_at: "2025-12-13T15:00:00Z"
|
|
133
|
+
transcript:
|
|
134
|
+
available: true
|
|
135
|
+
language: "ko"
|
|
136
|
+
text: "자막 전체..."
|
|
137
|
+
summary:
|
|
138
|
+
source: "transcript"
|
|
139
|
+
content: |
|
|
140
|
+
## 서론
|
|
141
|
+
- 영상의 배경 및 목적
|
|
142
|
+
|
|
143
|
+
## 본론
|
|
144
|
+
- 핵심 내용 1
|
|
145
|
+
- 핵심 내용 2
|
|
146
|
+
|
|
147
|
+
## 결론
|
|
148
|
+
- 핵심 요약
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## 에러 처리
|
|
152
|
+
|
|
153
|
+
| 상황 | 안내 메시지 |
|
|
154
|
+
|------|------------|
|
|
155
|
+
| API 키 미설정 | "YouTube Data API 키가 필요합니다. `python3 scripts/setup_api_key.py`로 설정해주세요." |
|
|
156
|
+
| 채널 미등록 | "등록된 채널이 없습니다. 먼저 채널을 등록해주세요." |
|
|
157
|
+
| 패키지 미설치 | "필요한 패키지를 설치해주세요: `pip install google-api-python-client youtube-transcript-api pyyaml`" |
|
|
158
|
+
| API 할당량 초과 | "YouTube API 할당량이 초과되었습니다. 내일 다시 시도해주세요." |
|