---
name: anilsoylu-dev-flow
title: dev flow
kind: skill
version: 0.5.0
description: >
  Stage-aware delivery flow for a feature or project: plan with guardian risk
  review, build, review, commit gate, merge through /cpr, and the
  production-readiness audit at the end. For "the usual flow", "what's next",
  "the feature is done", "is it production ready", "what if the server dies /
  how does it scale". A single narrow ask goes to its own skill.
updated: 2026-12-05
authored_by: anilsoylu
author_url: https://github.com/anilsoylu
source_url: https://github.com/anilsoylu/famiglia-agent-skills/tree/HEAD/skills/dev-flow
brought_by: kt
license: Apache-2.0
---

# Dev flow

The user's engineering workflow, one stage at a time. Each stage has its own prompts (in `references/`) and its own
skills. The point is that the right check runs at the right moment: risk thinking before code is written, an
inefficiency review right after, the commit gate before every commit, `/cpr` into the default branch, and the full audit at the end.
Running the full audit on every commit wastes hours. Skipping the gate lets problems pile up.

## 1. Find the stage

Read the situation before asking: the user's words first, then the repo signals. `scripts/detect-stage.sh` collects
the repo signals (branch, working tree, diff size, commits ahead of the default branch, the branch's PR) and names the
stage they point to on its `repo-hint:` line. If a `DEV-FLOW-STAGE` block appears below, use it. Otherwise run
`bash <this skill's folder>/scripts/detect-stage.sh` from the project directory and use its output.

!`bash ${CLAUDE_SKILL_DIR}/scripts/detect-stage.sh || true`

The user's words beat `repo-hint:`. The hint can't know whether the gate already passed, so a clean branch that is
ahead goes to **merge** only when the gate ran; otherwise it goes to **commit** first. A `pr: unknown` line means gh
wasn't available; don't treat it as "no PR".

| Signal | Stage |
|---|---|
| new feature/project, "how should we build", no code yet | **plan** |
| writing code, "implement", "add" | **build** |
| "done", "finished the feature", working tree has a fresh feature diff | **review** |
| "commit", "ready to commit", staged changes | **commit** |
| "merge", "master"/"main", "PR", branch is ahead and gate already passed | **merge** |
| "project is finished", "production ready?", "before launch", "server dies / scale" | **end** |

If two stages fit, or there's no signal, ask once (AskUserQuestion in Claude Code; options = the stages, the most
likely one first). Say which stage you're running in your first line, e.g. `dev-flow → commit stage`.

## 2. Run the stage

Open `stages.md` and follow the section for that stage. It names the reference files to read and the skills to call.
Load only that stage's references. The guardian catalog and the audit are large, and reading them all every time
wastes context.

Short version:

| Stage | Runs |
|---|---|
| plan | `references/guardian/core.md` working procedure · the guardian sections for the touched areas · `backend-patterns.md` if it matches · the short "server dies / scale" check from `review-questions.md` · Plan mode for non-trivial work |
| build | repo conventions · UI work → `/frontend-design` or `/ui-ux-pro-max` · React/Next → `vercel-react-best-practices` · client data fetching → `frontend-data.md` · tests and bug fixes → `testing.md` · proportionate guardian review of what's touched |
| review | `review-questions.md` → "After implementing" · `/review` · `/simplify` |
| commit | `/commit-gate` (perf → optimize → security-audit on the diff) |
| merge | `/cpr` (clean → PR), then merge and pull when asked |
| end | `references/audit/` full production-readiness audit · full "server dies / scale" from `review-questions.md` · `/security-audit` guidance mode (full mode only on the user's yes) |

Stages chain forward when the user wants that ("finish it up" after review → commit → merge). Stop between stages
when a step reports a blocker.

## 3. When a skill isn't installed

Every hand-off has a fallback, so the flow still works when someone installs only this skill. Use the fallback and say so in one line.

| Skill | Fallback |
|---|---|
| `/commit-gate` | run its three steps yourself: `perf-checklist.md`, then an exact-parity rewrite of any measured hot spot, then guardian A + E on the diff |
| `/review` | read the diff for bugs, against repo conventions (CLAUDE.md, lint config) and against the task/issue. Blocking findings first |
| `/simplify` | look at the diff again for reuse, dead code and needless abstraction |
| `/cpr` | clean the diff by hand, topical commits, `gh pr create`/`gh pr edit` with a body describing the whole change, print the PR link (the merge steps stay this stage's either way) |
| `/security-audit` | `references/guardian/A-appsec-identity.md` + `references/guardian/E-http-api.md` + audit checklist sections B, C, D, F |
| `/frontend-design`, `/ui-ux-pro-max`, `vercel-react-best-practices`, `vercel:*` | follow the repo's existing UI patterns |
| `/code-review` | `/review`, or read the diff for bugs as in the `/review` row |
| `/steward` | `gh pr checks --watch` in a background shell |

## 4. Finish a unit of work

When the user wants a finished unit shipped end to end, run these in order without asking between steps. Stop only on
a blocker.

1. **Gate**: `/commit-gate` (in a `worker` subagent when the project routes it there), only when the diff has runtime
   code or scripts. A `BLOCKED` result is fixed before anything is committed.
2. **Commit** with the project's git identity and an English Conventional Commit message.
3. **PR**: brief the `writer` agent with the facts (what changed and why, measured numbers, test commands and
   results), then run `/cpr` (clean, then open or refresh the PR) with its title and body instead of drafting new
   ones. Without a `writer` agent, the title and body pass `/no-tropes`. Review summaries posted to the PR go through
   `writer` the same way.
4. **Lead review**, only when code or scripts changed. Pick the effort by risk: take the sha from
   `git merge-base origin/<default-branch> HEAD`, then run `node <review skill folder>/review-tier.mjs . <sha>` (it
   prints `none`, `medium`, `high` or `xhigh`). `none` skips the review. Otherwise run `/code-review <tier>` on the
   PR branch directly, with no wrapper agent. You may escalate the tier with a stated reason, never downgrade it, and
   never pick `max` or `ultra` yourself; those are for the user. No `node` or no `review` skill: use `medium`.
   - Nothing worth fixing: list the remaining findings under `## Found while working` in the PR body, then merge.
   - Findings to fix: post them as one PR comment (`gh pr comment`), fix them, push, and review only the fix commits,
     not the whole PR again (a fresh review of the same tree always finds something new). At most two fix rounds;
     findings left after that go to the user.
   - Log each fixed finding as a papercut too, with `--ref` set to the skill that should have caught it
     (`commit-gate`, `dev-flow` or `review`).
5. **Merge**: no CI means no wait. With CI, wait with `gh pr checks --watch` in the background (or `/steward`), never
   by polling in the main thread. Green CI and a clear review: `gh pr merge --squash --delete-branch`, then pull the
   default branch. Red CI or open review threads: `/pr-ready` first.

`/commit-gate` already reviews every code diff. Beyond that, run a full `/security-audit` (ask the user first, it is
long) before a release, and when work touches authentication, authorization, payments, file uploads, secrets handling,
or CI/deploy permissions.

## 5. New stack: read the docs first

Adding a library, framework or service, or changing a feature built on one, starts with research, because scaffold
defaults are rarely the recommended integration. Do this in plan, before build.

1. Find the installed (or to-be-installed) version from the lockfile or manifest.
2. Read that project's `llms.txt` / `llms-full.txt` if it publishes one, otherwise the official docs for that version
   (guides, migration notes, best practices). Run this research in a `researcher` subagent when one exists.
3. Integrate the way the docs recommend for this project's setup (config, file layout, idioms), not the bare default.
4. Mention the docs used in the PR description.

## If something fails

| Failure | Fix |
|---|---|
| No `DEV-FLOW-STAGE` block, or it shows the literal `!` line | Run `bash <this skill's folder>/scripts/detect-stage.sh` by hand from the project directory. |
| `git` isn't runnable or this isn't a repo | Pick the stage from the user's words alone and say the repo signals were unavailable. |
| Merge stage, but the repo has no CI | Don't wait for checks; report the local test command and its result in the PR body, then merge when asked. |
| A stage's reference file is missing | Use that stage's row in the fallback table above and say which file was missing. |

## Rules that hold in every stage

- Ask, don't assume. When ambiguity could change behavior, data, security or cost, ask one focused question. Never ask
  something the repo can answer.
- Simplest correct change. Don't touch unrelated code. No new dependencies or paid services without asking.
- Measure before claiming performance. Keep exact behavior for any refactor or optimization.
- Evidence, not confidence: `file:line`, the command that ran and its result. Never invent test results or line numbers.
- Never print secrets. A hardcoded credential-looking literal (`sk_live_`, `AKIA`, `ghp_`, a private key) stays a blocker
  until the user confirms it's fake. Don't downgrade it because it looks like a placeholder.
- Don't commit, push, merge or deploy unless the user asked for that step.
- No subtitle/helper text under headings, labels or cards by default (from the user's audit rules).
