rules-scripts

Enforce coding standards for shell and Python scripts using ast-grep.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the enforcement of coding standards and best practices for shell and Python scripts, ensuring consistency, maintainability, and reliability across the codebase.

Core Features & Use Cases

  • Automated Linting: Applies predefined rules to identify common errors and anti-patterns in scripts.
  • Best Practice Enforcement: Ensures scripts adhere to security, style, and operational guidelines.
  • Use Case: Before merging a new script, run make validate to automatically check for strict mode, proper shebangs, and Python main guards, preventing potential runtime errors and improving code quality.

Quick Start

Run make validate to check all scripts in the repository against defined rules.

Frequently Asked Questions about rules-scripts

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

FAQPage Schema
How do I enforce best practices for shell and Python scripts in a CI/CD pipeline?

Automated linting enforces best practices for shell and Python scripts in a CI/CD pipeline by applying predefined rules to identify common errors and anti-patterns. This ensures consistency, maintainability, and reliability across the codebase.

What's the best way to automatically check bash scripts for proper shebangs and strict mode?

Automated code reviews check bash scripts for proper shebangs and strict mode using static analysis with ast-grep. Running validation commands ensures scripts adhere to specific rule sets, preventing potential runtime errors.

How does static analysis identify anti-patterns in Python scripts?

Static analysis identifies anti-patterns in Python scripts by applying predefined rules to check for proper main guards and coding standards. This automated linting ensures adherence to security, style, and operational guidelines.

Can I run automated linting for scripts before merging new code?

Yes, you can run automated linting for scripts before merging by executing validation commands like `make validate`. This automatically checks all scripts in the repository against defined rules to prevent potential runtime errors.

Do I need ast-grep to enforce coding standards in my repository?

Yes, you need ast-grep to enforce coding standards in your repository. It provides the static analysis required to ensure scripts adhere to specific rule sets for bash and Python, maintaining code quality and consistency.

Why does automated code review fail on missing Python main guards?

Automated code review fails on missing Python main guards because strict rule sets require them to ensure proper script execution. This best practice enforcement prevents potential runtime errors and improves overall code quality.