name: project-init description: Apply project-workflow standards to a repo — feat → dev → main promotion model + CI gate, GitHub repo setup (branch protection, environments, secrets, OIDC), and the quality stack (skylos/fallow via lefthook + a shared justfile, run identically in CI). Detects current state and applies only the missing patterns, so it works on both new repos and existing ones. Use when setting up a new project or bringing an existing one up to standard. user-invocable: true
Initialize project standards
You are applying the project-workflow standards to the current repo — either first-time setup for a new project, or bringing an existing repo up to standard. This skill detects what's already in place and applies only the gaps, so it's safe to run against either. Run through this checklist.
Step 1: Detect the current state
Read the current repo's state quickly:
git remote -v— confirm it's a real git repo with a remote.git branch -a— does adevbranch already exist?ls .github/workflows/— what CI is wired today? Is there apull_requestgate or only deploy-on-push?ls lefthook.yml justfile .pre-commit-config.yaml 2>/dev/null— does the quality stack already exist (lefthook+just, or legacy pre-commit)?gh api repos/{owner}/{repo}/branches/main/protection 2>/dev/nullandgh api repos/{owner}/{repo}/environments 2>/dev/null— ismainprotected, dodev/prodenvironments exist? (A 404 means not set up.)- Languages — don't key on a root manifest alone; a repo can have code without one. Detect:
- Python → any
*.py, or apyproject.toml/pytest.ini/setup.cfganywhere (incl. subdirs).git ls-files '*.py' '*pyproject.toml' '*pytest.ini'. - Node/TS →
package.json(andtsconfig.jsonfor a real TS project; a handful of stray.tsfiles with nopackage.jsonare scripts/templates, not a project — don't wire TS tooling for them). - Note the layout: is there a root manifest, or does the code live in subdirs (monorepo / plugin-style)? This decides where the quality stack points (see Finding-3 handling in
quality-stack-setup).
- Python → any
- Deployability — does anything actually deploy? Look for IaC (
cdk.json,*.tf,serverless.yml,Dockerfile+ a host), a deploy script, or existing deploy workflows. If nothing deploys, this is a library / CLI / docs / plugin-marketplace repo → apply the branch model + CI gate, and skipdeploy-{dev,prod}.yml, environments, secrets, and OIDC entirely. - Multi-repo? Check for
.feature-workspace.ymlat the root (already a workspace) — and if absent, consider whether this repo is meant to coordinate several interconnected repos in one org (the user is setting up a hub, the repo is near-empty but the org has related repos, or they say so). A workspace is a thin coordination repo with member repos nested as independent clones; it's scaffolded byfeature-init --workspace, not by hand. If it's a workspace (or should be), offer the multi-repo on-ramp (Step 2 menu → Step 3 section). An ordinary single repo skips all of this.
Report what you found before asking anything. Don't apply patterns that are already in place, and don't propose deploy machinery for a repo with nothing to deploy.
Step 2: Ask which patterns to apply
Use AskUserQuestion with one multi-select question covering only the missing patterns:
| Pattern | Skill to load for the rationale | Templates |
|---|---|---|
Branch promotion model (dev + CI gate; + deploy workflows only if the repo deploys) |
branch-promotion-model |
github-workflows/ci.yml always; deploy-{dev,prod}.yml only if deployable |
| GitHub repo setup — branch protection always; environments/secrets/OIDC only if deployable | github-repo-setup |
none — gh commands |
| Quality stack (lefthook hooks + justfile, shared with CI) | quality-stack-setup |
justfile, lefthook.yml (+ fallowrc.example.json if TS) |
| Multi-repo workspace scaffolding (coordinate several repos as one) — only if this is/should be a workspace | feature-workflow:feature-init --workspace |
.feature-workspace.yml, .gitignore, .claude/settings.json, CLAUDE.md, scripts/clone-members.sh |
The multi-repo workspace row is independent of the others: it's the on-ramp for feature-workflow's cross-repo model, not a per-repo standard. Offer it only when Step 1 found (or the user wants) a workspace. The branch model + CI gate + quality stack still apply — to the workspace repo itself, and separately to each member (run /project-init inside a member).
If the repo deploys: the promotion model and repo setup are paired — the deploy workflows reference environment: / secrets.* that repo setup creates, so recommend them together or the first deploy fails. If it doesn't deploy (library/CLI/docs/marketplace — per the Step 1 deployability probe): offer only dev + ci.yml + branch protection; do not propose deploy-{dev,prod}.yml, environments, secrets, or OIDC.
This skill is setup only. Evergreen coding standards live elsewhere and don't belong in this one-shot menu — e.g. when the repo fetches from GitHub at runtime, the github-api-discipline skill (engineering-standards plugin) fires on its own; you don't wire it here.
Skip any pattern that's already in place. If nothing is missing, say so and stop.
Step 3: For each selected pattern, in order
Branch promotion model
- If no
devbranch exists locally and onorigin:git push origin refs/remotes/origin/main:refs/heads/devto create it. - Always copy
${CLAUDE_PLUGIN_ROOT}/templates/github-workflows/ci.ymlinto.github/workflows/— the PR gate applies to every repo. Don't overwrite existing files without confirming. - Only if the repo deploys (Step 1 deployability probe): also copy
deploy-dev.yml+deploy-prod.yml, and surface their CUSTOMIZE comments — cloud auth (AWS_ROLE_ARN_DEV/PROD by default), build/deploy steps, smoke-check URLs. Then flag that they referenceenvironment:/secrets.AWS_ROLE_ARN_*that don't exist yet → do the GitHub repo setup section before the first deploy. If it doesn't deploy, skip this step entirely — no deploy workflows. - Adapt
ci.ymlto the repo: point its steps at the real check command (just verify), and for a non-deploy repo drop thebuildstep if there's nothing to build. For Python-in-subdirs (no root manifest), make the steps run the subdir suites (seequality-stack-setup). - Note the suggested next move: make the change on a branch, PR into
main(still the source of truth at setup time), and merge — that's the cutover. From then on, feature PRs targetdev.
GitHub repo setup (protection, environments, secrets, OIDC)
Load the github-repo-setup skill for the rationale and the exact gh/gh api commands. This is mostly GitHub-side configuration, not files — walk the user through it rather than copying templates. Do not run these silently; they change repo settings, so show each command and let the user run it (or confirm before you do).
Branch protection applies to every repo. Environments / secrets / OIDC are deploy-only — skip them for a non-deploying repo.
- Always — branch protection on
main(PR required,cistatus check required, ≥1 approval, no force-push/deletion) and a lighter version ondev(PR +cirequired). Thecicheck must have run at least once before it can be marked required — so landci.ymlfirst, let one PR run it, then enable the requirement. - Deploy repos only — create the
devandprodenvironments; add required reviewers toprodand a deployment-branch policy limitingprodtomain(anddevtodev). This is what makes the promotion model's "deliberate prod deploy" real. - Deploy repos only — set environment-scoped secrets (
AWS_ROLE_ARN_DEVondev,AWS_ROLE_ARN_PRODonprod), not repo-scoped, so prod creds are only reachable from the reviewer-gated environment. - Deploy repos only — if using OIDC (the templates do), set up the cloud trust scoped to
…:environment:prod/:environment:dev, not just the repo. The skill has the AWS trust-policy snippet.
Quality stack
Load the quality-stack-setup skill for the full rationale. The model: a justfile holds the checks (single source of truth), lefthook dispatches them by git stage, and CI runs the same just verify — so local and CI can't drift. Install steps:
- Copy
${CLAUDE_PLUGIN_ROOT}/templates/justfileand${CLAUDE_PLUGIN_ROOT}/templates/lefthook.ymlto the repo root. - Adjust to the project's languages: recipes auto-detect Python (
pyproject.toml) / TS-JS (package.json); delete the language commands not used, set thekioskTS dir inlefthook.yml, pointtestat the project's runner. Detect the languages from Step 1 and tailor rather than asking blindly. - (TS) Copy
${CLAUDE_PLUGIN_ROOT}/templates/fallowrc.example.jsonto the TS dir as.fallowrc.json; adjust ignores. - Install + enable, and add to the project README:
brew install just lefthook # or: cargo install just; npm i -D lefthook lefthook install - Confirm
ci.ymlis present and runsjust verify(it's installed with the promotion model) — that's the unbypassable backstop and the parity anchor. It must be a required status check (see the GitHub repo setup section). - Suggest adding to project
CLAUDE.md: a "Quality stack" section — lefthook runs fixers on commit +just verifyon push; CI runs the same; no--no-verify; suppressions need an inline rationale (point at thesuppression-disciplineskill).
Multi-repo workspace scaffolding
Only when Step 1 found (or the user wants) a workspace — a coordination repo for several interconnected repos. This is not a per-repo standard; it's the on-ramp for the multi-repo model in feature-workflow. Skip it for an ordinary single repo.
The model: a thin workspace repo holds the coordination files; each member repo is nested inside it as an independent, gitignored clone (not a submodule). You launch Claude at the workspace root, so cross-repo edits never prompt, yet each member stays its own git repo. Full day-to-day model: feature-workflow/skills/shared/workspace.md.
- Scaffold it — don't hand-write the manifest. Run the feature-workflow scaffolder:
This writes/feature-workflow:feature-init --workspace --org <org> \ --member <dir>=<owner/repo> --member <dir>=<owner/repo>.feature-workspace.yml(manifest + workspace identity), a.gitignorethat ignores the member clones (while keeping the shared.claude/settings.jsontracked),.claude/settings.jsonallowlistinggit -C */gh -R *so member ops never prompt, aCLAUDE.mdtopology skeleton, the workspace's own.feature-workflow.yml(targetsmain), andscripts/clone-members.sh. - Pull the members in:
bash scripts/clone-members.shclones every member listed in the manifest into the workspace tree (idempotent — skips ones already present). - Fill in the topology (optional; edit
.feature-workspace.yml, the scaffolder leaves commented examples):contracts:(producer → consumers — drives the contract-edit warning) anddeploy:(ordered producer-first — drives/feature-deploy). - Apply standards to the right place. The branch model + CI gate + quality stack apply to the workspace coordination repo itself (its own commits), and separately to each member — run
/project-initinside a member to bring it up to standard. The workspace's.feature-workflow.ymlalready targetsmain; each member keeps its owndev→mainmodel. - Hand off: point the user at
feature-workflow/skills/shared/workspace.md— how single-member features (cd <member>), cross-repo epics (repo:idchildren), contracts, and coordinated deploy work from here.
Verify and hand off (do this whenever the quality stack was installed)
The install is not done until the hooks are proven to fire:
- Run
/quality-verify-hook(quality-workflow) — stages known-bad fixtures and asserts the hook fails. A hook that doesn't fail on bad input is not a hook. - Run
/quality-audit(quality-workflow) for a baseline snapshot. On an existing repo this surfaces the debt the new gates will start enforcing. - Point the user at the
suppression-disciplineskill (quality-workflow) for the standing rule, and/quality-unblockfor when a hook later blocks a commit.
Step 4: Summarize
- List what was applied (path of each file written + edited).
- List what still needs the user's manual customization (with the specific TODOs).
- Note the cross-plugin next steps that were handed off (
/quality-verify-hook,/quality-audit, and/feature-initif they want feature tracking — see the repo's top-levelADOPTION.mdfor the full sequence). - If a workspace was scaffolded: note the next moves —
bash scripts/clone-members.shto pull members in, fillcontracts:/deploy:in the manifest, run/project-initinside each member, and readfeature-workflow/skills/shared/workspace.md. - Suggest the next concrete action: typically "create a
chore/project-standardsbranch, commit these, PR it intomainto bring the standards in." - Once setup is complete and verified, mention that
project-workflowis a setup plugin — they can disable it for this repo via/pluginif they don't want/project-initlingering (the evergreen standards live in the other plugins, which stay enabled).
Notes
- Don't push or commit on the user's behalf — let them review the staged changes.
- TypeScript projects: wire both scanners — and don't pigeonhole skylos. skylos
agent pre-commitis a broad static-analysis scanner (code quality, dead code, complexity, clones, security/danger, secrets, dependencies/SCA, AI-introduced regressions) that runs on staged TS/JS/C#/JSON, not just Python — so it pulls real weight on a TS repo, well beyond secrets/security. fallow adds TS/JS-native dead-code / complexity / duplication depth alongside it. The heavier full audit (skylos --quality --danger --secrets --sca) belongs in/quality-audit, not the hook. Just never wire skylos behind a*.pyglob on a non-Python repo — it'd match nothing and silently scan zero files. - Existing / legacy repo: expect a large findings backlog (hundreds–thousands). Wire the scanners new-only so they gate what's introduced and merely report the backlog without blocking every commit — then plan an incremental cleanup. Full details + exact flags in the "Existing / legacy repo: gate new, fix old incrementally" section of
quality-stack-setup. - A critical failure mode when adapting the
lefthook.ymltemplate (especially for a monorepo): keeping the auto-fixers (prettier/eslint, ruff) but dropping the static-analysis scans (py-scan/ts-scan). The scans are the load-bearing AI-slop guardrail — pre-commit without them only formats. After customizing, confirm bothskylosandfallowscan commands are still present and pointed at the real source dirs, and that/quality-verify-hookproves each fires. - If the user is in a docs-only repo (no
package.json, nopyproject.toml), only apply the branch promotion model — quality hooks would be ceremony with no value.