Skip to content

Blog

Standards Compliance Linter: Enforce Your Standards in CI

Phase 2 of the standards tooling roadmap ships make lint-standards — a multi-language compliance linter that checks your project against coding standards and reports results in text, JSON, or SARIF format for GitHub Code Scanning integration.

The linter is organized into two tiers: common checks that run on every project, and language-specific checks that activate based on your .standards.yml configuration.

Check What it verifies
conventional-commits Last 10 git commits match type(scope): subject pattern
test-directory A tests/, test/, spec/, or __tests__/ directory exists and is non-empty
no-secrets No AWS keys, private key blocks, or hardcoded passwords/API keys in source files
coverage-config CI workflows, jest config, pytest config, or .standards.yml declare a coverage threshold
artifact-hygiene Committed *.wasm, *.a, *.so, *.dylib, *.jar files embed no absolute /Users/ or /home/ paths (WARN: non-reproducible build; see arch-06 §6)
Check What it verifies
python/type-annotations mypy is configured; WARN if not in strict mode, FAIL if not configured at all
python/banned-functions No eval(), exec(), pickle.loads(), os.system(), or subprocess with shell=True
python/ruff-config ruff.toml, .ruff.toml, or [tool.ruff] in pyproject.toml
Check What it verifies
typescript/strict-tsconfig "strict": true in tsconfig.json
typescript/banned-functions No eval(), new Function(), .innerHTML =, document.write(), or setTimeout with string literal
typescript/eslint-config An .eslintrc*, eslint.config.*, or eslintConfig in package.json
Check What it verifies
go/golangci-config A v2 golangci-lint config (version: "2") in .golangci.yml, .yaml, .toml, or .json
go/error-handling No bare _ = or , _ := patterns that discard return values (likely errors)
Check What it verifies
elixir/credo-config :credo in mix.exs dependencies
elixir/dialyzer-config :dialyxir in mix.exs dependencies
Check What it verifies
rust/clippy-ci A CI step runs cargo clippy … -D warnings (WARN if clippy runs without -D warnings)
rust/deny-config deny.toml present with a non-empty [licenses] allow list
rust/toolchain-pin rust-toolchain.toml channel, Cargo.toml rust-version, and CI toolchain pins agree
rust/ffi-no-unwrap No unwrap()/expect()/panic! family calls in ffi.rs, wasm.rs, or ffi//wasm/ facade modules
Check What it verifies
swift/swift-format-config .swift-format present (WARN if only .swiftlint.yml exists — swift-format is the default gate)
swift/package-resolved Package.resolved committed when Package.swift declares dependencies (WARN only for a library with no executable and no CI build)
swift/warnings-as-errors -warnings-as-errors, SWIFT_TREAT_WARNINGS_AS_ERRORS, or treatAllWarnings(as: .error) enabled in CI or the project spec

Each check is a standalone bash script in scripts/lint-checks/<language>/. The interface is minimal: receive the project root as $1, print one line (PASS|WARN|FAIL <check-name> <message>), exit with 0, 1, or 2. Adding a new check is as simple as dropping a new script in the right directory — the orchestrator discovers it automatically.

The orchestrator (scripts/lint-standards.sh) reads .standards.yml to determine which language-specific check directories to activate. Common checks always run.

🔎 Standards Compliance Check
═══════════════════════════════════════
✅ PASS conventional-commits All recent commits follow Conventional Commits format
⚠️ WARN test-directory Test directory found but appears empty
✅ PASS no-secrets No hardcoded secrets detected
✅ PASS coverage-config Coverage gate found in .standards.yml (minimum: 95%)
✅ PASS python/type-annotations mypy strict mode enabled in pyproject.toml
❌ FAIL python/banned-functions eval() at src/utils.py:42
✅ PASS python/ruff-config [tool.ruff] section configured in pyproject.toml
═══════════════════════════════════════
Results: 5 pass, 1 warn, 1 fail
Terminal window
./scripts/lint-standards.sh --format json

Produces a structured JSON object with summary counts and a results array — suitable for parsing in scripts, dashboards, or custom reporters.

Terminal window
./scripts/lint-standards.sh --format sarif > results.sarif

SARIF 2.1.0 output maps WARN to warning and FAIL to error. Upload to GitHub Code Scanning to get inline annotations on pull requests:

- name: Run standards linter
run: ./scripts/lint-standards.sh --format sarif > standards.sarif || true
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: standards.sarif
Terminal window
make lint-standards

Or directly with a format flag:

