/nestjs-nextjs:w-setup --resetfrom nestjs-nextjs
One-time setup wizard that creates .claude/workflow.yaml — the project config consumed by w-task, w-fix, and all workflow skills. Spawns code-explorer to survey project structure before asking questions, so suggestions are accurate. Run once per project before using any workflow skill.
Ships in nestjs-nextjs. Installing the plugin adds it to Claude Code.
Interactive wizard that writes .claude/workflow.yaml.
All workflow skills (w-task, w-fix, w-status, etc.) read this file.
First run: surveys the project, then walks through setup interactively.
--reset: shows existing config and reconfigures selected sections.
cat .claude/workflow.yaml 2>/dev/null
This wizard writes config schema CURRENT_VERSION = 3. Read the existing
file's version: field (treat a missing version: as 1) and branch:
File missing + no --reset: proceed to Step 1 (fresh setup).
File exists, version == 3, no --reset: display current config and say:
Config already exists (version 3). Run
/w-setup --resetto reconfigure, or/w-task <title>to start a task. Stop here.
File exists, version < 3 (or no version:), no --reset: an older config
was detected → offer auto-migration (do NOT silently overwrite, do NOT force a
full re-interview). See Step 0a — Migrate below.
File exists, version > 3: the config is newer than this wizard. Say:
⚠️ workflow.yaml is version
<N>, but this/w-setuponly understands version 3. Update the workflow plugin before reconfiguring, or edit the file by hand. Stop here — do not rewrite.
--reset flag (any version): display current config, proceed to Step 1
(existing values shown as defaults). A --reset run also upgrades the file to
version 3 on write.
Only when an existing file has version < 3.
Migration is add-only: every existing value is preserved verbatim, and each version's additions are applied in order. No re-interview.
| Target | Adds |
|---|---|
| v2 | top-level repos: — per-repo default branch (Step 7a) |
| v3 | project.codegraph.* — CodeGraph fast path (Step 5a)verify.* — Phase 5b acceptance verification (Step 5b) |
Run the v1→v2 block below when the file is below 2, then the v2→v3 block. A file already at 2 skips straight to v2→v3.
Probe for CodeGraph:
command -v codegraph >/dev/null 2>&1 && echo binary
test -d .codegraph && echo indexed
enabled: auto, auto_index: trueenabled: auto, auto_index: true (w-task asks once, per task)enabled: auto — the block costs nothing and starts
working the day the binary is installed.Show the v3 card:
Detected workflow.yaml version: <N> (current: 3)
Will ADD:
+ version: 3
+ project.codegraph: enabled: auto auto_index: true
CodeGraph: <found, indexed | found, not indexed | not installed>
Phases 0b / 2 / 4 query the graph instead of grepping — falls back on its own.
+ verify: acceptance: true visual: auto max_loops: 3
browser_wait_seconds: 180
Adds Phase 5b: every ticket requirement traced to evidence, UI compared
against the Figma export, findings fixed in at most 3 committed iterations.
All existing settings are preserved.
Migrate now? [Y]es / [e]dit a value / [n]o (keep as-is): ___
Y / Enter → write the upgraded file with version: 3 plus both blocks.
e → ask which value to change, set it, re-show the card.
n → leave untouched. w-task still runs; it prints a one-line notice that
codegraph and acceptance verification are off until the file is migrated.
The addition in v2 is the top-level repos: list (per-repo default branch —
see Step 7a).
Detect repos / submodules of the project:
git submodule status 2>/dev/null # lists submodule paths, if any
cat .gitmodules 2>/dev/null | grep 'path =' # fallback enumeration
For each repo (the main workspace . plus every submodule path), resolve its
default branch:
git -C <path> symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##'
. → default branch = old pr.default_branch if set, else the
symbolic-ref result, else main.symbolic-ref result. If it can't be resolved, leave
it blank and flag it for the developer to fill in the confirm card.Show the migration card — only the additions, existing values are kept verbatim:
Detected workflow.yaml version: <N> (current: 2)
Will ADD:
+ version: 2
+ repos:
- path: "." default_branch: <derived> remote: origin
- path: apps/api default_branch: <derived> remote: origin (submodule)
(2 git submodule(s) detected; main workspace + submodules listed above)
All existing settings (issue_tracker, workflow.*, project.*, pr.*) are preserved.
Any default_branch shown as "<?>" could not be auto-detected — edit before accepting.
Migrate now? [Y]es / [e]dit a branch / [n]o (keep as-is): ___
Y / Enter → write the upgraded file (Step 8) with version: 2 + the derived
repos: list, every other field copied unchanged. Print a one-line confirmation
and stop (no need to walk Steps 1–7).
e → ask which repo's default_branch to change, set it, re-show the card.
n → leave the file untouched, stop.
If the project has no submodules, repos: is a single entry
[{path: ".", default_branch: <derived>, remote: origin}] — migration is still
applied so the file reaches version 2 and gains the explicit repos: list.
Before asking any questions, spawn the code-explorer agent to survey the project.
Use its findings to pre-fill all suggestions in Steps 2–7.
Agent brief:
Survey this project's configuration and structure to inform a workflow setup wizard. Focus on the following — do NOT analyse business logic or feature code:
Root layout: list top-level dirs and files. Identify if this is a monorepo (multiple
package.json/go.mod/pyproject.toml, workspaces config, etc.). List all source root directories (e.g.src/,packages/,apps/,services/).Language & runtime: detect primary language(s) from config files (
package.json→ Node/TS,pyproject.toml/setup.py→ Python,go.mod→ Go,Cargo.toml→ Rust,pom.xml/build.gradle→ JVM).Test setup: find test config files (
jest.config.*,vitest.config.*,pytest.ini,pyproject.toml [tool.pytest],go.mod→go test,Cargo.toml→cargo test). Readpackage.json scriptsif present. Determine the exact test command to run.Typecheck setup: look for
tsconfig.json(→npx tsc --noEmit),mypy.ini/pyproject.toml [tool.mypy](→mypy .), or equivalent.Lint setup: look for
.eslintrc*,eslint.config.*(→npx eslint .),ruff.toml/pyproject.toml [tool.ruff](→ruff check .),.golangci.yml(→golangci-lint run),clippy(→cargo clippy).CI scripts: read
.github/workflows/*.yml(first 2 files only). Extract the exact test, lint, and typecheck commands used in CI — these are the most reliable source of truth.Docs structure: check if
docs/,documentation/,wiki/,streaming-docs/, or*-docs/exists. For each candidate, probe for the streaming-docs convention — does it have adocuments/ANDworkflow/subdir side-by-side? If yes, classify asstreaming-docs-conventionand return the parent (the<docs_root>). If onlydocuments/exists, still classify asstreaming-docs-convention(workflow/ will be created). If neither, classify asflat-layout. Also probe for these sub-paths and report which exist:
<docs_root>/documents/modules/<docs_root>/documents/database/<docs_root>/documents/database/diagrams/<docs_root>/documents/database/diagrams/00-database-overview-erd.puml<docs_root>/documents/overview/open-questions.md<docs_root>/documents/overview/architecture-overview.md<docs_root>/workflow/Git: run
git remote get-url originandgit branch -r | head -5to identify the remote host and default branch. Also enumerate submodules and each repo's own default branch — a superproject may mixmainandmaster:git submodule status 2>/dev/null # main workspace + each submodule path: git -C <path> symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##'Report a
reposlist: one entry per repo{path, default_branch, remote}wherepath: "."is the main workspace. If there are no submodules, report a single.entry.Schema files: probe for
prisma/schema.prisma,<api-dir>/prisma/schema.prisma,*.graphqlfiles under source dirs. Report exact path(s) found.Module convention: probe for
<api-dir>/src/modules/*/,src/modules/*/,apps/*/,packages/*/,services/*/,src/features/*/. Report the pattern with the most matching subdirs that each contain at least one.ts/.js/.py/.gosource file.Output a structured report with these exact sections:
- Monorepo: yes/no + workspace dirs if yes
- Language(s): list
- Source dirs: list of paths
- Test command: exact string, or "none detected"
- Typecheck command: exact string, or "none detected"
- Lint command: exact string, or "none detected"
- CI commands: test / typecheck / lint extracted from CI, or "not found"
- Docs root: path, or "none"
- Docs convention:
streaming-docs-convention|flat-layout|none- Docs sub-paths present: list of which sub-paths from item 7 exist
- Git remote host: github / gitlab / bitbucket / other
- Default branch: main / master / other (main workspace)
- Repos: list of
{path, default_branch, remote}— main workspace.plus any submodules, each with its own default branch (may differ —mainvsmaster)- Schema paths: prisma / graphql paths found, or "none"
- Module glob: pattern with the most subdirs containing source files
- Notes: anything unusual
Store the agent's full report as survey for use in all subsequent steps.
Use survey.git_remote_host to suggest a default:
github.com → suggest githubnoneDisplay survey finding:
Detected git remote: <host> → suggesting <tracker>
Ask:
Which issue tracker does this project use?
1) GitHub Issues (fetch via gh CLI)
2) Plane (pm.*.* URL)
3) Jira (*.atlassian.net)
4) Linear (linear.app)
5) None (always use free text)
Enter number [<suggested>]:
github: No further questions.
plane:
Plane workspace URL (e.g. https://pm.example.com): ___
Workspace slug: ___
Project identifier prefix (e.g. MYPROJ): ___
Are Plane MCP tools configured in this Claude Code session? (y/n) [n]: ___
jira:
Jira base URL (e.g. https://company.atlassian.net): ___
Project key (e.g. PROJ): ___
API token env var name [JIRA_TOKEN]: ___
linear:
Linear workspace URL: ___
Team ID or key: ___
API token env var name [LINEAR_TOKEN]: ___
none: skip to Step 4.
Use survey.docs_root + survey.docs_convention + survey.docs_sub_paths_present
to compute all paths automatically. Present one bulk confirmation card — user
approves the whole set, or selects which fields to override.
Derivation rules:
docs_root = survey.docs_root (or null if user wants to skip Phase 5)
if survey.docs_convention == "streaming-docs-convention":
DOCS_PREFIX = "<docs_root>/documents"
state_root = "<docs_root>/workflow"
state_in_vcs = true # commit state files (project history)
else:
DOCS_PREFIX = "<docs_root>"
state_root = ".workflow"
state_in_vcs = false # add to .gitignore
module_docs_root = "<DOCS_PREFIX>/modules"
feature_records_subdir = "features"
api_docs_filename = "api.md"
workflow_links_filename = "workflow-links.md"
db_docs_root = "<DOCS_PREFIX>/database"
diagrams_root = "<db_docs_root>/diagrams"
master_erd_path = "<diagrams_root>/00-database-overview-erd.puml"
oq_docs_path = "<DOCS_PREFIX>/overview/open-questions.md"
adr_docs_path = "<DOCS_PREFIX>/overview/architecture-overview.md"
If a sub-path from survey.docs_sub_paths_present is missing from the derived
defaults (e.g. project uses non-standard naming), surface that as a hint —
do not silently drop it.
Confirmation card — present ALL derived paths in one card:
Detected docs convention: <streaming-docs-convention | flat-layout | none>
Proposed configuration (derived from project survey — review and confirm):
Workflow state
state_root: <state_root> [will be <gitignored | committed>]
Docs (Phase 5 persistence)
docs_root: <docs_root>
module_docs_root: <module_docs_root>
feature_records_subdir: <feature_records_subdir>
api_docs_filename: <api_docs_filename>
workflow_links_filename: <workflow_links_filename>
Database (Phase 5 — only if project has relational DB)
db_docs_root: <db_docs_root>
diagrams_root: <diagrams_root>
master_erd_path: <master_erd_path>
Overview (cross-cutting)
oq_docs_path: <oq_docs_path>
adr_docs_path: <adr_docs_path>
Accept all? [Y]es / [e]dit specific fields / [s]kip Phase 5 entirely: ___
[...])null, skip Phase 5 in w-taskConcrete example for streaming-workspace (the wizard would present this card verbatim with values pre-filled):
Detected docs convention: streaming-docs-convention (found documents/ + workflow/)
Proposed configuration:
state_root: streaming-docs/workflow [committed]
docs_root: streaming-docs
module_docs_root: streaming-docs/documents/modules
feature_records_subdir: features
api_docs_filename: api.md
workflow_links_filename: workflow-links.md
db_docs_root: streaming-docs/documents/database
diagrams_root: streaming-docs/documents/database/diagrams
master_erd_path: streaming-docs/documents/database/diagrams/00-database-overview-erd.puml
oq_docs_path: streaming-docs/documents/overview/open-questions.md
adr_docs_path: streaming-docs/documents/overview/architecture-overview.md
Accept all? [Y]es / [e]dit specific fields / [s]kip Phase 5 entirely: ___
State path under streaming-docs convention is part of the project's documented history — task intake, plan, impact, verify files are valuable artefacts. They are committed alongside docs, not gitignored.
Same pattern as Step 4: AI derives everything from survey, presents one
confirmation card.
Derivation rules:
module_glob = survey.module_glob # e.g. "streaming-api/src/modules/*"
schema_paths:
prisma = survey.schema_paths.prisma # e.g. "streaming-api/prisma/schema.prisma"
graphql = survey.schema_paths.graphql # e.g. "streaming-api/src/**/*.graphql"
test_layers = derived from survey.language(s) + framework markers:
- has @nestjs/* in deps → include "nestjs"
- has @apollo/* or *.graphql → include "graphql"
- has bullmq in deps → include "bullmq"
- has next in deps → include "nextjs"
- jest/vitest config → include "unit"
- any docker-compose.test.* → include "integration"
fallback: ["unit"]
Confirmation card:
Project conventions (detected from survey):
module_glob: <pattern>
schema_paths:
prisma: <path or "—">
graphql: <pattern or "—">
test_layers: <list>
Accept all? [Y]es / [e]dit specific fields: ___
Concrete example for streaming-workspace:
Project conventions:
module_glob: streaming-api/src/modules/*
schema_paths:
prisma: streaming-api/prisma/schema.prisma
graphql: streaming-api/src/**/*.graphql
test_layers: [unit, integration, graphql, bullmq, nestjs, nextjs]
Accept all? [Y]es / [e]dit specific fields: ___
Probe, then confirm — this is one question, not an interview:
command -v codegraph >/dev/null 2>&1 && echo binary
test -d .codegraph && echo indexed
Code intelligence:
CodeGraph: <found + indexed | found, no index yet | not installed>
With an index, w-task Phases 0b / 2 / 4 ask the graph which files matter instead
of grepping the tree — same answers, far fewer reads. Without it every phase
falls back to git grep on its own; nothing breaks either way.
codegraph.enabled: auto (use it whenever an index exists)
codegraph.auto_index: true (offer to build one, once, on the first task)
Accept? [Y]es / [e]dit / [d]isable entirely: ___
d writes enabled: false — every phase then uses git grep and never mentions it again.
If the binary is present but .codegraph/ is missing, do not index here — w-task
asks at the start of the first task, when the developer is already waiting on it.
Add .codegraph/ to .gitignore if absent: the index is a local build artefact.
Acceptance verification (w-task Phase 5b — runs after docs, before the PR):
Traces every requirement in the ticket to evidence in the code, tests and docs,
and for UI work compares the implementation against the Figma export so a redrawn
icon or an eyeballed colour cannot reach the PR. Findings are fixed, committed and
re-documented in a bounded loop; whatever survives is written up for you in plain
language instead of being retried forever.
verify.acceptance: true (requirement traceability)
verify.visual: auto (runs when the task has UI + a design ref)
verify.max_loops: 3 (fix iterations before handing back to you)
verify.browser_wait_seconds: 180 (how long to wait out a busy browser MCP
before asking you whether to wait or skip)
Accept? [Y]es / [e]dit: ___
Show survey findings. Prefer CI-extracted commands over detected — mark clearly:
Project survey:
Language(s): <languages>
Monorepo: <yes — workspaces: ... | no>
Source dirs: <list>
Suggested commands ([CI] = extracted from CI pipeline, most reliable):
test: <command> [CI] / [detected] / [none detected]
typecheck: <command> [CI] / [detected] / [none detected]
lint: <command> [CI] / [detected] / [none detected]
Press Enter to accept each, or type an override (blank = skip that check):
test [<value>]: ___
typecheck [<value>]: ___
lint [<value>]: ___
Use survey.repos to present the repo topology. Each repo (the main workspace and
every submodule) carries its own default branch — they need not agree.
Single-repo project (no submodules) — confirm one value:
Default branch for PRs [<survey.repos[0].default_branch or "main">]: ___
Record as repos: [{path: ".", default_branch: <value>, remote: origin}].
Superproject with submodules — present the detected list, let developer fix any:
Detected repos (each has its own default branch — main vs master is fine):
. default_branch: main remote: origin (main workspace)
apps/api default_branch: master remote: origin (submodule)
apps/web default_branch: main remote: origin (submodule)
Accept all? [Y]es / [e]dit a repo's default branch: ___
default_branch, re-show.
Record the full repos: list.Open PRs as drafts? (y/n) [y]: ___
Path to PR body template file (optional, Enter to skip): ___
Record pr.draft, pr.template. pr.default_branch is kept in the written file
(= the main workspace . default branch) as a fallback for older consumers.
Write .claude/workflow.yaml:
# Generated by /w-setup — edit manually if needed
# Consumed by: w-task, w-fix, w-status, w-reset, w-checkpoint, w-pr,
# w-codegraph, w-acceptance-verify
version: 3
# Repos this workflow operates on. path "." is the main workspace; the rest are
# git submodules. Each repo has its OWN default branch — they need not agree
# (one may target `main`, another `master`). w-task Phase 6 syncs and opens a PR
# per repo against the branch named here.
repos:
- path: "."
default_branch: <branch> # e.g. main
remote: origin
# - path: apps/api # a git submodule
# default_branch: master
# remote: origin
issue_tracker:
type: <github|plane|jira|linear|none>
# tracker-specific fields only when type != github/none:
url: <url>
workspace: <workspace>
project: <project>
mcp_available: <true|false> # plane only
workflow:
state_root: <path> # default: .workflow
docs_root: <path or null> # null = skip Phase 5 in w-task
# Structured doc paths (all optional — blank disables the corresponding skill)
module_docs_root: <path or null> # e.g. docs/modules — <NN>-<name>/ folders
feature_records_subdir: <string or null> # e.g. features (inside each module dir)
api_docs_filename: <string or null> # e.g. api.md
workflow_links_filename: <string or null># e.g. workflow-links.md
db_docs_root: <path or null> # e.g. docs/database
diagrams_root: <path or null> # e.g. docs/database/diagrams
master_erd_path: <path or null> # mandatory sync target on any sub-ERD change
oq_docs_path: <path or null> # e.g. docs/overview/open-questions.md
adr_docs_path: <path or null> # e.g. docs/overview/architecture-overview.md
project:
test_command: <command or null>
typecheck_command: <command or null>
lint_command: <command or null>
src_dirs: <list from survey, or []>
module_glob: <glob or null> # e.g. src/modules/* — drives module auto-detect
schema_paths:
prisma: <path or null> # e.g. prisma/schema.prisma
graphql: <glob or null> # e.g. src/**/*.graphql
test_layers: <list or [unit]> # e.g. [unit, integration, graphql, bullmq]
dev_server_command: <command or null> # e.g. pnpm dev — null disables Phase 4c
dev_server_port: <port or null> # e.g. 3000
codegraph:
enabled: auto # auto | true | false — auto = use when .codegraph/ exists
auto_index: true # offer to build the index once, on the first task
sync_phases: [0b, 2, 4, 5b] # phases that refresh the graph before working
# Phase 5b — acceptance verification. Set both `acceptance` and `visual` to false
# to disable the phase entirely.
verify:
acceptance: true # requirement-to-evidence traceability
visual: auto # auto | true | false — needs a design reference
max_loops: 3 # fix iterations before handing back to the operator
browser_wait_seconds: 180 # MCP contention wait before the confirm gate
pr:
default_branch: <branch> # = repos[path="."].default_branch — fallback for older consumers
draft: <true|false> # applies to every repo's PR
template: <path or null>
Gitignore handling (state_root-dependent):
If state_root == ".workflow" (default flat layout): the folder is ephemeral
scratch state. Add to .gitignore if not present:
grep -q "^\.workflow" .gitignore 2>/dev/null || echo ".workflow/" >> .gitignore
If state_root is under docs_root (streaming-docs convention, e.g.
streaming-docs/workflow): state files are part of the project's documented
history — task intake, plan, impact, verification are valuable artefacts.
Do NOT gitignore. Commit normally alongside docs. Skip this step.
Detection: if the path begins with <docs_root>/ AND <docs_root> is tracked
in git → treat as docs-companion state, no gitignore.
✓ .claude/workflow.yaml written
Survey applied:
Language: <language(s)>
Source dirs: <list>
Commands: from CI / detected / manual
Config written:
Version: 3
Repos: <N> (. → <branch>[, apps/api → master, ...])
Issue tracker: <type>
State root: .workflow/ (added to .gitignore)
Docs root: <path or "skipped">
├ Module docs: <module_docs_root or "—">
├ DB docs: <db_docs_root or "—">
├ Master ERD: <master_erd_path or "—">
├ OQ doc: <oq_docs_path or "—">
└ ADR doc: <adr_docs_path or "—">
Module glob: <module_glob or "—">
Test: <command or "none">
Typecheck: <command or "none">
Lint: <command or "none">
CodeGraph: <auto — indexed | auto — not indexed | not installed | disabled>
Acceptance: <on — visual auto, max 3 loops | off>
PR: <draft/open>, one PR per repo against its own default branch
Next steps:
/w-task <title or issue URL> — start a feature task
/w-fix <title or issue URL> — fix a bug or small change
/w-status — check current task state
/w-document-build-up — bootstrap docs from existing source code
(run BEFORE /w-task if docs/ is empty)
Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub phantien133/dotclaude --plugin nestjs-nextjs8 commands in this plugin
/feature-devPhasesGuided feature development with codebase understanding and architecture focus/f-setup/f-setup — Figma Workflow Config WizardOne-time setup that writes `.claude/figma.yaml` for the current project./prp-planPRP PlanCreate comprehensive feature implementation plan with codebase analysis and pattern extraction/setup-dotclaude-preset-hooksSetup Dotclaude Preset HooksWire or unwire hooks for the installed dotclaude preset. Run when you want to enable or disable individual hooks in settings.json./w-prCreate a GitLab merge request for one repo (main workspace or a submodule) using glab CLI. Reads MR settings + per-repo default branch from .claude/workflow.yaml. Pass a task slug to use plan.md as MR body, --repo/--target to scope a submodule. Runs w-doc-gate first to enforce docs-with-code invariant./w-resetReset a w-task workflow back to phase 0, or wipe the task folder entirely. Reads state root from .claude/workflow.yaml.3 plugins in one repository ship this exact command · first indexed Aug 26, 2026