Skip to content
Back to skills

Guardrails

ASecurity

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.

  • 157 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 5, 2026
developmentsqlrailstestingcode-reviewsecurity

Security analysis

A100/100

Scanned September 5, 2026

npx -y skills add irahardianto/antigravity-setup --skill guardrails --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Guardrails?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Guardrails
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/irahardianto-guardrails/badge)](https://www.skillsdirectory.com/skills/irahardianto-guardrails)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: guardrails
description: 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.
---

# 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
- [ ] Checked for existing structured specs (PRD/SDD/TSD/BDD/Plan) and identified applicable contracts (`CT-*`) and requirements (`REQ-*`)

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

> For universal error handling principles, see `.agents/rules/error-handling-principles.md`. Below: language-specific patterns only.
- [ ] 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 from `code-review/languages/{language}.md`. The language files contain both review anti-patterns and self-review checklists.

> Only load the file for languages you are actively writing. If a language is not listed, skip — but the universal checklist above always applies.

---

## 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…