script-quality-gate

Validate Python scripts for docstrings, argparse, __main__, logging, and import conventions.

45|13|Updated May 11, 2023
One-click install
npx skills add https://github.com/Open-Earth-Foundation/CityCatalyst --skill script-quality-gate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: script-quality-gate
Source: https://github.com/Open-Earth-Foundation/CityCatalyst/tree/main/.cursor/skills/script-quality-gate
Command: npx skills add https://github.com/Open-Earth-Foundation/CityCatalyst --skill script-quality-gate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures runnable Python scripts and CLI entrypoints adhere to documented standards, preventing ambiguity and drift in project codebases.

Core Features & Use Cases

  • Docstring enforcement: require a top-level module docstring describing purpose and usage.
  • Argparse & CLI consistency: ensure command-line interfaces follow the project's conventions and provide helpful --help output.
  • main entrypoint & logging: verify presence of a main() guard and proper logging configuration.
  • Use Case: When adding a new script or modifying an existing CLI, run this skill to validate structure, naming, and packaging.

Quick Start

Run the gate against a new or updated script to verify docstrings, argparse, main, and logging conventions are satisfied.

Frequently Asked Questions about script-quality-gate

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

FAQPage Schema
How do I enforce Python script quality standards for docstrings and argparse?

Enforce Python script quality by validating module docstrings, argparse usage, __main__ entrypoints, and logging configuration. This ensures runnable scripts adhere to project conventions and prevents codebase drift.

What does a Python CLI script need to pass a code quality gate?

To pass a code quality gate, a Python CLI script must have a top-level module docstring, a parse_args function, a main function guard, proper logging setup, and correct import paths.

Can I check argparse consistency and __main__ entrypoints for new Python scripts?

Yes, you can check argparse consistency and __main__ entrypoints for new Python scripts. The validation verifies CLI conventions, provides helpful --help output, and confirms the presence of a main() guard.

Why do I need a module docstring and logging setup in my Python CLI?

You need a module docstring and logging setup in your Python CLI to prevent ambiguity and codebase drift. These standards ensure scripts describe their purpose and handle execution logs correctly.

Does this quality gate work with existing scripts or only new Python code?

This quality gate works with both new scripts and changes to existing runnable scripts or CLI flags across Python projects. It validates structure, naming, and packaging conventions in either case.