wb-flow 1.0.0-r01

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/README.md +128 -0
  4. package/assets/demo.gif +0 -0
  5. package/bin/install.js +175 -0
  6. package/bin/link.js +71 -0
  7. package/bin/verify-wrappers.js +49 -0
  8. package/package.json +56 -0
  9. package/templates/commands/_shared/output_conventions.md +433 -0
  10. package/templates/commands/_shared/wb_universal_agent_instructions.md +72 -0
  11. package/templates/commands/model_recommendation_updates.md +74 -0
  12. package/templates/commands/model_recommendations.md +112 -0
  13. package/templates/commands/wbActOn/wbActOn_template.md +546 -0
  14. package/templates/commands/wbAudit/wbAudit_template.md +315 -0
  15. package/templates/commands/wbBroadcast/wbBroadcast_template.md +133 -0
  16. package/templates/commands/wbCheck/wbCheck_template.md +322 -0
  17. package/templates/commands/wbClean/wbClean_template.md +118 -0
  18. package/templates/commands/wbContext/wbContext_template.md +213 -0
  19. package/templates/commands/wbDebug/wbDebug_template.md +132 -0
  20. package/templates/commands/wbDeploy/wbDeploy_template.md +224 -0
  21. package/templates/commands/wbDoc/wbDoc_template.md +138 -0
  22. package/templates/commands/wbExplain/wbExplain_template.md +98 -0
  23. package/templates/commands/wbGit/wbGit_template.md +160 -0
  24. package/templates/commands/wbHelp/wbHelp_template.md +101 -0
  25. package/templates/commands/wbIdea/wbIdea_template.md +337 -0
  26. package/templates/commands/wbLicense/wbLicense_template.md +148 -0
  27. package/templates/commands/wbMonetize/wbMonetize_template.md +113 -0
  28. package/templates/commands/wbNext/wbNext_template.md +270 -0
  29. package/templates/commands/wbPlan/wbPlan_template.md +413 -0
  30. package/templates/commands/wbPublish/wbPublish_template.md +205 -0
  31. package/templates/commands/wbRefactor/wbRefactor_template.md +129 -0
  32. package/templates/commands/wbRelease/wbRelease_template.md +229 -0
  33. package/templates/commands/wbReview/wbReview_template.md +252 -0
  34. package/templates/commands/wbSecure/wbSecure_template.md +157 -0
  35. package/templates/commands/wbSetup/wbSetup_template.md +203 -0
  36. package/templates/commands/wbStandup/wbStandup_template.md +198 -0
  37. package/templates/commands/wbTest/wbTest_template.md +226 -0
  38. package/templates/commands/wbToWBC/wbToWBC_template.md +91 -0
  39. package/templates/commands/wbTrack/wbTrack_template.md +555 -0
  40. package/templates/commands/wbTranslate/wbTranslate_template.md +114 -0
  41. package/templates/commands/wbValid/wbValid_template.md +142 -0
  42. package/templates/commands/wbVision/wbVision_template.md +141 -0
  43. package/templates/commands/wbWork/wbWork_template.md +140 -0
  44. package/templates/commands/wb_commands_reference.claude.json +2305 -0
  45. package/templates/commands/wb_commands_reference.json +1109 -0
  46. package/templates/shortcuts/shortcuts.md +413 -0
  47. package/templates/shortcuts/usage-management-examples-shortcuts/budget_controllers_examples.md +96 -0
  48. package/templates/shortcuts/usage-management-examples-shortcuts/ultimate_shortcuts_examples.md +1531 -0
