guardrail

Generate custom ESLint and ast-grep lint rules for architectural standards.

13|3|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/phrazzld/agent-skills --skill guardrail
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guardrail
Source: https://github.com/phrazzld/agent-skills/tree/main/core/guardrail
Command: npx skills add https://github.com/phrazzld/agent-skills --skill guardrail

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill automates the enforcement of architectural decisions and coding standards by generating custom lint rules, preventing violations at the source.

Core Features & Use Cases

  • Custom Lint Rule Generation: Creates ESLint rules for JS/TS or ast-grep rules for any language.
  • Enforce Boundaries & Conventions: Codifies rules like import restrictions, API naming, or deprecated pattern blocking.
  • Use Case: Ensure all database interactions are routed through a specific repository layer by generating a lint rule that flags any direct imports from the database module.

Quick Start

Generate an ESLint rule to enforce that all API routes must start with '/api/v1'.

Frequently Asked Questions about guardrail

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

FAQPage Schema
How do I enforce architectural boundaries and prevent direct imports from specific modules?

To enforce architectural boundaries, you can generate custom lint rules that flag direct imports from specific modules. This ensures interactions are routed through designated layers, like a repository layer, preventing violations directly at the source code level.

Can I use ast-grep to create lint rules for languages other than JavaScript and TypeScript?

Yes, you can use ast-grep to create lint rules for languages other than JavaScript and TypeScript. This approach allows you to codify architectural patterns and coding standards across various programming languages within your codebase.

How do I codify API naming conventions into automated ESLint rules?

You can codify API naming conventions into automated ESLint rules by generating custom rules that enforce specific patterns. For example, you can create a rule to ensure all API routes must start with a specific prefix like '/api/v1'.

What is the best way to block deprecated coding patterns automatically in a CI/CD pipeline?

The best way to block deprecated coding patterns automatically is by generating custom lint rules and integrating them into your CI/CD pipelines and pre-commit hooks. This prevents non-compliant code from being merged or committed.

Do I need to write automated tests for custom ESLint rules generated for my codebase?

Yes, the generation of custom lint rules includes automated testing. This ensures the rules accurately detect violations of your architectural decisions and coding standards without producing false positives or unintended errors.

How does codifying architectural patterns into lint rules compare to standard linting configurations?

Codifying architectural patterns into lint rules goes beyond standard linting configurations by enforcing project-specific import boundaries, API conventions, and deprecated pattern blocking, rather than just checking generic syntax and code formatting standards.