← Back to Skills Marketplace
peterhiroshi

Aegis Quality Guardian

by PeterHiroshi · GitHub ↗ · v1.4.0 · MIT-0
cross-platform ✓ Security Clean
179
Downloads
1
Stars
0
Active Installs
5
Versions
Install in OpenClaw
/install aegis-quality-guardian
Description
AI Development Quality Guardian — contract-driven, design-first quality guardrails for AI-assisted full-stack development. Five-layer defense: Design → Contr...
README (SKILL.md)

Aegis — AI Development Quality Guardian

Five-layer defense for AI-assisted software development.

Modes

Lite Mode (Default for small tasks)

  • Design Brief only → straight to implementation
  • Use when: solo dev, single-service feature, quick fix

Full Mode (Multi-service / team projects)

  • Complete contract-first workflow
  • Use when: multiple API boundaries, team collaboration, complex features

Phase 0: Workspace Architecture Detection

Before starting the Aegis workflow, detect the project architecture to choose the right contract strategy.

Auto-Detection

Scan the workspace for indicators:

  • Both frontend//client//web/ AND backend//server//api/ directories → Monorepo
  • package.json with workspaces containing both frontend and backend → Monorepo
  • Only one side present (pure frontend or pure backend) → Split Workspace

If Split Workspace detected, ask the human:

Detected: This workspace contains only {frontend|backend} code.
Where does the other side live?

(a) Another repo managed by the same agent (I can access it)
(b) Another repo managed by a different agent/workspace (I cannot access it)
(c) This is actually a monorepo (I missed something)

Architecture Modes

Mode Contract Location Sync Method
Monorepo contracts/ in project root Direct (same repo)
Multi-Repo, Single Agent Lead workspace's contracts/, copied to each repo Copy before dispatch
Cross-Agent, Cross-Workspace Dedicated contract repository Git submodule / package / lead copy-sync

Cross-Workspace: Contract lives in an independent Git repo. Each agent's workspace integrates it as read-only. Contract Change Requests go through the Lead who has merge rights. See references/multi-agent-protocol.md for the full protocol.


Phase 1: Design

Before any non-trivial feature, create a Design Brief:

  1. Read templates/design-brief.md for the template
  2. Fill in: Problem Statement, Architecture Overview, Key Decisions, Module Boundaries, API Surface, Known Gaps, Testing Strategy
  3. Submit for human review
  4. Gate: Do not proceed to Phase 2 until Design Brief is approved

Lite Mode stops here — proceed to Phase 3 after Design Brief approval.

Phase 2: Contract (Full Mode)

Define the API contract before writing implementation code:

  1. Create/update contracts/api-spec.yaml (OpenAPI 3.1) — use templates/api-spec-starter.yaml as base
  2. Create/update contracts/shared-types.ts — use templates/shared-types-starter.ts as base
  3. Create/update contracts/errors.yaml — use templates/errors-starter.yaml as base
  4. Run bash scripts/validate-contract.sh \x3Cproject-path> to check consistency
  5. Gate: Contracts must be reviewed before implementation begins

Reference: references/contract-first-guide.md for the full contract-first methodology.

Phase 3: Implementation

Pre-Coding Checklist (EVERY TIME before writing code)

  1. Check if contracts/ exists in the project root
  2. If yes: read contracts/api-spec.yaml, contracts/errors.yaml, contracts/shared-types.ts
  3. Read CLAUDE.md for project-specific constraints
  4. If a Design Brief exists for your task: read docs/designs/ relevant file

Hard Rules (violation = PR rejected)

R1: Contract is the truth

  • All API responses MUST conform to contracts/api-spec.yaml
  • Response shapes, status codes, field names — all from the spec

R2: Shared types — import, never redefine

  • import { User, ApiResponse } from '../contracts/shared-types'
  • NEVER create local types that shadow contract types
  • If shared-types doesn't have what you need → file a Change Request (R5)

R3: Error codes from registry only

  • Use codes defined in contracts/errors.yaml
  • Never invent ad-hoc error codes
  • Need a new code → file a Change Request (R5)

R4: Contract tests mandatory

  • Every new API endpoint MUST have a contract test
  • Contract test = validate real response against OpenAPI spec schema
  • Modified endpoints → update contract test

R5: Never modify contracts directly If the contract needs changes:

  1. Create docs/contract-changes/CHANGE-{date}-{description}.md
  2. Include: what, why, which modules affected
  3. Continue implementing with the CURRENT contract
  4. Human reviews and updates the contract

R6: CLAUDE.md constraints

  • Read and follow all ⛔ Hard Constraints in CLAUDE.md
  • These are project-specific and override general preferences

R7: Pre-commit checks are mandatory

  • Run lint → type-check → format-check → contract validation before committing
  • After ALL code changes, run formatters as a final step
  • Never bypass with --no-verify

Quick Reference

