From harness-engineering
Bootstraps new projects interactively (Node/TS scripted, others manual) or adds enforcement tooling (TDD, secret scanning, file limits, git hooks, CLAUDE.md) to existing projects.
npx claudepluginhub jrenaldi79/harness-engineering --plugin harness-engineeringThis skill uses the workspace's default tool permissions.
Before any other step, resolve the skill's install directory:
references/claude-md-guide.mdreferences/enforcement-scripts.mdreferences/stack-node-typescript.mdscripts/generate-claude-md.jsscripts/hooks/pre-commitscripts/hooks/pre-pushscripts/init-project.jsscripts/install-enforcement.jsscripts/lib/check-file-sizes.jsscripts/lib/check-secrets.jsscripts/lib/check-test-colocation.jsscripts/lib/generate-docs-helpers.jsscripts/lib/generate-docs.jsscripts/lib/validate-docs.jstemplates/eslint-base.jstemplates/gitignore-templatetemplates/global-claude.mdtemplates/lint-staged.config.jstemplates/project-claude.mdtemplates/rules/code-quality.mdSets up new projects or improves existing ones with project structure, git config, documentation, testing, code quality tools, workflows, and CI/CD.
Initializes projects for Claude Code by generating CLAUDE.md with progressive disclosure docs, auto-format hooks, test infrastructure; scaffolds empty directories via stack tooling; audits/syncs docs. Supports monorepos/multi-repo git workspaces.
Initializes new Python, Rust, or TypeScript projects interactively with git repo, GitHub workflows, pre-commit hooks, Makefile, and standard configs. Updates existing projects too.
Share bugs, ideas, or general feedback.
Before any other step, resolve the skill's install directory:
SKILL_DIR=$(find ~/.claude/plugins -path "*/setup/SKILL.md" -print -quit | xargs dirname)
SCRIPTS_DIR=$SKILL_DIR/scripts
TEMPLATES_DIR=$SKILL_DIR/templates
REFERENCES_DIR=$SKILL_DIR/references
If SKILL_DIR is empty, halt and tell the user: "Could not locate the setup plugin directory under ~/.claude/plugins. Verify the plugin is installed."
Check the working directory for these manifest files: package.json, pyproject.toml, CMakeLists.txt, go.mod, Cargo.toml, Makefile.
Also check for: .git/, src/, existing CLAUDE.md.
Determine:
.git/, effectively an empty directoryFor existing projects, record the detected stack so Phase 2 questions can be skipped where answers are already known.
Use the AskUserQuestion tool for each question, one at a time. Adapt or skip questions based on what was detected in Phase 1.
Q1 — Purpose (always ask): "What are you building?" — understand whether this is a web app, REST API, CLI tool, data pipeline, ML project, firmware, mobile app, etc.
Q2 — Language/stack (skip if inferred from manifest): "What language/stack would you like to use?"
Recommend based on the answer to Q1:
Q3 — Framework (skip if inferred; options depend on stack chosen):
Q4 — Project name (new projects only): "What should the project be called?" — suggest the current directory name as the default.
Do not ask about things you can infer. If the student says "firmware in C", ask about the build system, not web frameworks.
Skip this phase entirely for existing projects.
Node/TypeScript path (fast path — script does the work):
node $SCRIPTS_DIR/init-project.js --name=<name> --framework=<framework>
All other stacks (adaptive path — Claude does the work):
git initsrc/, tests/, scripts/, docs/pyproject.toml with [build-system] and [tool.pytest.ini_options]CMakeLists.txt with project name, C++ standard, and a test targetgo.mod with module path and Go versionCargo.toml with package metadatasrc/main.<ext> entry point and a tests/ placeholderRead $REFERENCES_DIR/enforcement-scripts.md first to understand the enforcement principles and the secret-scanning regex patterns before writing any scripts.
Node/TypeScript path (fast path):
node $SCRIPTS_DIR/install-enforcement.js --target=<project-root> --framework=<framework>
This also creates:
.claude/settings.json with pre-approved commands (test, lint, build, git) and a deny list blocking destructive operations (rm -rf /, git push --force, etc.). Normal file removal still works — Claude prompts for approval so the user stays in control..claude/rules/*.md — path-scoped rules (TDD, code quality, testing, TypeScript, and React for vite/nextjs) that auto-load when Claude works on matching file patterns. These use globs: YAML frontmatter for path-scoping.All other stacks (adaptive path — Claude creates equivalent enforcement):
Use the equivalents table to choose the right tools:
| Enforcement | Node/TS | Python | C/C++ | Go |
|---|---|---|---|---|
| Linter | ESLint | ruff / flake8 | clang-tidy | golangci-lint |
| Formatter | Prettier | black / ruff | clang-format | gofmt |
| Test runner | Jest | pytest | CTest / GoogleTest | go test |
| Pre-commit mgr | husky + lint-staged | pre-commit framework | git hooks (shell) | git hooks (shell) |
Steps for the adaptive path:
enforcement-scripts.md, adapted to the stack's scripting language (Python script, shell script, etc.)scripts/lib/ directory and place both scripts there.git/hooks/pre-commit — runs linter, formatter check, secret scanner, file size checker.git/hooks/pre-push — runs the test suite with SHA-based caching to skip unchanged codechmod +x .git/hooks/pre-commit .git/hooks/pre-push.claude/settings.json by copying $TEMPLATES_DIR/settings.json into the target project. Adjust the allow list entries to match the stack's commands (e.g., replace npm test with pytest for Python, go test ./... for Go).claude/rules/*.md from $TEMPLATES_DIR/rules/ into the target project. For non-TypeScript stacks, adapt rules/typescript.md to the relevant language conventions (e.g., PEP 8 for Python, Go naming conventions for Go)Read $REFERENCES_DIR/claude-md-guide.md first for quality guidelines — the goal is a dense, high-signal file where every line saves a future session from re-discovery.
Read $TEMPLATES_DIR/project-claude.md as the base pattern to follow.
Node/TypeScript (if generate-claude-md.js exists):
node $SCRIPTS_DIR/generate-claude-md.js --target=<project-root> --framework=<framework>
All stacks (or if the script doesn't exist yet) — Claude generates CLAUDE.md directly:
Adapt the template to include:
src/, tests/, scripts/ layout and what goes whereIf no global CLAUDE.md exists in the project's parent directory, read $TEMPLATES_DIR/global-claude.md and generate an adapted version for the detected stack.
Run a smoke test to confirm everything was installed correctly. Report each check as pass/fail and fix any failures before moving to the summary.
1. Git hooks are executable:
test -x .git/hooks/pre-commit && echo "PASS: pre-commit hook executable" || echo "FAIL: pre-commit hook not executable"
test -x .git/hooks/pre-push && echo "PASS: pre-push hook executable" || echo "FAIL: pre-push hook not executable"
2. Enforcement scripts run without errors: Run each enforcement script in check/dry-run mode against the project. They should all exit 0 on a freshly scaffolded project.
3. CLAUDE.md exists and has required sections: Verify the file exists and contains at minimum: a Commands section, an Architecture section, and a Gotchas section.
4. Agent config is valid:
.claude/settings.json exists and parses as valid JSON.claude/settings.json contains both permissions.allow and permissions.deny arrays.claude/rules/*.md file exists with globs: in its YAML frontmatter5. Auto-documentation pipeline works:
If generate-docs.js (or equivalent) was installed, run it and verify it completes without errors. This confirms that future commits will auto-update CLAUDE.md.
6. Linter runs clean: Run the stack's linter on the scaffolded code. A freshly generated project should have zero lint errors.
If any check fails, fix the issue immediately (e.g., chmod +x a hook, regenerate a missing file). Then re-run the failing check to confirm the fix. Only proceed to the summary once all checks pass.
After all phases complete and verification passes, output a summary that includes:
[bracketed placeholders] in CLAUDE.md