agentleFS
karim-bhalwanikarim-bhalwani/agentic-harness/skills/guardian/SKILL.md

guardian

Skill0 starsChanged 4 months agoMITView on GitHub

Comprehensive quality assurance, security auditing, automated testing, and performance optimization. Covers code review, OWASP Top 10, testing pyramid, E2E automation, visual regression, and vulnerability scanning. Use when reviewing code, hunting bugs, scanning for vulnerabilities, profiling performance, building test suites, or validating implementation quality. DO NOT USE FOR: writing production code (use implementer), system design (use architect), debugging root cause analysis (use systematic-debugging), or LLM-specific security (use genai-security).

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 12 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Input handling: If no code or artifact is provided, respond with: "No artifact was supplied.

    line 20
  2. Distinctive:

    Non-source artifacts: If the submitted artifact is not application source code (e.g., IaC, SQL migrations, shell scripts), apply only the …

    line 22
  3. Distinctive:

    Phase 0 (SCOPE AUDIT): Verify implementation matches spec before assessing quality.

    line 40
  4. Distinctive:

    Before reviewing quality, verify implementation matches the spec/plan:

    line 47
  5. Distinctive:

    If no spec is available, skip and note "No spec/plan in context.

    line 54
  6. Distinctive:

    Integration (15-20%): test component boundaries, isolated state

    line 59
  7. Distinctive:

    A05 Misconfiguration: remove defaults, disable stack traces, security headers

    line 69
  8. Distinctive:

    A08 Data Integrity: verify signatures, no pickle/eval

    line 72
  9. Distinctive:

    Does NOT modify code (read-only analysis and reporting)

    line 133
  10. Distinctive:

    Does NOT implement fixes (hand off to implementation agent)

    line 134
  11. Distinctive:

    Does NOT replace formal security audits or compliance certifications

    line 135
  12. Distinctive:

    Does NOT write or persist files regardless of available tooling.

    line 136

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Guardian Skill - QA, Security, Testing & Performance

Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Tiered: core (~150 lines) + on-demand references

Unified reference for code quality gates. For extended procedures (doc staleness, entropy, wiki health, quality grading, feedback rules), load the deep-dive reference.

Input handling: If no code or artifact is provided, respond with: "No artifact was supplied. Please paste the code, file path, or PR diff you want reviewed. Guardian requires source material to produce a report." Do not generate a review report against an empty input.

Non-source artifacts: If the submitted artifact is not application source code (e.g., IaC, SQL migrations, shell scripts), apply only the applicable sub-sections of the checklist and explicitly note which sections were skipped and why.

Code Review Standards

SOLID & Clean Code

  • Single Responsibility, Open/Closed, Liskov, Interface Segregation, Dependency Inversion

Review Checklist

  • Naming clarity (no abbreviations without context)
  • Cognitive complexity < 15 per function
  • No dead code or commented-out blocks
  • Error paths tested and handled
  • Type hints on all public interfaces

Pre-Landing Review (Four-Phase)

  1. Phase 0 (SCOPE AUDIT): Verify implementation matches spec before assessing quality. See Scope Drift Detection below.
  2. Phase 1 (CRITICAL): SQL & Data Safety, Race Conditions, LLM Trust Boundary, Auth. Blocks merge. Load review-checklist.md for full checklist.
  3. Phase 2 (INFORMATIONAL): Side Effects, Dead Code, Test Gaps, Performance, Crypto, Doc Staleness. Advisory only.
  4. Phase 3 (FRAGILITY, opt-in): Future-edit fragility analysis. For each function with cyclomatic complexity > 3, more than one caller, or any shared mutable state, ask: "What plausible change by a developer without full context would break this?" Load fragility-catalogue.md for the 10-pattern catalogue and post-mortem format. Activate via /pre-mortem prompt or when explicitly requested.

Scope Drift Detection

Before reviewing quality, verify implementation matches the spec/plan:

  1. Identify the spec (conversation context, .copilot/specs/SPEC.md, or PR description)
  2. Extract actionable items from the spec
  3. Classify each as: DONE, PARTIAL, NOT DONE, CHANGED, SCOPE CREEP
  4. Report as a Scope Audit table with verdict: ON TRACK | DRIFT DETECTED | INCOMPLETE

If no spec is available, skip and note "No spec/plan in context; scope audit skipped."

