Skip to content

Commit ffd691b

Browse files
committed
feat(skills): add comprehensive skills marketplace with 40+ tools and community skills
- Add 18 community skills including api-designer, ci-cd-generator, code-review, database-designer, docker-compose, documentation-writer, express-api, git-workflow, nextjs-app, prompt-engineer, react-component, refactor-assistant, security-scanner, test-generator, web-scraper, and more - Add 40+ utility tools with Python/Node.js implementations: barcode-generator, base64-encoder, bilibili-analyzer, clipboard-manager, code-formatter, color-converter, cron-scheduler, csv-processor, email-sender, env-manager, excel-handler, file-archiver, file-hasher, file-watcher, git-stats, http-client, image-processor, json-validator, json-yaml-converter, jwt-decoder, log-analyzer, markdown-converter, password-generator, pdf-generator, port-scanner, qrcode-generator, regex-tester, screenshot-capture, sql-executor, system-info, text-diff, text-to-speech, text-translator, url-shortener, uuid-generator, web-scraper, x-report-generator - Add bilibili-analyzer specification with design, requirements, and comprehensive task documentation - Add bilibili-analyzer implementation with video downloader, frame extractor, AI analyzer, metadata fetcher, report generator, and property-based tests - Update skills index.json to register all new skills - Update plan skill documentation - Update API endpoints to support new skill registrations - Update SkillInstallModal component for enhanced skill installation UI - Expand skills marketplace with both community-contributed and utility tools for improved developer productivity
1 parent fdb2524 commit ffd691b

118 files changed

Lines changed: 18605 additions & 17 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.kiro/specs/bilibili-analyzer/design.md

