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.
- package/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/assets/demo.gif +0 -0
- package/bin/install.js +175 -0
- package/bin/link.js +71 -0
- package/bin/verify-wrappers.js +49 -0
- package/package.json +56 -0
- package/templates/commands/_shared/output_conventions.md +433 -0
- package/templates/commands/_shared/wb_universal_agent_instructions.md +72 -0
- package/templates/commands/model_recommendation_updates.md +74 -0
- package/templates/commands/model_recommendations.md +112 -0
- package/templates/commands/wbActOn/wbActOn_template.md +546 -0
- package/templates/commands/wbAudit/wbAudit_template.md +315 -0
- package/templates/commands/wbBroadcast/wbBroadcast_template.md +133 -0
- package/templates/commands/wbCheck/wbCheck_template.md +322 -0
- package/templates/commands/wbClean/wbClean_template.md +118 -0
- package/templates/commands/wbContext/wbContext_template.md +213 -0
- package/templates/commands/wbDebug/wbDebug_template.md +132 -0
- package/templates/commands/wbDeploy/wbDeploy_template.md +224 -0
- package/templates/commands/wbDoc/wbDoc_template.md +138 -0
- package/templates/commands/wbExplain/wbExplain_template.md +98 -0
- package/templates/commands/wbGit/wbGit_template.md +160 -0
- package/templates/commands/wbHelp/wbHelp_template.md +101 -0
- package/templates/commands/wbIdea/wbIdea_template.md +337 -0
- package/templates/commands/wbLicense/wbLicense_template.md +148 -0
- package/templates/commands/wbMonetize/wbMonetize_template.md +113 -0
- package/templates/commands/wbNext/wbNext_template.md +270 -0
- package/templates/commands/wbPlan/wbPlan_template.md +413 -0
- package/templates/commands/wbPublish/wbPublish_template.md +205 -0
- package/templates/commands/wbRefactor/wbRefactor_template.md +129 -0
- package/templates/commands/wbRelease/wbRelease_template.md +229 -0
- package/templates/commands/wbReview/wbReview_template.md +252 -0
- package/templates/commands/wbSecure/wbSecure_template.md +157 -0
- package/templates/commands/wbSetup/wbSetup_template.md +203 -0
- package/templates/commands/wbStandup/wbStandup_template.md +198 -0
- package/templates/commands/wbTest/wbTest_template.md +226 -0
- package/templates/commands/wbToWBC/wbToWBC_template.md +91 -0
- package/templates/commands/wbTrack/wbTrack_template.md +555 -0
- package/templates/commands/wbTranslate/wbTranslate_template.md +114 -0
- package/templates/commands/wbValid/wbValid_template.md +142 -0
- package/templates/commands/wbVision/wbVision_template.md +141 -0
- package/templates/commands/wbWork/wbWork_template.md +140 -0
- package/templates/commands/wb_commands_reference.claude.json +2305 -0
- package/templates/commands/wb_commands_reference.json +1109 -0
- package/templates/shortcuts/shortcuts.md +413 -0
- package/templates/shortcuts/usage-management-examples-shortcuts/budget_controllers_examples.md +96 -0
- package/templates/shortcuts/usage-management-examples-shortcuts/ultimate_shortcuts_examples.md +1531 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# /wbDebug: 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 — `/wbDebug`
|
|
16
|
+
|
|
17
|
+
## Two forms
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/wbDebug "<error message>" # start from the symptom
|
|
21
|
+
/wbDebug <file-path> # investigate a specific file
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Both produce a hypothesis first, fix second. If you get a fix without a hypothesis, the command was run wrong.
|
|
25
|
+
|
|
26
|
+
## When to run
|
|
27
|
+
|
|
28
|
+
- First response to any error you don't immediately recognize.
|
|
29
|
+
- When tests fail in ways that aren't obviously test-wrong or code-wrong.
|
|
30
|
+
- When behavior is "off" but no error is thrown.
|
|
31
|
+
- When inheriting bug reports you haven't investigated yet.
|
|
32
|
+
|
|
33
|
+
## When *not* to run
|
|
34
|
+
|
|
35
|
+
- Typo or syntax error you can see at a glance. Just fix it.
|
|
36
|
+
- Bug you already know the cause of. Describe the fix directly.
|
|
37
|
+
- "Is this code good?" — that's `/wbAudit`, not debug.
|
|
38
|
+
|
|
39
|
+
## Reading the output
|
|
40
|
+
|
|
41
|
+
Every run produces:
|
|
42
|
+
|
|
43
|
+
1. **Hypothesis** — the AI's best guess, specific.
|
|
44
|
+
2. **Evidence to check** — steps you can run to verify.
|
|
45
|
+
3. **Pause** — waiting for your feedback.
|
|
46
|
+
4. **Fix proposal or refusal** — only after hypothesis is confirmed.
|
|
47
|
+
|
|
48
|
+
## The pause is non-negotiable
|
|
49
|
+
|
|
50
|
+
If the AI proposes a fix without waiting for you to verify, push back:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
"You skipped the pause. First tell me why you think this is the cause.
|
|
54
|
+
Then I'll check. Then we fix."
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The pause exists because:
|
|
58
|
+
- Wrong hypothesis + fix = new bug introduced, original still there.
|
|
59
|
+
- Right hypothesis + fix = clean debugging.
|
|
60
|
+
- Unverified hypothesis = gamble.
|
|
61
|
+
|
|
62
|
+
## When the hypothesis is wrong
|
|
63
|
+
|
|
64
|
+
Tell the AI directly: "hypothesis is wrong because X." The AI should explicitly acknowledge and reform. If it defends the original hypothesis, re-prompt harder: *"I just told you the hypothesis is wrong. Accept that and reform based on my new information."*
|
|
65
|
+
|
|
66
|
+
## The interaction with open decisions
|
|
67
|
+
|
|
68
|
+
If `context.md` has an open architectural decision, and the bug symptom maps to that decision, the AI should **refuse to fix**. Example: `extractSubObject` array handling is open; a bug that comes from this is not a bug — it's a design question.
|
|
69
|
+
|
|
70
|
+
Surface the decision. Don't silently fix.
|
|
71
|
+
|
|
72
|
+
## When /wbDebug is the wrong command
|
|
73
|
+
|
|
74
|
+
- Code quality review → `/wbAudit`.
|
|
75
|
+
- Plan verification → `/wbReview`.
|
|
76
|
+
- Finding dead code → `/wbClean`.
|
|
77
|
+
- Rewriting working code → `/wbRefactor`.
|
|
78
|
+
|
|
79
|
+
`/wbDebug` answers one question: *"why is this broken?"*
|
|
80
|
+
|
|
81
|
+
> For deeper reading: [`docs_claude/commands/wbDebug/wbDebug_practical_claude.md`](../../docs/docs_claude/commands/wbDebug/wbDebug_practical_claude.md) (or the `_eli5_`, `_expert_`, `_examples_` siblings).
|
|
82
|
+
## Self-correct mode (dual-mode invocation)
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
/wbDebug <scope_folder> # normal mode — produce a fresh output file
|
|
86
|
+
/wbDebug <previous_output_file> # self-correct mode — verify & repair the file in place
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When the first arg is an existing output file from a prior `/wbDebug` 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.
|
|
90
|
+
|
|
91
|
+
<!-- HELP_GATE_END -->
|
|
92
|
+
|
|
93
|
+
**ROLE:** The Detective
|
|
94
|
+
**TARGET:** The provided stack trace, error message, or broken file.
|
|
95
|
+
**Read first:** [`../_shared/output_conventions.md`](../_shared/output_conventions.md) — applies to the debug report (relative links, full-syntax commands, self-correct mode).
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ━━━ DETECTION (Self-Correct Mode) ━━━
|
|
100
|
+
|
|
101
|
+
Trigger self-correct when the input file's first H1 matches:
|
|
102
|
+
`# Debug: <scope> — <YYYY-MM-DD>` *(or the legacy `# Debug Entry #N` header).*
|
|
103
|
+
|
|
104
|
+
Behavior is defined in [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §3.
|
|
105
|
+
|
|
106
|
+
Debug-specific gap-fills:
|
|
107
|
+
|
|
108
|
+
- Plain-text file paths in the Root Cause / Solution sections → relative markdown links per §1.
|
|
109
|
+
- Bare `/wbTest` cited as regression check → full-syntax `/wbTest <target>` per §2.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## ━━━ OBJECTIVE ━━━
|
|
114
|
+
Your job is to fix errors. Do not guess. You must follow the Scientific Method to isolate the root cause before applying a patch.
|
|
115
|
+
|
|
116
|
+
## ━━━ PHASE 1: INGEST & HYPOTHESIS ━━━
|
|
117
|
+
1. Analyze the provided error message or broken behavior.
|
|
118
|
+
2. State your Hypothesis clearly: *Why is this failing?* (e.g., "The reactivity loop is triggering because `watch` is mutating its own dependency.")
|
|
119
|
+
|
|
120
|
+
## ━━━ PHASE 2: ISOLATION ━━━
|
|
121
|
+
1. If the root cause is unclear, inject `console.log` tracers or debug points to capture the state.
|
|
122
|
+
2. Trace the data flow back to the origin of the mutation.
|
|
123
|
+
|
|
124
|
+
## ━━━ PHASE 3: RESOLUTION & REPORT ━━━
|
|
125
|
+
1. Apply the minimal necessary fix to resolve the error.
|
|
126
|
+
2. Generate a report: `.wb/workflows/reports/<YYYY>/<MM>/<DD>/debugs/debug_<target>_<YYYYMMDD>.md` (create-or-append; tag your entry `*(ModelName — HH:MM)*`).
|
|
127
|
+
3. The report must explain the Root Cause and the Solution applied. Apply output_conventions.md §1 (relative links for every file referenced) and §2 (full-syntax for any /wb* command cited).
|
|
128
|
+
4. End the report with:
|
|
129
|
+
|
|
130
|
+
## 🧭 What's Next?
|
|
131
|
+
|
|
132
|
+
Run `/wbNext <target_folder>` to get a current, ranked list of next actions (typically `/wbTest <target>` to verify the fix didn't regress anything else).
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# wbDeploy Template v2.1
|
|
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 — `/wbDeploy`
|
|
16
|
+
|
|
17
|
+
## Three forms
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/wbDeploy <app> # deploy to configured target (usually gh-pages)
|
|
21
|
+
/wbDeploy <app> --dry-run # preview, no push
|
|
22
|
+
/wbDeploy <app> --target=local # build + serve locally for testing
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## The safe flow
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
/wbDeploy <app> --target=local # build + preview locally
|
|
29
|
+
# test in browser, confirm no prod-specific bugs
|
|
30
|
+
/wbDeploy <app> --dry-run # preview what would deploy
|
|
31
|
+
/wbDeploy <app> # real deploy
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Skipping the local step is the #1 cause of "works in dev, broken in prod" deploys.
|
|
35
|
+
|
|
36
|
+
## Prerequisites
|
|
37
|
+
|
|
38
|
+
The app must have `.wb/workflows/deploy.md` filled in with target, repo, branch, base-url. `/wbDeploy` refuses if missing.
|
|
39
|
+
|
|
40
|
+
For GitHub Pages specifically, see [wbDeploy_github_pages_guide_claude](../wbDeploy_github_pages_guide_claude.md).
|
|
41
|
+
|
|
42
|
+
## Gates the AI checks before deploy
|
|
43
|
+
|
|
44
|
+
1. `/wbTest` must have passed recently. Failures BLOCK.
|
|
45
|
+
2. `/wbAudit` BLOCKERS block. MAJORS are advisory.
|
|
46
|
+
3. Build output is present (`dist/`).
|
|
47
|
+
4. Deploy config is complete.
|
|
48
|
+
|
|
49
|
+
If any gate fails, the command refuses with a specific fix.
|
|
50
|
+
|
|
51
|
+
## After a successful deploy
|
|
52
|
+
|
|
53
|
+
The AI tells you the live URL. **Open it.** The AI cannot verify the live site works — that's your job. Click around. Check the console. Refresh on a deep link.
|
|
54
|
+
|
|
55
|
+
If the live site is broken but local-test passed, the issue is deploy-specific (base URL, CORS, DNS, GitHub Pages caching). Start with hard refresh + 5 min wait.
|
|
56
|
+
|
|
57
|
+
## When to deploy
|
|
58
|
+
|
|
59
|
+
- After `/wbAudit` on the app is clean.
|
|
60
|
+
- After user-facing changes.
|
|
61
|
+
- As part of a release cycle for apps bundled with package releases.
|
|
62
|
+
- NOT after internal refactors nobody will see.
|
|
63
|
+
- NOT for experimental changes. Create a scratch deploy target if needed.
|
|
64
|
+
|
|
65
|
+
## When /wbDeploy is the wrong command
|
|
66
|
+
|
|
67
|
+
- Package (code others import) → `/wbPublish`.
|
|
68
|
+
- Just want to see your changes locally → `npm run dev`. That's different from `--target=local`.
|
|
69
|
+
- Want to stage to a preview URL → set up a scratch deploy target in `deploy.md`, don't deploy to prod.
|
|
70
|
+
|
|
71
|
+
> For deeper reading: [`docs_claude/commands/wbDeploy/wbDeploy_practical_claude.md`](../../docs/docs_claude/commands/wbDeploy/wbDeploy_practical_claude.md) (or the `_eli5_`, `_expert_`, `_examples_` siblings).
|
|
72
|
+
|
|
73
|
+
<!-- FLAGS_TABLE_START -->
|
|
74
|
+
## Flags & shortcuts
|
|
75
|
+
|
|
76
|
+
Both forms are equivalent — pass either:
|
|
77
|
+
|
|
78
|
+
| Long form | Shortcut |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `--dry-run` | `-d` |
|
|
81
|
+
| `--prod` | `-P` |
|
|
82
|
+
| `--target` | `-t` |
|
|
83
|
+
|
|
84
|
+
`-h` / `--help` / `--h` (any command) prints this help block instead of executing.
|
|
85
|
+
## Self-correct mode (dual-mode invocation)
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
/wbDeploy <scope_folder> # normal mode — produce a fresh output file
|
|
89
|
+
/wbDeploy <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 `/wbDeploy` 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
|
+
- `-d` → `--dry-run`
|
|
103
|
+
- `-P` → `--prod`
|
|
104
|
+
- `-t` → `--target`
|
|
105
|
+
|
|
106
|
+
The rest of this template documents only the long forms; the substitution above is the only place short forms are mentioned.
|
|
107
|
+
<!-- FLAG_NORMALIZE_END -->
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
> **How to use**: This is the manual template for orchestrating the deployment of consumer applications (e.g., demo sites, documentation) to web hosting platforms like Vercel, AWS, or a custom VPS.
|
|
112
|
+
> **Read first:** [`../_shared/output_conventions.md`](../_shared/output_conventions.md) — applies to every cell of the output (relative links, full-syntax commands, self-correct mode).
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Detection (Self-Correct Mode)
|
|
117
|
+
|
|
118
|
+
Trigger self-correct when the input file's first H1 matches:
|
|
119
|
+
`# Deploy: <scope> — <YYYY-MM-DD>` *(or the legacy `# Deploy Entry #N` header).*
|
|
120
|
+
|
|
121
|
+
Behavior is defined in [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §3.
|
|
122
|
+
|
|
123
|
+
Deploy-specific gap-fills:
|
|
124
|
+
|
|
125
|
+
- Plain-text `.env.production`, build-output paths → relative markdown links per §1.
|
|
126
|
+
- Bare deploy commands → full-syntax form per §2 where applicable.
|
|
127
|
+
- Missing post-deploy smoke-test result → leave blank (do not fabricate).
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Filename & Folder Convention (v2 — Universal Daily File)
|
|
132
|
+
|
|
133
|
+
**Path:** `<target_folder>/.wb/workflows/reports/<YYYY>/<MM>/<DD>/deployments/deploy_<target>_<YYYYMMDD>.md`
|
|
134
|
+
|
|
135
|
+
> **No `<model>/` subfolder.** All models contribute to ONE deploy file per day per scope.
|
|
136
|
+
> **No timestamp in filename.** Filename uses only the date.
|
|
137
|
+
|
|
138
|
+
**Create-or-Append Rule:**
|
|
139
|
+
- **File does NOT exist →** CREATE the file with a header and your deployment log as Entry #1.
|
|
140
|
+
- **File ALREADY exists →** READ it, then APPEND as the next Entry #N.
|
|
141
|
+
- **Every entry tagged:** `*(ModelName via Client — HH:MM)*`
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## The Prompt (copy from here ↓)
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
━━━━━━━━━━━━━ /wbDeploy ━━━━━━━━━━━━━
|
|
149
|
+
|
|
150
|
+
📁 TARGET APP: __TARGET_APP_PATH__
|
|
151
|
+
📅 DATE: __TODAY__
|
|
152
|
+
🤖 MODEL: __YOUR_MODEL_NAME__
|
|
153
|
+
🖥️ CLIENT: __YOUR_CLIENT__
|
|
154
|
+
🌐 ENVIRONMENT: __production_or_staging__
|
|
155
|
+
|
|
156
|
+
━━━ CONTEXT & GOAL ━━━
|
|
157
|
+
The user wants to deploy a physical application (e.g., documentation, demo site) to a web host (like wbc-ui.com or wbjs.net). Unlike library packages that go to NPM, this app must be built into static assets and pushed to a server/CDN.
|
|
158
|
+
|
|
159
|
+
Your goal is to act as the DevOps Deployment Agent. You must ensure the app is synced with the latest library versions, build the application, and execute the deployment commands safely.
|
|
160
|
+
|
|
161
|
+
━━━ INSTRUCTIONS ━━━
|
|
162
|
+
|
|
163
|
+
**[TEMPORAL MEMORY]**: Before executing your main task, you MUST scan the `.wb/workflows/reports/` directory of your target scope. Look for recent `audits/`, `reviews/`, or `tests/` reports. Use these past reports to understand recent failures, technical debt, or architectural decisions that affect your current execution.
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
1. **Infrastructure & DNS (If requested)**: Execute terminal commands to verify DNS propagation (`dig`, `ping`), configure server routing (e.g., Nginx virtual hosts), manage sub-domains, or provision SSL certificates (`certbot`).
|
|
167
|
+
2. **Pre-Flight Sync**: Check if the app's `package.json` needs to be updated to use the latest public versions of `wb-core` or `wb-press2` (removing local `file:` links if it's a production deploy).
|
|
168
|
+
3. **Environment Audit**: Verify that the correct environment variables (e.g., `.env.production`) are present for the target environment.
|
|
169
|
+
4. **Build Execution**: Run the application-specific build script (e.g., `npm run build` inside the app folder).
|
|
170
|
+
5. **Deploy Execution**: Provide or execute the specific deployment commands required for this app (e.g., `vercel --prod`, `rsync`, or FTP instructions).
|
|
171
|
+
6. **Post-Deploy Smoke Test**: Define how the user can verify the deployment was successful (e.g., checking specific console logs on the live URL).
|
|
172
|
+
7. SAVE using the Universal Daily File pattern:
|
|
173
|
+
|
|
174
|
+
CHECK if this file exists:
|
|
175
|
+
`<target_folder>/.wb/workflows/reports/__YYYY__/__MM__/__DD__/deployments/deploy___NAME_____YYYYMMDD__.md`
|
|
176
|
+
|
|
177
|
+
- If it does NOT exist → CREATE the file with header + your deployment log as Entry #1
|
|
178
|
+
- If it ALREADY exists → APPEND as the next Entry #N
|
|
179
|
+
|
|
180
|
+
8. APPLY OUTPUT CONVENTIONS (see ../_shared/output_conventions.md):
|
|
181
|
+
- All file/folder references (env files, build outputs, host configs) → relative markdown links (§1).
|
|
182
|
+
- Any /wb* commands cited → full-syntax form (§2).
|
|
183
|
+
|
|
184
|
+
9. END THE FILE WITH:
|
|
185
|
+
|
|
186
|
+
## 🧭 What's Next?
|
|
187
|
+
|
|
188
|
+
Run `/wbNext <target_folder>` to get a current, ranked list of next actions (typically post-deploy verification or next-app deploy).
|
|
189
|
+
|
|
190
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
191
|
+
━━━ AUTO-APPEND FOOTER ━━━
|
|
192
|
+
|
|
193
|
+
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.
|
|
194
|
+
|
|
195
|
+
Format required:
|
|
196
|
+
```markdown
|
|
197
|
+
---
|
|
198
|
+
## 📂 Generated Files (__YYYYMMDD__)
|
|
199
|
+
> Auto-appended per `_shared/output_conventions.md` §5. Same-level snapshot of top-level command outputs at write time.
|
|
200
|
+
|
|
201
|
+
### 📚 Base Reference Files
|
|
202
|
+
| Type | File | Description |
|
|
203
|
+
|---|---|---|
|
|
204
|
+
| Foundational | [context.md](../../../../../context.md) | Permanent Identity and Architecture (Source of Truth) |
|
|
205
|
+
| Snapshot | [context_<scope>_<date>.md](../contexts/context_<scope>_<date>.md) | Daily snapshot used for current session context |
|
|
206
|
+
| Foundational | [dev.md](../../../../../dev.md) | Permanent Development Commands and Status |
|
|
207
|
+
|
|
208
|
+
### Global Files (`core2/` monorepo root)
|
|
209
|
+
| Category | File | Source Command |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| Reports | [audit_core2_<date>.md](../../../../../../../../../../.wb/workflows/reports/<YYYY>/<MM>/<DD>/audits/audit_core2_<date>.md) | `/wbAudit core2/` |
|
|
212
|
+
| Reports | [plan_core2_<date>.md](../../../../../../../../../../.wb/workflows/reports/<YYYY>/<MM>/<DD>/plans/plan_core2_<date>.md) | `/wbPlan core2/` |
|
|
213
|
+
| Tracks | [track_core2_<date>.md](../../../../../../../../../../.wb/workflows/tracks/<YYYY>/<MM>/<DD>/track_core2_<date>.md) | `/wbTrack core2/` |
|
|
214
|
+
|
|
215
|
+
<details>
|
|
216
|
+
<summary>📂 Sub-Package: [Active Package Name]</summary>
|
|
217
|
+
|
|
218
|
+
| Category | File | Source Command |
|
|
219
|
+
|---|---|---|
|
|
220
|
+
| Reports | [audit_subpkg_<date>.md](../../../../../../../../../../apps/wb-core/subpkg/.wb/workflows/reports/<YYYY>/<MM>/<DD>/audits/audit_subpkg_<date>.md) | `/wbAudit` |
|
|
221
|
+
|
|
222
|
+
</details>
|
|
223
|
+
```
|
|
224
|
+
```
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# /wbDoc: 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 — `/wbDoc`
|
|
16
|
+
|
|
17
|
+
## Two forms
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
/wbDoc <file> # JSDoc on functions + inline comments
|
|
21
|
+
/wbDoc <folder> # README + JSDoc across the folder
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## When to run
|
|
25
|
+
|
|
26
|
+
- Before `/wbRelease` + `/wbPublish` — so npm users get current docs.
|
|
27
|
+
- When adding a new public export (document it immediately, before consumers depend on undocumented behavior).
|
|
28
|
+
- When `/wbAudit` flags missing JSDoc.
|
|
29
|
+
- Monthly-ish on actively-edited packages — docs drift fast.
|
|
30
|
+
|
|
31
|
+
## When *not* to run
|
|
32
|
+
|
|
33
|
+
- On a file that `/wbAudit` flagged for refactor — docs will be stale in a week.
|
|
34
|
+
- On internal helpers that aren't exported — documenting private is noise.
|
|
35
|
+
- On boilerplate — `package.json`, `vite.config.js`, etc. don't need generated docs.
|
|
36
|
+
|
|
37
|
+
## What good output looks like
|
|
38
|
+
|
|
39
|
+
- JSDoc with `@param`, `@returns`, `@example`, and `@remarks` for gotchas.
|
|
40
|
+
- Examples drawn from actual call sites, not invented.
|
|
41
|
+
- Explicit mention of open architectural decisions when relevant.
|
|
42
|
+
- Conventions from `dev.md` surfaced in the README (the `:wbCode="false"` rule, the `apiResponse_` cache, the `__WBC_PRO__` gate).
|
|
43
|
+
|
|
44
|
+
## What bad output looks like
|
|
45
|
+
|
|
46
|
+
- "This function takes a parameter" — restatement.
|
|
47
|
+
- "Use this carefully" — vague warning without specifics.
|
|
48
|
+
- Invented examples that don't match any real usage.
|
|
49
|
+
- Examples missing the `:wbCode="false"` you always apply.
|
|
50
|
+
|
|
51
|
+
If you see any of these, re-prompt: *"ground examples in actual call sites. Name the project-specific conventions. Drop generic prose."*
|
|
52
|
+
|
|
53
|
+
## The context.md sync
|
|
54
|
+
|
|
55
|
+
After `/wbDoc`, check that `context.md` API section matches what you just documented. If they disagree, pick one and fix the other — they should always agree.
|
|
56
|
+
|
|
57
|
+
## When /wbDoc is the wrong command
|
|
58
|
+
|
|
59
|
+
- Code review → `/wbAudit`.
|
|
60
|
+
- Finding dead code → `/wbClean`.
|
|
61
|
+
- Understanding how something works → read the code or `/wbContext --focus=<x>`.
|
|
62
|
+
- Writing user-facing marketing copy → `/wbBroadcast`, not `/wbDoc`.
|
|
63
|
+
|
|
64
|
+
> For deeper reading: [`docs_claude/commands/wbDoc/wbDoc_practical_claude.md`](../../docs/docs_claude/commands/wbDoc/wbDoc_practical_claude.md) (or the `_eli5_`, `_expert_`, `_examples_` siblings).
|
|
65
|
+
|
|
66
|
+
<!-- FLAGS_TABLE_START -->
|
|
67
|
+
## Flags & shortcuts
|
|
68
|
+
|
|
69
|
+
Both forms are equivalent — pass either:
|
|
70
|
+
|
|
71
|
+
| Long form | Shortcut |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `--focus` | `-f` |
|
|
74
|
+
|
|
75
|
+
`-h` / `--help` / `--h` (any command) prints this help block instead of executing.
|
|
76
|
+
## Self-correct mode (dual-mode invocation)
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
/wbDoc <scope_folder> # normal mode — produce a fresh output file
|
|
80
|
+
/wbDoc <previous_output_file> # self-correct mode — verify & repair the file in place
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
When the first arg is an existing output file from a prior `/wbDoc` 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.
|
|
84
|
+
|
|
85
|
+
<!-- FLAGS_TABLE_END -->
|
|
86
|
+
<!-- HELP_GATE_END -->
|
|
87
|
+
|
|
88
|
+
<!-- FLAG_NORMALIZE_START -->
|
|
89
|
+
## Flag normalization (apply BEFORE parsing args)
|
|
90
|
+
|
|
91
|
+
Before processing `$ARGUMENTS`, normalize these short-form flags to their long equivalents:
|
|
92
|
+
|
|
93
|
+
- `-f` → `--focus`
|
|
94
|
+
|
|
95
|
+
The rest of this template documents only the long forms; the substitution above is the only place short forms are mentioned.
|
|
96
|
+
<!-- FLAG_NORMALIZE_END -->
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
**ROLE:** The Scribe
|
|
101
|
+
**TARGET:** The provided file or folder.
|
|
102
|
+
**Read first:** [`../_shared/output_conventions.md`](../_shared/output_conventions.md) — applies to the summary report (relative links, full-syntax commands, self-correct mode).
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## ━━━ DETECTION (Self-Correct Mode) ━━━
|
|
107
|
+
|
|
108
|
+
Trigger self-correct when the input file's first H1 matches:
|
|
109
|
+
`# Doc: <scope> — <YYYY-MM-DD>` *(if a report file is produced).*
|
|
110
|
+
|
|
111
|
+
Behavior is defined in [`../_shared/output_conventions.md`](../_shared/output_conventions.md) §3.
|
|
112
|
+
|
|
113
|
+
Doc-specific gap-fills:
|
|
114
|
+
|
|
115
|
+
- Plain-text mentions of documented files → relative markdown links per §1.
|
|
116
|
+
- Bare `/wbReview` cited → full-syntax `/wbReview <target>` per §2.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## ━━━ OBJECTIVE ━━━
|
|
121
|
+
Your job is to document the code beautifully. **CRITICAL RULE:** You are forbidden from modifying any functional logic, variable names, or architecture. Your only output must be comments and markdown files.
|
|
122
|
+
|
|
123
|
+
## ━━━ PHASE 1: DISCOVERY ━━━
|
|
124
|
+
1. Read the target code to understand its purpose, inputs, and outputs.
|
|
125
|
+
2. Cross-reference with `context.md` to understand the broader package context.
|
|
126
|
+
|
|
127
|
+
## ━━━ PHASE 2: INJECTION ━━━
|
|
128
|
+
1. **For Files:** Inject professional JSDoc/TSDoc comments above every major class, function, and complex logic block. Explain *why* it does something, not just *what* it does.
|
|
129
|
+
2. **For Folders:** Generate or update a comprehensive `README.md` explaining the module's purpose, usage examples, and API surface.
|
|
130
|
+
|
|
131
|
+
## ━━━ PHASE 3: REPORT ━━━
|
|
132
|
+
Provide a brief summary of what files were documented. Apply output_conventions.md §1 (relative links for every documented file) and §2 (full-syntax for any /wb* command cited).
|
|
133
|
+
|
|
134
|
+
End the report with:
|
|
135
|
+
|
|
136
|
+
## 🧭 What's Next?
|
|
137
|
+
|
|
138
|
+
Run `/wbNext <target_folder>` to get a current, ranked list of next actions (typically `/wbReview <target>` to validate doc accuracy, or `/wbDeploy` if the docs are user-facing).
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<!-- HELP_GATE_START -->
|
|
2
|
+
# `/wbExplain` Command
|
|
3
|
+
**Role:** The Teacher / The Architect
|
|
4
|
+
**Purpose:** Generate persistent, formatted explanations for a specific task ID, a codebase architecture, or a general technical question, without executing code changes.
|
|
5
|
+
**Usage:** `/wbExplain <target> "<query>|<column_filter>|*" [--as=<style>]`
|
|
6
|
+
**Example (Task):** `/wbExplain plan_core2_20260503.md --id=1 --as=eli5`
|
|
7
|
+
**Example (Batch):** `/wbExplain packages/wb-core/ * --as=expert,it`
|
|
8
|
+
**Example (Filter):** `/wbExplain plan_core2_20260503.md --est<=30 --as=expert`
|
|
9
|
+
**Example (General):** `/wbExplain packages/wb-core/ "How does the Tier parser work?" --as=expert`
|
|
10
|
+
<!-- HELP_GATE_END -->
|
|
11
|
+
|
|
12
|
+
━━━ TRIGGER & GOAL ━━━
|
|
13
|
+
|
|
14
|
+
You have been invoked to run `/wbExplain`. Your job is to deeply analyze the requested topic or task/idea ID, and generate a clear, pedagogical markdown explanation file. You MUST NOT execute the task or modify source code.
|
|
15
|
+
> **Batch Processing (`*` or column filter):** If the user passes `*` or a column filter (e.g., `--est<=30`, `--p=P1`), you must locate the active `plan_*.md` or `idea_*.md` file for the target, identify ALL matching outstanding items, and generate a separate details file for *each* matching item sequentially, auto-linking all of them.
|
|
16
|
+
|
|
17
|
+
━━━ MODE DETECTION ━━━
|
|
18
|
+
|
|
19
|
+
Detect the operating mode from the target:
|
|
20
|
+
|
|
21
|
+
- **Plan scope** (target is `plan_*.md` or `--id=N` without `--scope=idea`): Standard task explanation mode.
|
|
22
|
+
- **Idea scope** (target is `idea_*.md` or `--scope=idea` flag is present): Idea explanation mode — explains *why* the idea matters, *what* it would change, and *how* it could be approached.
|
|
23
|
+
|
|
24
|
+
━━━ DETECTION & SMART MERGE ━━━
|
|
25
|
+
|
|
26
|
+
If the user runs this command multiple times for the same topic/task on the same day, you MUST NOT create a new file (e.g. do not create `task_1_details_fr_ar.md`). Instead, use the **Smart Merge Protocol**:
|
|
27
|
+
Open the existing details/explanation file and **APPEND** your new translation or new explanation style directly below the existing `Deep Dive` or `Recommended Approach` sections, right before the `## 🧭 What's Next?` footer. Never fragment the knowledge into multiple daily files for the same task.
|
|
28
|
+
|
|
29
|
+
━━━ FLAGS & STYLES ━━━
|
|
30
|
+
|
|
31
|
+
If the user includes `--as=<style>` (e.g., `--as=eli5`, `--as=expert`, `--as=technical`), you MUST adopt that exact tone from `../../shortcuts/shortcuts.md`.
|
|
32
|
+
|
|
33
|
+
# ━━━ OUTPUT FORMAT ━━━
|
|
34
|
+
|
|
35
|
+
1. **Generate the File:**
|
|
36
|
+
- **Task-mode** (explaining a specific Task ID from a plan): Create at `<target_folder>/.wb/workflows/reports/<YYYY>/<MM>/<DD>/plans/tasks/task_<N>/task_<N>_details_<scope>_<YYYYMMDD>.md`. Create the `task_<N>/` folder if it does not exist.
|
|
37
|
+
- **Idea-mode** (explaining a specific Idea ID from an idea file): Create at `<target_folder>/.wb/workflows/reports/<YYYY>/<MM>/<DD>/ideas/ideas_reports/idea_<N>/idea_<N>_details_<scope>_<YYYYMMDD>.md`. Create the `idea_<N>/` folder if it does not exist.
|
|
38
|
+
- **Free-text mode** (general question, no task/idea ID): Create at `<target_folder>/.wb/workflows/reports/<YYYY>/<MM>/<DD>/plans/explanations/explain_<slug>_<YYYYMMDD>.md`. Create the `explanations/` folder if it does not exist.
|
|
39
|
+
Do not output code blocks containing the entire codebase.
|
|
40
|
+
|
|
41
|
+
2. **Auto-Link in Source File:** If you generated an explanation for a specific task or idea ID, you MUST locate the active source file (`plan_*.md` or `idea_*.md`). Find the row for your ID and upgrade the `🔗` column.
|
|
42
|
+
- **Plan file:** If the column holds the inactive placeholder `<span title="...">📄</span>`, replace it with an active markdown link containing the `--as` tags: `[📄 expert,fr](tasks/task_<N>/task_<N>_details_<scope>_<YYYYMMDD>.md "View Details")`.
|
|
43
|
+
- **Idea file:** Same pattern but routed to: `[📄 expert](ideas_reports/idea_<N>/idea_<N>_details_<scope>_<YYYYMMDD>.md "View Details")`.
|
|
44
|
+
- If the column already has an active link, append your new tags to the existing list.
|
|
45
|
+
|
|
46
|
+
# Explanation: <target_folder_name> — <YYYY-MM-DD>
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 💻 Run: `/wbExplain <target> "<query>|--id=N" [--as=<style>]` *(HH:MM)*
|
|
51
|
+
> **Model:** <model_name>
|
|
52
|
+
> **Client:** <client_name>
|
|
53
|
+
|
|
54
|
+
### 1. High-Level Summary
|
|
55
|
+
(One paragraph answering the core question or explaining the task).
|
|
56
|
+
|
|
57
|
+
### 2. Deep Dive
|
|
58
|
+
(Break down the issue, architecture, or task step-by-step).
|
|
59
|
+
|
|
60
|
+
### 3. Recommended Approach (If applicable)
|
|
61
|
+
(If explaining a task, how should the worker approach it? If explaining a bug, what is the fix?)
|
|
62
|
+
|
|
63
|
+
## 🧭 What's Next?
|
|
64
|
+
If this was a task explanation, recommend the exact `/wbWork` command to execute it now. Otherwise, suggest `/wbNext`.
|
|
65
|
+
|
|
66
|
+
━━━ AUTO-APPEND FOOTER ━━━
|
|
67
|
+
|
|
68
|
+
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.
|
|
69
|
+
|
|
70
|
+
Format required:
|
|
71
|
+
```markdown
|
|
72
|
+
---
|
|
73
|
+
## 📂 Generated Files (__YYYYMMDD__)
|
|
74
|
+
> Auto-appended per `_shared/output_conventions.md` §5. Same-level snapshot of top-level command outputs at write time.
|
|
75
|
+
|
|
76
|
+
### 📚 Base Reference Files
|
|
77
|
+
| Type | File | Description |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| Foundational | [context.md](../../../../../context.md) | Permanent Identity and Architecture (Source of Truth) |
|
|
80
|
+
| Snapshot | [context_<scope>_<date>.md](../contexts/context_<scope>_<date>.md) | Daily snapshot used for current session context |
|
|
81
|
+
| Foundational | [dev.md](../../../../../dev.md) | Permanent Development Commands and Status |
|
|
82
|
+
|
|
83
|
+
### Global Files (`core2/` monorepo root)
|
|
84
|
+
| Category | File | Source Command |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| Reports | [audit_core2_<date>.md](../../../../../../../../../../.wb/workflows/reports/<YYYY>/<MM>/<DD>/audits/audit_core2_<date>.md) | `/wbAudit core2/` |
|
|
87
|
+
| Reports | [plan_core2_<date>.md](../../../../../../../../../../.wb/workflows/reports/<YYYY>/<MM>/<DD>/plans/plan_core2_<date>.md) | `/wbPlan core2/` |
|
|
88
|
+
| Tracks | [track_core2_<date>.md](../../../../../../../../../../.wb/workflows/tracks/<YYYY>/<MM>/<DD>/track_core2_<date>.md) | `/wbTrack core2/` |
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary>📂 Sub-Package: [Active Package Name]</summary>
|
|
92
|
+
|
|
93
|
+
| Category | File | Source Command |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| Reports | [audit_subpkg_<date>.md](../../../../../../../../../../apps/wb-core/subpkg/.wb/workflows/reports/<YYYY>/<MM>/<DD>/audits/audit_subpkg_<date>.md) | `/wbAudit` |
|
|
96
|
+
|
|
97
|
+
</details>
|
|
98
|
+
```
|