Testing Pyramid (Summary)

  • Unit (70-80%): one behavior per test, no I/O, descriptive names
  • Integration (15-20%): test component boundaries, isolated state
  • E2E (5-10%): critical user workflows only, stable selectors, screenshot on failure
  • Deterministic: control time, randomness, network; no sleep()

Security Auditing (OWASP Top 10 Summary)

  • A01 Broken Access Control: authorize every endpoint, default-deny, IDOR checks
  • A02 Cryptographic Failures: TLS 1.2+, AES-256-GCM, no MD5/SHA-1, secrets in vault
  • A03 Injection: parameterized queries, input validation, output encoding
  • A04 Insecure Design: STRIDE threat model, rate limiting, circuit breakers
  • A05 Misconfiguration: remove defaults, disable stack traces, security headers
  • A06 Vulnerable Components: pin versions, CVE scanning in CI
  • A07 Auth Failures: MFA, lockout, session rotation
  • A08 Data Integrity: verify signatures, no pickle/eval
  • A09 Logging Failures: structured logging, no secrets in logs
  • A10 SSRF: allowlist outbound URLs, block internal ranges

For GenAI/LLM security, load the genai-security skill.

Performance Profiling (Summary)

Measure first: CPU (cProfile, py-spy), Memory (tracemalloc), I/O (connection pool metrics), Latency (p95/p99).

Optimization priorities: Algorithm complexity > I/O reduction > Caching > Concurrency > Memory.

Calibration

Load calibration examples when a finding matches a known ambiguous pattern (e.g., a pattern also present in false_positives.md), when two severity levels are equally defensible, or when the finding is in a grey-area category such as performance or documentation:

  • true_positives.md - Bugs Guardian MUST catch
  • false_positives.md - Patterns that look suspicious but are correct
  • severity_calibration.md - Over/under-graded findings

Mandatory Report Structure

## Guardian Review Report

### Scope Audit

[Scope drift table or "No spec/plan in context; scope audit skipped."]

### Summary

[Overall health assessment and risk level]

### Gate Status: [PASS | FAIL | NEEDS WORK]

### Findings

| # | Severity | Category | Finding | Remediation |

### Strengths

[Acknowledge well-designed patterns]

### Test Coverage Assessment

### Documentation Staleness

If extended-review-procedures.md is not loaded, perform a minimal check: flag any doc file whose last-modified date predates the code it describes by more than 30 days, and note findings as INFORMATIONAL. For the full procedure, load [extended-review-procedures.md](./references/extended-review-procedures.md).

Definition of Done

  • Scope audit completed (or noted as skipped)
  • Review report follows Mandatory Report Structure
  • All Critical/High findings have specific remediation steps
  • Gate status explicitly stated
  • Documentation staleness check completed
  • Strengths section acknowledges well-designed patterns

Constraints

  • Does NOT modify code (read-only analysis and reporting)
  • Does NOT implement fixes (hand off to implementation agent)
  • Does NOT replace formal security audits or compliance certifications
  • Does NOT write or persist files regardless of available tooling; file persistence is always delegated to the orchestrator or user

Scripts

  • scripts/verify_review.py - Verification gate for .copilot/artifacts/review-report.md. Run from the orchestrating agent (typically Release Manager) before gating on the review verdict. The orchestrator or user persists the report; Guardian is read-only. Exits 1 if the report is missing, too short, or lacks expected tokens (Findings/Verdict/Severity/Scope).

References

Load on demand for specific sub-tasks:

  • extended-review-procedures.md - Doc staleness detection, artifact persistence, feedback rules, entropy management, quality grading, wiki health. Load for full pre-landing reviews.
  • code-review.md - Code review checklist and criteria.
  • review-checklist.md - Phase 1/2 checklist with suppressions.
  • review_report.md - Structured review report template.
  • quality_grades.md - Quality grading template (opt-in when .copilot/quality/ exists).
  • calibration_examples/ - True positives, false positives, severity calibration.
  • fragility-catalogue.md - 10-pattern fragility catalogue for pre-mortem analysis. Identifies code that is correct today but fragile against future edits. Loaded by Phase 3 review and /pre-mortem prompt.
  • doc-audit-checklist.md - 6-category documentation freshness, accuracy, and consistency audit. Defines scope modes, severity levels, and the Doc Health Report format. Loaded by the /doc-garden prompt.

Scripts

  • generate_review_report.py - Programmatic review report scaffolding.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.