[Documentation] Use when generating, smart-merging or refactoring the root AI context (CLAUDE.md, AGENTS.md) and its Claude/Codex projections. Config file only: project-config.
The English summary is being prepared. Showing the original description.
[Quality] Use when a workflow step or the user asks for linters, formatters, type checks and static analysis in pre-commit and CI gates.
The English summary is being prepared. Showing the original description.
Review the instructions the agent will receive before you install.
<!-- PROMPT-ENHANCE:STEP-TASK-ANCHOR:END -->[BLOCKING] Execute skill steps in declared order. NEVER skip, reorder, or merge steps without explicit user approval. Inside a workflow run,
/start-workflow→ Workflow-step mode bounds this rule. [BLOCKING] Before each step or sub-skill call, update todo tracking: setin_progresswhen step starts, setcompletedwhen step ends. [BLOCKING] Every completed/skipped step MUST include brief evidence or explicit skip reason. [BLOCKING] If Task tools are unavailable, create and maintain an equivalent step-by-step plan tracker with the same status transitions.
Goal: Install a strict, stack-appropriate quality sensor layer—linter, formatter, type checker, static/dependency/architecture analysis, pre-commit, and CI—so every code change is checked locally and in CI with zero divergence before reaching main.
Summary:
ask user question tool; (3) install/configure strict settings, document rule purpose, update .gitignore, ALWAYS emit .editorconfig; (4) wire staged-files-only <30s formatter→linter→type-check hook and document README.md; (5) mirror format→lint→type→static→dep-scan in CI with coverage diagnostic-only; (6) prove the hook blocks an INTENTIONAL violation; (7) ask whether to continue to /harness-setup.ask user question tool for unknown stack/CI fields, tool choices, or loosening; keep local/CI commands, config, and versions identical; line coverage stays diagnostic-only; architecture fitness is N/A without declared dependency directions..editorconfig, and README setup; invoked after /scaffold, before /harness-setup.Output: Config files at project root + pre-commit hook config + CI quality gate step + .editorconfig.
When invoked: After /scaffold in the greenfield workflow, before /harness-setup.
Design principles:
Read in priority order: (1) plan.md YAML frontmatter — tech_stack, language, framework; (2) architecture --mode=design report — tech stack comparison table; (3) tech-stack-comparison report — chosen stack.
Extract primary language(s), framework(s), CI provider/tooling, test framework, package manager. Write profile to tmp/linter-setup/stack-profile.md:
# Stack Profile
Language: {language}
Framework: {framework}
Package Manager: {npm/pip/dotnet/go/cargo/etc}
CI Provider/Tooling: {github-actions/gitlab-ci/azure-pipelines/etc}
Test Framework: {framework}
If any critical field undetectable → ask user question tool to confirm before research.
MANDATORY IMPORTANT MUST ATTENTION — Use QUERY TEMPLATES, not tool names. DO NOT hardcode recommendations; research the detected stack's current ecosystem and present options.
For each tech stack layer detected, research these TOOL CATEGORIES using the query templates below:
| Category | Purpose (WHY) | Research Query Template |
|---|---|---|
| Linter | Catch bugs, enforce style, prevent common errors at author time | "{language} best linter {year} community standard" |
| Formatter | Eliminate style debates, enforce consistent code shape | "{language} opinionated code formatter {year}" |
| Type Checker | Catch type errors without runtime — strongest computational sensor | "{language} static type checker {year}" |
| Static Analyzer | Deep bug patterns, complexity, dead code, security CWEs | "{language} static analysis SAST tool {year}" |
| Dependency Scanner | Known CVEs in dependencies — supply chain security | "{language} dependency vulnerability scanner {year}" |
| Architecture Fitness | Enforce module boundaries, dependency direction | "{language} architecture linting module boundaries {year}" |
Research process per category:
ask user question tool: "For {category} in {language}, which tool?" — top 2–3 options with brief pros/cons.IMPORTANT: Confidence in current ecosystem <80% (fast-moving ecosystem, unfamiliar stack) → use WebSearch to verify before presenting options. — why: tool ecosystems churn fast; stale recommendations cargo-cult dead tools.
The Architecture Fitness category chooses dependency-direction / module-boundary enforcement from the architecture --mode=design "Arch rules / fitness" scaffold handoff. The following are example candidates to research and evaluate for stack fit, never mandatory installs. Research the current ecosystem, present the top 2–3 via ask user question tool, and let the user confirm:
| Stack family | Example dependency-boundary tools (evaluate, do NOT hardcode) |
|---|---|
| JS / TS | dependency-cruiser, eslint-plugin-boundaries (eslint-boundaries), Nx module-boundary lint |
| .NET | NetArchTest, ArchUnitNET |
| JVM | ArchUnit |
| Python | import-linter |
| Go | go-arch-lint / depguard |
Add a boundary tool only when architecture declares dependency directions; otherwise record N/A — no cross-module dependency rules declared. Chosen rules MUST encode those directions and fail CI, matching pre-commit (local↔CI zero divergence). architecture --mode=scalability owns init/audit grading; architecture --mode=review owns per-change drift. — why: a boundary tool without declared rules is ceremony; enforcement without CI teeth is documentation.
After user selects tools:
ask user question tool..{tool}rc, {tool}.config.{ext}, pyproject.toml section, etc..gitignore.editorconfig (ALWAYS generate — stack-agnostic):
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Adjust indent_size and end_of_line to detected stack conventions.
Framework names are glue, not quality-tool defaults. Pre-commit framework selection may follow stack conventions; quality tools invoked inside hooks remain the research-driven selections above.
Detect pre-commit framework for the stack:
pre-commit package).git/hooks/pre-commit shell scriptConfigure hooks in this order (fastest first):
Performance constraint: Hooks MUST run in <30 seconds total. If slower:
Generate:
.husky/pre-commit, .lefthook.yml, .pre-commit-config.yaml, etc.)README.md section: "## Code Quality — Pre-commit Hooks" with setup instructions for new team membersDetect CI provider/tooling from repository files:
.github/workflows/ → GitHub Actions.gitlab-ci.yml → GitLab CIazure-pipelines.yml → Azure PipelinesJenkinsfile → Jenkinsbitbucket-pipelines.yml → Bitbucket PipelinesIf not detected → ask user question tool: "Which CI provider/tooling does this repository use?"
Generate a CI job/step that:
--check mode, no auto-fix)MANDATORY: CI gate must match pre-commit hooks. If a check runs locally, it runs in CI. No divergence.
After all config files generated, verify MUST ATTENTION each item:
.editorconfig created at project rootREADME.md — new devs know to run {hook install command} after clone.gitignore updated with tool cache directoriesInside a workflow: when this skill runs as a step of an active workflow, skip the prompts in this section and return the result — the workflow's next step decides what runs (
/start-workflow→ Step Execution Protocol, Workflow-step mode).
ask user question tool:
<!-- PROTOCOL-GUIDES:START -->[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting. This prevents context loss from long files. Keep task depth proportional to the work.
Protocol guides — Apply each protocol only when its read-when condition holds. If a protocol's text is not in your context, read its file below before you act on it.
engineering-foundation-gate — Seven engineering-foundation dimensions judged by project profile; creating or reviewing how a project is built, run, tested or checked → .claude/skills/shared/protocols/engineering-foundation-gate.mdIMPORTANT MUST ATTENTION follow declared step order for this skill; NEVER skip, reorder, or merge steps without explicit user approval; inside a workflow run, /start-workflow → Workflow-step mode bounds this
IMPORTANT MUST ATTENTION for every step/sub-skill call: set in_progress before execution, set completed after execution
IMPORTANT MUST ATTENTION every skipped step MUST include explicit reason; every completed step MUST include concise evidence
IMPORTANT MUST ATTENTION if Task tools unavailable, maintain an equivalent step-by-step plan tracker with synchronized statuses
IMPORTANT MUST ATTENTION evidence-backed lifecycle/scale/criticality/repo/runtime profile; unknowns take lower tiers. Judge all 7 outcomes: F1 reproducible build/run/test · F2 exercise supported/required modes; dual modes only when warranted · F3 applicable local/CI/production-shaped test portability · F4 test-strength proof; no universal mutation tool · F5 measured performance at warranted scale/risk · F6 build/change scalability at meaningful module boundaries · F7 stack/profile-fit mechanical checks. Evidence-backed N/A-by-profile is valid; prevent over-engineering. Creation blocks warranted omissions; brownfield advises without score changes, with smallest next steps. Catalog: .claude/docs/engineering-foundation-catalog.md; update first, re-run inject_engineering_foundation_gate.py.
IMPORTANT MUST ATTENTION Goal: Install a strict, stack-appropriate quality sensor layer—linter, formatter, type checker, static/dependency/architecture analysis, pre-commit, and CI—so every code change is checked locally and in CI with zero divergence before reaching main.
IMPORTANT MUST ATTENTION Main steps (in order — no skip/reorder): (1) detect stack/profile → (2) research six categories with QUERY TEMPLATES, score top 3, present 2–3 via ask user question tool → (3) install/configure strict settings, document rule purpose, update .gitignore, ALWAYS emit .editorconfig → (4) wire staged-files-only <30s formatter→linter→type-check hook and document README.md → (5) mirror format→lint→type→static→dep-scan in CI with coverage diagnostic-only → (6) prove the hook blocks an INTENTIONAL violation → (7) ask whether to continue to /harness-setup.
IMPORTANT MUST ATTENTION Gates: Track each step/sub-skill with status + evidence; use ask user question tool for unknown stack/CI fields, tool choices, or loosening; keep local/CI commands, config, and versions identical; line coverage stays diagnostic-only; architecture fitness is N/A without declared dependency directions.
IMPORTANT MUST ATTENTION use QUERY TEMPLATES in Tool Research — NEVER hardcode tool names in the research phase; research the detected stack's current ecosystem and present options — why: tool ecosystems churn fast, hardcoded names cargo-cult dead tools.
IMPORTANT MUST ATTENTION present top 2-3 options per category via ask user question tool — let the user pick; NEVER auto-select — why: tool choice is a team-owned decision, not the skill's.
IMPORTANT MUST ATTENTION Test pre-commit only in an isolated temporary fixture: lint-specific rejection, valid success and absent-hook failure classification; preserve the working HEAD/index and clean fixture artifacts — why: an unproven gate is no gate.
IMPORTANT MUST ATTENTION CI gate MUST match pre-commit hooks — if a check runs locally it runs in CI, no divergence — why: divergent local/CI checks let violations slip through one path.
MUST ATTENTION detect the stack FIRST (plan.md → architecture report → tech-stack report); if a critical field is undetectable, ask user question tool before research — why: every downstream tool choice depends on the stack profile.
MUST ATTENTION configure with the STRICTEST reasonable defaults; loosen ONLY with explicit user approval via ask user question tool — why: starting strict is easier to loosen than starting loose is to tighten.
MUST ATTENTION ALWAYS emit a stack-agnostic .editorconfig and add tool cache dirs to .gitignore — why: editorconfig is the one truly portable cross-tool baseline; cached artifacts must never be committed.
MUST ATTENTION order hooks formatter→linter→type-check, staged-files-only, <30s; defer slow checks (static analysis, full type-check) to CI — why: a slow hook gets bypassed, killing local feedback.
MUST ATTENTION report line-coverage as a DIAGNOSTIC only — NEVER fail the build on a coverage %; choose profile-fit intent evidence if a test-strength sensor is warranted — why: high coverage is not evidence of assertion quality.
MUST ATTENTION pre-commit hook framework names ARE allowed (ecosystem glue, not research choices) — the quality tools invoked inside them are the research-driven selections — why: keep the generic/research boundary clear.
MUST ATTENTION when confidence in the current ecosystem is <80% (fast-moving or unfamiliar stack), use WebSearch to verify before presenting options — cite confidence % for every recommendation; <60% DO NOT recommend — why: stale tool advice fails silently.
MUST ATTENTION grep/glob the repo for 3+ existing config/CI patterns before generating new ones — match the project's existing layout, don't impose a foreign convention — why: a config that fights local convention gets reverted.
MUST ATTENTION evaluate fit before copying a nearby config — verify the new stack shares the same package manager, CI provider, and conventions as the source — why: closest example ≠ matching preconditions.
MUST ATTENTION bootstrap a TaskCreate breakdown (one task per category/config file + a final verification task) BEFORE acting; keep exactly one task in_progress — why: long research/config work loses context without external tracking.
Anti-Rationalization:
| Evasion | Rebuttal |
|---|---|
| "I know the best linter for this stack" | Ecosystems churn — research current options, present 2-3 via ask user question tool. Hardcoding = stale. |
| "Strict defaults are too aggressive, loosen now" | Start strict; loosen ONLY with explicit user approval. Easier to loosen than to tighten later. |
| "Hook works, no need to test it" | Fire an INTENTIONAL violation and confirm it blocks. Unproven gate = no gate. |
| "Local checks are enough, skip CI" | CI gate MUST mirror pre-commit. No divergence — a local-only check is bypassable. |
| "Coverage % is high, gate on it" | Coverage is diagnostic only. Gate on mutation score; high coverage ≠ strong assertions. |
| "Simple stack, skip task tracking" | Still bootstrap TaskCreate. Skip depth, never skip tracking. |
IMPORTANT MUST ATTENTION use QUERY TEMPLATES — NEVER hardcode tool names; present top 2-3 via ask user question tool.
IMPORTANT MUST ATTENTION prove the pre-commit hook blocks an intentional violation before declaring complete.
IMPORTANT MUST ATTENTION CI gate must match pre-commit hooks — zero divergence between local and CI checks.
[TASK-PLANNING] Before acting, analyze task scope and break it into small todo tasks using TaskCreate.
No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
[Documentation] Use when generating, smart-merging or refactoring the root AI context (CLAUDE.md, AGENTS.md) and its Claude/Codex projections. Config file only: project-config.
The English summary is being prepared. Showing the original description.
[Code Quality] Use when a workflow step or the user asks for AI code or plan review: LLM calls, prompts, agents, RAG, evals and guardrails. --mode={code|plan}; --report-only is read-only.
The English summary is being prepared. Showing the original description.
[Architecture] Use when a workflow step or the user asks for architecture design, compliance review, scalability grading or whole-project audit via --mode={design|review|scalability|full}.
The English summary is being prepared. Showing the original description.
[Content] Use when a workflow step or the user asks for product/feature ideation with ranked opportunities and validation tests. --mode={roadmap|scope}.
The English summary is being prepared. Showing the original description.
[Content] Use when a workflow step or the user asks for business viability: Business Model Canvas, financials, risks and go-to-market recommendation.
The English summary is being prepared. Showing the original description.
[Code Quality] Use when a workflow step or the user asks for a focused code-change review: staged, unstaged, branch diff or simple pull request. --fix-loop fixes and re-reviews. Complex pull request: workflow-review-changes; rationale: why-review.
The English summary is being prepared. Showing the original description.