@@ -0,0 +1,148 @@
1
+ # /wbLicense: Execution Template
2
+
3
+
4
+ <!-- HELP_GATE_START -->
5
+ ## Help intercept (handle FIRST — before any other action)
6
+
7
+ **If `$ARGUMENTS` contains `--help`, `-h`, or `--h`** (case-insensitive, anywhere in the args), DO NOT execute the command's normal procedure. Instead:
8
+
9
+ 1. Output the **HELP BLOCK** below verbatim (rendered as markdown).
10
+ 2. Stop. Do not perform any file reads, writes, or other tool calls.
11
+ 3. Do not generate any reports under `.wb/workflows/reports/`.
12
+
13
+ Otherwise, ignore this section and proceed to the rest of the template.
14
+
15
+ ### HELP BLOCK — `/wbLicense`
16
+
17
+ ## Two modes
18
+
19
+ ```
20
+ /wbLicense <file> # inject __WBC_PRO__ gate + emit pro-required event
21
+ /wbLicense <folder> # audit package for tier leaks and pattern drift
22
+ ```
23
+
24
+ ## When to run each
25
+
26
+ **File mode:** immediately after shipping a new premium feature. Before `/wbGit`. Before any consumer imports the unguarded export.
27
+
28
+ **Folder mode:** periodically (monthly is fine) and always before `/wbRelease` on packages that have Pro features.
29
+
30
+ ## The gate pattern this project uses
31
+
32
+ ```js
33
+ if (typeof __WBC_PRO__ === 'undefined' || !__WBC_PRO__) {
34
+ this.$emit('pro-required', { feature: '<name>' });
35
+ return;
36
+ }
37
+ // premium logic here
38
+ ```
39
+
40
+ Always `typeof` check first — `__WBC_PRO__` is undefined in dev without the define plugin, and ReferenceError kills the flow. The `pro-required` event is the project's convention for surfacing upgrade CTAs to the parent.
41
+
42
+ If you find a different pattern in existing code (global `window.__WBC_PRO__`, env var `VITE_WBC_PRO`, silent fallback), it's drift. Audit mode flags this.
43
+
44
+ ## The security caveat
45
+
46
+ `__WBC_PRO__` is **client-side**. Anyone with DevTools can flip it. This is by design — the wbc-ui2 model is:
47
+
48
+ - **Client gate** (`__WBC_PRO__`) = convenience barrier. Stops honest users from wandering into Pro features by accident.
49
+ - **Server gate** (in your API) = actual security. Stops adversarial users.
50
+
51
+ `/wbLicense` handles the first. `/wbSecure` + your backend handle the second. Don't confuse them.
52
+
53
+ ## Reading the audit output
54
+
55
+ Three finding classes, ranked:
56
+
57
+ - **LEAK** = Pro code runs for Free users. High priority.
58
+ - **INCONSISTENT** = gate works but pattern differs from convention. Medium priority.
59
+ - **OK** = correctly gated. Just reassurance.
60
+
61
+ Every audit also names what it didn't check (notably: runtime bypass, server-side enforcement, business logic).
62
+
63
+ ## The one mistake to avoid
64
+
65
+ **Treating `/wbLicense` as security.** It's not. If someone bypasses the gate and accesses a Pro feature, the worst case should be: they use a nice-to-have for free. The *data* should never be at risk because the server should enforce the same tier check independently. If your Pro feature leaks sensitive data when the client gate is bypassed, the feature is designed wrong, not the gate.
66
+
67
+ ## When /wbLicense is the wrong command
68
+
69
+ - Pure security / vulnerability scan → `/wbSecure`.
70
+ - Generic code quality review → `/wbAudit`.
71
+ - Finding leaks in existing ungated code you haven't tier-decided yet → `/wbVision` first (what's Pro?), then `/wbLicense`.
72
+
73
+ > For deeper reading: [`docs_claude/commands/wbLicense/wbLicense_practical_claude.md`](../../docs/docs_claude/commands/wbLicense/wbLicense_practical_claude.md) (or the `_eli5_`, `_expert_`, `_examples_` siblings).
74
+
75
+ <!-- FLAGS_TABLE_START -->
76
+ ## Flags & shortcuts
77
+
78
+ Both forms are equivalent — pass either:
79
+
80
+ | Long form | Shortcut |
81
+ |---|---|
82
+ | `--scope` | `-s` |
83
+
84
+ `-h` / `--help` / `--h` (any command) prints this help block instead of executing.
85
+ ## Self-correct mode (dual-mode invocation)
86
+
87
+ ```
88
+ /wbLicense <scope_folder> # normal mode — produce a fresh output file
89
+ /wbLicense <previous_output_file> # self-correct mode — verify & repair the file in place
90
+ ```
91
+
92
+ When the first arg is an existing output file from a prior `/wbLicense` run (detected by its first H1 — see this template's **Detection** section), the command runs in **verify-and-repair** mode: gap-fills missing fields, normalizes links, ticks done/valid checkboxes whose reports exist, never rewrites authored content. See [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §3.
93
+
94
+ <!-- FLAGS_TABLE_END -->
95
+ <!-- HELP_GATE_END -->
96
+
97
+ <!-- FLAG_NORMALIZE_START -->
98
+ ## Flag normalization (apply BEFORE parsing args)
99
+
100
+ Before processing `$ARGUMENTS`, normalize these short-form flags to their long equivalents:
101
+
102
+ - `-s` → `--scope`
103
+
104
+ The rest of this template documents only the long forms; the substitution above is the only place short forms are mentioned.
105
+ <!-- FLAG_NORMALIZE_END -->
106
+
107
+
108
+
109
+ **ROLE:** The Gatekeeper
110
+ **TARGET:** The provided component or application path.
111
+ **Read first:** [`../_shared/output_conventions.md`](../_shared/output_conventions.md) — applies to the verification report (relative links, full-syntax commands, self-correct mode).
112
+
113
+ ---
114
+
115
+ ## ━━━ DETECTION (Self-Correct Mode) ━━━
116
+
117
+ Trigger self-correct when the input file's first H1 matches:
118
+ `# License: <scope> — <YYYY-MM-DD>` *(if a report file is produced).*
119
+
120
+ Behavior is defined in [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §3.
121
+
122
+ License-specific gap-fills:
123
+
124
+ - Plain-text component file references → relative markdown links per §1.
125
+ - Missing tier coverage (Free / Pro / Dev) in the verification table → fill from current `monorepo_rules.md`.
126
+
127
+ ---
128
+
129
+ ## ━━━ OBJECTIVE ━━━
130
+ Your job is to enforce the business logic of the monorepo. Ensure that premium components are properly gated behind Pro/Dev tier checks and that licensing mock mechanisms are safely implemented.
131
+
132
+ ## ━━━ PHASE 1: CONTEXT SYNC ━━━
133
+ 1. Read the local `context.md`.
134
+ 2. Strictly review the global `core2/.wb/workflows/monorepo_rules.md` (specifically the Licensing and Tier logic section).
135
+
136
+ ## ━━━ PHASE 2: IMPLEMENTATION ━━━
137
+ 1. Analyze the target component. Does it expose premium features to Free users?
138
+ 2. Inject the standard licensing wrapper or API key simulation logic as defined in the monorepo rules.
139
+ 3. Ensure there is a graceful fallback UI for users who do not have the Pro license (e.g., a "Upgrade to Pro" overlay).
140
+
141
+ ## ━━━ PHASE 3: VERIFICATION ━━━
142
+ Provide a short summary report confirming that the component now correctly handles `Free`, `Pro`, and `Dev` environments. Apply output_conventions.md §1 (relative links to every file changed) and §2 (full-syntax for any /wb* command cited).
143
+
144
+ End the report with:
145
+
146
+ ## 🧭 What's Next?
147
+
148
+ Run `/wbNext <target_folder>` to get a current, ranked list of next actions (typically `/wbTest <target> --scope=licensing` to verify the gate works in all 3 tiers).
@@ -0,0 +1,113 @@
1
+ # /wbMonetize: Execution Template
2
+
3
+
4
+ <!-- HELP_GATE_START -->
5
+ ## Help intercept (handle FIRST — before any other action)
6
+
7
+ **If `$ARGUMENTS` contains `--help`, `-h`, or `--h`** (case-insensitive, anywhere in the args), DO NOT execute the command's normal procedure. Instead:
8
+
9
+ 1. Output the **HELP BLOCK** below verbatim (rendered as markdown).
10
+ 2. Stop. Do not perform any file reads, writes, or other tool calls.
11
+ 3. Do not generate any reports under `.wb/workflows/reports/`.
12
+
13
+ Otherwise, ignore this section and proceed to the rest of the template.
14
+
15
+ ### HELP BLOCK — `/wbMonetize`
16
+
17
+ ## One command, three verdicts (auto-detected)
18
+
19
+ ```
20
+ /wbMonetize <package-path> # detect → bootstrap or maintenance
21
+ /wbMonetize <package-path> "<split spec>" # bootstrap with explicit split, no prompt
22
+ ```
23
+
24
+ The mode is **detected**, not flagged. The detection is hybrid:
25
+
26
+ - **Marker:** `package.json::wbMonetize` — authoritative.
27
+ - **Heuristic:** scan source for `__WBC_DEV__`, `isWb[Pkg]Pro`, `_wb_[pkg]_auth`, the `created()` hook.
28
+
29
+ | Marker | Heuristic | Verdict |
30
+ |---|---|---|
31
+ | absent | no gating | **BOOTSTRAP** — inject full tier system once |
32
+ | present | gating present | **MAINTENANCE** — verify & repair plumbing |
33
+ | absent | partial gating | **ABORT** — ask user; manual gating exists outside the convention |
34
+
35
+ ## When to run each
36
+
37
+ **Bootstrap** is one-shot per package, ideally on a feature branch with a clean working tree, before the package has any consumers depending on tier assumptions.
38
+
39
+ **Maintenance** can run periodically — monthly is fine, or after any change to `monorepo_rules.md`. It will not move features between tiers; that's your manual call after bootstrap.
40
+
41
+ ## What bootstrap touches
42
+
43
+ - Source: injects `__WBC_DEV__` reads, `isWb[Pkg]Pro` getter consumption, simulation-key support, cookie persistence (`_wb_[pkg]_auth`), the `created()` license hook from monorepo_rules.md §4, and free-fallback slots.
44
+ - `package.json`: writes the `wbMonetize` marker with `version`, `tier`, `bootstrappedAt`, `rulesVersion`, `lastVerifiedAt`.
45
+ - Tests: **flagged but not fixed.** Existing tests written against the open API will break. Fix them manually or via `/wbTest`.
46
+
47
+ ## What maintenance touches
48
+
49
+ - Plumbing only (cookie names, hook structure, getter wiring) when `rulesVersion` shows drift.
50
+ - Marker (`lastVerifiedAt`, `rulesVersion`).
51
+ - **Never** feature placement. Never moves a feature from Free to Pro or vice versa. That's your call.
52
+
53
+ ## The advisory section
54
+
55
+ Maintenance runs include an advisory pass: "feature X could be promoted to Pro", "feature Y might be over-gated". These are suggestions, never patches. The whole point of the bootstrap-once design is that you control the monetization surface after the initial setup.
56
+
57
+ ## When `/wbMonetize` is the wrong command
58
+
59
+ - Per-component gate injection on an already-monetized package → `/wbLicense`.
60
+ - Producing dev/free/pro **build artifacts** → not yet a command; for now, handled by your build config.
61
+ - Coverage report across the whole monorepo → not yet a command; consider running `/wbMonetize` per-package and aggregating manually.
62
+ - Moving a single feature between tiers → manual edit. Not in scope.
63
+
64
+ ## The one mistake to avoid
65
+
66
+ **Re-running bootstrap by editing the marker out.** If you want to re-bootstrap a package (rare), do it intentionally: revert the package, delete the marker, run `/wbMonetize` again. Don't half-strip the marker and hope the heuristic catches it — that's the abort case, and you'll have to confirm the override anyway.
67
+
68
+ > For deeper reading: [`docs_claude/commands/wbMonetize/wbMonetize_practical_claude.md`](../../docs/docs_claude/commands/wbMonetize/wbMonetize_practical_claude.md) (or the `_eli5_`, `_expert_`, `_examples_` siblings).
69
+ <!-- HELP_GATE_END -->
70
+
71
+ **ROLE:** The Monetization Bootstrapper
72
+ **TARGET:** A package path (e.g., `packages/wb-dataviewer`).
73
+
74
+ ## ━━━ OBJECTIVE ━━━
75
+ Convert a tier-unaware package into a tier-aware one (first run), or verify and repair the monetization plumbing of an already-monetized package (subsequent runs). This command sets up keys, simulation logic, cookie persistence, and the initial Free / Pro / Dev split — once. After bootstrap, feature movement between tiers is the user's manual decision; this command only maintains the verification logic.
76
+
77
+ ## ━━━ PHASE 1: CONTEXT SYNC ━━━
78
+ 1. Read the local `context.md` and `dev.md` of the target package.
79
+ 2. Strictly review the global `core2/.wb/workflows/monorepo_rules.md` — sections 3 (Tier System) and 4 (Licensing Flow).
80
+ 3. Detect the package's monetization state using **the hybrid mechanism (option 3)**:
81
+ - **Authoritative marker:** look for `wbMonetize` field in the package's `package.json` (or `.wb-monetized.json` in the package root). If present, package is monetized.
82
+ - **Heuristic safety check:** independently scan the source for any of `__WBC_DEV__`, `isWb[Pkg]Pro`, `userTier`, `WB[Pkg]_SIMULATE_PRO`, the `created()` license hook, or `_wb_[pkg]_auth` cookies.
83
+ - **Reconcile:** marker present + heuristic finds gating → MAINTENANCE mode. Marker absent + heuristic finds no gating → BOOTSTRAP mode. Marker absent + heuristic finds gating → ABORT and ask the user (manual gating exists; bootstrapping would corrupt it).
84
+
85
+ ## ━━━ PHASE 2: BOOTSTRAP MODE (first run) ━━━
86
+ Run only if Phase 1 detected a tier-unaware package.
87
+
88
+ 1. **Propose the feature split.** Read the package's source. Categorize each public-facing feature/component/composable as Free, Pro, or Dev candidate. Surface the proposal in a table and pause for user confirmation. If the user passed a description argument, use it to govern the split and skip the prompt.
89
+ 2. **Inject the gating constants.** Add `__WBC_DEV__` reads, `isWb[Pkg]Pro` store-getter consumption, and `userTier` resolution per monorepo_rules.md §3.
90
+ 3. **Wire simulation keys.** Implement support for `WB[Pkg]_SIMULATE_PRO` and `WBC_SIMULATE_PRO` per monorepo_rules.md §3.
91
+ 4. **Set up cookie persistence.** Use `_wb_[pkg]_auth` per the established convention.
92
+ 5. **Implement the `created()` license hook** in the appropriate root component(s), copied from monorepo_rules.md §4.
93
+ 6. **Add free-fallback UI scaffolding** for premium features (e.g., "Upgrade to Pro" overlay slot).
94
+ 7. **Update `package.json`** — add the `wbMonetize` field with `{ "version": "1.0", "tier": "premium", "bootstrappedAt": "<ISO date>", "rulesVersion": "<monorepo_rules.md version or hash>" }`.
95
+ 8. **Flag test impact.** List existing tests that will break; do not fix them — surface them so the user can update tests intentionally.
96
+
97
+ ## ━━━ PHASE 3: MAINTENANCE MODE (subsequent runs) ━━━
98
+ Run only if Phase 1 detected an already-monetized package.
99
+
100
+ 1. **Report current state.** Output the existing Free / Pro / Dev split as a table. No changes proposed to feature placement.
101
+ 2. **Verify plumbing.** Check each of: gating constants present and named per current monorepo_rules.md, simulation keys wired to current store shape, cookie name matches `_wb_[pkg]_auth` convention, `created()` hook matches canonical form, free-fallback UI hooks intact.
102
+ 3. **Repair drift.** If monorepo_rules.md has evolved since the bootstrap (the marker's `rulesVersion` is older than current), patch the verification logic to match. Do **not** touch feature placement.
103
+ 4. **Advisory pass on features.** Optionally suggest moves ("feature X is heavy and could be promoted to Pro"; "feature Y has minimal value, consider keeping Free"). Output as advice; do not patch.
104
+ 5. **Update marker.** Refresh `bootstrappedAt` (no — keep this immutable) but update `lastVerifiedAt` and `rulesVersion`.
105
+
106
+ ## ━━━ PHASE 4: VERIFICATION & REPORT ━━━
107
+ Write a report at `reports/<YYYY>/<MM>/<DD>/monetize/monetize_<pkg>_<HHMMSS>.md` with: mode (bootstrap/maintenance), feature split, plumbing checklist, drift repairs applied, advisory suggestions, test-impact list, and the final state of the marker. End with recommended next commands (`/wbLicense` per-component, `/wbTest` for the breakage, `/wbRelease` if shipping).
108
+
109
+ ## ━━━ ABORT CONDITIONS ━━━
110
+ - Marker absent but heuristic finds partial gating → abort, ask user.
111
+ - Working tree dirty → abort, ask user to commit or stash first (bootstrap rewrites source).
112
+ - Target is not a package directory (no `package.json`) → abort.
113
+ - Target is on `main` branch and bootstrap mode → abort, recommend a feature branch.
@@ -0,0 +1,270 @@
1
+ # wbNext Template v1.0 — Dynamic "What Should I Do Next?"
2
+
3
+
4
+ <!-- HELP_GATE_START -->
5
+ ## Help intercept (handle FIRST — before any other action)
6
+
7
+ **If `$ARGUMENTS` contains `--help`, `-h`, or `--h`** (case-insensitive, anywhere in the args), DO NOT execute the command's normal procedure. Instead:
8
+
9
+ 1. Output the **HELP BLOCK** below verbatim (rendered as markdown).
10
+ 2. Stop. Do not perform any file reads, writes, or other tool calls.
11
+ 3. Do not generate any reports under `.wb/workflows/reports/`.
12
+
13
+ Otherwise, ignore this section and proceed to the rest of the template.
14
+
15
+ ### HELP BLOCK — `/wbNext`
16
+
17
+ ## When to run it
18
+
19
+ - **You sat down and don't know what to do.** This is the entire job of `/wbNext`.
20
+ - **End of a logical unit of work** — you finished a thing; what's the next thing?
21
+ - **After a long absence** — back from vacation, no idea what state the repo is in.
22
+
23
+ Do NOT run it:
24
+
25
+ - When you already have a `/wbPlan` open. Execute the next unchecked row instead.
26
+ - When you have a clear priority. The command's job is to break ties; don't ask it to override your judgment.
27
+ - More than once per session. Re-running it produces the same answer 95% of the time.
28
+
29
+ ## The two forms
30
+
31
+ ```
32
+ /wbNext # whole-monorepo scan, single recommendation
33
+ /wbNext <package-path> # narrowed to one package
34
+ ```
35
+
36
+ ## What it does, in order
37
+
38
+ 1. **Reads recent `reports/`** (default: `--since=7d`). Looks for the latest `audit`, `plan`, `debug`, `standup`, `review`.
39
+ 2. **Reads `git status`** and the last 3 commits. Has anything been started but not committed?
40
+ 3. **Reads `dev.md`** for the target package(s). Are there refusals that flag work?
41
+ 4. **Computes a single recommendation** with three things: *what* to run, *why* it's the best next move, and *what other options were considered and rejected*.
42
+
43
+ ## The output shape
44
+
45
+ ```text
46
+ Recommendation: /wbAudit packages/wb-core/
47
+
48
+ Why:
49
+ - Last /wbAudit on wb-core was 14 days ago.
50
+ - 8 commits since then; 3 touch the public API.
51
+ - /wbTest passed yesterday, so the gate is green for an audit.
52
+ - /wbStandup last week flagged "wb-core context drift" — audit will catch it.
53
+
54
+ Considered and rejected:
55
+ - /wbContext: stale-but-not-blocking; audit covers more ground.
56
+ - /wbDebug: no open errors in reports/.
57
+ - /wbRefactor: refactor without audit is the #1 mistake (see playbook).
58
+ ```
59
+
60
+ The "considered and rejected" section is the real value. Without it, you're trusting a black box. With it, you can disagree if your judgment differs.
61
+
62
+ ## When `/wbNext` will refuse to recommend
63
+
64
+ - **Working tree is dirty with uncommitted, unrelated changes.** First clean up; mixed states make every recommendation noisy.
65
+ - **No `reports/` exist for the target.** Run `/wbContext` first; `/wbNext` needs at least one prior signal.
66
+ - **Conflicting signals** (e.g., audit says ship, secure says don't). The command names the conflict and asks you to resolve it before recommending.
67
+
68
+ ## When `/wbNext` is the wrong command
69
+
70
+ - You want a roadmap, not a single step → `/wbPlan` or `/wbVision`.
71
+ - You want a list of *everything* in flight → `/wbStandup`, not `/wbNext`.
72
+ - You want the AI to *do* the work instead of recommending it → describe the task directly.
73
+
74
+ ## The one mistake to avoid
75
+
76
+ **Running `/wbNext` and then ignoring its recommendation because you "had a feeling."** Either run what it suggests, or take 60 seconds to articulate why your alternative is better. The articulation often reveals you were going to make the second-best choice for vibes-based reasons.
77
+
78
+ That said: `/wbNext` doesn't know about external pressure (deadlines, support tickets, what your boss said this morning). Override is fine when you have outside information; override is dangerous when you have only intuition.
79
+
80
+ > For deeper reading: [`docs_claude/commands/wbNext/wbNext_practical_claude.md`](../../docs/docs_claude/commands/wbNext/wbNext_practical_claude.md) (or the `_eli5_`, `_expert_`, `_examples_` siblings).
81
+
82
+ <!-- FLAGS_TABLE_START -->
83
+ ## Flags & shortcuts
84
+
85
+ Both forms are equivalent — pass either:
86
+
87
+ | Long form | Shortcut |
88
+ |---|---|
89
+ | `--scope` | `-s` |
90
+ | `--since` | `-S` |
91
+
92
+ `-h` / `--help` / `--h` (any command) prints this help block instead of executing.
93
+ ## Self-correct mode (dual-mode invocation)
94
+
95
+ ```
96
+ /wbNext <scope_folder> # normal mode — produce a fresh output file
97
+ /wbNext <previous_output_file> # self-correct mode — verify & repair the file in place
98
+ ```
99
+
100
+ When the first arg is an existing output file from a prior `/wbNext` run (detected by its first H1 — see this template's **Detection** section), the command runs in **verify-and-repair** mode: gap-fills missing fields, normalizes links, ticks done/valid checkboxes whose reports exist, never rewrites authored content. See [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §3.
101
+
102
+ <!-- FLAGS_TABLE_END -->
103
+ <!-- HELP_GATE_END -->
104
+
105
+ <!-- FLAG_NORMALIZE_START -->
106
+ ## Flag normalization (apply BEFORE parsing args)
107
+
108
+ Before processing `$ARGUMENTS`, normalize these short-form flags to their long equivalents:
109
+
110
+ - `-s` → `--scope`
111
+ - `-S` → `--since`
112
+
113
+ The rest of this template documents only the long forms; the substitution above is the only place short forms are mentioned.
114
+ <!-- FLAG_NORMALIZE_END -->
115
+
116
+
117
+
118
+ > **Purpose:** When the user is stuck, mid-flow, or returning to a project, `/wbNext` analyzes the current state and produces a **ranked, actionable** list of suggestions — tailored to *this* project at *this* moment, not a static template.
119
+ > **How to use**: Copy the prompt below, replace `__PLACEHOLDERS__`, paste to any AI agent.
120
+ > Read [`../_shared/output_conventions.md`](../_shared/output_conventions.md) before producing output. Includes §9 **Action Type Tagging** — every suggested next-step row MUST carry a `Requires` tag (🧠/✅/🔨/📋, plain text) and the file MUST declare `type:` + `emits:` in YAML front-matter and include a `## 🔗 Action Types` legend.
121
+
122
+ ---
123
+
124
+ ## Filename & Folder Convention
125
+
126
+ **Path:** `<target_folder>/.wb/workflows/reports/<YYYY>/<MM>/<DD>/nexts/next_<target>_<YYYYMMDD>.md`
127
+
128
+ - No args → `<target_folder>` is the **monorepo root** (`core2/`).
129
+ - `<folder_scope>` arg → `<target_folder>` is that folder.
130
+ - `<existing_file>` arg (matches the next-output schema) → **self-correct mode** (see [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §3): re-rank, fill missing fields, do not change structure.
131
+
132
+ **Cumulative behavior:**
133
+ - Same day → if `next_<target>_<YYYYMMDD>.md` exists, **append a new section** `## 🔁 Run @ <HH:MM>` rather than overwriting.
134
+ - New day → new file.
135
+
136
+ ---
137
+
138
+ ## Detection (Self-Correct Mode)
139
+
140
+ Trigger self-correct when the input file's first H1 matches:
141
+ `# Next: <scope> — <YYYY-MM-DD>`
142
+
143
+ In self-correct mode, the command:
144
+ - Re-ranks suggestions based on the current state of the project (some may now be done, blockers may have cleared).
145
+ - Fills missing `Origin`, `Verify`, `Est. Time`, `Suggested Worker` cells.
146
+ - Converts plain-text file references to relative markdown links per [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §1.
147
+ - Does **not** delete or reorder rows the user has annotated.
148
+ - Appends one trailing line: `> _Self-corrected: <YYYY-MM-DD HH:MM> by <model>_`
149
+
150
+ ---
151
+
152
+ ## 🚀 The Suggestion Prompt (copy from here ↓)
153
+
154
+ ```
155
+ ━━━━━━━━━━━━━ /wbNext v1.0 ━━━━━━━━━━━━━
156
+
157
+ 📁 SCOPE: __TARGET_FOLDER_OR_MONOREPO_ROOT__
158
+ 📅 DATE: __TODAY__
159
+ 🤖 MODEL: __YOUR_MODEL_NAME__
160
+ 🖥️ CLIENT: __YOUR_CLIENT__
161
+ 📂 OUTPUT FILE: __TARGET_FOLDER__/.wb/workflows/reports/__YYYY__/__MM__/__DD__/nexts/next___TARGET_NAME_____YYYYMMDD__.md
162
+
163
+ ━━━ INPUT ━━━
164
+
165
+ If invoked with no args → analyze the monorepo root.
166
+ If invoked with a folder → analyze that folder.
167
+ If invoked with a file matching the next-output schema → SELF-CORRECT MODE
168
+ (see ../_shared/output_conventions.md §3).
169
+
170
+ ━━━ CONTEXT TO SCAN ━━━
171
+
172
+ 1. Most recent files under `<scope>/.wb/workflows/reports/`:
173
+ - `plans/plan_*.md` — what tasks are pending? Which are blocked? Which Done-but-not-Valid?
174
+ - `audits/audit_*.md` — any P1 findings without a corresponding plan task?
175
+ - `reviews/review_*.md` — any unresolved review comments?
176
+ - `tasks_reports/task_*.md` — any tasks claiming Done but the report is missing or empty?
177
+ 2. Read `<scope>/.wb/workflows/context.md` for project state.
178
+ 3. Check `../model_recommendations.md` for worker/validator suggestions.
179
+ 4. Look for stale TODOs in code (>30 days), unresolved merge conflicts, broken tests in CI.
180
+
181
+ ━━━ OUTPUT FORMAT ━━━
182
+
183
+ Produce a markdown file at the OUTPUT FILE path above with this exact structure:
184
+
185
+ # Next: <scope> — <YYYY-MM-DD>
186
+
187
+ > **Target:** <relative-link-to-scope-folder>
188
+ > **Created by:** <model> via <client>
189
+ > **Time:** <YYYY-MM-DD HH:MM>
190
+
191
+ ---
192
+
193
+ ## 🧭 Situation Summary
194
+
195
+ <2–4 sentences: where the project stands right now, what just happened, what is blocked.>
196
+
197
+ ## 🎯 Suggested Next Actions (ranked)
198
+
199
+ | # | Requires | Suggestion | Target | Why now | Origin | Verify | Est. Time | Suggested Worker | Blockers |
200
+ |---|---|-----------|--------|---------|--------|--------|-----------|------------------|----------|
201
+ | 1 | 🔨 Worker | <short imperative, e.g. "Validate task 1 of today's plan"> | <relative-link to file/folder> | <1 sentence: why this is the most valuable next move> | <full /wbX command that surfaced this, OR `—` if /wbNext-native> | <full /wbX command to confirm done> | <e.g. 15m, 2h, 0.5d> | <e.g. Opus 4.7 / Gemini 3.1 Pro / human> | <relative-link or `—`> |
202
+ | 2 | ✅ Validator | ... | ... | ... | ... | ... | ... | ... | ... |
203
+
204
+ **Column rules:**
205
+ - **Requires**: plain-text action-type tag (`🧠 Planner` / `✅ Validator` / `🔨 Worker` / `📋 Mechanical`) per `_shared/output_conventions.md` §9.3. Mandatory; the file MUST also include a `## 🔗 Action Types` legend before the Generated Files footer. Self-correct mode (§3) MUST insert this column on legacy files.
206
+ - **Target**: relative markdown link from THIS file's directory (per output_conventions.md §1). Apply §1.1 link beautification: basename label, full relative href.
207
+ - **Origin**: full invocable command (per output_conventions.md §2). Use `—` when the suggestion is /wbNext-native (no upstream command surfaced it).
208
+ - **Verify**: always fillable — the command that proves the action is done.
209
+ - **Suggested Worker**: pull from model_recommendations.md; include `human` when the action requires judgment beyond an AI agent.
210
+ - **Blockers**: relative link to the blocking file/issue, or `—` if none.
211
+
212
+ ## 💡 Tips & Warnings
213
+
214
+ | Type | Note |
215
+ |---|---|
216
+ | 💡 Tip | <optional: a non-obvious observation, e.g. "Task 3 has the same fix pattern as last week's task 7 — reuse that worker."> |
217
+ | ⚠️ Warning | <optional: a risk, e.g. "Plan file has 4 Done-but-not-Valid tasks older than 24h — validation drift risk."> |
218
+
219
+ ---
220
+
221
+ > _Generated by /wbNext at <YYYY-MM-DD HH:MM> via <model>._
222
+
223
+ ━━━ RULES ━━━
224
+
225
+ 1. Suggestions must be SPECIFIC. "Run tests" is bad. "Run /wbTest apps/wb-core/md.wbc-ui.com/ --scope=task-1 to verify ARCH-1 fix" is good.
226
+ 2. Rank by VALUE × URGENCY, not by ease. The #1 suggestion should unblock the most downstream work.
227
+ 3. Maximum 7 suggestions. If you need more, the project is too broad — split the scope.
228
+ 4. Always include at least one Verify command per row.
229
+ 5. Apply relative-link rule (output_conventions.md §1) to EVERY local file mention.
230
+ 6. If self-correcting an existing file, preserve user-authored notes verbatim; only fill cells that are blank or stale.
231
+ ━━━ AUTO-APPEND FOOTER ━━━
232
+
233
+ At the VERY END of the file (after "What's Next?"), you MUST append the `## 📂 Generated Files (__YYYYMMDD__)` cross-link footer. Do NOT use simple tables. You MUST use the rich "Tier 1" layout from `_shared/output_conventions.md` §5.
234
+
235
+ Format required:
236
+ ```markdown
237
+ ---
238
+ ## 📂 Generated Files (__YYYYMMDD__)
239
+ > Auto-appended per `_shared/output_conventions.md` §5. Same-level snapshot of top-level command outputs at write time.
240
+
241
+ ### 📚 Base Reference Files
242
+ | Type | File | Description |
243
+ |---|---|---|
244
+ | Foundational | [context.md](../../../../../context.md) | Permanent Identity and Architecture (Source of Truth) |
245
+ | Snapshot | [context_<scope>_<date>.md](../contexts/context_<scope>_<date>.md) | Daily snapshot used for current session context |
246
+ | Foundational | [dev.md](../../../../../dev.md) | Permanent Development Commands and Status |
247
+
248
+ ### Global Files (`core2/` monorepo root)
249
+ | Category | File | Source Command |
250
+ |---|---|---|
251
+ | Reports | [audit_core2_<date>.md](../../../../../../../../../../.wb/workflows/reports/<YYYY>/<MM>/<DD>/audits/audit_core2_<date>.md) | `/wbAudit core2/` |
252
+ | Reports | [plan_core2_<date>.md](../../../../../../../../../../.wb/workflows/reports/<YYYY>/<MM>/<DD>/plans/plan_core2_<date>.md) | `/wbPlan core2/` |
253
+ | Tracks | [track_core2_<date>.md](../../../../../../../../../../.wb/workflows/tracks/<YYYY>/<MM>/<DD>/track_core2_<date>.md) | `/wbTrack core2/` |
254
+
255
+ <details>
256
+ <summary>📂 Sub-Package: [Active Package Name]</summary>
257
+
258
+ | Category | File | Source Command |
259
+ |---|---|---|
260
+ | Reports | [audit_subpkg_<date>.md](../../../../../../../../../../apps/wb-core/subpkg/.wb/workflows/reports/<YYYY>/<MM>/<DD>/audits/audit_subpkg_<date>.md) | `/wbAudit` |
261
+
262
+ </details>
263
+ ```
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Worked Example
269
+
270
+ See [`wbNext_examples_claude.md`](../../docs/docs_claude/commands/wbNext/wbNext_examples_claude.md) (or the gemini edition) for full input/output samples.