Our review
Installs a three-layer AI-assisted engineering system into the current project, including architecture conventions, review skills, and deterministic enforcement tools.
Strengths
- Language and framework agnostic, auto-detecting the stack.
- Combines AI-driven review with deterministic enforcement for robust code quality.
- Includes code embeddings for semantic duplicate detection.
- Update mode to keep installation in sync with project evolution.
Limitations
- Requires external tools like /research and significant setup time.
- Code embeddings require a database setup (voyage/pgvector).
- May be overkill for very small projects.
When setting up a new project or enhancing an existing one with AI-assisted code quality and architecture enforcement.
For trivial projects or when you want minimal tooling without AI integration.
Security analysis
CautionThe skill legitimately needs powerful tools like Bash and package managers to scaffold a development environment. It does not exfiltrate data or disable safety, but the dynamic installation and execution steps carry inherent risk if the research phase is compromised or the user is unaware of what is being installed.
- •Uses Bash to install packages and run scripts, which could be abused if research phase returns malicious tool recommendations.
- •Skill dynamically writes and executes hook scripts, creating potential for arbitrary code execution.
Examples
/code-factory/code-factory --update/code-factory --minimalname: code-factory description: Install an AI-assisted engineering code factory into the current project. Language and framework agnostic — researches the right tooling for the target stack and scaffolds skills, hooks, and static enforcement. Invoke with /code-factory. disable-model-invocation: true allowed-tools: "Read Write Bash Glob Grep Agent" argument-hint: "[--update | --minimal]"
Code Factory Installer
Install a three-layer AI-assisted engineering system into the current project:
- CLAUDE.md / engineer skill — architecture conventions (advisory, project-specific)
- AI review skills — complexity, SRP, DRY, meta-check (LLM review at Stop hook)
- Deterministic enforcement — linter, formatter, architecture rules, import boundaries (always-on, blocking)
Plus: code embeddings for semantic DRY detection, whitelist for accepted violations, code factory skills for scaffolding new modules.
Modes
- Default (no args) — full install. Detects language + framework, researches right tools, creates all files.
--update— re-detect and update existing installations to match current state of the codebase--minimal— skip code embeddings (no voyage/pgvector setup). Useful if the project is too small to justify them.
Phase 1: Detect the target stack
-
Identify the primary language:
- Python:
pyproject.toml,requirements.txt,setup.py - JavaScript/TypeScript:
package.json - Go:
go.mod - Rust:
Cargo.toml - Java/Kotlin:
build.gradle,pom.xml - Ruby:
Gemfile - Elixir:
mix.exs
- Python:
-
Identify the framework (if any):
- Python: Litestar, FastAPI, Django, Flask
- TS: Next.js, NestJS, Express, Fastify, Hono
- Go: Gin, Echo, Fiber, chi
- Rust: axum, actix, rocket
- Java: Spring Boot, Micronaut, Quarkus
-
Identify the package manager:
- Python: uv, poetry, pip
- JS: npm, pnpm, yarn, bun
- Go: go modules
- Rust: cargo
-
Identify testing framework already in use.
-
Write findings to
.claude/code-factory-stack.mdfor reference.
Phase 2: Research language-specific tooling
You must use /research (the multi-source research skill) to find current best-in-class tools for the target language. Do NOT guess. Research these:
-
Linter + formatter (fast, sub-second on edits):
- What is the Ruff equivalent? (Python: ruff, TS: biome/eslint+prettier, Go: gofmt+golangci-lint, Rust: rustfmt+clippy, Ruby: rubocop, Java: checkstyle/spotless)
-
Architecture enforcement (layer/import rules):
- What is the import-linter equivalent? (Python: import-linter, TS: dependency-cruiser/eslint-plugin-boundaries, Java: ArchUnit, Go: go-arch-lint/dep)
-
Complexity rules (cyclomatic, cognitive):
- What rules exist in the linter for branches/statements/complexity?
-
Testing:
- Standard testing framework + HTTP client for integration tests
- Whether query-counting fixtures / N+1 detection tooling exists
-
Duplicate detection (beyond embeddings):
- jscpd, PMD CPD equivalents
-
Empirical Big O:
- bigO (Python), hyperfine (any), criterion (Rust), benchmark.js (JS)
Phase 3: Install dependencies
Install the language-specific tools via the project's package manager. Never skip this — deterministic enforcement is the most important layer.
Phase 4: Scaffold the factory files
Create the following in the target project (adapted per language):
.claude/skills/engineer/SKILL.md
Project-specific architecture skill. See templates/engineer.spec.md for the required structure and placeholders. Uses paths: to auto-load when editing source files.
.claude/skills/complexity-check/SKILL.md
Copy as-is from templates/complexity-check.md. Inside, substitute the linter invocation command with the language's equivalent (researched in Phase 2).
.claude/skills/srp-check/SKILL.md
Copy as-is from templates/srp-check.md. Language-independent — the check is pure LLM prompt.
.claude/skills/dry-check/SKILL.md
Copy as-is from templates/dry-check.md. Replace the hook script path in the skill body with the target language's script extension.
.claude/skills/dead-code-check/SKILL.md
Copy as-is from templates/dead-code-check.md. The guardrails section at the end lists language-specific false-positive patterns; retain the block matching the target language and remove the rest.
.claude/skills/benchmark/SKILL.md
Copy from templates/benchmark.md. Replace the bigO-specific example block with the language's equivalent benchmarking library (criterion for Rust, hyperfine for CLI, benchmark.js for JS, JMH for Java, go test -bench for Go).
.claude/skills/new-model/SKILL.md and .claude/skills/new-step/SKILL.md
Code factory skills. See templates/factory-skills.spec.md for the abstract structure. Write language-appropriate versions; reference references/python-litestar/new-model.md for a concrete example.
.claude/whitelist.yaml
Copy as-is from templates/whitelist.yaml. YAML format is language-independent.
.claude/hooks/check-imports.<ext>
Architecture enforcement script. See templates/check-imports.spec.md for the interface contract. Write in whatever language fits the project. Reference references/python-litestar/check-imports.sh.
.claude/hooks/code_embeddings.<ext>
Function extractor + voyage-code-3 indexer. See templates/code-embeddings.spec.md for interface and schema. Use the target language's tree-sitter grammar. Reference references/python-litestar/code_embeddings.py.
.claude/hooks/whitelist.<ext>
Whitelist loader (reads .claude/whitelist.yaml). Simple utility — use whatever language fits. Reference references/python-litestar/whitelist.py.
.claude/settings.json
Hook wiring. See templates/settings.spec.md for structure and per-language command substitutions. Reference references/python-litestar/settings.json.
Project-level config
Add linter config with the research-recommended rules (complexity, unused imports, formatting) to the project's standard config file (pyproject.toml, package.json, .eslintrc, golangci.yml, Cargo.toml, etc.).
Add architecture rule config (import-linter contracts, dependency-cruiser config, ArchUnit tests, etc.).
Phase 5: Verify
Run all static checks on the existing codebase:
- Linter: report any findings but don't block installation
- Architecture rules: report violations, ask user to fix or whitelist
- Run any existing tests to confirm we didn't break the toolchain
Phase 6: Update CLAUDE.md
If CLAUDE.md exists, append or update:
- Reference to
.claude/skills/engineer/SKILL.md - Reference to the code-factory tooling
- Key commands added (uv, npm, go, etc.)
If not, create a minimal one.
Dependencies
Required API keys:
VOYAGE_API_KEY— for code embeddings (skip with--minimal)
Required local tools:
git- Language-specific package manager (detected in Phase 1)
jq(for hook JSON parsing)- For Python:
pgvectorextension on Postgres (if using embeddings)
When to Use
- Starting a new project — full install
- Joining an existing project —
/code-factoryto bootstrap AI tooling - After a major refactor —
/code-factory --updateto re-sync
Philosophy
The three layers are complementary:
- CLAUDE.md + engineer skill: advisory knowledge. LLM reads and follows (usually).
- AI check skills: LLM review layer. Catches judgment-call issues (SRP, algorithmic intent).
- Deterministic enforcement: shell/lint scripts that cannot be ignored. Catches mechanical violations.
Each layer is necessary. None is sufficient alone. CLAUDE.md alone = hoping Claude remembers. Linters alone = no judgment. AI reviews alone = no hard guarantees.
Reference Implementation
The first implementation was for a Python/Litestar project at /Users/jarekbird/aprative/electrical-floorplan-back. You can read its .claude/ directory as a complete working example before adapting to a new language.
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.