.agents/skills/ai-standardize-repo/SKILL.md
Audit and fix repository standards (pipeline, rulesets, pre-commit, renovate, release, dotfiles) against universal quality gates.
npx skillsauth add svange/tagmania ai-standardize-repoInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit and fix repository standards: $ARGUMENTS
Unified standardization skill. Detects project type, audits against the universal standard, and fixes drift. Uses ai-gh for GitHub-side config and directly patches local files.
/ai-standardize-repo # Full audit, present findings, ask before fixing
/ai-standardize-repo --validate # Audit only, no changes
/ai-standardize-repo --fix # Audit and fix everything
/ai-standardize-repo renovate # Audit+fix just renovate config
/ai-standardize-repo github # Audit+fix GitHub settings via ai-gh
All repos, all languages. These are the branch ruleset status check names.
| # | Gate (status check name) | Python adapter | TypeScript/React adapter |
|---|---|---|---|
| 1 | Code quality | ruff format+check, mypy, yaml/whitespace/eof, forbid .env, uv.lock check, uv build | biome (lint+format), tsc --noEmit, yaml/whitespace/eof, forbid .env, lockfile check, npm run build / cdk synth / sam build |
| 2 | Security scanning | semgrep (p/python, p/owasp-top-ten, p/secrets), pip-audit | semgrep (p/typescript, p/react, p/nodejs, p/owasp-top-ten, p/secrets), npm audit |
| 3 | Unit tests | pytest --cov-fail-under=80 | vitest --coverage (threshold >=80%) |
| 4 | License compliance | liccheck (enforce block on GPL/AGPL, allow LGPL) + pip-licenses (reporting artifacts) | licensee (enforce block on GPL/AGPL, allow LGPL) |
Build validation is inside Code quality -- "can this code produce its artifact?" is a quality concern.
| Type | Branch strategy | Rulesets | Post-merge delivery | |---|---|---|---| | library | main-only | 4 checks on main | release -> publish (PyPI/npm) -> docs | | service | dev + main | 4 checks on dev AND main | dev: deploy staging -> integration tests -> e2e tests; main: deploy prod -> smoke tests -> release |
"Service" covers IaC (SAM, CDK, Terraform), frontends (React/Vite/Next.js), APIs, and anything that deploys.
Framework (SAM/CDK/Terraform/Vite/Next.js) affects only the build step inside Code quality and the deploy step in delivery.
Detect project shape before auditing.
ai-shell.toml for [project] repo_type overrideorigin/dev, origin/develop, or origin/staging exists -> servicepyproject.toml exists -> pythonpackage.json exists -> typescripttemplate.yaml or template.yml or samconfig.toml -> SAMcdk.json -> CDKmain.tf -> Terraformvite.config.* -> Vitenext.config.* -> Next.jsDisplay detected configuration:
Detected: type=service, language=python, framework=sam
Branch strategy: dev+main (dev branch: dev)
Check each concern against the standard. Report as PASS / DRIFT / MISSING with error (E) and warning (W) counts.
github section)Prerequisite: ai-gh CLI must be available and .env must have GH_REPO, GH_ACCOUNT, GH_TOKEN. If missing, report and skip this section.
Run: ai-gh status --type <library|service> --verbose
Check:
Note: ai-gh may still use older gate names (e.g., "Pre-commit checks" instead of "Code quality"). If so, flag this as DRIFT and note that ai-gh templates need updating per augint-github issues.
pipeline section)Check .github/workflows/pipeline.yaml exists.
Verify it has 4 jobs with these exact name: values (these are the status check contract):
For each job, check language-appropriate contents:
Code quality job must include:
uv build (or framework build command)npm run build (or framework build command)Security scanning job must include:
Unit tests job must include:
License compliance job must include:
Delivery jobs (post-merge, not in rulesets):
quality section)Python repos: Check .pre-commit-config.yaml exists and contains:
ruff-format hook covering src/ and tests/ruff-check hook with --fix covering src/ and tests/mypy hook covering src/check-yaml (with SAM template exclusion if framework is SAM)end-of-file-fixer, trailing-whitespaceforbid-env-commit (blocks .env files)uv-lock-check (validates uv.lock freshness)uv run entries use --no-sync flagTypeScript repos: Check for biome config (biome.json or biome.jsonc) and hook integration.
Use python-template.pre-commit-config.yaml in this skill's directory as reference template.
renovate section)Check renovate.json5 exists.
Validate:
baseBranchPatterns)chore(deps): for prod deps (no release trigger), fix(deps): for vulnerabilitiesfix(deps): for prod deps (triggers patch release on promotion)ci(deps): for GitHub Actions, chore(deps-dev): for dev depsvulnerabilityAlerts enabled with automerge: truedependencyDashboardApproval: truesemantic-release / python-semantic-release packages have automerge: falsebaseBranches (use baseBranchPatterns), matchDepGroups (use matchCategories)uv (use pep621), pip_requirements (use pep621)Use library-template.json5 or service-template.json5 in this skill's directory as reference.
release section)Python repos: Check [tool.semantic_release] in pyproject.toml:
exclude_commit_patterns must exclude chore, ci, style, test, build (except build(deps):)commit_message includes [skip ci]tag_format uses project-name prefix: {project-name}-v{version}build_command: library="uv lock && uv build", service=""version_variables points to valid __init__.py with __version__TypeScript repos: Check .releaserc.json or release.config.js:
releaseRules: chore/ci map to false, fix scope deps to patch[skip ci]Verify renovate prefix alignment: fix(deps): must NOT be excluded (triggers releases). chore(deps):, ci(deps): must be excluded.
Use python-template.toml or node-template.releaserc.json in this skill's directory as reference.
dotfiles section)Check .editorconfig:
root = true, end_of_line = lf, insert_final_newline = trueCheck .gitignore:
.env, .env.*, *.pem, .claude/settings.local.json__pycache__, node_modules/, *.pyc, .coverage, dist/, build/*.lock files should NOT be in .gitignore (lock files must be committed)Check tool config:
pyproject.toml: ruff line-length = 100, mypy strict or disallow_untyped_defs, coverage source and omitpackage.json: required scripts (dev, build, test, lint, format), biome config presentUse editorconfig-template in this skill's directory as reference.
Display a summary table:
Section Status Errors Warnings Notes
----------------------------------------------------------------------
GitHub settings DRIFT 1E 0W Rulesets use old gate names
Pipeline PASS 0E 0W
Pre-commit DRIFT 0E 2W Missing uv-lock-check hook
Renovate MISSING 1E 0W No renovate.json5
Release PASS 0E 0W
Dotfiles DRIFT 0E 1W Missing .editorconfig
----------------------------------------------------------------------
Total 2E 3W
If --validate was specified, stop here.
If no args (default), ask the user: "Found 2 errors and 3 warnings. Fix all? [Y/n]"
If --fix was specified or user confirms, proceed to step 4.
Apply fixes in this order (later steps may depend on earlier ones):
.editorconfig from template if missing. Add safety entries to .gitignore..pre-commit-config.yaml from template if missing. Patch existing config to add missing hooks.ai-gh config --standardize. Run ai-gh rulesets --apply <library|service>.ai-gh workflow --type <library|service>. If exists but drifted, show diff and patch specific issues. Customize build step for detected framework.renovate.json5 from template if missing. If exists, validate and patch prefix scheme.For each fix, show what changed. If a fix would overwrite user customizations in an existing file, show the diff and ask for confirmation.
After fixes:
ai-gh is available: run ai-gh status --type <library|service> --verbose to verify GitHub-side alignmentVerification: 0 errors, 0 warnings. Repository is standard-compliant.
If issues remain, list them with guidance on manual resolution.
ai-gh not installed or .env missing GH variables: skip GitHub sections, audit local config only, note what was skippedai-gh commands fail: show error output, continue with remaining sectionsdevelopment
Deploy or validate Renovate dependency update configuration. Detects repo type (library vs IaC), package ecosystem, and generates or fixes renovate.json5.
development
Deploy or validate semantic-release configuration. Handles Python (python-semantic-release) and Node (JS semantic-release) repos with correct Renovate prefix alignment.
development
Audit and fix pre-commit hook configuration. Ensures consistent developer-side quality gates for formatting, linting, type checking, and secret protection.
testing
Audit and fix CI/CD GitHub Actions workflows. Checks security scanning, coverage enforcement, type checking, CVE ignores, and concurrency settings.