From strictify
This skill should be used when the user asks to "strictify a repo", "add code quality enforcement", "make this repo strict", "add pre-commit hooks", "add type checking", "enforce code quality", "set up linting", or runs the /strictify command.
How this skill is triggered — by the user, by Claude, or both
Slash command
/strictify:strictifyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill enforces taste programmatically across 21 categories of Python code quality. It analyzes an existing repository (or bootstraps a new one), proposes strict-but-pragmatic defaults across static analysis, type safety, testing, architecture, and ongoing enforcement, then applies approved changes. Every rule exists because it improves code quality, not because a linter supports it.
assets/agents.red-green-tdd.mdassets/hookify.doc-code-coupling.mdassets/hookify.no-junk-drawers.mdassets/hookify.parse-dont-validate.mdassets/hookify.semantic-types.mdassets/hookify.taste-enforcer.mdreferences/beartype-setup.mdreferences/pre-commit-config.mdreferences/pyproject-strict.mdscripts/check_exception_handling.pyscripts/check_file_length.pyscripts/check_print_statements.pyscripts/check_private_test_imports.pyscripts/check_timeless_comments.pyscripts/fix_future_annotations.pyThis skill enforces taste programmatically across 21 categories of Python code quality. It analyzes an existing repository (or bootstraps a new one), proposes strict-but-pragmatic defaults across static analysis, type safety, testing, architecture, and ongoing enforcement, then applies approved changes. Every rule exists because it improves code quality, not because a linter supports it.
The approach is inspired by the "AI Is Forcing Us to Write Good Code" thesis and OpenAI's "Harness Engineering" insight: AI agents amplify whatever quality level a codebase already has. The only guardrails are the ones that get set and enforced. The tooling, abstractions, and feedback loops that keep a codebase coherent are the primary leverage point. Agent legibility -- making code navigable by both humans and AI agents -- is a first-class goal alongside human readability.
Scan the target repo to understand its current state. Check all of the following:
src/ layout vs flat layout; identify the package namepyproject.toml requires-python, .python-version, or python3 --versionuv.lock), poetry (poetry.lock), pip (requirements.txt)__init__.py contents -- identify insertion point for beartypedocs/, inline comments qualityPresent findings grouped by the 6 category groups below. For each category, show: current state -> proposed change. Ask the user to veto any categories they do not want. Default is to apply everything -- the user opts OUT, not in.
references/pre-commit-config.md for the full template.E, W, F, I, B, UP, C4, SIM, RUF) and format config. Read references/pyproject-strict.md for exact settings.strict = true with pragmatic exceptions for the project's frameworks. Read references/pyproject-strict.md for strict mypy config and framework overrides.beartype_this_package() in package __init__.py. Read references/beartype-setup.md for integration patterns and common issues.NewType/TypeAlias for domain concepts (user IDs, amounts, slugs). Detects bare primitives used for domain values.NewType) instead of scattered validation. Coerce at the boundary, carry proof through types.references/pyproject-strict.md for min_confidence and ignore settings.references/pre-commit-config.md for xenon hook config.logger.info("message", key=value) style.fail_under = 100. Coverage report as explicit todo list. Curated exclude_lines for TYPE_CHECKING, @abstractmethod, __repr__, and other pragmatic exclusions. Read references/pyproject-strict.md for the full exclusion list.--failed-first for fast feedback. Read references/pyproject-strict.md for pytest addopts config.utils.py/helpers.py/misc.py creation. The problem is not shared code -- it is anonymous shared code. If a shared utility is needed, name it after what it does.docs/ARCHITECTURE.md. Keep constraints lightweight for small projects, more rigid for larger ones.docs/QUALITY.md scorecard grading each module/domain on coverage, type safety, complexity, and test health. Assess the current state, produce initial grades, and include guidance on how to maintain and update the scorecard over time.uv run works as single-command entry. Add bootstrap script or documentation as needed.uv run works from any worktree. For complex ones it may involve environment variable templating or a dev setup script.check_exception_handling.py), print/logging bans (check_print_statements.py), timeless comments (check_timeless_comments.py), future annotations (fix_future_annotations.py), and tests-verify-public-behaviour (check_private_test_imports.py, which forbids tests from importing leading-underscore first-party symbols so they exercise the public surface instead of internal shape). Read each script from scripts/ to understand behavior and adapt to the target repo.detect-secrets for entropy-based secret scanning. Standard pre-commit hooks from the pre-commit-hooks repo and Yelp/detect-secrets. Out of scope: personal/prod strings (internal hostnames, real usernames, prod URLs). Any mechanism for these either commits the pattern (defeating the point) or requires per-user config strictify cannot bootstrap -- users who care should add a local hook that reads patterns from a gitignored file.doc-code-coupling hookify rule that reminds authors to leave NOTE: back-pointers at code sites whose values are documented elsewhere.For each approved category, perform the following. Read the referenced files before writing any config.
pyproject.toml -- read references/pyproject-strict.md for strict tool configurations. Merge sections: never remove existing settings, only add or tighten. Create pyproject.toml if it does not exist..pre-commit-config.yaml -- read references/pre-commit-config.md for the complete template. Add missing repos and hooks. Create the file if it does not exist.scripts/ (check_exception_handling.py, check_print_statements.py, check_file_length.py, check_timeless_comments.py, check_private_test_imports.py, fix_future_annotations.py). Adapt paths and package names to the target repo. Write to scripts/pre_commit_hooks/ in the target repo. check_private_test_imports.py auto-detects first-party packages from the target's layout, so it needs no per-repo edit (pass --package only to override).references/beartype-setup.md. Modify the package __init__.py to insert beartype_this_package().assets/ (taste-enforcer, no-junk-drawers, parse-dont-validate, semantic-types) to the target repo's .claude/ directory.Detect the package manager and run the appropriate install command:
uv add --dev ruff mypy beartype vulture pytest pytest-xdist pytest-cov pytest-timeout pytest-asyncio xenon pyupgrade flynt pre-commitpip install equivalentpoetry add --group dev equivalentpre-commit install to activate hooks.docs/ARCHITECTURE.md with layer definitions and dependency rules.docs/QUALITY.md with initial grades per module.When existing configuration already exists:
Detailed configs, scripts, and assets live in the skill's bundled resources. Read these before writing any configuration to the target repo.
references/pyproject-strict.md -- strict tool configurations for ruff, mypy, pytest, coverage, and vulture sections in pyproject.tomlreferences/pre-commit-config.md -- complete .pre-commit-config.yaml template with all hook repos and local hook definitionsreferences/beartype-setup.md -- beartype integration guide: beartype_this_package() snippet, BeartypeConf options, common issues, and install commands per package managerCustom pre-commit hook scripts in scripts/. All scripts accept filenames as arguments, report violations as {file}:{line}: {message} -- {remediation} (agent-readable), exit nonzero on failure, and support # allow: {hook-name} per-line exemptions.
scripts/check_exception_handling.py -- detects bare except:, swallowed exceptions, exception handlers with only passscripts/check_print_statements.py -- bans print() in production code, detects unstructured logging patternsscripts/check_file_length.py -- enforces max 400 logical lines per filescripts/check_timeless_comments.py -- detects temporal keywords in comments (legacy, new, old, TODO, FIXME, HACK, temporary)scripts/check_private_test_imports.py -- forbids tests from importing leading-underscore first-party symbols; auto-detects first-party packages, supports --package overrides and a # allow: private-test-imports carve-outscripts/fix_future_annotations.py -- ensures from __future__ import annotations is placed correctly; runs as a fixerHookify rule files in assets/. Copy these to the target repo's .claude/ directory.
assets/hookify.taste-enforcer.md -- captures user taste preferences and codifies them as hooks, rules, or configassets/hookify.no-junk-drawers.md -- warns on junk-drawer module names (utils.py, helpers.py, misc.py)assets/hookify.parse-dont-validate.md -- nudges toward boundary parsing with constrained typesassets/hookify.semantic-types.md -- detects bare primitives for domain concepts, nudges toward NewTypeassets/hookify.doc-code-coupling.md -- reminds authors to leave NOTE: back-pointers at code sites whose values are also documented in prose, so code and docs don't drift out of syncProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub crypdick/strictify --plugin strictify