Situation Action
Need a new endpoint Check api-spec.yaml first
Need a new type Check shared-types.ts → if missing, Change Request
Need a new error code Check errors.yaml → if missing, Change Request
API response doesn't match spec Fix code, not spec
Spec seems wrong Change Request, implement per current spec
No contracts/ directory Hard rules don't apply — standard development

Phase 4: Verification

After implementation, validate quality:

  1. Run contract tests — bash scripts/validate-contract.sh \x3Cproject-path>
  2. Run frontend tests — pnpm test (if frontend exists)
  3. Run backend integration tests — HTTP E2E against real server + real DB
  4. Generate gap report — bash scripts/gap-report.sh \x3Cproject-path>
  5. Review: are all Design Brief items implemented?
  6. Review: do all endpoints have contract + integration tests?
  7. Gate: All tests must pass before PR/MR

Testing Hierarchy

E2E Test          ← Playwright (real browser + real backend)
Integration Test  ← Real HTTP server + real DB (no mocks)
Contract Test     ← Validate against api-spec.yaml (NO mocking the contract)
Frontend Test     ← Vitest + React Testing Library + MSW (contract-typed mocks)
Unit Test         ← Mock external deps, test pure logic

Frontend Testing (when project has frontend)

  • Stack: Vitest + React Testing Library + MSW
  • Required coverage: API clients (normal/error/auth), data hooks (loading/success/error), key components
  • MSW handlers: must mock every backend endpoint with data matching contracts/shared-types.ts
  • CI gate: pnpm test must pass — same blocking power as backend tests

Backend Integration Testing (HTTP E2E)

  • Every endpoint must have: happy path (200) + bad request (400) + not found (404) + auth failure (401)
  • Real database — isolated test DB, not mocks. Transactions or migrations for clean state.
  • Mutation verification — POST/PUT/DELETE → GET to confirm state change
  • CI pipeline: lint → type-check → unit → frontend-test → contract → integration → route-coverage → build → E2E

Consumer-Driven Route Coverage

Integration tests must cover what the frontend calls, not just what the backend implements.

  • Full mode: verify-route-coverage.sh cross-references frontend API calls with backend routes. Every consumer route needs a backend handler + integration test.
  • Degraded mode: If no frontend manifest or scannable frontend code exists, CI warns but does not fail. Provider-driven tests remain the baseline.
  • Cross-workspace: Frontend agent exports consumer-routes.yaml to the contract repo. Backend CI validates coverage against it.
  • Route manifest: contracts/route-manifest.yaml — declares every API route the frontend consumes. Auto-generated or manual.

Run after integration tests in CI:

bash scripts/verify-route-coverage.sh \x3Cproject-path>

Test Strategy = Design Artifact

Full-stack features require a complete testing strategy in the Design Brief before coding begins.

Reference: references/testing-strategy.md for the full testing pyramid and standards.

Phase 5: PM

Track progress and enforce quality gates:

  1. Update docs/designs/\x3Cfeature>/implementation-summary.md — use templates/implementation-summary.md
  2. Mark Design Brief items as completed
  3. Note any contract Change Requests filed during implementation
  4. Release readiness check: all gates passed?

Project Setup

Initialize Aegis in any project:

bash scripts/init-project.sh /path/to/project

This creates:

  • contracts/ — API spec, shared types, error codes (stack-aware)
  • docs/designs/ — for Design Briefs
  • .aegis/ — portable validation scripts
  • CLAUDE.md — from Aegis template (if not existing)
  • docker-compose.integration.yml — auto-detects your database

Set up guardrails (pre-commit hooks + CI):

bash scripts/setup-guardrails.sh /path/to/project --ci github  # or --ci gitlab

Multi-Agent Protocol

When multiple agents work on the same project:

  • Each agent reads contracts before starting
  • Contracts are the synchronization point — not code
  • Change Requests prevent concurrent contract modifications

Cross-Workspace: When agents operate in separate workspaces, contract lives in a dedicated repository. Each agent integrates via submodule/package/copy-sync and treats contracts/ as read-only. Integration testing is orchestrated externally.

Reference: references/multi-agent-protocol.md

File Structure

~/.claude/skills/aegis/          # ← You are here (CC skill)
├── SKILL.md                     # This file
├── templates/                   # Project templates
│   ├── design-brief.md
│   ├── claude-md.md
│   ├── api-spec-starter.yaml
│   ├── shared-types-starter.ts
│   ├── errors-starter.yaml
│   ├── contract-test-example.ts
│   ├── docker-compose.integration.yml
│   ├── implementation-summary.md
│   └── route-manifest-starter.yaml  # Consumer route manifest template
├── scripts/                     # Automation
│   ├── init-project.sh          # Initialize Aegis in a project
│   ├── setup-guardrails.sh      # Pre-commit + CI setup
│   ├── detect-stack.sh          # Auto-detect language/framework
│   ├── validate-contract.sh     # Validate contract consistency
│   ├── gap-report.sh            # Design Brief vs implementation gaps
│   ├── generate-types.sh        # Generate types from OpenAPI spec
│   └── verify-route-coverage.sh # Consumer-driven route coverage check
└── references/                  # Deep-dive guides
    ├── contract-first-guide.md
    ├── testing-strategy.md
    └── multi-agent-protocol.md
