factory-baseline
Bootstrap or align a repository to the Factory quality, CI, security, worktree, and agent-entry baseline (PC-01..PC-23 + SAST). Use for /factory-baseline…
от watt-mind★ 25 звёзд на GitHub
Установить factory-baseline в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Align a Repository to the Factory Baseline
Bring a new or lagging repository into conformance with Factory's PC-01…PC-23 baseline and SAST controls in one clean, verified pull request.
1. Read the Baseline References
Read both bundled references in full before touching files:
references/project-conventions.md—PC-01…PC-23,W-1…W-13,H-1…H-8,R-1…R-6, concurrency, branch protection, agent entry files.references/code-security.md— Semgrep, Gitleaks, Actionlint, ESLint security rules, RuffSrules,pip-audit,npm audit --audit-level=high, Lefthook/Husky hooks.
If an org-local conventions overlay exists on this machine (for example via $FACTORY_CONVENTIONS_OVERLAY or your org's infra docs), also read it for org-specific runner labels and tracker team/project mappings.
2. Survey and Grade (PC-01…PC-23)
Inspect the target repository against origin/<base> (git fetch --quiet) and live GitHub state:
- Stack & scripts: Node/Bun/TypeScript (
package.json), Python (pyproject.toml,uv.lock,requirements*.txt), Rust/Go, Docker/GHCR. - Branches & visibility: integration branch (
developor default), deploy branch (main/master), and repo visibility (gh repo view --json isPrivate,nameWithOwner-> private org repos pin target self-hosted labels perPC-03; public repos allow hosted runners when configured). - Grade
PC-01…PC-23: Record PASS / FAIL / N/A (with concrete repo-grounded N/A reasons only) before editing.
If --dry-run was passed, stop after outputting the PC-01…PC-23 grade matrix and remediation plan.
3. Ticket and Worktree Discipline
Follow AGENTS.md / shared/floor.md:
- Before writing files inside an existing tracked repo, find or create a tracking issue (unless working explicitly with
--no-ticket/"no ticket"). - Work inside an isolated worktree (
bin/worktree-up.sh <ISSUE-ID>when present, otherwisegit worktree add). Never usegit stashorgit rebase --autostash.
4. Scaffold or Align In-Repo Baseline
Apply only the missing or drifting items cleanly within the target stack (respecting specific check IDs when $ARGUMENTS names a subset such as PC-01 PC-06 PC-10):
PC-01–PC-05,PC-22(.github/workflows/ci.yml):- Run lint, typecheck, format check, and unit tests on
pull_requestand pushes to integration/deploy branches. - Use the baseline
concurrency:group (ci-${{ github.event_name }}-${{ github.event.pull_request.number || github.sha }}, canceling onlypull_requestruns). - Match
runs-on:to the repo's runner policy (PC-03), setretention-days: 1on everyupload-artifact(PC-04), and enforceH-1…H-8Docker/port isolation for E2E containers. - Wire dependency CVE checks (
npm audit --audit-level=highfor JS/TS;pip-auditfor Python).
- Run lint, typecheck, format check, and unit tests on
PC-06(.github/workflows/security.yml& language SAST):- Add CodeQL (gated with
vars.CODEQL_ENABLED == 'true'if unavailable on the plan, andram: 8192ingithub/codeql-action/analyze), Semgrep, Gitleaks, and Actionlint. - For Python repos, add calibrated
ruff.toml(Srules with test-dir exemptionsS101,S105,S106,S107,S608— advisory-first if legacy backlog exists). - For JS/TS repos, configure ESLint + Prettier (
lint,typecheck,format,format:checkscripts).
- Add CodeQL (gated with
PC-07(.github/dependabot.yml):- Configure weekly package ecosystem updates + monthly
github-actionsupdates targeting the integration branch.
- Configure weekly package ecosystem updates + monthly
PC-10(Local Git hooks):- Prefer
lefthook.yml(stagedgitleaks git --pre-commit --staged, commit-msg format gate, stagedruff/linter) or Husky +lint-staged+@commitlint/climatching repo conventions.
- Prefer
PC-12–PC-14,PC-19–PC-20(AGENTS.md,CLAUDE.md,GEMINI.md,docs/product-decisions.md):- Ensure
AGENTS.mddocuments the stack, commands, tracker/branch pointer, worktree workflow (W-12), and current<!-- FACTORY:FLOOR:BEGIN -->block (sync from$FACTORY_ROOTviabun build/emit.mjs --sync-floorwhen registered inconfig/repos.yaml). - Create/align thin
CLAUDE.mdandGEMINI.mdentry pointers without duplicating protocols or vendor skill dumps. - Seed
docs/product-decisions.mdif absent (PC-19) and demote any competingtodo.md/issues.mdfile (PC-14).
- Ensure
PC-15(Worktree isolation):- Scaffold Worktrunk
.config/wt.tomlorbin/worktree-{up,down,warm}.shmeetingW-1…W-13(deterministic per-ticket ports/DB, fail-closedmigrate deploy, non-interactive, safe teardown), or explicitly documentmax_in_flight: 1when deferring to a dedicated follow-up ticket.
- Scaffold Worktrunk
PC-16,PC-17,PC-21,PC-23(Deploy smoke, E2E, Dev login, GHCR retention):- Add or verify post-deploy smoke workflow (
PC-16),e2e.yml(PC-17), fail-closedbin/dev-login.sh(PC-21, if authenticated UI), andR-1…R-6(
- Add or verify post-deploy smoke workflow (
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/code-security.md
- references/project-conventions.md
FAQ
Что делает скилл factory-baseline?
Bootstrap or align a repository to the Factory quality, CI, security, worktree, and agent-entry baseline (PC-01..PC-23 + SAST). Use for /factory-baseline, /factory-audit --fix, or when setting up CI, lint, hooks, security scans, worktree scripts, and AGENTS.md for a new or lagging repo.
Как установить скилл factory-baseline?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл factory-baseline запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…