ADinsights Scope Gatekeeper
Overview
Assess proposed or detected file scope against ADinsights guardrails, then return an advisory decision packet that includes escalation routing, folder-level tests, and scope-owned docs maintenance signals.
Context Load Order
- Open
AGENTS.md. - Open
docs/workstreams.md. - Open
docs/ops/escalation-rules.md. - Open
docs/runbooks/release-checklist.md. - Open
references/scope-rules.yaml.
Inputs and Evidence Priority
Use these inputs in this order:
--changed-files-from-gitoutput if provided and non-empty.- Explicit path hints (
--changed-fileand--path). - Prompt-extracted path hints.
If no reliable path evidence exists, return WARN_UNCLEAR_SCOPE.
Decision Outcomes
Return exactly one status:
PASS_SINGLE_SCOPEWARN_UNCLEAR_SCOPEESCALATE_CROSS_SCOPEESCALATE_ARCH_RISKESCALATE_CONTRACT_RISK
Always treat results as advisory-first; do not hard-block. Contract risk is signal-first and delegated to contract guard for final contract classification.
Output Contract
Return a scope packet with:
schema_version(1.1.0)scope_statustouched_top_level_foldersrequired_reviewersrequired_tests_by_folderrequired_docs_updatesrecommended_next_actionrationaleevidenceentries (type,value,strength,source)contract_risk_signalcontract_risk_reasonshandoff_recommendationsinvoke_contract_guardinvoke_release_readiness
Router Handoff
If a persona-router packet indicates invoke_scope_gatekeeper=true, run this skill before implementation planning.
When contract_risk_signal=true, invoke adinsights-contract-guard before merge planning.
Guardrails
- Keep single-top-level-folder rule as the default path.
- Route cross-folder changes to Raj.
- Route architecture-sensitive changes to Raj + Mira.
- Use contract-risk signals only to route review/handoff; do not make final breaking-change decisions or require contract docs updates here.
- Keep recommendations aligned with AGENTS test matrix and runbooks.
Maintenance
- Keep rules in
references/scope-rules.yamlsynchronized with AGENTS and workstream docs. - Run
scripts/validate_scope_rules.pyafter rules edits. - Run
scripts/run_scope_golden_tests.pybefore syncing. - Sync with
scripts/sync_to_codex_home.sh.