Terminal window
./scripts/lint-standards.sh --format json
./scripts/lint-standards.sh --format sarif

The linter exits with code 1 if any checks fail, making it CI-friendly as a blocking gate.

Drop a new executable *.sh script in scripts/lint-checks/common/ or scripts/lint-checks/<language>/. Follow the one-line output contract and the orchestrator picks it up automatically on the next run. Run make test-scripts to validate syntax before committing.

Token-Efficient Agent Configs: 60% Smaller, Zero Traversal

AI coding agents are only as good as the context they’re given. Until now, our agent configs pointed agents into the standards submodule — references like “See standards/languages/lang-01_python_standards.md” meant a diligent agent might read 800-1,200+ lines of documentation per session, much of it irrelevant to the project at hand. A Python web service doesn’t need Rust, Swift, or Dart standards taking up context window space.

We’ve rebuilt the entire agent configuration system around a simple idea: assemble one self-contained config per agent at setup time, with only the content that project actually needs.

The setup script now assembles agent configs from three ingredients:

  1. Base template (~25-40 lines) — agent-specific behavioral rules. Cursor gets interaction modes and custom commands. Gemini gets the A-P-E workflow. Aider gets diff mode guidance. Each agent gets only what’s unique to how it works.

  2. Content blocks (~5-20 lines each) — atomic summaries of standards, stored in standards/shared/blocks/. Six common blocks (architecture, testing, security, naming, git, documentation) are always included. Language and role blocks are selected based on detection.

  3. Language + role filtering — detect-languages.sh identifies your project’s languages (13 supported, including Go and Elixir, with TypeScript, Rails, Java, and Kotlin sub-detection). You pick a project role (--role service|library|app|data-pipeline). Only relevant blocks are included.

The result: a Python/TypeScript web service gets a ~130-line CLAUDE.md with everything the agent needs — no submodule traversal required.

Before After
Agent reads 329-line config + traverses into 800+ lines of standards docs Agent reads one ~130-line self-contained file
All 13 language standards included regardless of project Only detected languages included
Security rules duplicated across 6 agent configs Single security-summary.md block assembled into each
No .cursorrules template for consumer projects Full Cursor template with assembly support
Codex used obsolete .codexrc format Migrated to AGENTS.md (current OpenAI Codex CLI)

We also deduplicated the standards docs themselves:

  • arch-01 reduced from 253 to ~30 lines (Sections 2-10 were verbatim copies of core-standards.md)
  • arch-03 deleted entirely — content distributed to the Cursor base template and proc-04
  • Banned-functions lists removed from 8 language docs (now single source in sec-01)
  • Git aliases catalog extracted from proc-02 to a standalone reference doc

Every agent gets a purpose-built base template with platform-specific best practices:

  • Claude Code — worktree conventions, key commands structure
  • Cursor — @new-feature/@refactor/@debug/@review modes, condensed custom commands
  • GitHub Copilot — /explain, /fix, /tests guidance, code review behavior
  • Gemini CLI — Analyze-Plan-Execute workflow, checkpointing
  • Aider — two-file model (.aiderrc + .aider-instructions.md), diff mode guidance
  • Codex — new AGENTS.md format with sandbox awareness

Smart Sync: Customizations Survive Updates

Section titled “Smart Sync: Customizations Survive Updates”

A common worry with generated configs: what happens when you improve your CLAUDE.md with /claude-md-improver or add project-specific conventions, then sync pulls new standards? Before, your changes would be overwritten.

Now, sync-standards uses checksum-based detection. After assembling a config, the setup script records a SHA256 hash of the standards content. On the next sync, if the hash doesn’t match — meaning you’ve customized the file — the sync skips that file and stages the update to .standards-pending/ instead.

To merge the pending update:

  • Claude Code: Run /merge-standards — an included skill that reads both versions, merges section-by-section (updating standards rules while preserving your additions), and shows a diff for approval.
  • Any other agent: Point it to .standards/docs/reference/merge-standards-prompt.md — the same merge instructions in a format any agent can follow.

This works for all six agent configs, not just CLAUDE.md. Customize your .cursorrules or GEMINI.md and they’ll be protected too.

Existing projects can pick up the new system by syncing their standards submodule:

Terminal window
cd .standards && git pull
./scripts/setup.sh --role service

The setup script detects your languages, assembles configs for all detected agents, and saves your selections to .standards-config for reproducible syncs.

New projects get this automatically via the standard install process.

Eating Our Own Dogfood: A Compliance Audit

A coding standards repo that doesn’t follow its own standards is a bad look. We ran a compliance audit and fixed every gap we found.

