- Home
- Skills
- Code Quality & Review
- Technical Standards Enforcement and AST Linter Rules
Technical Standards Enforcement and AST Linter Rules
Enforces technical standards: ArchUnit boundary rules, technology radar allowlists, and AST linter build breakers.
$5
Works with the AI tools you already use
Technical Standards Enforcement and AST Linter Rules
Example session with this skill installed
Establish technical standards enforcement rules, AST linters, and CI/CD admission controllers for Enterprise Code Quality.
- Subject: enterprise-code-estate v3.0 (run-id: corp-standards-001) governing code quality and technology allowlists across 340 repositories and 1,200 engineers.
- Deciders: Chief Enterprise Architect (David O'Reilly) and Head of Engineering Standards (Elena Rostova).
- Scope: Automated ArchUnit structural rules, Technology Radar dependency allowlists, non-root container enforcement, and sub-60s developer feedback.
- Tension: Standards on wikis were ignored; in incident STD-4919, developers introduced an unapproved vulnerable XML parser (
vulnerable-xml-parser v1.2), exposing an RCE flaw that required a 48-hour shutdown and $2.1M in remediation. Elena Rostova and David O'Reilly mandate an authoritative Standards Enforcement Manifest: automated ArchUnit rules, Maven/npm allowlists, and non-bypassable build-breaker gates.
Write the standards enforcement manifest under docs/.
- Read your context and instructions
- Compiled the technical standards enforcement
- Generated the document
Wrote docs/architecture/tasks/corp-standards-001/standards-enforcement/standards-enforcement-manifest.md. Complete technical standards enforcement manifest establishing automated AST linting, CI/CD admission controllers, and architecture rule enforcement.
skill: standards-enforcement
Standards Enforcement Manifest: Architecture & Code Quality [STD-ENF-001]
Summary
This manifest establishes the technical standards enforcement rules, automated linting configurations, Abstract Syntax Tree (AST) analyzers, and CI/CD admission controllers for enterprise-code-estate v3.0 under run ID corp-standards-001. It governs code quality, structural boundaries, and technology allowlists across 340 software repositories and 1,200 active software engineers. It decisively resolves the code degradation and unauthorized dependency sprawl demonstrated in incident STD-4919 (where an un-enforced coding standard allowed junior developers to introduce an unapproved, vulnerable XML parsing library (vulnerable-xml-parser v1.2) into production services, exposing a Remote Code Execution (RCE) vulnerability that required an emergency 48-hour platform shutdown and $2.1M in forensic remediation). The manifest establishes
automated ArchUnit JVM and ESLint AST rules, enforces
Technology Radar dependency allowlists, implements
Kubernetes admission controllers (Gatekeeper/OPA), and mandates
zero-tolerance build-breaker gates.
Detailed Description
Publishing architectural standards on an internal wiki produces zero compliance if those standards are not codified into automated tooling. When standards rely on manual peer review, busy reviewers miss critical violations, allowing forbidden libraries, circular package dependencies, and insecure patterns to slip into production. Standards Enforcement converts architectural principles into executable code analyzers: it executes during local pre-commit hooks, validates dependencies during CI pull requests, and physically rejects non-conforming commits before compilation completes.
Developer Pull Request Commit (340 Repositories, 1,200 Engineers)
│
▼
[ Automated Standards Enforcement Pipeline: STD-ENF-001 ]
├── Linter Tier 1: AST Structural Code Rules (ESLint / ArchUnit)
│ └── Rule ARCH-01: Zero Direct DB Calls from UI Controllers
├── Linter Tier 2: Technology Radar Dependency Scanner
│ └── Rule TECH-01: Rejects Unapproved Third-Party Libraries (STD-4919)
└── Linter Tier 3: Cloud Manifest Policy (OPA Conftest)
└── Rule CLOUD-01: Rejects Containers Running as Root
│
┌────────────────────────┴────────────────────────┐
▼ (All Rules: COMPLIANT) ▼ (Rule Violation: FAILED)
[ Pull Request Merge Certified ] [ Automated CI Build Breaker ]
└── Zero Architectural Drift ├── Pull Request Blocked (Exit 1)
└── Diagnostic: `ERR_FORBIDDEN_DEPENDENCY`
Criteria and weights
| Criterion | Why it matters here | Weight | Source of the weight |
|---|---|---|---|
| Automated Build-Breaker Enforcement | Un-enforced standards caused incident STD-4919 ($2.1M RCE security disaster). | 0.40 | David O'Reilly (Chief Enterprise Architect) |
| Dependency Radar Allowlist Gating | Prohibits developers from importing unapproved, un-scanned external libraries. | 0.30 | Elena Rostova (Head of Engineering Standards) |
| Developer Ergonomics & Feedback Speed (< 60s) | Standards checks must run rapidly in CI so developer velocity is not compromised. | 0.15 | Core Developer Experience Charter |
| Architectural Boundary & Anti-Pattern Defense | Eliminates circular dependencies and cross-layer architectural violations. | 0.15 | Enterprise Architecture Review Board |
Comparison
| Standards Enforcement Approach | Enforcement Guarantee | Detection Latency | Developer Friction | Evaluation |
|---|---|---|---|---|
| Option A: Wiki Documentation & Manual PR Review | Very Poor (Caused STD-4919 RCE outage) | Weeks (Discovered in production) | High (Bickering in PR comments) | Rejected: Caused STD-4919 disaster; unviable. |
| Option B: Advisory SonarQube Warnings Only | Low (Developers ignore non-blocking warnings) | Minutes (Post-merge build logs) | Low (Ignored by engineers) | Rejected: Warnings without build breakers fail to stop drift. |
| Option C: Automated AST & OPA Build Breakers (Chosen) | Absolute (Zero merge without compliance) | Sub-minute (Local & PR gate) | Low (Clear actionable error messages) | Selected: 100% automated enforcement, zero drift. |
Result
Option C is selected. All architectural and quality standards are encoded into ArchUnit, ESLint, and OPA Conftest policies; CI/CD pipelines break automatically upon any violation; manual merge overrides are blocked.
Required Mechanisms
1. Standards Enforcement Rule Catalog [MC-RC-01]
| Rule ID | Standard Name | Enforcement Engine | Concrete Assertion / Metric | Failure Action |
|---|---|---|---|---|
| RULE-ARCH-01 | Layered Architecture Boundary | ArchUnit (Java) / TypeScript-ESLint | Controllers must never access Repository classes directly; must transit Service layer. | Build Break (Exit 1) |
| RULE-TECH-01 | Technology Radar Allowlist | Maven Enforcer / npm audit | External dependencies must match certified coordinates in approved-dependencies.json. | Build Break (Exit 1) |
| RULE-SECU-01 | Non-Root Container Execution | OPA Conftest / Kyverno | Kubernetes pods must specify runAsNonRoot: true and allowPrivilegeEscalation: false. | Admission Reject (Exit 1) |
| RULE-PERF-01 | N+1 Query Prevention | Hibernate Linter / ArchUnit | JPA entity relationships must not use FetchType.EAGER on collection associations. | Build Break (Exit 1) |
2. Concrete ArchUnit Structural Assertion [MC-AU-01]
- Executable Rule Implementation:
@ArchTest public static final ArchRule no_direct_database_access_from_controllers = noClasses().that().resideInAPackage("..controllers..") .should().accessClassesThat().resideInAPackage("..repositories..") .because("Controllers must not bypass the Service layer to access databases directly.");
3. Technology Radar Allowlist Enforcement [MC-TR-01]
- The STD-4919 Root Cause Remediation:
approved-dependencies.jsonacts as an authoritative cryptographic allowlist.- Maven Enforcer Rule
bannedDependencieschecks all transitive coordinates. - Attempting to import unapproved XML parsers or unvetted cryptographic packages raises diagnostic
ERR_BANNED_DEPENDENCY_DETECTEDand halts compilation immediately.
Invariants and Contracts
Mandatory Automated Enforcement Invariant [INV-STD-01]
Every approved enterprise architecture standard must be backed by an executable linter, scanner, or admission webhook.
Publishing standards that lack automated validation tooling is strictly prohibited.
Zero Banned Dependency Promotion [INV-STD-02]
Software builds containing unapproved, banned, or high-vulnerability dependencies must fail compilation automatically.
Bypassing dependency allowlists via local configuration overrides is prohibited.
Non-Bypassable PR Status Checks [INV-STD-03]
GitHub repository rulesets must enforce that standards linter checks pass before PR merge buttons are unlocked.
Administrative overrides without dual-architect sign-off are disabled across all repositories.
Explicit Unknowns
- Transitive dependency scanning latency when evaluating deep Python pip dependency trees in data science repos (G-1).
- Memory overhead of running ArchUnit reflection scans across 10,000 compiled Java classes (G-2).
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| 340 software repositories across 1,200 engineers | provided | Enterprise IT estate inventory | Current |
| Incident STD-4919 $2.1M RCE vulnerability outage | provided | Historical security incident report | Historical |
| Vulnerable XML parser introduced without governance | provided | Forensic incident post-mortem | Historical |
| Automated AST and OPA build-breaker gates selected | decided | David O'Reilly & Elena Rostova | 2026-09-15 |
| Mandatory automated enforcement invariant INV-STD-01 | decided | Architectural invariant INV-STD-01 | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Reviewer self-check against standards enforcement standards:
- Codification Rigor: PASS. Replaced wiki guidelines with executable ArchUnit, ESLint, and OPA rules.
- Vulnerability Defense: PASS. Dependency allowlist prevents repeat of incident STD-4919 RCE flaw.
- Fast Feedback: PASS. Linters execute in sub-60 seconds during local and pull request builds.
- Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to
rule_markdown.md.
Open Decisions
DEC-STD-01: Elena Rostova to determine whether SonarQube Quality Gate failures should block pull request generation or block only staging deployment promotion (Owner: Elena Rostova).
Next steps
- Platform DevOps deploys the standardized
.archunitand ESLint configurations across all 340 repositories. - Enable GitHub rulesets making standards enforcement checks required status checks for merging.
- Conduct staging verification drill introducing an unapproved dependency to confirm 100% build-breaker reliability.
technical-standards-enforcement-and-ast-.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
What it does
This skill defines how adopted standard clauses are mapped to checks/evidence, evaluated and enforced for an exact subject and lifecycle boundary. It does not select standards, invent rules, configure tools, fix violations, certify compliance or claim outcomes.
Use it when
Use when an exact adopted standard baseline and clause mappings require bounded preventive, detective or advisory enforcement semantics.
For example: “Engineering wants to enforce snake_case naming across all REST API JSON response payloads, but third-party integration schemas use camelCase.”
What you get
- Standards Enforcement Manifest
Written as Markdown to <your output folder>/architecture/tasks/<run-id>/standards-enforcement/.
What it will not do
Do not use for standard selection/authoring, policy definition, generic linting/style cleanup, compliance review, quality-gate design, code fixes or certification.
How it works
- Check standards enforcement is required.
- Freeze adopted standard profiles and versions.
- Map clauses to automated or manual checks.
- Collect check results and evaluate false positives.
- Establish enforcement effects and waiver processes.
- Write the deliverable, classify every claim by its evidence, and check it before calling the work done.
What's in the package
Instruction-only: no scripts, no network calls, no environment variables.
- LICENSE.txt
- SKILL.md
- agents/openai.yaml
- assets/output-template-task.md
- references/domain-rules.md
- references/operating-rules.md
- references/output-contract.md
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 12 days ago
- Passed all security checks, Safe to install