Agent skill

guardrails

Pre-flight checklist and post-implementation self-review protocol. Use before generating any code (pre-flight) and after writing code but before verification (self-review) to catch issues early.

Stars 129
Forks 45

Install this agent skill to your Project

npx add-skill https://github.com/irahardianto/awesome-agv/tree/main/.agents/skills/guardrails

SKILL.md

Agent Guardrails Skill

Purpose

Structured checklists that ensure the agent considers all applicable rules before and after writing code. Catches issues that would otherwise only surface during verification.

When to Invoke

  • Pre-Flight: At the start of Phase 2 (Implement), before writing any code
  • Self-Review: At the end of Phase 2 (Implement), after writing code but before Phase 3/4

Pre-Flight Checklist

Run through this checklist before writing any code:

  • Identified all applicable rules from .agents/rules/
  • Searched for existing patterns in codebase (Pattern Discovery Protocol from architectural-pattern.md)
  • Confirmed project structure alignment (project-structure.md)
  • Identified I/O boundaries that need abstraction
  • Determined test strategy (unit/integration/E2E)
  • Reviewed rule-priority.md for any potential conflicts

If any item cannot be checked, stop and resolve before proceeding.


Post-Implementation Self-Review

Run through this checklist after writing code, before verification:

Security

  • No hardcoded secrets or configuration values
  • All user input validated at system boundaries
  • Parameterized queries (no string concatenation for SQL)

Testability

  • All I/O operations behind interfaces/abstractions
  • Business logic is pure (no side effects in calculations)
  • Dependencies injected, not hardcoded

Observability

  • All public operation entry points logged (start/success/failure)
  • Structured logging with correlation IDs
  • Appropriate log levels (not everything is INFO)

Error Handling

  • Error paths handled explicitly (no empty catch blocks)
  • Errors provide context (wrapped with additional info)
  • Resources cleaned up in error paths (defer/finally)

Testing

  • Tests cover happy path
  • Tests cover at least 2 error paths
  • Tests cover edge cases relevant to the domain
  • If I/O adapters were modified: integration tests exist and pass
  • If UI was modified: E2E tests exist (or Phase 3.5 is planned)

Consistency

  • Follows existing codebase patterns (>80% consistency)
  • Naming conventions match the codebase
  • File organization matches project-structure.md

Language-Specific Self-Review

After completing the universal checklist above, load the relevant language-specific checklist:

Language Checklist
Go languages/go.md
TypeScript languages/typescript.md (placeholder — create when needed)
Flutter/Dart languages/flutter.md (placeholder — create when needed)
Rust languages/rust.md (placeholder — create when needed)

Only load the file for languages you are actively writing. If the file doesn't exist yet, skip — but flag its absence so it can be created.


Rule Compliance

This skill enforces:

  • All mandates (always-on rules)
  • Architectural Patterns @architectural-pattern.md
  • Testing Strategy @testing-strategy.md
  • Rule Priority @rule-priority.md

Expand your agent's capabilities with these related and highly-rated skills.

irahardianto/awesome-agv

code-review

Structured code review protocol for inspecting code quality against the full rule set. Use when auditing code written by yourself or another agent, during the /audit workflow, or when the user asks for a code review.

129 45
Explore
irahardianto/awesome-agv

mobile-design

Generates distinctive, production-grade mobile interfaces for Flutter and React Native. Prioritizes platform-native patterns, adaptive layouts, and fluid motion. Use when building mobile apps, screens, widgets, or when the user requests to style or create visually striking mobile UI.

129 45
Explore
irahardianto/awesome-agv

perf-optimization

Profile-driven performance optimization protocol. Use when profiling data (CPU, heap, trace) is available or when the user requests performance analysis. Covers methodology, pattern catalog, safety invariants, and when-to-stop heuristics. Language-specific tooling is in languages/*.md.

129 45
Explore
irahardianto/awesome-agv

adr

Architecture Decision Record skill for documenting significant architectural decisions with context, options, and consequences. Use during the Research phase when choosing between approaches, or whenever the user asks to document an architectural decision.

129 45
Explore
irahardianto/awesome-agv

frontend-design

Generates distinctive, production-grade frontend interfaces and artifacts (React, Vue, HTML/CSS). Prioritizes bold aesthetics, unique typography, and motion to avoid generic designs. Use when building websites, landing pages, dashboards, posters, or when the user requests to style, beautify, or create visually striking UI.

129 45
Explore
irahardianto/awesome-agv

debugging-protocol

Comprehensive protocol for validating root causes of software issues. Use when you need to systematically debug a complex bug, flaky test, or unknown system behavior by forming hypotheses and validating them with specific tasks.

129 45
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results