Usage Guidance
This skill appears to do what it says: it will scan your repo and create guardrail files (contracts/, .aegis/, pre-commit hook, CI workflows, docker-compose) and run common tools (npx, python3/pip). Before installing/running: review the scripts (especially init-project.sh and setup-guardrails.sh), run them in a copy or disposable branch first, and confirm you are comfortable with added files and the pre-commit hook (you can bypass commits with --no-verify). Note that type generation uses npx/pip which will fetch packages from public registries — ensure that is acceptable in your environment.
Capability Analysis
Type: OpenClaw Skill Name: aegis-quality-guardian Version: 1.4.0 The Aegis Quality Guardian is a comprehensive framework designed to enforce contract-first development and quality guardrails in AI-assisted projects. The bundle contains scripts for project initialization (`init-project.sh`), stack detection (`detect-stack.sh`), and the automated setup of pre-commit hooks and CI/CD pipelines (`setup-guardrails.sh`). While the scripts perform high-risk operations such as installing dependencies via `pip` and `npx`, and writing to `.git/hooks`, these actions are transparently documented and directly support the tool's stated purpose of enforcing code quality. The instructions in `SKILL.md` provide a structured workflow for AI agents without any indicators of malicious prompt injection or unauthorized data access.
Capability Assessment
Purpose & Capability
Name/description (contract-first guardrails for AI development) matches the provided scripts and templates: detect-stack, init-project, setup-guardrails, contract validation and type generation. The resources requested (filesystem access, project files) are expected for this purpose; no unrelated cloud credentials or unexpected binaries are required.
Instruction Scope
SKILL.md and the scripts instruct the agent to scan the entire repository (package.json, tsconfig, Dockerfiles, docs/designs/, contracts/) and to read/write project files (.aegis/, contracts/, .git/hooks, .github/workflows). This is appropriate for a guardrails tool but is intrusive: it will create files, install pre-commit hooks, and add CI workflows. The scripts also run generation/validation commands (npx, python3/pip) when invoked — review before running in a sensitive repo.
Install Mechanism
There is no external install spec for the skill itself (instruction-only). The included scripts rely on common package managers (npx/openapi-typescript, pip/pyyaml) and standard public images in docker-compose. There are no downloads from personal servers, URL shorteners, or IP addresses. The scripts may auto-install Python package pyyaml (pip) or run npx which fetches npm packages on demand — expected for type generation but worth noting.
Credentials
The skill declares no required environment variables or credentials. Scripts generate docker-compose files with default 'test' DB credentials for local integration testing (e.g., POSTGRES_USER/POSTGRES_PASSWORD=test) — these are default test values and not secret exfiltration. No broad or unrelated secret access is requested.
Persistence & Privilege
The skill does write files into the project (templates, .aegis scripts, pre-commit hook, CI config) and installs a pre-commit hook if .git is present; this is consistent with its stated role. It does not request platform-level 'always' inclusion nor modify other skills. Installing hooks/CI is invasive by design but proportionate.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install aegis-quality-guardian
  3. After installation, invoke the skill by name or use /aegis-quality-guardian
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.4.0
Consumer-Driven Contract Testing + Cross-Repo Route Coverage + Degradation Strategy
v1.3.1
Testing strategy overhaul: concrete code examples (Vitest+RTL+MSW, Go httptest, TS supertest), language-specific tool table, coverage matrix template, Design Brief template with structured testing section, standardized CI pipeline order
v1.3.0
Frontend Testing Standard (Vitest+RTL+MSW, mandatory CI gate) + Backend HTTP E2E Standard (real server+DB, per-endpoint coverage matrix) + Test Strategy as Design Review gate
v1.2.0
CC Skill synced: Phase 0 Workspace Architecture Detection (auto-detect monorepo/split/cross-agent), Cross-Workspace Contract Protocol (dedicated contract repo, submodule/package/copy-sync integration), cross-workspace dispatch template, test isolation strategy
v1.1.0
v1.1.0: Self-contained CC skill package. Five-layer defense (Design → Contract → Implementation → Verification → PM) for AI-assisted full-stack development. 8 templates, 6 scripts, 3 references.
Metadata
Slug aegis-quality-guardian
Version 1.4.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 5
Frequently Asked Questions

What is Aegis Quality Guardian?

AI Development Quality Guardian — contract-driven, design-first quality guardrails for AI-assisted full-stack development. Five-layer defense: Design → Contr... It is an AI Agent Skill for Claude Code / OpenClaw, with 179 downloads so far.

How do I install Aegis Quality Guardian?

Run "/install aegis-quality-guardian" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Aegis Quality Guardian free?

Yes, Aegis Quality Guardian is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Aegis Quality Guardian support?

Aegis Quality Guardian is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Aegis Quality Guardian?

It is built and maintained by PeterHiroshi (@peterhiroshi); the current version is v1.4.0.

💬 Comments