Lines changed: 475 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Requirements Document
2+
3+
## Introduction
4+
5+
本文档定义了Bilibili视频分析器Skill的需求规格。该Skill允许用户提供B站视频地址,自动下载视频、提取关键帧、使用AI分析视频内容,并生成包含截图和时间戳的Markdown总结报告。
6+
7+
## Glossary
8+
9+
- **Bilibili_Analyzer**: 核心分析系统,负责协调视频下载、帧提取、AI分析和报告生成
10+
- **Video_Downloader**: 视频下载模块,负责从B站获取视频文件
11+
- **Frame_Extractor**: 帧提取模块,使用ffmpeg从视频中提取关键帧
12+
- **AI_Analyzer**: AI分析模块,使用Claude Code分析视频帧内容
13+
- **Report_Generator**: 报告生成模块,汇总分析结果生成Markdown报告
14+
- **Key_Frame**: 视频中的关键帧,代表视频内容的重要时刻
15+
- **Analysis_Task**: 单个帧分析任务,分配给Claude Code执行
16+
- **Summary_Report**: 最终生成的Markdown格式视频总结报告
17+
18+
## Requirements
19+
20+
### Requirement 1: 视频地址解析与验证
21+
22+
**User Story:** As a user, I want to provide a Bilibili video URL, so that the system can identify and process the video.
23+
24+
#### Acceptance Criteria
25+
26+
1. WHEN a user provides a Bilibili video URL, THE Bilibili_Analyzer SHALL validate the URL format matches `https://www.bilibili.com/video/BV*` or `https://b23.tv/*` patterns
27+
2. WHEN a valid URL is provided, THE Bilibili_Analyzer SHALL extract the video BV号 (BV ID)
28+
3. IF an invalid URL is provided, THEN THE Bilibili_Analyzer SHALL return a descriptive error message indicating the expected URL format
29+
4. WHEN the URL is validated, THE Bilibili_Analyzer SHALL fetch video metadata including title, duration, author, and description
30+
31+
### Requirement 2: 视频下载
32+
33+
**User Story:** As a user, I want the system to download the video automatically, so that it can be analyzed locally.
34+
35+
#### Acceptance Criteria
36+
37+
1. WHEN a valid video URL is confirmed, THE Video_Downloader SHALL download the video to a temporary directory
38+
2. WHILE downloading, THE Video_Downloader SHALL display progress information including percentage and estimated time
39+
3. IF the video download fails, THEN THE Video_Downloader SHALL retry up to 3 times with exponential backoff
40+
4. IF all download attempts fail, THEN THE Video_Downloader SHALL return an error with the failure reason
41+
5. WHEN download completes, THE Video_Downloader SHALL verify the file integrity
42+
43+
### Requirement 3: 关键帧提取
44+
45+
**User Story:** As a user, I want the system to extract key frames from the video, so that important visual content can be analyzed.
46+
47+
#### Acceptance Criteria
48+
49+
1. WHEN a video file is available, THE Frame_Extractor SHALL use ffmpeg to extract frames at configurable intervals (default: every 30 seconds)
50+
2. THE Frame_Extractor SHALL detect scene changes and extract additional frames at scene boundaries
51+
3. WHEN extracting frames, THE Frame_Extractor SHALL save each frame as a JPEG image with timestamp in filename
52+
4. THE Frame_Extractor SHALL generate a frame manifest containing frame paths, timestamps, and scene change indicators
53+
5. IF ffmpeg is not available, THEN THE Frame_Extractor SHALL return an error with installation instructions
54+
55+
### Requirement 4: AI帧分析
56+
57+
**User Story:** As a user, I want AI to analyze each key frame, so that I can understand the visual content of the video.
58+
59+
#### Acceptance Criteria
60+
61+
1. WHEN frames are extracted, THE AI_Analyzer SHALL create analysis tasks for each frame
62+
2. THE AI_Analyzer SHALL distribute analysis tasks across multiple Claude Code instances for parallel processing
63+
3. WHEN analyzing a frame, THE AI_Analyzer SHALL identify: objects, text, people, actions, and scene context
64+
4. THE AI_Analyzer SHALL return structured analysis results including descriptions and confidence scores
65+
5. IF an analysis task fails, THEN THE AI_Analyzer SHALL retry the task once before marking it as failed
66+
6. WHEN all tasks complete, THE AI_Analyzer SHALL aggregate results maintaining temporal order
67+
68+
### Requirement 5: 报告生成
69+
70+
**User Story:** As a user, I want a comprehensive Markdown report, so that I can review the video content summary.
71+
72+
#### Acceptance Criteria
73+
74+
1. WHEN analysis is complete, THE Report_Generator SHALL create a Markdown report in `./bilibili/{video_title}/` directory
75+
2. THE Report_Generator SHALL include video metadata (title, author, duration, URL) in the report header
76+
3. THE Report_Generator SHALL organize content by timeline with embedded frame images
77+
4. WHEN embedding images, THE Report_Generator SHALL use relative paths to images stored in `./bilibili/{video_title}/frames/`
78+
5. THE Report_Generator SHALL include timestamps in `HH:MM:SS` format for each analyzed frame
79+
6. THE Report_Generator SHALL generate an executive summary at the beginning of the report
80+
7. THE Report_Generator SHALL create a table of contents with links to each section
81+
8. IF the output directory does not exist, THEN THE Report_Generator SHALL create it automatically
82+
83+
### Requirement 6: 配置与自定义
84+
85+
**User Story:** As a user, I want to customize the analysis parameters, so that I can control the depth and focus of the analysis.
86+
87+
#### Acceptance Criteria
88+
89+
1. THE Bilibili_Analyzer SHALL accept optional parameters for frame extraction interval (default: 30 seconds)
90+
2. THE Bilibili_Analyzer SHALL accept optional parameters for maximum frames to analyze (default: 50)
91+
3. THE Bilibili_Analyzer SHALL accept optional parameters for analysis focus areas (e.g., text, faces, objects)
92+
4. WHERE custom output directory is specified, THE Report_Generator SHALL use the specified path instead of default
93+
94+
### Requirement 7: 错误处理与日志
95+
96+
**User Story:** As a user, I want clear error messages and logs, so that I can troubleshoot issues.
97+
98+
#### Acceptance Criteria
99+
100+
1. IF any component fails, THEN THE Bilibili_Analyzer SHALL log the error with timestamp and context
101+
2. WHEN errors occur, THE Bilibili_Analyzer SHALL provide user-friendly error messages with suggested actions
102+
3. THE Bilibili_Analyzer SHALL create a log file in the output directory for debugging purposes
103+
4. IF partial analysis completes before failure, THEN THE Bilibili_Analyzer SHALL save partial results and indicate incomplete status
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Implementation Plan: Bilibili Video Analyzer
2+
3+
## Overview
4+
5+
本实现计划将Bilibili视频分析器设计转化为可执行的编码任务。采用增量开发方式,从核心模块开始,逐步构建完整功能。使用Python作为实现语言,pytest + hypothesis作为测试框架。
6+
7+
## Tasks
8+
9+
- [x] 1. 项目初始化和基础结构
10+
- [x] 1.1 创建skill目录结构和SKILL.md文件
11+
- 创建 `skills/tools/bilibili-analyzer/` 目录
12+
- 创建 `skills/tools/bilibili-analyzer/scripts/` 目录
13+
- 编写 SKILL.md 文档,包含使用说明和依赖
14+
- _Requirements: 全部_
15+
- [x] 1.2 创建核心数据模型和配置类
16+
- 实现 `VideoMetadata`, `FrameInfo`, `FrameAnalysis` 数据类
17+
- 实现 `AnalyzerConfig`, `VideoReport` 配置类
18+
- 实现自定义异常类层次结构
19+
- _Requirements: 6.1, 6.2, 6.3, 6.4, 7.1_
20+
21+
- [x] 2. URL解析模块
22+
- [x] 2.1 实现URLParser类
23+
- 实现 `validate()` 方法验证B站URL格式
24+
- 实现 `extract_bvid()` 方法提取BV号
25+
- 实现 `normalize_url()` 方法处理短链接
26+
- 支持 `bilibili.com/video/BV*``b23.tv/*` 格式
27+
- _Requirements: 1.1, 1.2, 1.3_
28+
- [x] 2.2 编写URL解析属性测试
29+
- **Property 1: URL Validation Correctness**
30+
- **Property 2: BV ID Extraction Round-Trip**
31+
- **Validates: Requirements 1.1, 1.2, 1.3**
32+
33+
- [x] 3. 元数据获取模块
34+
- [x] 3.1 实现MetadataFetcher类
35+
- 实现通过BV号获取视频信息的API调用
36+
- 解析返回的JSON数据填充VideoMetadata
37+
- 处理API错误和网络异常
38+
- _Requirements: 1.4_
39+
- [x] 3.2 编写元数据获取单元测试
40+
- 测试API响应解析
41+
- 测试错误处理
42+
- _Requirements: 1.4_
43+
44+
- [x] 4. 视频下载模块
45+
- [x] 4.1 实现VideoDownloader类
46+
- 实现视频流获取和下载逻辑
47+
- 实现进度回调机制
48+
- 实现指数退避重试逻辑(最多3次)
49+
- 实现文件完整性验证
50+
- _Requirements: 2.1, 2.2, 2.3, 2.4, 2.5_
51+
- [x] 4.2 编写下载模块属性测试
52+
- **Property 3: Download Retry Behavior**
53+
- **Property 4: File Integrity Verification**
54+
- **Validates: Requirements 2.3, 2.4, 2.5**
55+
56+
- [x] 5. Checkpoint - 核心下载功能验证
57+
- 确保URL解析、元数据获取、视频下载功能正常
58+
- 运行所有测试确保通过
59+
- 如有问题请询问用户
60+
61+
- [x] 6. 帧提取模块
62+
- [x] 6.1 实现FrameExtractor类
63+
- 实现ffmpeg可用性检查
64+
- 实现按间隔提取帧功能
65+
- 实现场景变化检测
66+
- 生成帧清单(manifest)
67+
- 时间戳格式化为HH:MM:SS
68+
- _Requirements: 3.1, 3.2, 3.3, 3.4, 3.5_
69+
- [x] 6.2 编写帧提取属性测试
70+
- **Property 5: Frame Extraction Interval Consistency**
71+
- **Property 6: Frame Manifest Completeness**
72+
- **Validates: Requirements 3.1, 3.3, 3.4**
73+
74+
- [x] 7. AI分析模块
75+
- [x] 7.1 实现AIAnalyzer类 - 任务管理
76+
- 实现任务创建逻辑(每帧一个任务)
77+
- 实现任务状态管理
78+
- 实现结果按时间顺序聚合
79+
- _Requirements: 4.1, 4.6_
80+
- [x] 7.2 实现AIAnalyzer类 - 并行分析
81+
- 实现Claude Code调用接口
82+
- 实现多worker并行处理
83+
- 实现单次重试逻辑
84+
- 返回结构化分析结果
85+
- _Requirements: 4.2, 4.3, 4.4, 4.5_
86+
- [x] 7.3 编写AI分析属性测试
87+
- **Property 7: Task-Frame Bijection**
88+
- **Property 8: Analysis Result Structure**
89+
- **Property 9: Analysis Retry Behavior**
90+
- **Validates: Requirements 4.1, 4.4, 4.5, 4.6**
91+
92+
- [x] 8. Checkpoint - 分析流程验证
93+
- 确保帧提取和AI分析功能正常
94+
- 运行所有测试确保通过
95+
- 如有问题请询问用户
96+
97+
- [-] 9. 报告生成模块
98+
- [x] 9.1 实现ReportGenerator类 - 核心功能
99+
- 实现输出目录创建逻辑
100+
- 实现帧图片复制到输出目录
101+
- 实现Markdown报告主体生成
102+
- 嵌入图片使用相对路径
103+
- _Requirements: 5.1, 5.3, 5.4, 5.8_
104+
- [x] 9.2 实现ReportGenerator类 - 增强功能
105+
- 实现视频元数据头部生成
106+
- 实现执行摘要生成
107+
- 实现目录生成(带锚点链接)
108+
- 时间戳格式化为HH:MM:SS
109+
- _Requirements: 5.2, 5.5, 5.6, 5.7_
110+
- [ ] 9.3 编写报告生成属性测试
111+
- **Property 10: Report Content Completeness**
112+
- **Property 11: TOC-Section Consistency**
113+
- **Property 12: Output Directory Creation**
114+
- **Validates: Requirements 5.2, 5.3, 5.4, 5.5, 5.7, 5.8**
115+
116+
- [-] 10. 日志和错误处理
117+
- [-] 10.1 实现日志系统
118+
- 配置日志格式(时间戳、级别、上下文)
119+
- 实现日志文件输出到输出目录
120+
- 实现部分结果保存逻辑
121+
- _Requirements: 7.1, 7.2, 7.3, 7.4_
122+
- [ ] 10.2 编写日志属性测试
123+
- **Property 14: Error Logging Completeness**
124+
- **Property 15: Partial Result Preservation**
125+
- **Validates: Requirements 7.1, 7.3, 7.4**
126+
127+
- [ ] 11. 主程序和CLI集成
128+
- [ ] 11.1 实现主入口和命令行接口
129+
- 实现argparse命令行参数解析
130+
- 集成所有模块到主工作流
131+
- 实现配置参数传递
132+
- 添加进度显示和用户提示
133+
- _Requirements: 6.1, 6.2, 6.3, 6.4_
134+
- [ ] 11.2 编写配置参数属性测试
135+
- **Property 13: Configuration Parameter Application**
136+
- **Validates: Requirements 6.1, 6.2, 6.3, 6.4**
137+
138+
- [ ] 12. Checkpoint - 完整功能验证
139+
- 运行完整工作流测试
140+
- 确保所有测试通过
141+
- 如有问题请询问用户
142+
143+
- [ ] 13. 文档和索引更新
144+
- [ ] 13.1 完善SKILL.md文档
145+
- 添加完整使用示例
146+
- 添加依赖安装说明
147+
- 添加常见问题解答
148+
- _Requirements: 全部_
149+
- [ ] 13.2 更新skills/index.json
150+
- 添加bilibili-analyzer skill条目
151+
- 填写元数据和标签
152+
- _Requirements: 全部_
153+
154+
- [ ] 14. Final Checkpoint - 最终验证
155+
- 运行所有单元测试和属性测试
156+
- 验证完整工作流
157+
- 确保文档完整
158+
- 如有问题请询问用户
159+
160+
## Notes
161+
162+
- 所有任务均为必做任务,包括全部测试
163+
- 每个属性测试配置运行100次迭代
164+
- 属性测试使用hypothesis库
165+
- 需要预先安装ffmpeg才能运行帧提取功能
166+
- Claude Code并行分析需要配置API访问
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
name: api-designer
3+
description: 设计RESTful API并生成OpenAPI/Swagger规范文档,遵循行业最佳实践。包括端点命名、请求/响应模式和错误处理模式。
4+
metadata:
5+
short-description: 设计RESTful API与OpenAPI规范
6+
---
7+
8+
# API Designer Skill
9+
10+
## Description
11+
Design and document RESTful APIs with OpenAPI/Swagger specifications following industry best practices.
12+
13+
## Trigger
14+
- `/api-design` command
15+
- User requests API design or documentation
16+
- User needs OpenAPI/Swagger specification
17+
18+
## Prompt
19+
20+
You are an API design expert that creates well-structured RESTful APIs. Your goal is to:
21+
22+
1. **Design Endpoints**: Create RESTful endpoints following naming conventions
23+
2. **Define Schemas**: Create request/response JSON schemas
24+
3. **Generate OpenAPI**: Produce OpenAPI 3.0+ specifications
25+
4. **Document**: Provide comprehensive API documentation
26+
27+
### Instructions
28+
29+
When designing an API:
30+
31+
1. **Analyze Requirements**:
32+
- What resources need to be exposed?
33+
- What operations are needed (CRUD, custom actions)?
34+
- What authentication is required?
35+
- What are the data relationships?
36+
37+
2. **Design Endpoints**:
38+
```
39+
GET /api/v1/users # List users
40+
POST /api/v1/users # Create user
41+
GET /api/v1/users/{id} # Get user by ID
42+
PUT /api/v1/users/{id} # Update user
43+
DELETE /api/v1/users/{id} # Delete user
44+
```
45+
46+
3. **Define Request/Response Schemas**:
47+
```json
48+
{
49+
"type": "object",
50+
"properties": {
51+
"id": { "type": "string", "format": "uuid" },
52+
"name": { "type": "string", "minLength": 1 },
53+
"email": { "type": "string", "format": "email" },
54+
"createdAt": { "type": "string", "format": "date-time" }
55+
},
56+
"required": ["name", "email"]
57+
}
58+
```
59+
60+
4. **Generate OpenAPI Specification**:
61+
```yaml
62+
openapi: 3.0.3
63+
info:
64+
title: User API
65+
version: 1.0.0
66+
paths:
67+
/users:
68+
get:
69+
summary: List all users
70+
responses:
71+
'200':
72+
description: Successful response
73+
content:
74+
application/json:
75+
schema:
76+
type: array
77+
items:
78+
$ref: '#/components/schemas/User'
79+
```
80+
81+
### Design Principles
82+
83+
1. **Resource-Oriented**: Design around resources, not actions
84+
2. **Consistent Naming**: Use plural nouns for collections
85+
3. **Proper HTTP Methods**: GET (read), POST (create), PUT (update), DELETE (remove)
86+
4. **Status Codes**: 200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error
87+
5. **Versioning**: Include version in URL path (/api/v1/)
88+
6. **Pagination**: Support limit/offset or cursor-based pagination
89+
7. **Filtering**: Allow query parameters for filtering results
90+
91+
### Error Response Format
92+
93+
```json
94+
{
95+
"error": {
96+
"code": "VALIDATION_ERROR",
97+
"message": "Invalid input data",
98+
"details": [
99+
{ "field": "email", "message": "Invalid email format" }
100+
]
101+
}
102+
}
103+
```
104+
105+
## Tags
106+
`api`, `rest`, `openapi`, `swagger`, `design`, `documentation`
107+
108+
## Compatibility
109+
- Codex: ✅
110+
- Claude Code: ✅

0 commit comments

Comments
 (0)