check-doc-examples
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "check-doc-examples":https://skillpi.com/zh/skills/deepskill-7d2c5272f50d874b1d323d472b04165f7a16ad18d576524d6dc491ca1776d8d0。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
验证文档中的代码示例,检查类名、方法签名、命名空间和导入是否与实际代码库匹配,并检测过时或误导性的示例。
介绍来源: third_party · dykyi-roman · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 输入和输出
- 减记
- 实测状态
- 未测试
文件浏览
Frontmatter
name: check-doc-examples
description: Verifies code examples in documentation. Checks that class names, method signatures, namespaces, and imports match actual codebase. Detects outdated and misleading examples.Documentation Code Examples Verification
Analyze documentation for code examples that don't match the actual codebase.
Detection Patterns
1. Incorrect Class Name in Example
<!-- DOC says: -->
```php
use App\Service\OrderProcessor;
$processor = new OrderProcessor();
<!-- But actual class is App\Application\Order\ProcessOrderUseCase -->
### 2. Wrong Method Signature
```markdown
<!-- DOC says: -->
```php
$user = $repository->findByEmail($email);
<!-- But actual method signature is: -->
public function findByEmail(Email $email): ?User // Uses Email VO, not string
3. Outdated Namespace
<!-- DOC says: -->
```php
use App\Models\User; // Laravel-style
<!-- But project uses DDD structure: -->
use App\UserManagement\Domain\Entity\User;
4. Missing Required Parameters
<!-- DOC says: -->
```php
$order = Order::create($userId, $items);
<!-- But actual method requires: -->
Order::create(UserId $userId, ItemCollection $items, Currency $currency, Address $shippingAddress)
5. Deprecated API in Examples
<!-- DOC says: -->
```php
$service->process($data); // process() was renamed to execute()
<!-- Method was renamed but docs not updated -->
Verification Process
Step 1: Extract Code Blocks from Docs
# Find PHP code blocks in markdown
Grep: "```php" --glob "**/*.md" -A 20
# Find inline code references
Grep: "`[A-Z][a-zA-Z]+::[a-z]" --glob "**/*.md"
Grep: "`\\$[a-z]+->|new [A-Z]" --glob "**/*.md"
Step 2: Verify Class References
# For each class mentioned in docs, verify it exists
# Example: doc mentions "OrderProcessor"
Grep: "class OrderProcessor" --glob "**/*.php"
# Verify namespace matches
Grep: "namespace.*Order" --glob "**/*.php"
Step 3: Verify Method Signatures
# For each method call in doc examples
# Example: doc mentions "$repo->findByEmail($email)"
Grep: "function findByEmail" --glob "**/*.php"
# Compare parameter types and count
Step 4: Check Import Paths
# For each use statement in doc examples
# Example: "use App\Service\OrderProcessor"
Glob: **/Service/OrderProcessor.php
# If not found, search for actual location
Grep: "class OrderProcessor" --glob "**/*.php"
Step 5: Verify Constructor Parameters
# For each "new ClassName(...)" in docs
# Verify constructor matches
Grep: "class OrderProcessor" --glob "**/*.php" -A 20
# Check __construct parameters
Severity Classification
| Pattern | Severity |
|---|---|
| Non-existent class in install/quickstart | 🔴 Critical |
| Wrong method signature in API docs | 🔴 Critical |
| Outdated namespace in examples | 🟠 Major |
| Missing required parameters | 🟠 Major |
| Deprecated method in examples | 🟡 Minor |
| Style difference (not functional) | 🟡 Minor |
Output Format
### Code Example Mismatch: [Description]
**Severity:** 🔴/🟠/🟡
**Documentation:** `file.md:line`
**Code Reference:** `src/path/File.php:line`
**In Documentation:**
```php
// What the doc says
In Actual Code:
// What the code actually is
Fix: Update documentation to match current code.
## Summary Report Format
```markdown
## Code Examples Verification
| Metric | Count |
|--------|-------|
| Code blocks checked | X |
| Valid examples | X |
| Class name mismatches | X |
| Method signature mismatches | X |
| Namespace mismatches | X |
| Deprecated API usage | X |
### Mismatched Examples
| Doc File | Line | Reference | Issue |
|----------|------|-----------|-------|
| `README.md` | 45 | `OrderProcessor` | Class not found |
| `docs/api.md` | 78 | `findByEmail()` | Wrong parameters |当前收录版本
0.0.1
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供文档代码示例验证功能,能检测类名、方法签名、命名空间和导入是否与实际代码库匹配
- 识别过时和误导性示例,适用于大型项目或团队协作场景,能有效提升文档质量和开发效率
亮点
- description 明确描述了 Skill 的功能是验证文档中的代码示例
- 详细说明了检查内容和目标,触发词精准完整,边界清晰
亮点
- 结构清晰,包含多个 Phase,每个 Phase 都有详细的步骤划分和具体示例
- frontmatter 完整,单文件未超过 500 行
亮点
- 提供了具体的检测模式和验证流程,包括提取代码块、验证类引用、方法签名、导入路径和构造函数参数等步骤
- 工具来源明确,参数正确,覆盖了主要异常情况,并提供了严重性分类和输出格式
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。