name: alembic-guard
description: Check code against Alembic Recipe standards with alembic_code_guard and explicit files, inline code, or a current workRef with scoped files when this project has local Alembic knowledge.
Alembic Guard
Guard checks code against project Recipes. Use it after edits only when this project has a local Alembic knowledge base or project-level Alembic knowledge skill. For empty projects, call Guard only when the user explicitly asks for Alembic Guard or compliance checking.
Guard is a scoped Recipe-adherence check. It is not repo lint, security audit, general code review, or a whole-diff fallback.
Tool
Use alembic_code_guard for agent-facing checks. Supported public scopes are:
- explicit
files - inline
codewith optionalfilePath/language - an active
workRefwhose current Plugin session recorded scoped files
The public contract does not accept diffRef, primeRef, acceptedGuards, or applicableRecipe as Guard scope fields yet. alembic_guard is a compatibility/report surface, not the agent-facing default; it no longer accepts no-args whole-diff checks and must already receive an explicit scope.
Explicit files:
{
"files": [
"src/network/apiClient.ts",
"src/network/requestManager.ts"
]
}
Inline code:
{
"code": "URLSession.shared.dataTask(with: url) { ... }",
"language": "swift",
"filePath": "Sources/Network/LegacyClient.swift"
}
Current work scope:
{ "workRef": "work-public-1" }
The workRef form only uses source files already recorded by alembic_work_start / alembic_work_finish. If no scoped files exist, Guard returns no-code-scope instead of scanning unrelated repository state.
Workflow
For quick checks:
- Call
alembic_code_guardwith explicit files when work finish provides them, or with a current workRef when the work record has scoped files. - If there is no explicit file, inline-code, or scoped workRef input, report the structured blocker/skip instead of forcing a no-args check.
- Summarize violations by severity.
- Fix issues using returned do/dont clauses, core code, and Recipe references.
- Re-run Guard when the fix is meaningful.
For module audits:
- Use
alembic_project_matrix(operation: "overview")to find relevant modules or source refs. - Use matrix
node/relations,alembic_graph, or raw reads to choose an explicit file list. - Call
alembic_code_guardwith selected files. - Report the highest-severity issues first.
Guard Knowledge Source
Guard uses Recipe content as the standard — no separate config:
- kind=rule → enforced as Guard rules (severity: error/warning/info)
- kind=pattern → best-practice references
constraints.guards[].pattern→ regex patterns for automated detection
Related Skills
- alembic-recipes: Recipe content IS the Guard standard