Our standards require several things that the repo itself was missing:

  • proc-03 (Code Review) requires a CODEOWNERS file — we didn’t have one
  • sec-01 (Security) requires dependency scanning — no dependabot.yml
  • proc-01 (Documentation) requires an ADR directory and README per package — missing for standards/, bin/, and the ADR directory entirely
  • sec-01 defines a P0/P1/P2 severity model — but our PR template had no security checklist
  • Security standards existed but weren’t synced to the website or shown in the sidebar

New files:

  • .github/CODEOWNERS — all paths default to @c65llc
  • .github/dependabot.yml — weekly scans for npm (website) and GitHub Actions
  • docs/adr/0001-unified-standards-repository.md — documents the foundational decision
  • standards/README.md and bin/README.md — package-level documentation

Modified files:

  • PR template now includes P0/P1/P2 security checkboxes
  • Website sync script copies security standards with frontmatter injection
  • Astro sidebar includes a Security section under Standards
  • CHANGELOG.md restructured from one giant “Unreleased” block into proper versioned sections (0.1.0 through 0.5.0)

While we were at it, we noticed the blog had exactly one post. A project that ships security frameworks, adds two languages, builds a CI-tested bootstrap system, and then audits itself for compliance has more than one thing to say. So we added four posts covering the release history.

If you maintain standards, audit yourself first. It’s the fastest way to find gaps in your own documentation — and it builds credibility with the teams you’re asking to follow those standards.

Language-Aware Bootstrap for Claude Code

The setup script now detects your project’s languages and generates a tailored Claude Code settings.json — no manual configuration needed.

When you run setup.sh, the bootstrap system:

  1. Scans your project for language markers — *.py, Gemfile, package.json, Cargo.toml, *.swift, etc.
  2. Maps languages to tools — Python projects get ruff, pytest, mypy; Ruby projects get rubocop, rspec, brakeman; TypeScript gets eslint, vitest, tsc.
  3. Generates settings.json with the appropriate allowedTools configuration for Claude Code.

The result: Claude Code can run your project’s linters, test runners, and formatters without you having to manually allowlist each tool.

The generation uses a base template with language-specific tool blocks injected dynamically. This means the core settings (permissions, MCP servers, etc.) stay consistent while tool access adapts to the project.

We added functional tests that validate the bootstrap pipeline:

  • Language detection tests — verify that each file type maps to the correct language
  • Settings generation tests — confirm the output JSON is valid and contains expected tool entries
  • Round-trip tests — run setup on mock projects and validate the generated config

These run in CI on every PR that touches the setup scripts.

Update your standards submodule and re-run setup:

Terminal window
cd .standards && git pull origin main && cd ..
make setup

Your settings.json will be regenerated with language-appropriate tooling.

P0-P2 Security Standards: Severity-Driven Code Review

We’ve added a comprehensive security standards framework to Coding Standards, built around a severity model that makes security findings actionable in code review.

Not all security issues are equal. Our framework assigns every rule a severity level:

  • P0 (Critical) — SQL injection, command injection, hardcoded secrets. These block merge immediately.
  • P1 (High) — Missing auth checks, insecure deserialization, XSS. Also merge-blocking.
  • P2 (Medium) — Missing rate limiting, verbose error messages, weak TLS config. Flagged as warnings.

This gives reviewers a clear decision framework: P0/P1 means “stop and fix,” P2 means “track and address.”

The standard covers eight areas:

  1. Injection Prevention — SQL, command, XSS, SSRF, template injection
  2. Authentication & Authorization — session management, access control
  3. Secrets Management — hardcoded credential detection, vault usage
  4. Dangerous Functions — eval(), exec(), insecure deserialization
  5. Dependency Security — CVE scanning, lock files, supply chain
  6. Configuration Security — TLS, security headers, debug mode
  7. Data Protection — PII in logs, encryption at rest/in transit
  8. SAST Tooling — per-language static analysis and dependency scanning

Every language standard now includes a security section with recommended SAST tools. For example:

Language SAST Dependency Scanner
Python Bandit, Semgrep pip-audit, Safety
Ruby Brakeman bundler-audit
TypeScript ESLint security plugins npm audit
Rust cargo-audit cargo-deny

Security rules are baked into every AI agent config — Cursor, Copilot, Claude Code, Codex, and Gemini all reference the same P0-P2 model. The code review standard (proc-03) includes a security checklist, and the PR template now has P0/P1/P2 checkboxes.

See the full standard at sec-01: Security Standards.