Skip to main content

guard

Create structural guard tests that enforce architecture principles on every `make quality` run. Guards are AST-scanning tests that prevent categories of violations automatically. Available guards: schema-inheritance, boundary-completeness, query-type-safety, no-error-dicts.

설치로 이동

소스 정보

저장소
prebid/salesagent
최근 소스 활동
2026년 9월 17일 22:05
감지된 SKILL.md 언어
영어
스타
38
포크
54

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
guard
description
Create structural guard tests that enforce architecture principles on every `make quality` run. Guards are AST-scanning tests that prevent categories of violations automatically. Available guards: schema-inheritance, boundary-completeness, query-type-safety, no-error-dicts.
args
<guard-name-1> [guard-name-2] ...
# Structural Guard Creation Create AST-scanning enforcement tests that catch architecture violations automatically. Each guard runs on `make quality` and prevents regressions. ## Args ``` /guard <guard-name-1> [guard-name-2] ... ``` Guard names (space-separated). Each gets a test file at `tests/unit/test_architecture_{guard_name}.py`. ## Available Guards | Guard | What It Enforces | |-------|-----------------| | schema-inheritance | Schema classes extend correct adcp library base types | | boundary-completeness | MCP/A2A/REST wrappers expose all _impl parameters | | query-type-safety | DB queries use column types matching the column definition | | no-error-dicts | _impl functions raise exceptions, never return error dicts | Custom guard names are also supported — the research atom will determine what to enforce based on the name and #1050/#1066 principles. ## Existing Structural Guards These already exist (don't recreate): - `ruff-boundary.toml` (TID251) — No ToolError import anywhere under src/ but the two edge modules - `test_transport_agnostic_impl.py` — No transport imports in _impl - `ToolImpl` protocol on `ToolSpec.impl` (mypy) + `.ast-grep/rules/impl-signature-is-request-and-identity.yml` — _impl is exactly `(req, identity: ResolvedIdentity)` - `.ast-grep/rules/resolved-identity-constructed-only-by-its-owners.yml` — ResolvedIdentity constructed only by the resolver and the factory ## Protocol ### Step 1: Cook the molecule ```bash python3 .claude/scripts/cook_formula.py \ --formula .claude/formulas/structural-guard.yaml \ --var "GUARD_NAMES={all_args}" \ --epic-title "Guards: {all_args}" ``` **Dry run first** (recommended): ```bash python3 .claude/scripts/cook_formula.py \ --formula .claude/formulas/structural-guard.yaml \ --var "GUARD_NAMES={all_args}" \ --epic-title "Guards: {all_args}" \ --dry-run ``` ### Step 2: Walk the molecule ``` bd ready → bd show <atom-id> → execute → bd close <atom-id> → repeat ``` Each guard goes through: research → scan → write-guard → mark-known → verify → commit. ### Step 3: Done when all atoms closed All guards committed and passing in `make quality`. ## Key Principles - **Allowlists shrink, never grow.** New violations fail the guard immediately. - **FIXME comments link to beads tasks.** Every known violation has a tracker. - **Guards follow existing patterns.** Read the 3 existing structural tests first. ## See Also - `/surface` — Create entity test suites (what the guards protect) - `/remediate` — Fill entity test stubs (fix the violations guards find) - `/mol-execute` — Execute individual beads tasks
GitHub에서 보기