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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.0-r01] - 2026-05-10
|
|
6
|
+
|
|
7
|
+
### Initial Release
|
|
8
|
+
- **Zero-Dependency CLI:** Instant bootstrap via `npx wb-flow` without polluting your node_modules.
|
|
9
|
+
- **31 `wb*` Command Templates:** Full suite of workflow templates injected directly into your `.wb/` directory.
|
|
10
|
+
- **Multi-AI-Host Support:** Built-in parity for Claude Code, OpenCode, Gemini, and Cursor agents.
|
|
11
|
+
- **Ideas Pipeline:** Enforces deterministic multi-step processes via `/wbAudit` ā `/wbPlan` ā `/wbWork` ā `/wbValid`.
|
|
12
|
+
- **Four Install Paths:** Supports global, local (npx), and offline/git-clone installation methods.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wissem Boughamoura <wissemb11@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# š WB-Flow: The Agentic AI Workflow Engine
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/wb-flow)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
|
|
7
|
+
> **WB-Flow** is a zero-dependency CLI tool that instantly bootstraps a powerful, standardized Agentic AI workflow system into any repository.
|
|
8
|
+
|
|
9
|
+
By copying a highly tuned set of 31 `/wb*` slash-command templates into your project, **WB-Flow** transforms generic AI coding assistants (like Claude Code, OpenCode, Gemini CLI, or Cursor) into disciplined, structured engineering teams.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
> *30-second tour: `npx wb-flow` materializes the full agentic workflow into your repo.*
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## š§ What is it?
|
|
18
|
+
WB-Flow provides a definitive "contract" between you and your AI coding agents. It installs a `.wb/` directory containing markdown templates that instruct the AI exactly **how** to behave when performing complex software engineering tasks.
|
|
19
|
+
|
|
20
|
+
Instead of typing long, repetitive prompts, you simply type a command like `/wbAudit src/` or `/wbPlan`, and the AI reads the corresponding template to execute a deterministic, multi-step Standard Operating Procedure (SOP).
|
|
21
|
+
|
|
22
|
+
**Universal:** WB-Flow is framework-agnostic. It works with Vue, React, Python, Go, Rust, or any codebase ā the templates are pure Markdown and the bootstrapper has zero runtime dependencies beyond Node.
|
|
23
|
+
|
|
24
|
+
## šÆ What is it for?
|
|
25
|
+
Unconstrained AI agents often hallucinate, drift off-task, or write "spaghetti" code when given large objectives. WB-Flow solves this by enforcing an **Ideas Pipeline**:
|
|
26
|
+
1. **Audit:** Assess the codebase and identify technical debt (`/wbAudit`).
|
|
27
|
+
2. **Plan:** Break down the work into a structured task backlog (`/wbPlan`).
|
|
28
|
+
3. **Execute:** Work on atomic tasks one by one (`/wbWork`).
|
|
29
|
+
4. **Validate:** Perform an adversarial QA review of the work (`/wbValid`).
|
|
30
|
+
|
|
31
|
+
It ensures your AI follows strict monorepo conventions, maintains deep architectural context (`/wbContext`), and never goes rogue.
|
|
32
|
+
|
|
33
|
+
## š„ Compared With...
|
|
34
|
+
- **Raw AI Prompts / Chat:** You are at the mercy of the model's mood. With WB-Flow, the output format, reasoning steps, and constraints are rigidly defined in templates.
|
|
35
|
+
- **Heavy Frameworks (e.g., LangChain, AutoGen):** Those require python environments, API keys, and complex orchestration. WB-Flow is **pure Markdown**. It requires zero dependencies and works locally with your existing IDE or CLI AI assistant.
|
|
36
|
+
- **Persona-based agentic frameworks (e.g., BMAD-Method):** Those simulate a Scrum team ā PM agent, Architect agent, Dev agent. WB-Flow inverts the model: **verbs over personas.** You don't ask "the QA agent" to audit code; you run `/wbAudit`. Tighter, more honest, less roleplay.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## š Installation
|
|
41
|
+
|
|
42
|
+
WB-Flow supports **four install paths** ā pick whichever fits your environment. All four invoke the same `bin/install.js` underneath, so behavior is identical.
|
|
43
|
+
|
|
44
|
+
### Path 1 ā One-shot via `npx` (Recommended)
|
|
45
|
+
|
|
46
|
+
Zero-install, zero-pollution. Run it once to bootstrap your repo:
|
|
47
|
+
```bash
|
|
48
|
+
cd my-project/
|
|
49
|
+
npx wb-flow
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Path 2 ā Global install via npm
|
|
53
|
+
|
|
54
|
+
For repeat use across many projects:
|
|
55
|
+
```bash
|
|
56
|
+
npm install -g wb-flow
|
|
57
|
+
cd my-project/
|
|
58
|
+
wb-flow
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Path 3 ā Git clone + direct invocation (no npm needed)
|
|
62
|
+
|
|
63
|
+
If you can't or don't want to use npm (air-gapped, restricted CI, offline dev):
|
|
64
|
+
```bash
|
|
65
|
+
git clone https://github.com/wissemb11/wb-flow.git ~/.wb-flow
|
|
66
|
+
cd my-project/
|
|
67
|
+
node ~/.wb-flow/bin/install.js
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Path 4 ā Git clone + `npm link` (for contributors / local hacking)
|
|
71
|
+
|
|
72
|
+
Same global `wb-flow` command as Path 2, but sourced from a local clone you can edit:
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/wissemb11/wb-flow.git
|
|
75
|
+
cd wb-flow
|
|
76
|
+
npm link
|
|
77
|
+
cd ~/my-project/
|
|
78
|
+
wb-flow # uses your local clone ā edit templates and re-run instantly
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Bootstrap flags
|
|
82
|
+
|
|
83
|
+
Once invoked, the bootstrapper accepts:
|
|
84
|
+
|
|
85
|
+
- `--force` / `-f` ā overwrite existing files (default: skip existing)
|
|
86
|
+
- `--dry-run` / `-n` ā preview without writing
|
|
87
|
+
- `--list` / `-l` ā print the bundled command roster (31 entries) and exit
|
|
88
|
+
- `--help` / `-h` ā show usage
|
|
89
|
+
|
|
90
|
+
### Re-running on an existing project
|
|
91
|
+
|
|
92
|
+
By default, `wb-flow` is **non-destructive** ā it skips files that already exist in `.wb/`. Pass `--force` to overwrite, or `--dry-run` first to preview the diff. Your customizations to existing template copies are safe.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## ā” Quick Examples
|
|
97
|
+
|
|
98
|
+
Once WB-Flow is installed, your AI assistant will understand the following commands (and 27 others!):
|
|
99
|
+
|
|
100
|
+
* **Initialize the project AI identity:**
|
|
101
|
+
> `/wbSetup src/`
|
|
102
|
+
* **Deep dive and score the code quality:**
|
|
103
|
+
> `/wbAudit src/components/`
|
|
104
|
+
* **Create a task plan based on the audit:**
|
|
105
|
+
> `/wbPlan src/components/`
|
|
106
|
+
* **Execute the tasks autonomously:**
|
|
107
|
+
> `/wbWork .wb/workflows/reports/.../plan_xyz.md *`
|
|
108
|
+
|
|
109
|
+
> *Documentation site at [flow.wb-ui.com](https://flow.wb-ui.com) ā coming soon. For now, the canonical reference is each `wbX/wbX_template.md` inside `.wb/commands/`.*
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## šØāš» About the Owner & Resources
|
|
114
|
+
|
|
115
|
+
**WB-Flow** is created and maintained by **Wissem Boughamoura** as a standalone, framework-agnostic dev tool. It is independent of the Vue-based `wbc-ui` ecosystem (despite the shared author) and is free to use with any AI coding assistant.
|
|
116
|
+
|
|
117
|
+
* š **GitHub:** [@wissemb11/wb-flow](https://github.com/wissemb11/wb-flow)
|
|
118
|
+
* š **Documentation (planned):** [flow.wb-ui.com](https://flow.wb-ui.com)
|
|
119
|
+
* š¤ **Author:** [Wissem Boughamoura](https://github.com/wissemb11) ā `wissemb11@gmail.com`
|
|
120
|
+
|
|
121
|
+
### š¬ Contact & Support
|
|
122
|
+
|
|
123
|
+
* Bugs / feature requests ā [GitHub Issues](https://github.com/wissemb11/wb-flow/issues)
|
|
124
|
+
* General questions ā email `wissemb11@gmail.com`
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
*License: MIT Ā© 2026 Wissem Boughamoura. See [LICENSE](LICENSE).*
|
|
128
|
+
*Changelog: see [CHANGELOG.md](CHANGELOG.md).*
|
package/assets/demo.gif
ADDED
|
Binary file
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const TARGET_DIR = path.join(process.cwd(), '.wb');
|
|
7
|
+
const TEMPLATES_DIR = path.join(__dirname, '..', 'templates');
|
|
8
|
+
|
|
9
|
+
// Parse flags
|
|
10
|
+
const args = process.argv.slice(2);
|
|
11
|
+
const force = args.includes('--force') || args.includes('-f');
|
|
12
|
+
const dryRun = args.includes('--dry-run') || args.includes('-n');
|
|
13
|
+
const listCmd = args.includes('--list') || args.includes('-l');
|
|
14
|
+
|
|
15
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
16
|
+
console.log(`
|
|
17
|
+
wb-flow ā Bootstrap the /wb* agentic command system
|
|
18
|
+
|
|
19
|
+
Usage: npx wb-flow [options]
|
|
20
|
+
|
|
21
|
+
Options:
|
|
22
|
+
--force, -f Overwrite existing files (default: skip existing)
|
|
23
|
+
--dry-run, -n Show what would be copied without making changes
|
|
24
|
+
--list, -l List the bundled command roster and exit
|
|
25
|
+
--help, -h Show this help message
|
|
26
|
+
|
|
27
|
+
Copies templates/ into <cwd>/.wb/ to materialize the full
|
|
28
|
+
set of /wb* slash-command templates and shortcut grammar.
|
|
29
|
+
`);
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if (listCmd) {
|
|
35
|
+
if (!fs.existsSync(TEMPLATES_DIR)) {
|
|
36
|
+
console.error('ā Error: Internal templates directory not found.');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
const manifestPath = path.join(TEMPLATES_DIR, 'commands', 'wb_commands_reference.json');
|
|
40
|
+
try {
|
|
41
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
42
|
+
console.log(`\nš¦ Bundled Command Roster (${Object.keys(manifest).length} commands):\n`);
|
|
43
|
+
for (const [cmd, desc] of Object.entries(manifest)) {
|
|
44
|
+
console.log(` - ${cmd.padEnd(15)} : ${typeof desc === 'object' ? desc.description : desc}`);
|
|
45
|
+
}
|
|
46
|
+
console.log('');
|
|
47
|
+
} catch (err) {
|
|
48
|
+
console.error('ā Error reading command manifest:', err.message);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
process.exit(0);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const stats = { created: 0, skipped: 0, updated: 0, errors: [] };
|
|
55
|
+
|
|
56
|
+
function copyDirectory(src, dest) {
|
|
57
|
+
try {
|
|
58
|
+
if (!fs.existsSync(dest)) {
|
|
59
|
+
if (!dryRun) {
|
|
60
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
65
|
+
|
|
66
|
+
for (const entry of entries) {
|
|
67
|
+
const srcPath = path.join(src, entry.name);
|
|
68
|
+
const destPath = path.join(dest, entry.name);
|
|
69
|
+
|
|
70
|
+
if (entry.isDirectory()) {
|
|
71
|
+
copyDirectory(srcPath, destPath);
|
|
72
|
+
} else {
|
|
73
|
+
try {
|
|
74
|
+
const exists = fs.existsSync(destPath);
|
|
75
|
+
|
|
76
|
+
if (exists && !force) {
|
|
77
|
+
stats.skipped++;
|
|
78
|
+
} else {
|
|
79
|
+
if (dryRun) {
|
|
80
|
+
const action = exists ? 'update' : 'create';
|
|
81
|
+
const relPath = path.relative(process.cwd(), destPath);
|
|
82
|
+
console.log(` [${action}] ${relPath}`);
|
|
83
|
+
} else {
|
|
84
|
+
fs.copyFileSync(srcPath, destPath);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (exists) {
|
|
88
|
+
stats.updated++;
|
|
89
|
+
} else {
|
|
90
|
+
stats.created++;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
} catch (err) {
|
|
94
|
+
const relPath = path.relative(process.cwd(), destPath);
|
|
95
|
+
stats.errors.push({ file: relPath, error: err.message });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} catch (err) {
|
|
100
|
+
const relPath = path.relative(process.cwd(), src);
|
|
101
|
+
stats.errors.push({ file: relPath, error: err.message });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
console.log('š Initializing wb-flow inside your project...');
|
|
106
|
+
|
|
107
|
+
if (dryRun) {
|
|
108
|
+
console.log('š DRY RUN ā no files will be modified.\n');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (fs.existsSync(TARGET_DIR)) {
|
|
112
|
+
if (force) {
|
|
113
|
+
console.log(`ā ļø .wb/ folder already exists in ${process.cwd()}. Overwriting (--force)...`);
|
|
114
|
+
} else {
|
|
115
|
+
console.log(`š .wb/ folder already exists in ${process.cwd()}. New files only (use --force to overwrite).`);
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
console.log(`š Creating .wb/ folder in ${process.cwd()}...`);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (!fs.existsSync(TEMPLATES_DIR)) {
|
|
122
|
+
console.error('\nā Error: Internal templates directory not found.');
|
|
123
|
+
console.error(` Expected path: ${TEMPLATES_DIR}`);
|
|
124
|
+
console.error(' This usually means the package installation is corrupted. Please reinstall @wbc-ui/wb-flow.');
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
copyDirectory(TEMPLATES_DIR, TARGET_DIR);
|
|
129
|
+
|
|
130
|
+
// Version stamp
|
|
131
|
+
const pkgPath = path.join(__dirname, '..', 'package.json');
|
|
132
|
+
try {
|
|
133
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
134
|
+
const wbDir = TARGET_DIR;
|
|
135
|
+
if (!dryRun) {
|
|
136
|
+
if (!fs.existsSync(wbDir)) {
|
|
137
|
+
fs.mkdirSync(wbDir, { recursive: true });
|
|
138
|
+
}
|
|
139
|
+
fs.writeFileSync(path.join(wbDir, '.wb-flow-version'), pkg.version + '\n');
|
|
140
|
+
}
|
|
141
|
+
if (dryRun) {
|
|
142
|
+
console.log(` [create] .wb/.wb-flow-version ā ${pkg.version}`);
|
|
143
|
+
}
|
|
144
|
+
} catch (_) {
|
|
145
|
+
// Non-fatal: version stamp is informational only
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Post-install guidance
|
|
149
|
+
if (!dryRun) {
|
|
150
|
+
const docsUrl = 'https://flow.wb-ui.com';
|
|
151
|
+
console.log('');
|
|
152
|
+
console.log('š Templates installed to: .wb/');
|
|
153
|
+
console.log('š Documentation: ' + docsUrl);
|
|
154
|
+
console.log('š Start here: /wbSetup <your-project-path>');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Summary
|
|
158
|
+
if (dryRun) {
|
|
159
|
+
console.log(`\nš Dry run complete: ${stats.created} to create, ${stats.updated} to update, ${stats.skipped} to skip.`);
|
|
160
|
+
} else {
|
|
161
|
+
const parts = [];
|
|
162
|
+
if (stats.created > 0) parts.push(`${stats.created} created`);
|
|
163
|
+
if (stats.updated > 0) parts.push(`${stats.updated} updated`);
|
|
164
|
+
if (stats.skipped > 0) parts.push(`${stats.skipped} skipped`);
|
|
165
|
+
console.log(`ā
Done! ${parts.join(', ')}.`);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (stats.errors.length > 0) {
|
|
169
|
+
console.error(`\nā ļø ${stats.errors.length} error(s) during copy:`);
|
|
170
|
+
for (const { file, error } of stats.errors) {
|
|
171
|
+
console.error(` ā ${file}: ${error}`);
|
|
172
|
+
}
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
|
package/bin/link.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* bin/link.js ā Monorepo-internal wrapper wiring tool.
|
|
4
|
+
*
|
|
5
|
+
* PURPOSE: Rewrites .claude/commands/ wrappers to point at the local .wb/ copies
|
|
6
|
+
* instead of the raw templates/ path inside the wb-flow package.
|
|
7
|
+
*
|
|
8
|
+
* CONSUMER NOTE: This script is for MONOREPO-INTERNAL DEVELOPMENT ONLY.
|
|
9
|
+
* It writes to MONOREPO_ROOT/.claude/commands/ (5 levels up from this package).
|
|
10
|
+
* npm consumers of @wbc-ui/wb-flow cannot use this script ā they should instead
|
|
11
|
+
* run `npx wb-flow` which copies templates directly to their project .wb/.
|
|
12
|
+
*
|
|
13
|
+
* USAGE: Run from the monorepo root (wb-labs/), after `npx wb-flow` has been
|
|
14
|
+
* executed to populate the .wb/ commands directory.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const fs = require('fs');
|
|
18
|
+
const path = require('path');
|
|
19
|
+
|
|
20
|
+
const projectRoot = process.cwd();
|
|
21
|
+
|
|
22
|
+
if (projectRoot.includes('packages/wb-flow')) {
|
|
23
|
+
console.error('ā Error: bin/link.js must be run from a consumer project root,');
|
|
24
|
+
console.error(' not from inside the wb-flow package directory.');
|
|
25
|
+
console.error(' This script writes wrappers to MONOREPO_ROOT/.claude/commands/');
|
|
26
|
+
console.error(' and is not usable by npm consumers of @wbc-ui/wb-flow.');
|
|
27
|
+
console.error(' For monorepo-internal development only.');
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const claudeCommandsDir = path.join(projectRoot, '.claude', 'commands');
|
|
32
|
+
const wbCommandsDir = path.join(projectRoot, '.wb', 'commands');
|
|
33
|
+
|
|
34
|
+
if (!fs.existsSync(claudeCommandsDir)) {
|
|
35
|
+
console.log('No .claude/commands directory found. Nothing to link.');
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!fs.existsSync(wbCommandsDir)) {
|
|
40
|
+
console.log('No .wb/commands directory found. Please run npx wb-flow first.');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.log('š Wiring .claude/commands/ wrappers to .wb/ template copies...');
|
|
45
|
+
let updated = 0;
|
|
46
|
+
|
|
47
|
+
const files = fs.readdirSync(claudeCommandsDir);
|
|
48
|
+
for (const file of files) {
|
|
49
|
+
if (file.endsWith('.md')) {
|
|
50
|
+
const cmdName = file.replace('.md', '');
|
|
51
|
+
const wrapperPath = path.join(claudeCommandsDir, file);
|
|
52
|
+
|
|
53
|
+
// Check if the corresponding command exists in .wb/commands
|
|
54
|
+
const targetTemplatePath = path.posix.join('.wb', 'commands', cmdName, `${cmdName}_template.md`);
|
|
55
|
+
if (fs.existsSync(path.join(projectRoot, targetTemplatePath))) {
|
|
56
|
+
let content = fs.readFileSync(wrapperPath, 'utf8');
|
|
57
|
+
|
|
58
|
+
// We want to replace paths that point into frontEnd/wbc-ui/.../templates/commands/ with .wb/commands/
|
|
59
|
+
const rgx = /frontEnd\/wbc-ui\/core2\/packages\/wb-flow\/templates\/commands\/[a-zA-Z0-9_]+\/[a-zA-Z0-9_]+_template\.md/g;
|
|
60
|
+
|
|
61
|
+
if (rgx.test(content)) {
|
|
62
|
+
content = content.replace(rgx, targetTemplatePath);
|
|
63
|
+
fs.writeFileSync(wrapperPath, content);
|
|
64
|
+
updated++;
|
|
65
|
+
console.log(` [linked] ${file} -> ${targetTemplatePath}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
console.log(`ā
Done. Updated ${updated} wrappers.`);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const PKG_ROOT = path.resolve(__dirname, '..');
|
|
6
|
+
// Note: we are currently executing inside frontEnd/wbc-ui/core2/packages/wb-flow/
|
|
7
|
+
// The wrappers are 5 levels up in the project root.
|
|
8
|
+
const MONOREPO_ROOT = path.resolve(PKG_ROOT, '..', '..', '..', '..', '..');
|
|
9
|
+
|
|
10
|
+
const TEMPLATES_DIR = path.join(PKG_ROOT, 'templates', 'commands');
|
|
11
|
+
const CLAUDE_DIR = path.join(MONOREPO_ROOT, '.claude', 'commands');
|
|
12
|
+
const OPENCODE_DIR = path.join(MONOREPO_ROOT, '.config', 'opencode', 'command');
|
|
13
|
+
|
|
14
|
+
if (!fs.existsSync(TEMPLATES_DIR)) {
|
|
15
|
+
console.error('ā Templates dir not found');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const manifestPath = path.join(TEMPLATES_DIR, 'wb_commands_reference.json');
|
|
20
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
21
|
+
const commands = Object.keys(manifest);
|
|
22
|
+
|
|
23
|
+
let errors = 0;
|
|
24
|
+
|
|
25
|
+
console.log('š Verifying wrapper parity across clients...');
|
|
26
|
+
|
|
27
|
+
for (const cmd of commands) {
|
|
28
|
+
// Check Claude
|
|
29
|
+
const claudeFile = path.join(CLAUDE_DIR, `${cmd}.md`);
|
|
30
|
+
if (!fs.existsSync(claudeFile)) {
|
|
31
|
+
console.error(` ā Missing Claude wrapper: ${cmd}.md`);
|
|
32
|
+
errors++;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Check OpenCode
|
|
36
|
+
const opencodeFile = path.join(OPENCODE_DIR, `${cmd}.md`);
|
|
37
|
+
if (!fs.existsSync(opencodeFile)) {
|
|
38
|
+
console.error(` ā Missing OpenCode wrapper: ${cmd}.md`);
|
|
39
|
+
errors++;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (errors > 0) {
|
|
44
|
+
console.error(`\nā Wrapper drift detected: ${errors} missing wrapper(s).`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
console.log('ā
Wrapper parity confirmed (100% coverage).');
|
|
49
|
+
process.exit(0);
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wb-flow",
|
|
3
|
+
"version": "1.0.0-r01",
|
|
4
|
+
"description": "Zero-dependency CLI that bootstraps an agentic AI workflow system into any repo. Universal ā works with Vue, React, Python, or any codebase. Compatible with Claude Code, OpenCode, Gemini CLI, Cursor, and other AI coding assistants.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"wb-flow": "./bin/install.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/",
|
|
10
|
+
"templates/",
|
|
11
|
+
"assets/demo.gif",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"CHANGELOG.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "node test/smoke.js && node bin/verify-wrappers.js",
|
|
18
|
+
"prepublishOnly": "npm test"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"ai",
|
|
22
|
+
"agentic",
|
|
23
|
+
"agentic-ai",
|
|
24
|
+
"workflow",
|
|
25
|
+
"claude",
|
|
26
|
+
"claude-code",
|
|
27
|
+
"gemini",
|
|
28
|
+
"opencode",
|
|
29
|
+
"cursor",
|
|
30
|
+
"cli",
|
|
31
|
+
"sop",
|
|
32
|
+
"developer-tools",
|
|
33
|
+
"templates",
|
|
34
|
+
"scaffolding",
|
|
35
|
+
"zero-dependency"
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/wissemb11/wb-flow.git"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://flow.wb-ui.com",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/wissemb11/wb-flow/issues",
|
|
44
|
+
"email": "wissemb11@gmail.com"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=18.0.0"
|
|
48
|
+
},
|
|
49
|
+
"author": {
|
|
50
|
+
"name": "Wissem Boughamoura",
|
|
51
|
+
"email": "wissemb11@gmail.com",
|
|
52
|
+
"url": "https://github.com/wissemb11"
|
|
53
|
+
},
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"type": "commonjs"
|
|
56
|
+
}
|