check-doc-examples

Validate code examples in documentation by checking that class names, method signatures, namespaces, and imports match the actual codebase, and detect outdated or misleading examples.

Last repository push
GitHub Stars
109
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "check-doc-examples" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7d2c5272f50d874b1d323d472b04165f7a16ad18d576524d6dc491ca1776d8d0. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Validate code examples in documentation by checking that class names, method signatures, namespaces, and imports match the actual codebase, and detect outdated or misleading examples.

0 Downloads

Introduction source: third_party · dykyi-roman · 0.0.1 Reference

SkillPi interpretation

Tasks
Verifies code examples in documentation. Checks that class names, method signatures, namespaces, and imports match actual codebase. Detects outdated and misleading examples.
Inputs and outputs
```markdown
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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 |

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供文档代码示例验证功能,能检测类名、方法签名、命名空间和导入是否与实际代码库匹配
  • 识别过时和误导性示例,适用于大型项目或团队协作场景,能有效提升文档质量和开发效率
Trigger Precision95/100

Highlights

  • description 明确描述了 Skill 的功能是验证文档中的代码示例
  • 详细说明了检查内容和目标,触发词精准完整,边界清晰
Structure and Standards95/100

Highlights

  • 结构清晰,包含多个 Phase,每个 Phase 都有详细的步骤划分和具体示例
  • frontmatter 完整,单文件未超过 500 行
Execution Reliability90/100

Highlights

  • 提供了具体的检测模式和验证流程,包括提取代码块、验证类引用、方法签名、导入路径和构造函数参数等步骤
  • 工具来源明确,参数正确,覆盖了主要异常情况,并提供了严重性分类和输出格式
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.