rules-examples

Validate example scripts in a Python project's examples directory for API adherence and runnability.

Updated May 20, 2025
One-click install
npx skills add https://github.com/flext-sh/flext --skill rules-examples
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules-examples
Source: https://github.com/flext-sh/flext/tree/main/.claude/skills/rules-examples
Command: npx skills add https://github.com/flext-sh/flext --skill rules-examples

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill ensures that example scripts within the repository remain executable and aligned with current APIs and tooling, preventing them from becoming outdated and non-functional.

Core Features & Use Cases

  • API Alignment: Verifies that example scripts use current, public APIs and avoid internal implementation details.
  • Executable Examples: Ensures examples can be run directly from the repository root.
  • Documentation Sync: Keeps references in examples/README.md synchronized with script files.
  • Use Case: When adding a new feature to flext-core, this Skill helps ensure that the corresponding examples in the examples/ directory are updated to use the new public API and remain runnable, providing immediate validation for new functionality.

Quick Start

Run make check PROJECT=flext-core to verify core imports used by examples still pass.

Frequently Asked Questions about rules-examples

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate that Python example scripts are runnable?

To validate Python example scripts, you can run `make check PROJECT=flext-core` to verify core imports and ensure the examples remain executable directly from the repository root.

Why do my Python example scripts break after updating an API?

Python example scripts break after API updates because they often use outdated internal implementation details instead of current public APIs. Validating API adherence ensures scripts align with the latest tooling.

How do I keep examples directory documentation synchronized with script files?

To keep documentation synchronized with script files in your examples directory, enforce a validation process that checks references in `examples/README.md` against the actual executable scripts.

What's the best way to test if example scripts use current public APIs?

The best way to test if example scripts use current public APIs is to run a validation check that enforces the use of current public APIs while avoiding internal implementation details.

Can I run example scripts directly from the repository root?

Yes, you can run example scripts directly from the repository root. The validation process enforces direct runnability from the root to maintain a robust set of executable code examples.