Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Architecture Guardian

ASecurity

Prevent AI coding agents from introducing architecture drift. Use before non-trivial features, refactors, cross-module fixes, new services, repositories, validators, state stores, dependencies, schema changes, public API changes, or edits governed by a change contract. Architecture Guardian provides bounded discovery, reuse-first search, dependency rules, reviewed baselines, short-lived change contracts, scoped expiring exceptions, deterministic reports, and optional strict gates.

4 stars
0 votes
0 copies
0 views
Added 9/22/2026
developmentrustgobashgitapisecuritydocumentation

Works with

api

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add imMamdouhaboammar/agent-kernel --skill architecture-guardian --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Architecture Guardian?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Architecture Guardian
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/immamdouhaboammar-architecture-guardian-71383cc6/badge)](https://www.skillsdirectory.com/skills/immamdouhaboammar-architecture-guardian-71383cc6)

More formats (shields.io, HTML) on the badges page.

Download with Pro
Files
SKILL.md
---
name: architecture-guardian
description: |
  Prevent AI coding agents from introducing architecture drift. Use before non-trivial features,
  refactors, cross-module fixes, new services, repositories, validators, state stores, dependencies,
  schema changes, public API changes, or edits governed by a change contract. Architecture Guardian
  provides bounded discovery, reuse-first search, dependency rules, reviewed baselines, short-lived
  change contracts, scoped expiring exceptions, deterministic reports, and optional strict gates.
---

# Architecture Guardian

Architecture Guardian is Agent Kernel's local conformance workflow for AI-assisted code changes. It separates existing debt from new regressions, requires reuse evidence before parallel abstractions, and keeps implementation inside a reviewed task boundary.

## Activate this skill when

- a feature spans more than one module or layer
- a refactor changes dependencies or public interfaces
- a new service, repository, adapter, hook, validator, state store, or utility is proposed
- a package, schema, migration, provider integration, or deployment boundary changes
- a change contract already exists
- the user asks to prevent architecture drift, cycles, duplicate sources of truth, or out-of-scope edits
- CI reports Architecture Guardian findings

Do not require a full contract for a trivial typo or isolated documentation correction unless project policy explicitly requires it.

## Required workflow

### 1. Read project governance

Read `AGENTS.md`, relevant agent instructions, and `.agent-kernel/architecture/policy.json` when present. Do not infer policy from a roadmap or an old report.

### 2. Validate current state

```bash
agent-kernel architecture doctor . --json
agent-kernel architecture policy validate . --json
```

If policy or stored architecture state is malformed, stop and repair the state before enforcing it.

### 3. Discover the current structure

```bash
agent-kernel architecture discover . --json
```

Use the discovered map to identify source roots, layers, internal edges, external packages, cycles, and importer evidence. Discovery reads bounded source files; it does not execute repository code.

### 4. Search reuse candidates

Before creating a capability:

```bash
agent-kernel architecture reuse "<business capability>" . --json
```

Review symbols and files with adjacent responsibility. Do not create a parallel source of truth just because an existing abstraction has a different name.

### 5. Establish the task boundary

For non-trivial work:

```bash
agent-kernel architecture contract init . \
  --task "<reviewed task>" \
  --owner "<domain or team>" \
  --allow "src/area/**,test/area/**" \
  --expect "src/area/file.ts,test/area/file.test.ts" \
  --dependencies "<new packages, if any>" \
  --tests "<observable behavior>"

agent-kernel architecture contract validate . --json
```

The contract should be narrow enough to detect drift and broad enough to complete the reviewed task. Do not silently add unrelated directories.

### 6. Implement inside scope

Keep business rules in the reviewed domain layer. Use public interfaces rather than reaching into infrastructure internals. Preserve one source of truth for each rule.

A Claude `PreToolUse` hook can enforce Write, Edit, and MultiEdit scope. Review mode reports; strict mode denies.

### 7. Check before commit

```bash
agent-kernel architecture check . --json
```

For an intentionally enforced project:

```bash
agent-kernel architecture check . --strict --json
```

Classify every finding:

- new deterministic blocker
- existing baseline debt
- covered by a valid scoped exception
- semantic review hint
- false positive that requires policy or detector correction

Do not hide a critical violation behind an aggregate score.

### 8. Close or update reviewed state

Close the contract after the task is complete:

```bash
agent-kernel architecture contract close . --json
```

Update a baseline only after reviewing existing findings. A baseline is not an ignore file.

## Hard rules

- Do not create a second source of truth without evidence that responsibilities differ.
- Do not move business rules into transport, UI, persistence, provider, or framework layers.
- Do not bypass an existing public interface to access infrastructure directly.
- Do not add a dependency outside the reviewed layer graph or active contract.
- Do not broaden a contract because implementation drifted.
- Do not suppress findings without rule, scope, reason, owner, and expiry.
- Do not treat an expired exception as authorization.
- Do not attribute baseline findings to the current change.
- Do not block on low-confidence semantic guesses; report them for review.
- Do not weaken policy to make a single PR green without user review.

## Baselines

Create a baseline only after discovery and review:

```bash
agent-kernel architecture baseline . --json
agent-kernel architecture diff . --json
```

A baseline records reviewed existing findings and package/import evidence. New blockers remain distinguishable from old debt.

## Exceptions

```bash
agent-kernel architecture exception add . \
  --rule no-cycles \
  --files "src/legacy/**" \
  --reason "Migration is split across two reviewed releases" \
  --owner platform \
  --expires "2026-12-31T00:00:00.000Z"

agent-kernel architecture exception list . --json
agent-kernel architecture exception revoke . <exception-id>
```

Exceptions must be narrow, owned, and expiring. Prefer fixing the architecture or detector over creating long-lived exemptions.

## Review and strict modes

Review mode is the adoption default. It reports candidate blockers without preventing work.

Strict mode returns a nonzero exit for new blocking violations. Enable it only after policy, baseline, contract, and exceptions are trustworthy.

The hook override is explicit:

```bash
AGENT_KERNEL_ARCHITECTURE_MODE=review agent-kernel architecture check . --json
AGENT_KERNEL_ARCHITECTURE_MODE=strict agent-kernel architecture check . --json
```

## Failure handling

When an architecture check exposes a repeated agent mistake:

```bash
agent-kernel failure capture \
  --from <agent> \
  --type architecture-failure \
  --command "agent-kernel architecture check . --strict --json" \
  --exit-code 2 \
  --text "<redacted finding>" \
  --root-cause "<supported cause>" \
  --fix "<verified correction>"
```

Promote a reusable lesson through the normal proposal and approval flow. Do not mutate policy automatically from one finding.

## Output expectations

A complete Architecture Guardian response should state:

- policy and contract state inspected
- reuse candidates considered
- files and layers changed
- new dependencies requested or rejected
- baseline versus new findings
- tests and architecture checks run
- exceptions used, including owner and expiry
- remaining review hints or limitations

## References

Read only the focused reference needed for the task:

- `references/workflow.md`
- `references/policy-model.md`
- `references/change-contracts.md`
- `references/baselines.md`
- `references/exceptions.md`
- `references/reuse-first.md`
- `references/hooks.md`
- `references/false-positive-control.md`
- `references/language-support.md`
- `references/ci-and-gates.md`
- `references/evaluation.md`
- `references/threat-model.md`

Canonical docs:

- [Architecture Guardian](https://github.com/imMamdouhaboammar/agent-kernel/blob/master/docs/ARCHITECTURE_GUARDIAN.md)
- [Command reference](https://github.com/imMamdouhaboammar/agent-kernel/blob/master/docs/architecture-guardian/COMMAND_REFERENCE.md)
- [Security boundary](https://github.com/imMamdouhaboammar/agent-kernel/blob/master/docs/architecture-guardian/SECURITY.md)

Attribution

imMamdouhaboammarimMamdouhaboammar
View sourceMore from imMamdouhaboammar →
SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Know which skills are safe — weekly.

Best new skills + every skill we flagged as malicious. From the team that scanned 103,619.

Join free

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284072 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →