@lumenflow/cli 2.4.0 → 2.5.0
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/dist/__tests__/init-config-lanes.test.js +131 -0
- package/dist/__tests__/init-docs-structure.test.js +119 -0
- package/dist/__tests__/init-lane-inference.test.js +125 -0
- package/dist/__tests__/init-onboarding-docs.test.js +132 -0
- package/dist/__tests__/init-quick-ref.test.js +145 -0
- package/dist/__tests__/init-scripts.test.js +96 -0
- package/dist/__tests__/init-template-portability.test.js +97 -0
- package/dist/__tests__/init.test.js +7 -2
- package/dist/__tests__/initiative-add-wu.test.js +420 -0
- package/dist/__tests__/initiative-plan-replacement.test.js +162 -0
- package/dist/__tests__/initiative-remove-wu.test.js +458 -0
- package/dist/__tests__/onboarding-smoke-test.test.js +211 -0
- package/dist/__tests__/path-centralization-cli.test.js +234 -0
- package/dist/__tests__/plan-create.test.js +126 -0
- package/dist/__tests__/plan-edit.test.js +157 -0
- package/dist/__tests__/plan-link.test.js +239 -0
- package/dist/__tests__/plan-promote.test.js +181 -0
- package/dist/__tests__/wu-create-strict.test.js +118 -0
- package/dist/__tests__/wu-edit-strict.test.js +109 -0
- package/dist/__tests__/wu-validate-strict.test.js +113 -0
- package/dist/flow-bottlenecks.js +4 -2
- package/dist/gates.js +22 -0
- package/dist/init.js +580 -87
- package/dist/initiative-add-wu.js +112 -16
- package/dist/initiative-remove-wu.js +248 -0
- package/dist/onboarding-smoke-test.js +400 -0
- package/dist/plan-create.js +199 -0
- package/dist/plan-edit.js +235 -0
- package/dist/plan-link.js +233 -0
- package/dist/plan-promote.js +231 -0
- package/dist/wu-block.js +16 -5
- package/dist/wu-claim.js +15 -9
- package/dist/wu-create.js +50 -2
- package/dist/wu-deps.js +3 -1
- package/dist/wu-done.js +14 -5
- package/dist/wu-edit.js +35 -0
- package/dist/wu-spawn.js +8 -0
- package/dist/wu-unblock.js +34 -2
- package/dist/wu-validate.js +25 -17
- package/package.json +10 -6
- package/templates/core/AGENTS.md.template +2 -2
- package/dist/__tests__/init-plan.test.js +0 -340
- package/dist/agent-issues-query.d.ts +0 -16
- package/dist/agent-log-issue.d.ts +0 -10
- package/dist/agent-session-end.d.ts +0 -10
- package/dist/agent-session.d.ts +0 -10
- package/dist/backlog-prune.d.ts +0 -84
- package/dist/cli-entry-point.d.ts +0 -8
- package/dist/deps-add.d.ts +0 -91
- package/dist/deps-remove.d.ts +0 -17
- package/dist/docs-sync.d.ts +0 -50
- package/dist/file-delete.d.ts +0 -84
- package/dist/file-edit.d.ts +0 -82
- package/dist/file-read.d.ts +0 -92
- package/dist/file-write.d.ts +0 -90
- package/dist/flow-bottlenecks.d.ts +0 -16
- package/dist/flow-report.d.ts +0 -16
- package/dist/gates.d.ts +0 -94
- package/dist/git-branch.d.ts +0 -65
- package/dist/git-diff.d.ts +0 -58
- package/dist/git-log.d.ts +0 -69
- package/dist/git-status.d.ts +0 -58
- package/dist/guard-locked.d.ts +0 -62
- package/dist/guard-main-branch.d.ts +0 -50
- package/dist/guard-worktree-commit.d.ts +0 -59
- package/dist/index.d.ts +0 -10
- package/dist/init-plan.d.ts +0 -80
- package/dist/init-plan.js +0 -337
- package/dist/init.d.ts +0 -46
- package/dist/initiative-add-wu.d.ts +0 -22
- package/dist/initiative-bulk-assign-wus.d.ts +0 -16
- package/dist/initiative-create.d.ts +0 -28
- package/dist/initiative-edit.d.ts +0 -34
- package/dist/initiative-list.d.ts +0 -12
- package/dist/initiative-status.d.ts +0 -11
- package/dist/lumenflow-upgrade.d.ts +0 -103
- package/dist/mem-checkpoint.d.ts +0 -16
- package/dist/mem-cleanup.d.ts +0 -29
- package/dist/mem-create.d.ts +0 -17
- package/dist/mem-export.d.ts +0 -10
- package/dist/mem-inbox.d.ts +0 -35
- package/dist/mem-init.d.ts +0 -15
- package/dist/mem-ready.d.ts +0 -16
- package/dist/mem-signal.d.ts +0 -16
- package/dist/mem-start.d.ts +0 -16
- package/dist/mem-summarize.d.ts +0 -22
- package/dist/mem-triage.d.ts +0 -22
- package/dist/metrics-cli.d.ts +0 -90
- package/dist/metrics-snapshot.d.ts +0 -18
- package/dist/orchestrate-init-status.d.ts +0 -11
- package/dist/orchestrate-initiative.d.ts +0 -12
- package/dist/orchestrate-monitor.d.ts +0 -11
- package/dist/release.d.ts +0 -117
- package/dist/rotate-progress.d.ts +0 -48
- package/dist/session-coordinator.d.ts +0 -74
- package/dist/spawn-list.d.ts +0 -16
- package/dist/state-bootstrap.d.ts +0 -92
- package/dist/sync-templates.d.ts +0 -52
- package/dist/trace-gen.d.ts +0 -84
- package/dist/validate-agent-skills.d.ts +0 -50
- package/dist/validate-agent-sync.d.ts +0 -36
- package/dist/validate-backlog-sync.d.ts +0 -37
- package/dist/validate-skills-spec.d.ts +0 -40
- package/dist/validate.d.ts +0 -60
- package/dist/wu-block.d.ts +0 -16
- package/dist/wu-claim.d.ts +0 -74
- package/dist/wu-cleanup.d.ts +0 -35
- package/dist/wu-create.d.ts +0 -69
- package/dist/wu-delete.d.ts +0 -21
- package/dist/wu-deps.d.ts +0 -13
- package/dist/wu-done.d.ts +0 -225
- package/dist/wu-edit.d.ts +0 -63
- package/dist/wu-infer-lane.d.ts +0 -17
- package/dist/wu-preflight.d.ts +0 -47
- package/dist/wu-prune.d.ts +0 -16
- package/dist/wu-recover.d.ts +0 -37
- package/dist/wu-release.d.ts +0 -19
- package/dist/wu-repair.d.ts +0 -60
- package/dist/wu-spawn-completion.d.ts +0 -10
- package/dist/wu-spawn.d.ts +0 -192
- package/dist/wu-status.d.ts +0 -25
- package/dist/wu-unblock.d.ts +0 -16
- package/dist/wu-unlock-lane.d.ts +0 -19
- package/dist/wu-validate.d.ts +0 -16
package/dist/init.js
CHANGED
|
@@ -88,14 +88,49 @@ export function parseInitOptions() {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
const DEFAULT_CLIENT_CLAUDE = 'claude-code';
|
|
91
|
+
/**
|
|
92
|
+
* WU-1309: Get docs paths based on structure type
|
|
93
|
+
*/
|
|
94
|
+
export function getDocsPath(structure) {
|
|
95
|
+
if (structure === 'simple') {
|
|
96
|
+
return {
|
|
97
|
+
operations: 'docs',
|
|
98
|
+
tasks: 'docs/tasks',
|
|
99
|
+
onboarding: 'docs/_frameworks/lumenflow/agent/onboarding',
|
|
100
|
+
quickRefLink: 'docs/_frameworks/lumenflow/agent/onboarding/quick-ref-commands.md',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// arc42 structure
|
|
104
|
+
return {
|
|
105
|
+
operations: 'docs/04-operations',
|
|
106
|
+
tasks: 'docs/04-operations/tasks',
|
|
107
|
+
onboarding: 'docs/04-operations/_frameworks/lumenflow/agent/onboarding',
|
|
108
|
+
quickRefLink: 'docs/04-operations/_frameworks/lumenflow/agent/onboarding/quick-ref-commands.md',
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* WU-1309: Detect existing docs structure or return default
|
|
113
|
+
* Auto-detects arc42 when docs/04-operations or any numbered dir (01-*, 02-*, etc.) exists
|
|
114
|
+
*/
|
|
115
|
+
export function detectDocsStructure(targetDir) {
|
|
116
|
+
const docsDir = path.join(targetDir, 'docs');
|
|
117
|
+
if (!fs.existsSync(docsDir)) {
|
|
118
|
+
return 'simple';
|
|
119
|
+
}
|
|
120
|
+
// Check for arc42 numbered directories (01-*, 02-*, ..., 04-operations, etc.)
|
|
121
|
+
const entries = fs.readdirSync(docsDir);
|
|
122
|
+
const hasNumberedDir = entries.some((entry) => /^\d{2}-/.test(entry));
|
|
123
|
+
if (hasNumberedDir) {
|
|
124
|
+
return 'arc42';
|
|
125
|
+
}
|
|
126
|
+
return 'simple';
|
|
127
|
+
}
|
|
91
128
|
const CONFIG_FILE_NAME = '.lumenflow.config.yaml';
|
|
92
129
|
const FRAMEWORK_HINT_FILE = '.lumenflow.framework.yaml';
|
|
93
130
|
const LUMENFLOW_DIR = '.lumenflow';
|
|
94
131
|
const LUMENFLOW_AGENTS_DIR = `${LUMENFLOW_DIR}/agents`;
|
|
95
132
|
const CLAUDE_DIR = '.claude';
|
|
96
133
|
const CLAUDE_AGENTS_DIR = path.join(CLAUDE_DIR, 'agents');
|
|
97
|
-
// Shared path segment for docs structure
|
|
98
|
-
const DOCS_OPERATIONS_DIR = '04-operations';
|
|
99
134
|
/**
|
|
100
135
|
* WU-1177: Detect IDE environment from environment variables
|
|
101
136
|
* Auto-detects which AI coding assistant is running
|
|
@@ -199,9 +234,51 @@ export function checkPrerequisites() {
|
|
|
199
234
|
},
|
|
200
235
|
};
|
|
201
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* WU-1307: Default lane definitions for config generation
|
|
239
|
+
* These lanes match the parent lanes used in onboarding documentation.
|
|
240
|
+
*/
|
|
241
|
+
const DEFAULT_LANE_DEFINITIONS = [
|
|
242
|
+
{
|
|
243
|
+
name: 'Framework: Core',
|
|
244
|
+
wip_limit: 1,
|
|
245
|
+
code_paths: ['packages/**/core/**', 'src/core/**', 'lib/**'],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: 'Framework: CLI',
|
|
249
|
+
wip_limit: 1,
|
|
250
|
+
code_paths: ['packages/**/cli/**', 'src/cli/**', 'bin/**'],
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
name: 'Experience: UI',
|
|
254
|
+
wip_limit: 1,
|
|
255
|
+
code_paths: ['apps/web/**', 'src/components/**', 'src/pages/**', 'src/app/**'],
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
name: 'Experience: Web',
|
|
259
|
+
wip_limit: 1,
|
|
260
|
+
code_paths: ['apps/web/**', 'web/**'],
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: 'Operations: Infrastructure',
|
|
264
|
+
wip_limit: 1,
|
|
265
|
+
code_paths: ['apps/**', 'infrastructure/**', 'deploy/**'],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: 'Operations: CI/CD',
|
|
269
|
+
wip_limit: 1,
|
|
270
|
+
code_paths: ['.github/workflows/**', '.github/actions/**', '.circleci/**'],
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: 'Content: Documentation',
|
|
274
|
+
wip_limit: 1,
|
|
275
|
+
code_paths: ['docs/**', '*.md'],
|
|
276
|
+
},
|
|
277
|
+
];
|
|
202
278
|
/**
|
|
203
279
|
* Generate YAML configuration with header comment
|
|
204
280
|
* WU-1067: Supports --preset option for config-driven gates
|
|
281
|
+
* WU-1307: Includes default lane definitions for onboarding
|
|
205
282
|
*/
|
|
206
283
|
function generateLumenflowConfigYaml(gatePreset) {
|
|
207
284
|
const header = `# LumenFlow Configuration\n# Generated by: lumenflow init\n# Customize paths based on your project structure\n\n`;
|
|
@@ -215,6 +292,10 @@ function generateLumenflowConfigYaml(gatePreset) {
|
|
|
215
292
|
...presetConfig,
|
|
216
293
|
};
|
|
217
294
|
}
|
|
295
|
+
// WU-1307: Add default lane definitions
|
|
296
|
+
config.lanes = {
|
|
297
|
+
definitions: DEFAULT_LANE_DEFINITIONS,
|
|
298
|
+
};
|
|
218
299
|
return header + yaml.stringify(config);
|
|
219
300
|
}
|
|
220
301
|
/**
|
|
@@ -255,6 +336,7 @@ function getRelativePath(targetDir, filePath) {
|
|
|
255
336
|
}
|
|
256
337
|
// WU-1171: Template for AGENTS.md (universal entry point)
|
|
257
338
|
// WU-1300: Updated quick-ref link to correct path
|
|
339
|
+
// WU-1309: Use {{QUICK_REF_LINK}} and <project-root> placeholder for portability
|
|
258
340
|
const AGENTS_MD_TEMPLATE = `# Universal Agent Instructions
|
|
259
341
|
|
|
260
342
|
**Last updated:** {{DATE}}
|
|
@@ -274,11 +356,11 @@ cd worktrees/<lane>-wu-xxxx
|
|
|
274
356
|
pnpm gates
|
|
275
357
|
|
|
276
358
|
# 3. Complete (ALWAYS run this!)
|
|
277
|
-
cd
|
|
359
|
+
cd <project-root>
|
|
278
360
|
pnpm wu:done --id WU-XXXX
|
|
279
361
|
\`\`\`
|
|
280
362
|
|
|
281
|
-
> **Complete CLI reference:** See [quick-ref-commands.md](
|
|
363
|
+
> **Complete CLI reference:** See [quick-ref-commands.md]({{QUICK_REF_LINK}})
|
|
282
364
|
|
|
283
365
|
---
|
|
284
366
|
|
|
@@ -317,11 +399,13 @@ This file provides universal guidance for all AI agents. Additional vendor-speci
|
|
|
317
399
|
- **Windsurf**: See \`.windsurf/rules/lumenflow.md\` (if present)
|
|
318
400
|
`;
|
|
319
401
|
// Template for LUMENFLOW.md (main entry point)
|
|
320
|
-
|
|
402
|
+
// WU-1309: Use <project-root> placeholder for portability
|
|
403
|
+
const LUMENFLOW_MD_TEMPLATE = `# LumenFlow Workflow Guide\n\n**Last updated:** {{DATE}}\n\nLumenFlow is a vendor-agnostic workflow framework for AI-native software development.\n\n---\n\n## Critical Rule: ALWAYS Run wu:done\n\n**After completing work on a WU, you MUST run \`pnpm wu:done --id WU-XXXX\` from the main checkout.**\n\nThis is the single most forgotten step. Do NOT:\n- Write "To Complete: pnpm wu:done" and stop\n- Ask if you should run wu:done\n- Forget to run wu:done\n\n**DO**: Run \`pnpm wu:done --id WU-XXXX\` immediately after gates pass.\n\n---\n\n## Quick Start\n\n\`\`\`bash\n# 1. Create a WU\npnpm wu:create --id WU-XXXX --lane <Lane> --title "Title"\n\n# 2. Edit WU spec with acceptance criteria, then claim:\npnpm wu:claim --id WU-XXXX --lane <Lane>\ncd worktrees/<lane>-wu-xxxx\n\n# 3. Implement in worktree\n\n# 4. Run gates\npnpm gates --docs-only # for docs changes\npnpm gates # for code changes\n\n# 5. Complete (from main checkout)\ncd <project-root>\npnpm wu:done --id WU-XXXX\n\`\`\`\n\n---\n\n## Core Principles\n\n1. **TDD**: Failing test -> implementation -> passing test (>=90% coverage on new code)\n2. **Library-First**: Search existing libraries before custom code\n3. **DRY/SOLID/KISS/YAGNI**: No magic numbers, no hardcoded strings\n4. **Worktree Discipline**: After \`wu:claim\`, work ONLY in the worktree\n5. **Gates Before Done**: All gates must pass before \`wu:done\`\n6. **Do Not Bypass Hooks**: No \`--no-verify\`, fix issues properly\n7. **Always wu:done**: Complete every WU by running \`pnpm wu:done\`\n\n---\n\n## Documentation Structure\n\n### Core (Vendor-Agnostic)\n\n- **LUMENFLOW.md** - This file, main entry point\n- **.lumenflow/constraints.md** - Non-negotiable workflow constraints\n- **.lumenflow/agents/** - Agent instructions (vendor-agnostic)\n- **.lumenflow.config.yaml** - Workflow configuration\n\n### Optional Overlays\n\n- **CLAUDE.md + .claude/agents/** - Claude Code overlay (auto if Claude Code detected)\n- **{{DOCS_TASKS_PATH}}** - Task boards and WU storage (\`lumenflow init --full\`)\n- **{{DOCS_ONBOARDING_PATH}}** - Agent onboarding docs\n- **.lumenflow.framework.yaml** - Framework hint file (created with \`--framework\`)\n\n---\n\n## Worktree Discipline (IMMUTABLE LAW)\n\nAfter claiming a WU, you MUST work in its worktree:\n\n\`\`\`bash\n# 1. Claim creates worktree\npnpm wu:claim --id WU-XXX --lane <lane>\n\n# 2. IMMEDIATELY cd to worktree\ncd worktrees/<lane>-wu-xxx\n\n# 3. ALL work happens here\n\n# 4. Return to main ONLY to complete\ncd <project-root>\npnpm wu:done --id WU-XXX\n\`\`\`\n\n---\n\n## Definition of Done\n\n- Acceptance criteria satisfied\n- Gates green (\`pnpm gates\` or \`pnpm gates --docs-only\`)\n- WU YAML status = \`done\`\n- \`wu:done\` has been run\n\n---\n\n## Commands Reference\n\n| Command | Description |\n| ----------------- | ----------------------------------- |\n| \`pnpm wu:create\` | Create new WU spec |\n| \`pnpm wu:claim\` | Claim WU and create worktree |\n| \`pnpm wu:done\` | Complete WU (merge, stamp, cleanup) |\n| \`pnpm gates\` | Run quality gates |\n\n---\n\n## Constraints\n\nSee [.lumenflow/constraints.md](.lumenflow/constraints.md) for the 6 non-negotiable rules.\n\n---\n\n## Agent Onboarding\n\n- Start with **CLAUDE.md** if present (Claude Code overlay).\n- Add vendor-agnostic guidance in **.lumenflow/agents/**.\n- Check the onboarding docs in **{{DOCS_ONBOARDING_PATH}}** for detailed guidance.\n`;
|
|
321
404
|
// Template for .lumenflow/constraints.md
|
|
322
405
|
const CONSTRAINTS_MD_TEMPLATE = `# LumenFlow Constraints Capsule\n\n**Version:** 1.0\n**Last updated:** {{DATE}}\n\n## The 6 Non-Negotiable Constraints\n\n### 1. Worktree Discipline and Git Safety\nWork only in worktrees, treat main as read-only, never run destructive git commands on main.\n\n### 2. WUs Are Specs, Not Code\nRespect code_paths boundaries, no feature creep, no code blocks in WU YAML files.\n\n### 3. Docs-Only vs Code WUs\nDocumentation WUs use \`--docs-only\` gates, code WUs run full gates.\n\n### 4. LLM-First, Zero-Fallback Inference\nUse LLMs for semantic tasks, fall back to safe defaults (never regex/keywords).\n\n### 5. Gates and Skip-Gates\nComplete via \`pnpm wu:done\`; skip-gates only for pre-existing failures with \`--reason\` and \`--fix-wu\`.\n\n### 6. Safety and Governance\nRespect privacy rules, approved sources, security policies; when uncertain, choose safer path.\n\n---\n\n## Mini Audit Checklist\n\nBefore running \`wu:done\`, verify:\n\n- [ ] Working in worktree (not main)\n- [ ] Only modified files in \`code_paths\`\n- [ ] Gates pass\n- [ ] No forbidden git commands used\n- [ ] Acceptance criteria satisfied\n\n---\n\n## Escalation Triggers\n\nStop and ask a human when:\n- Same error repeats 3 times\n- Auth or permissions changes required\n- PII/PHI/safety issues discovered\n- Cloud spend or secrets involved\n`;
|
|
323
406
|
// Template for root CLAUDE.md
|
|
324
|
-
|
|
407
|
+
// WU-1309: Use <project-root> placeholder for portability
|
|
408
|
+
const CLAUDE_MD_TEMPLATE = `# Claude Code Instructions\n\n**Last updated:** {{DATE}}\n\nThis project uses LumenFlow workflow. For workflow documentation, see [LUMENFLOW.md](LUMENFLOW.md).\n\n---\n\n## Quick Start\n\n\`\`\`bash\n# 1. Claim a WU\npnpm wu:claim --id WU-XXXX --lane <Lane>\ncd worktrees/<lane>-wu-xxxx\n\n# 2. Work in worktree, run gates\npnpm gates\n\n# 3. Complete (ALWAYS run this!)\ncd <project-root>\npnpm wu:done --id WU-XXXX\n\`\`\`\n\n---\n\n## Critical: Always wu:done\n\nAfter completing work, ALWAYS run \`pnpm wu:done --id WU-XXXX\`.\n\nSee [LUMENFLOW.md](LUMENFLOW.md) for full workflow documentation.\n`;
|
|
325
409
|
// Template for .claude/settings.json
|
|
326
410
|
const CLAUDE_SETTINGS_TEMPLATE = `{
|
|
327
411
|
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
@@ -354,6 +438,7 @@ const CLAUDE_SETTINGS_TEMPLATE = `{
|
|
|
354
438
|
}
|
|
355
439
|
`;
|
|
356
440
|
// WU-1171: Template for .cursor/rules/lumenflow.md (updated path)
|
|
441
|
+
// WU-1309: Use <project-root> placeholder for portability
|
|
357
442
|
const CURSOR_RULES_TEMPLATE = `# Cursor LumenFlow Rules
|
|
358
443
|
|
|
359
444
|
This project uses LumenFlow workflow. See [LUMENFLOW.md](../../LUMENFLOW.md).
|
|
@@ -383,11 +468,12 @@ cd worktrees/<lane>-wu-xxx
|
|
|
383
468
|
pnpm gates
|
|
384
469
|
|
|
385
470
|
# Complete (from main)
|
|
386
|
-
cd
|
|
471
|
+
cd <project-root>
|
|
387
472
|
pnpm wu:done --id WU-XXX
|
|
388
473
|
\`\`\`
|
|
389
474
|
`;
|
|
390
475
|
// WU-1171: Template for .windsurf/rules/lumenflow.md
|
|
476
|
+
// WU-1309: Use <project-root> placeholder for portability
|
|
391
477
|
const WINDSURF_RULES_TEMPLATE = `# Windsurf LumenFlow Rules
|
|
392
478
|
|
|
393
479
|
This project uses LumenFlow workflow. See [LUMENFLOW.md](../../LUMENFLOW.md).
|
|
@@ -417,11 +503,12 @@ cd worktrees/<lane>-wu-xxx
|
|
|
417
503
|
pnpm gates
|
|
418
504
|
|
|
419
505
|
# Complete (from main)
|
|
420
|
-
cd
|
|
506
|
+
cd <project-root>
|
|
421
507
|
pnpm wu:done --id WU-XXX
|
|
422
508
|
\`\`\`
|
|
423
509
|
`;
|
|
424
510
|
// WU-1177: Template for .clinerules (Cline AI assistant)
|
|
511
|
+
// WU-1309: Use <project-root> placeholder for portability
|
|
425
512
|
const CLINE_RULES_TEMPLATE = `# Cline LumenFlow Rules
|
|
426
513
|
|
|
427
514
|
This project uses LumenFlow workflow. See [LUMENFLOW.md](LUMENFLOW.md).
|
|
@@ -451,7 +538,7 @@ cd worktrees/<lane>-wu-xxx
|
|
|
451
538
|
pnpm gates
|
|
452
539
|
|
|
453
540
|
# Complete (from main)
|
|
454
|
-
cd
|
|
541
|
+
cd <project-root>
|
|
455
542
|
pnpm wu:done --id WU-XXX
|
|
456
543
|
\`\`\`
|
|
457
544
|
`;
|
|
@@ -468,6 +555,7 @@ const FRAMEWORK_HINT_TEMPLATE = `# LumenFlow Framework Hint\n# Generated by: lum
|
|
|
468
555
|
// Template for docs/04-operations/_frameworks/<framework>/README.md
|
|
469
556
|
const FRAMEWORK_OVERLAY_TEMPLATE = `# {{FRAMEWORK_NAME}} Framework Overlay\n\n**Last updated:** {{DATE}}\n\nThis overlay captures framework-specific conventions, constraints, and references for {{FRAMEWORK_NAME}} projects.\n\n## Scope\n\n- Project structure conventions\n- Framework-specific testing guidance\n- Common pitfalls and mitigations\n\n## References\n\n- Add official docs links here\n`;
|
|
470
557
|
// WU-1083: Agent onboarding docs templates
|
|
558
|
+
// WU-1309: Updated quick-ref with --docs-structure and complete wu:create example
|
|
471
559
|
const QUICK_REF_COMMANDS_TEMPLATE = `# Quick Reference: LumenFlow Commands
|
|
472
560
|
|
|
473
561
|
**Last updated:** {{DATE}}
|
|
@@ -476,24 +564,57 @@ const QUICK_REF_COMMANDS_TEMPLATE = `# Quick Reference: LumenFlow Commands
|
|
|
476
564
|
|
|
477
565
|
## Project Setup
|
|
478
566
|
|
|
479
|
-
| Command
|
|
480
|
-
|
|
|
481
|
-
| \`pnpm exec lumenflow init\`
|
|
482
|
-
| \`pnpm exec lumenflow init --full\`
|
|
483
|
-
| \`pnpm exec lumenflow init --
|
|
484
|
-
| \`pnpm exec lumenflow init --
|
|
567
|
+
| Command | Description |
|
|
568
|
+
| ---------------------------------------------------- | ----------------------------------------- |
|
|
569
|
+
| \`pnpm exec lumenflow init\` | Scaffold minimal LumenFlow core |
|
|
570
|
+
| \`pnpm exec lumenflow init --full\` | Add docs + agent onboarding scaffolding |
|
|
571
|
+
| \`pnpm exec lumenflow init --docs-structure simple\` | Use simple docs structure (docs/tasks) |
|
|
572
|
+
| \`pnpm exec lumenflow init --docs-structure arc42\` | Use arc42 structure (docs/04-operations) |
|
|
573
|
+
| \`pnpm exec lumenflow init --framework <name>\` | Add framework hint + overlay docs |
|
|
574
|
+
| \`pnpm exec lumenflow init --client <type>\` | Add client overlay (claude, cursor, etc.) |
|
|
575
|
+
| \`pnpm exec lumenflow init --force\` | Overwrite existing files |
|
|
485
576
|
|
|
486
577
|
---
|
|
487
578
|
|
|
488
579
|
## WU Management
|
|
489
580
|
|
|
490
|
-
| Command
|
|
491
|
-
|
|
|
492
|
-
| \`pnpm wu:create
|
|
493
|
-
| \`pnpm wu:claim --id WU-XXX --lane <Lane
|
|
494
|
-
| \`pnpm wu:done --id WU-XXX\`
|
|
495
|
-
| \`pnpm wu:block --id WU-XXX --reason "
|
|
496
|
-
| \`pnpm wu:unblock --id WU-XXX\`
|
|
581
|
+
| Command | Description |
|
|
582
|
+
| ----------------------------------------- | ------------------------------- |
|
|
583
|
+
| \`pnpm wu:create ...\` (see example below) | Create new WU |
|
|
584
|
+
| \`pnpm wu:claim --id WU-XXX --lane <Lane>\`| Claim WU (creates worktree) |
|
|
585
|
+
| \`pnpm wu:done --id WU-XXX\` | Complete WU (merge, stamp) |
|
|
586
|
+
| \`pnpm wu:block --id WU-XXX --reason "..."\`| Block a WU |
|
|
587
|
+
| \`pnpm wu:unblock --id WU-XXX\` | Unblock a WU |
|
|
588
|
+
| \`pnpm wu:status --id WU-XXX\` | Check WU status and location |
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
## Complete wu:create Example
|
|
593
|
+
|
|
594
|
+
\`\`\`bash
|
|
595
|
+
pnpm wu:create \\
|
|
596
|
+
--id WU-001 \\
|
|
597
|
+
--lane "Framework: Core" \\
|
|
598
|
+
--title "Add validation feature" \\
|
|
599
|
+
--description "Context: Users need input validation. Problem: No validation exists. Solution: Add Zod-based validation." \\
|
|
600
|
+
--acceptance "Validation rejects invalid input" \\
|
|
601
|
+
--acceptance "Unit tests cover edge cases with >90% coverage" \\
|
|
602
|
+
--acceptance "Documentation updated" \\
|
|
603
|
+
--code-paths "packages/@lumenflow/core/src/validation.ts" \\
|
|
604
|
+
--test-paths-unit "packages/@lumenflow/core/src/__tests__/validation.test.ts" \\
|
|
605
|
+
--exposure backend-only \\
|
|
606
|
+
--spec-refs "lumenflow://plans/WU-001-plan.md"
|
|
607
|
+
\`\`\`
|
|
608
|
+
|
|
609
|
+
**Required fields for code WUs:**
|
|
610
|
+
- \`--lane\`: Format is "Parent: Sublane" (e.g., "Framework: Core")
|
|
611
|
+
- \`--title\`: Short descriptive title
|
|
612
|
+
- \`--description\`: Context, Problem, Solution
|
|
613
|
+
- \`--acceptance\`: At least one (repeatable)
|
|
614
|
+
- \`--code-paths\`: Files to modify (repeatable)
|
|
615
|
+
- \`--test-paths-unit\` or \`--test-paths-e2e\`: Test files
|
|
616
|
+
- \`--exposure\`: ui | api | backend-only | documentation
|
|
617
|
+
- \`--spec-refs\`: Required for type: feature
|
|
497
618
|
|
|
498
619
|
---
|
|
499
620
|
|
|
@@ -528,7 +649,7 @@ const QUICK_REF_COMMANDS_TEMPLATE = `# Quick Reference: LumenFlow Commands
|
|
|
528
649
|
cd worktrees/<lane>-wu-xxx
|
|
529
650
|
|
|
530
651
|
# Return to main for wu:done
|
|
531
|
-
cd
|
|
652
|
+
cd <project-root>
|
|
532
653
|
\`\`\`
|
|
533
654
|
|
|
534
655
|
---
|
|
@@ -536,13 +657,14 @@ cd /path/to/main
|
|
|
536
657
|
## Workflow Sequence
|
|
537
658
|
|
|
538
659
|
\`\`\`bash
|
|
539
|
-
# 1. Create
|
|
660
|
+
# 1. Create (see complete example above)
|
|
540
661
|
pnpm wu:create --id WU-001 --lane "Framework: Core" --title "Add feature" \\
|
|
541
|
-
--description "Context:
|
|
542
|
-
--acceptance "
|
|
543
|
-
--code-paths "src/
|
|
544
|
-
--test-paths-unit "src/__tests__/
|
|
545
|
-
--exposure backend-only
|
|
662
|
+
--description "Context: ... Problem: ... Solution: ..." \\
|
|
663
|
+
--acceptance "Feature works" --acceptance "Tests pass" \\
|
|
664
|
+
--code-paths "src/feature.ts" \\
|
|
665
|
+
--test-paths-unit "src/__tests__/feature.test.ts" \\
|
|
666
|
+
--exposure backend-only \\
|
|
667
|
+
--spec-refs "lumenflow://plans/WU-001-plan.md"
|
|
546
668
|
|
|
547
669
|
# 2. Claim
|
|
548
670
|
pnpm wu:claim --id WU-001 --lane "Framework: Core"
|
|
@@ -559,8 +681,8 @@ git push origin lane/framework-core/wu-001
|
|
|
559
681
|
# 5. Gates
|
|
560
682
|
pnpm gates
|
|
561
683
|
|
|
562
|
-
# 6. Complete
|
|
563
|
-
cd
|
|
684
|
+
# 6. Complete (from main checkout)
|
|
685
|
+
cd <project-root>
|
|
564
686
|
pnpm wu:done --id WU-001
|
|
565
687
|
\`\`\`
|
|
566
688
|
|
|
@@ -568,12 +690,12 @@ pnpm wu:done --id WU-001
|
|
|
568
690
|
|
|
569
691
|
## File Paths
|
|
570
692
|
|
|
571
|
-
| Path
|
|
572
|
-
|
|
|
573
|
-
| \`
|
|
574
|
-
| \`
|
|
575
|
-
| \`.lumenflow/stamps/WU-XXX.done\`
|
|
576
|
-
| \`worktrees/<lane>-wu-xxx/\`
|
|
693
|
+
| Path | Description |
|
|
694
|
+
| ------------------------------------ | -------------------- |
|
|
695
|
+
| \`{{DOCS_TASKS_PATH}}/wu/WU-XXX.yaml\` | WU specification |
|
|
696
|
+
| \`{{DOCS_TASKS_PATH}}/status.md\` | Current status board |
|
|
697
|
+
| \`.lumenflow/stamps/WU-XXX.done\` | Completion stamp |
|
|
698
|
+
| \`worktrees/<lane>-wu-xxx/\` | Worktree directory |
|
|
577
699
|
`;
|
|
578
700
|
const FIRST_WU_MISTAKES_TEMPLATE = `# First WU Mistakes
|
|
579
701
|
|
|
@@ -923,39 +1045,109 @@ Choose the safer path:
|
|
|
923
1045
|
- Don't skip gates
|
|
924
1046
|
- Ask rather than assume
|
|
925
1047
|
`;
|
|
926
|
-
// WU-
|
|
1048
|
+
// WU-1307: Lane inference configuration template (hierarchical Parent→Sublane format)
|
|
1049
|
+
// This format is required by lane-inference.ts and lane-checker.ts
|
|
927
1050
|
const LANE_INFERENCE_TEMPLATE = `# Lane Inference Configuration
|
|
928
1051
|
# Generated by: lumenflow init
|
|
929
|
-
#
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
-
|
|
940
|
-
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
-
|
|
945
|
-
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
-
|
|
951
|
-
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
-
|
|
956
|
-
-
|
|
957
|
-
|
|
958
|
-
#
|
|
1052
|
+
#
|
|
1053
|
+
# Hierarchical format: Parent -> Sublane -> { code_paths, keywords }
|
|
1054
|
+
# This format is required by lane-inference.ts for proper sub-lane suggestion.
|
|
1055
|
+
|
|
1056
|
+
# Framework Lane: Core packages and libraries
|
|
1057
|
+
Framework:
|
|
1058
|
+
Core:
|
|
1059
|
+
description: 'Core library: business logic, domain models, utilities'
|
|
1060
|
+
code_paths:
|
|
1061
|
+
- 'packages/**/core/**'
|
|
1062
|
+
- 'src/core/**'
|
|
1063
|
+
- 'lib/**'
|
|
1064
|
+
keywords:
|
|
1065
|
+
- 'core library'
|
|
1066
|
+
- 'business logic'
|
|
1067
|
+
- 'domain'
|
|
1068
|
+
- 'utility'
|
|
1069
|
+
|
|
1070
|
+
CLI:
|
|
1071
|
+
description: 'CLI commands and tooling'
|
|
1072
|
+
code_paths:
|
|
1073
|
+
- 'packages/**/cli/**'
|
|
1074
|
+
- 'src/cli/**'
|
|
1075
|
+
- 'bin/**'
|
|
1076
|
+
keywords:
|
|
1077
|
+
- 'cli command'
|
|
1078
|
+
- 'command line'
|
|
1079
|
+
- 'tooling'
|
|
1080
|
+
|
|
1081
|
+
# Experience Lane: User-facing frontend work
|
|
1082
|
+
Experience:
|
|
1083
|
+
UI:
|
|
1084
|
+
description: 'User interface components and pages'
|
|
1085
|
+
code_paths:
|
|
1086
|
+
- 'apps/web/**'
|
|
1087
|
+
- 'src/components/**'
|
|
1088
|
+
- 'src/pages/**'
|
|
1089
|
+
- 'src/app/**'
|
|
1090
|
+
keywords:
|
|
1091
|
+
- 'ui'
|
|
1092
|
+
- 'component'
|
|
1093
|
+
- 'page'
|
|
1094
|
+
- 'frontend'
|
|
1095
|
+
- 'user interface'
|
|
1096
|
+
|
|
1097
|
+
Web:
|
|
1098
|
+
description: 'Web application features'
|
|
1099
|
+
code_paths:
|
|
1100
|
+
- 'apps/web/**'
|
|
1101
|
+
- 'web/**'
|
|
1102
|
+
keywords:
|
|
1103
|
+
- 'web'
|
|
1104
|
+
- 'browser'
|
|
1105
|
+
- 'frontend'
|
|
1106
|
+
|
|
1107
|
+
# Operations Lane: Infrastructure and CI/CD
|
|
1108
|
+
Operations:
|
|
1109
|
+
Infrastructure:
|
|
1110
|
+
description: 'Apps, deployment, hosting configuration'
|
|
1111
|
+
code_paths:
|
|
1112
|
+
- 'apps/**'
|
|
1113
|
+
- 'infrastructure/**'
|
|
1114
|
+
- 'deploy/**'
|
|
1115
|
+
- 'turbo.json'
|
|
1116
|
+
- 'pnpm-workspace.yaml'
|
|
1117
|
+
keywords:
|
|
1118
|
+
- 'infrastructure'
|
|
1119
|
+
- 'deployment'
|
|
1120
|
+
- 'hosting'
|
|
1121
|
+
- 'monorepo'
|
|
1122
|
+
|
|
1123
|
+
CI/CD:
|
|
1124
|
+
description: 'GitHub Actions, workflows, build pipelines'
|
|
1125
|
+
code_paths:
|
|
1126
|
+
- '.github/workflows/**'
|
|
1127
|
+
- '.github/actions/**'
|
|
1128
|
+
- '.github/**'
|
|
1129
|
+
- '.circleci/**'
|
|
1130
|
+
keywords:
|
|
1131
|
+
- 'ci'
|
|
1132
|
+
- 'cd'
|
|
1133
|
+
- 'github actions'
|
|
1134
|
+
- 'workflow'
|
|
1135
|
+
- 'pipeline'
|
|
1136
|
+
|
|
1137
|
+
# Content Lane: Documentation
|
|
1138
|
+
Content:
|
|
1139
|
+
Documentation:
|
|
1140
|
+
description: 'All documentation: guides, references, specs'
|
|
1141
|
+
code_paths:
|
|
1142
|
+
- 'docs/**'
|
|
1143
|
+
- '*.md'
|
|
1144
|
+
- 'README.md'
|
|
1145
|
+
keywords:
|
|
1146
|
+
- 'documentation'
|
|
1147
|
+
- 'docs'
|
|
1148
|
+
- 'guide'
|
|
1149
|
+
- 'readme'
|
|
1150
|
+
- 'markdown'
|
|
959
1151
|
{{FRAMEWORK_LANES}}
|
|
960
1152
|
`;
|
|
961
1153
|
// WU-1300: Starting prompt template for agent onboarding
|
|
@@ -1135,6 +1327,280 @@ pnpm wu:create \\
|
|
|
1135
1327
|
2. Claim the WU: \`pnpm wu:claim --id WU-XXX --lane "Lane"\`
|
|
1136
1328
|
3. cd to worktree: \`cd worktrees/<lane>-wu-xxx\`
|
|
1137
1329
|
`;
|
|
1330
|
+
// WU-1309: First 15 Minutes template
|
|
1331
|
+
const FIRST_15_MINS_TEMPLATE = `# First 15 Minutes with LumenFlow
|
|
1332
|
+
|
|
1333
|
+
**Last updated:** {{DATE}}
|
|
1334
|
+
|
|
1335
|
+
A quick-start guide for your first session with LumenFlow.
|
|
1336
|
+
|
|
1337
|
+
---
|
|
1338
|
+
|
|
1339
|
+
## Minute 0-2: Verify Setup
|
|
1340
|
+
|
|
1341
|
+
\`\`\`bash
|
|
1342
|
+
# Check LumenFlow is configured
|
|
1343
|
+
ls LUMENFLOW.md AGENTS.md .lumenflow.config.yaml
|
|
1344
|
+
|
|
1345
|
+
# Run doctor to verify safety components
|
|
1346
|
+
pnpm exec lumenflow doctor
|
|
1347
|
+
\`\`\`
|
|
1348
|
+
|
|
1349
|
+
---
|
|
1350
|
+
|
|
1351
|
+
## Minute 2-5: Read Essential Docs
|
|
1352
|
+
|
|
1353
|
+
1. Open **LUMENFLOW.md** - Main workflow guide
|
|
1354
|
+
2. Scan **AGENTS.md** - Quick reference for commands
|
|
1355
|
+
3. Review **.lumenflow/constraints.md** - The 6 rules you must follow
|
|
1356
|
+
|
|
1357
|
+
---
|
|
1358
|
+
|
|
1359
|
+
## Minute 5-8: Find a WU to Work On
|
|
1360
|
+
|
|
1361
|
+
\`\`\`bash
|
|
1362
|
+
# Check status board
|
|
1363
|
+
cat docs/04-operations/tasks/status.md
|
|
1364
|
+
|
|
1365
|
+
# List ready WUs
|
|
1366
|
+
ls docs/04-operations/tasks/wu/*.yaml | head -5
|
|
1367
|
+
\`\`\`
|
|
1368
|
+
|
|
1369
|
+
---
|
|
1370
|
+
|
|
1371
|
+
## Minute 8-12: Claim and Start
|
|
1372
|
+
|
|
1373
|
+
\`\`\`bash
|
|
1374
|
+
# Claim a WU
|
|
1375
|
+
pnpm wu:claim --id WU-XXX --lane "Framework: Core"
|
|
1376
|
+
|
|
1377
|
+
# IMPORTANT: cd to worktree immediately
|
|
1378
|
+
cd worktrees/framework-core-wu-xxx
|
|
1379
|
+
|
|
1380
|
+
# Verify you're in the right place
|
|
1381
|
+
pwd # Should end with worktrees/...
|
|
1382
|
+
\`\`\`
|
|
1383
|
+
|
|
1384
|
+
---
|
|
1385
|
+
|
|
1386
|
+
## Minute 12-15: Begin TDD Cycle
|
|
1387
|
+
|
|
1388
|
+
\`\`\`bash
|
|
1389
|
+
# 1. Write a failing test
|
|
1390
|
+
# 2. Run it to confirm RED
|
|
1391
|
+
pnpm test -- --run
|
|
1392
|
+
|
|
1393
|
+
# 3. Write minimal code to pass
|
|
1394
|
+
# 4. Run test again for GREEN
|
|
1395
|
+
pnpm test -- --run
|
|
1396
|
+
|
|
1397
|
+
# 5. Run gates to check everything
|
|
1398
|
+
pnpm gates
|
|
1399
|
+
\`\`\`
|
|
1400
|
+
|
|
1401
|
+
---
|
|
1402
|
+
|
|
1403
|
+
## Key Reminders
|
|
1404
|
+
|
|
1405
|
+
- **Stay in the worktree** after claiming
|
|
1406
|
+
- **TDD**: Test first, then code
|
|
1407
|
+
- **Gates before done**: Always run \`pnpm gates\`
|
|
1408
|
+
- **Always wu:done**: Never forget to complete
|
|
1409
|
+
|
|
1410
|
+
---
|
|
1411
|
+
|
|
1412
|
+
## When Done
|
|
1413
|
+
|
|
1414
|
+
\`\`\`bash
|
|
1415
|
+
# From worktree: run gates
|
|
1416
|
+
pnpm gates
|
|
1417
|
+
|
|
1418
|
+
# From main: complete WU
|
|
1419
|
+
cd <project-root>
|
|
1420
|
+
pnpm wu:done --id WU-XXX
|
|
1421
|
+
\`\`\`
|
|
1422
|
+
`;
|
|
1423
|
+
// WU-1309: Local-only / no remote template
|
|
1424
|
+
const LOCAL_ONLY_TEMPLATE = `# Local-Only Development
|
|
1425
|
+
|
|
1426
|
+
**Last updated:** {{DATE}}
|
|
1427
|
+
|
|
1428
|
+
Configure LumenFlow for local development without a remote repository.
|
|
1429
|
+
|
|
1430
|
+
---
|
|
1431
|
+
|
|
1432
|
+
## When to Use
|
|
1433
|
+
|
|
1434
|
+
- Air-gapped environments
|
|
1435
|
+
- Testing/evaluation
|
|
1436
|
+
- Pre-remote development (haven't pushed to GitHub yet)
|
|
1437
|
+
- Offline development
|
|
1438
|
+
|
|
1439
|
+
---
|
|
1440
|
+
|
|
1441
|
+
## Configuration
|
|
1442
|
+
|
|
1443
|
+
Add this to \`.lumenflow.config.yaml\`:
|
|
1444
|
+
|
|
1445
|
+
\`\`\`yaml
|
|
1446
|
+
git:
|
|
1447
|
+
requireRemote: false
|
|
1448
|
+
\`\`\`
|
|
1449
|
+
|
|
1450
|
+
---
|
|
1451
|
+
|
|
1452
|
+
## Behavior Changes
|
|
1453
|
+
|
|
1454
|
+
When \`requireRemote: false\`:
|
|
1455
|
+
|
|
1456
|
+
| Command | Default Behavior | Local-Only Behavior |
|
|
1457
|
+
|---------|------------------|---------------------|
|
|
1458
|
+
| \`wu:create\` | Fetches origin/main | Skips remote fetch |
|
|
1459
|
+
| \`wu:claim\` | Pushes lane branch | Creates local branch only |
|
|
1460
|
+
| \`wu:done\` | Pushes to origin | Commits to local main |
|
|
1461
|
+
|
|
1462
|
+
---
|
|
1463
|
+
|
|
1464
|
+
## Warnings
|
|
1465
|
+
|
|
1466
|
+
With local-only mode:
|
|
1467
|
+
|
|
1468
|
+
1. **No remote visibility** - Team members can't see your WUs
|
|
1469
|
+
2. **No backup** - Work is only on your machine
|
|
1470
|
+
3. **Manual sync required** - When adding a remote later
|
|
1471
|
+
|
|
1472
|
+
---
|
|
1473
|
+
|
|
1474
|
+
## Transitioning to Remote
|
|
1475
|
+
|
|
1476
|
+
When you add an origin remote:
|
|
1477
|
+
|
|
1478
|
+
1. Update config: \`git.requireRemote: true\` or remove the setting
|
|
1479
|
+
2. Push your main branch: \`git push -u origin main\`
|
|
1480
|
+
3. Resume normal workflow
|
|
1481
|
+
|
|
1482
|
+
---
|
|
1483
|
+
|
|
1484
|
+
## Troubleshooting
|
|
1485
|
+
|
|
1486
|
+
### "No origin remote configured"
|
|
1487
|
+
|
|
1488
|
+
**Cause:** \`requireRemote: true\` (default) but no origin exists.
|
|
1489
|
+
|
|
1490
|
+
**Fix:** Add remote or set \`requireRemote: false\`:
|
|
1491
|
+
|
|
1492
|
+
\`\`\`bash
|
|
1493
|
+
# Option 1: Add remote
|
|
1494
|
+
git remote add origin <url>
|
|
1495
|
+
|
|
1496
|
+
# Option 2: Enable local-only mode
|
|
1497
|
+
echo "git:\\n requireRemote: false" >> .lumenflow.config.yaml
|
|
1498
|
+
\`\`\`
|
|
1499
|
+
`;
|
|
1500
|
+
// WU-1309: Lane Inference template
|
|
1501
|
+
const LANE_INFERENCE_DOC_TEMPLATE = `# Lane Inference
|
|
1502
|
+
|
|
1503
|
+
**Last updated:** {{DATE}}
|
|
1504
|
+
|
|
1505
|
+
How LumenFlow determines which lane a WU belongs to.
|
|
1506
|
+
|
|
1507
|
+
---
|
|
1508
|
+
|
|
1509
|
+
## Lane Format
|
|
1510
|
+
|
|
1511
|
+
LumenFlow uses hierarchical lanes: \`"Parent: Sublane"\`
|
|
1512
|
+
|
|
1513
|
+
Examples:
|
|
1514
|
+
- \`"Framework: Core"\`
|
|
1515
|
+
- \`"Framework: CLI"\`
|
|
1516
|
+
- \`"Experience: UI"\`
|
|
1517
|
+
- \`"Operations: CI/CD"\`
|
|
1518
|
+
- \`"Content: Documentation"\`
|
|
1519
|
+
|
|
1520
|
+
---
|
|
1521
|
+
|
|
1522
|
+
## Lane Taxonomy File
|
|
1523
|
+
|
|
1524
|
+
Lanes are defined in \`.lumenflow.lane-inference.yaml\`:
|
|
1525
|
+
|
|
1526
|
+
\`\`\`yaml
|
|
1527
|
+
Framework:
|
|
1528
|
+
Core:
|
|
1529
|
+
description: 'Core library'
|
|
1530
|
+
code_paths:
|
|
1531
|
+
- 'packages/**/core/**'
|
|
1532
|
+
keywords:
|
|
1533
|
+
- 'core'
|
|
1534
|
+
- 'library'
|
|
1535
|
+
|
|
1536
|
+
CLI:
|
|
1537
|
+
description: 'CLI commands'
|
|
1538
|
+
code_paths:
|
|
1539
|
+
- 'packages/**/cli/**'
|
|
1540
|
+
- 'bin/**'
|
|
1541
|
+
keywords:
|
|
1542
|
+
- 'cli'
|
|
1543
|
+
- 'command'
|
|
1544
|
+
\`\`\`
|
|
1545
|
+
|
|
1546
|
+
---
|
|
1547
|
+
|
|
1548
|
+
## Auto-Inference
|
|
1549
|
+
|
|
1550
|
+
Use \`wu:infer-lane\` to suggest a lane based on code paths:
|
|
1551
|
+
|
|
1552
|
+
\`\`\`bash
|
|
1553
|
+
# Infer from WU code_paths
|
|
1554
|
+
pnpm wu:infer-lane --id WU-XXX
|
|
1555
|
+
|
|
1556
|
+
# Infer from manual inputs
|
|
1557
|
+
pnpm wu:infer-lane --paths "packages/@lumenflow/cli/**" --desc "Add CLI command"
|
|
1558
|
+
\`\`\`
|
|
1559
|
+
|
|
1560
|
+
---
|
|
1561
|
+
|
|
1562
|
+
## Generating Lane Taxonomy
|
|
1563
|
+
|
|
1564
|
+
If no taxonomy exists, generate one:
|
|
1565
|
+
|
|
1566
|
+
\`\`\`bash
|
|
1567
|
+
pnpm lane:suggest --output .lumenflow.lane-inference.yaml
|
|
1568
|
+
\`\`\`
|
|
1569
|
+
|
|
1570
|
+
---
|
|
1571
|
+
|
|
1572
|
+
## Common Issues
|
|
1573
|
+
|
|
1574
|
+
### "Lane format invalid"
|
|
1575
|
+
|
|
1576
|
+
**Cause:** Missing colon or space.
|
|
1577
|
+
|
|
1578
|
+
**Fix:** Use \`"Parent: Sublane"\` format (colon + space).
|
|
1579
|
+
|
|
1580
|
+
### "Sub-lane validation failed"
|
|
1581
|
+
|
|
1582
|
+
**Cause:** No \`.lumenflow.lane-inference.yaml\` file.
|
|
1583
|
+
|
|
1584
|
+
**Fix:** Create the file or generate it:
|
|
1585
|
+
|
|
1586
|
+
\`\`\`bash
|
|
1587
|
+
pnpm lane:suggest --output .lumenflow.lane-inference.yaml
|
|
1588
|
+
\`\`\`
|
|
1589
|
+
|
|
1590
|
+
---
|
|
1591
|
+
|
|
1592
|
+
## Lane Health
|
|
1593
|
+
|
|
1594
|
+
Check lane configuration for issues:
|
|
1595
|
+
|
|
1596
|
+
\`\`\`bash
|
|
1597
|
+
pnpm lane:health
|
|
1598
|
+
\`\`\`
|
|
1599
|
+
|
|
1600
|
+
This detects:
|
|
1601
|
+
- Overlapping code paths between lanes
|
|
1602
|
+
- Code files not covered by any lane
|
|
1603
|
+
`;
|
|
1138
1604
|
// WU-1083: Claude skills templates
|
|
1139
1605
|
const WU_LIFECYCLE_SKILL_TEMPLATE = `---
|
|
1140
1606
|
name: wu-lifecycle
|
|
@@ -1413,9 +1879,16 @@ export async function scaffoldProject(targetDir, options) {
|
|
|
1413
1879
|
if (!fs.existsSync(targetDir)) {
|
|
1414
1880
|
fs.mkdirSync(targetDir, { recursive: true });
|
|
1415
1881
|
}
|
|
1882
|
+
// WU-1309: Detect or use specified docs structure
|
|
1883
|
+
const docsStructure = options.docsStructure ?? detectDocsStructure(targetDir);
|
|
1884
|
+
const docsPaths = getDocsPath(docsStructure);
|
|
1416
1885
|
const tokenDefaults = {
|
|
1417
1886
|
DATE: getCurrentDate(),
|
|
1418
|
-
PROJECT_ROOT:
|
|
1887
|
+
PROJECT_ROOT: '<project-root>', // WU-1309: Use portable placeholder
|
|
1888
|
+
QUICK_REF_LINK: docsPaths.quickRefLink,
|
|
1889
|
+
DOCS_OPERATIONS_PATH: docsPaths.operations, // WU-1309: For framework overlay
|
|
1890
|
+
DOCS_TASKS_PATH: docsPaths.tasks,
|
|
1891
|
+
DOCS_ONBOARDING_PATH: docsPaths.onboarding,
|
|
1419
1892
|
};
|
|
1420
1893
|
// Create .lumenflow.config.yaml (WU-1067: includes gate preset if specified)
|
|
1421
1894
|
// Note: Config files don't use merge mode (always skip or force)
|
|
@@ -1453,17 +1926,19 @@ export async function scaffoldProject(targetDir, options) {
|
|
|
1453
1926
|
return result;
|
|
1454
1927
|
}
|
|
1455
1928
|
/**
|
|
1456
|
-
* WU-
|
|
1929
|
+
* WU-1307: LumenFlow scripts to inject into package.json
|
|
1930
|
+
* Uses standalone binaries (wu-claim, wu-done, gates) that work in consumer projects
|
|
1931
|
+
* after installing @lumenflow/cli.
|
|
1457
1932
|
*/
|
|
1458
1933
|
const LUMENFLOW_SCRIPTS = {
|
|
1459
|
-
'wu:claim': '
|
|
1460
|
-
'wu:done': '
|
|
1461
|
-
'wu:create': '
|
|
1462
|
-
'wu:status': '
|
|
1463
|
-
'wu:block': '
|
|
1464
|
-
'wu:unblock': '
|
|
1465
|
-
gates: '
|
|
1466
|
-
'gates:docs': '
|
|
1934
|
+
'wu:claim': 'wu-claim',
|
|
1935
|
+
'wu:done': 'wu-done',
|
|
1936
|
+
'wu:create': 'wu-create',
|
|
1937
|
+
'wu:status': 'wu-status',
|
|
1938
|
+
'wu:block': 'wu-block',
|
|
1939
|
+
'wu:unblock': 'wu-unblock',
|
|
1940
|
+
gates: 'gates',
|
|
1941
|
+
'gates:docs': 'gates --docs-only',
|
|
1467
1942
|
};
|
|
1468
1943
|
/**
|
|
1469
1944
|
* WU-1300: Inject LumenFlow scripts into package.json
|
|
@@ -1508,7 +1983,9 @@ async function injectPackageJsonScripts(targetDir, options, result) {
|
|
|
1508
1983
|
}
|
|
1509
1984
|
}
|
|
1510
1985
|
async function scaffoldFullDocs(targetDir, options, result, tokens) {
|
|
1511
|
-
|
|
1986
|
+
// WU-1309: Use docs structure from tokens (computed in scaffoldProject)
|
|
1987
|
+
const tasksPath = tokens.DOCS_TASKS_PATH;
|
|
1988
|
+
const tasksDir = path.join(targetDir, tasksPath);
|
|
1512
1989
|
const wuDir = path.join(tasksDir, 'wu');
|
|
1513
1990
|
const templatesDir = path.join(tasksDir, 'templates');
|
|
1514
1991
|
await createDirectory(wuDir, result, targetDir);
|
|
@@ -1523,18 +2000,25 @@ async function scaffoldFullDocs(targetDir, options, result, tokens) {
|
|
|
1523
2000
|
await scaffoldAgentOnboardingDocs(targetDir, options, result, tokens);
|
|
1524
2001
|
}
|
|
1525
2002
|
/**
|
|
1526
|
-
* WU-
|
|
2003
|
+
* WU-1307: Scaffold lane inference configuration
|
|
2004
|
+
* Uses hierarchical Parent→Sublane format required by lane-inference.ts
|
|
1527
2005
|
*/
|
|
1528
2006
|
async function scaffoldLaneInference(targetDir, options, result, tokens) {
|
|
1529
|
-
// Add framework-specific lanes if framework is provided
|
|
2007
|
+
// WU-1307: Add framework-specific lanes in hierarchical format if framework is provided
|
|
1530
2008
|
let frameworkLanes = '';
|
|
1531
2009
|
if (options.framework) {
|
|
1532
2010
|
const { name, slug } = normalizeFrameworkName(options.framework);
|
|
2011
|
+
// Add framework lanes in hierarchical format (indentation matters in YAML)
|
|
1533
2012
|
frameworkLanes = `
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
2013
|
+
# Framework-specific lanes (added with --framework ${name})
|
|
2014
|
+
${name}:
|
|
2015
|
+
description: '${name} framework-specific code'
|
|
2016
|
+
code_paths:
|
|
2017
|
+
- 'src/${slug}/**'
|
|
2018
|
+
- 'packages/${slug}/**'
|
|
2019
|
+
keywords:
|
|
2020
|
+
- '${slug}'
|
|
2021
|
+
- '${name.toLowerCase()}'
|
|
1538
2022
|
`;
|
|
1539
2023
|
}
|
|
1540
2024
|
const laneInferenceContent = processTemplate(LANE_INFERENCE_TEMPLATE, {
|
|
@@ -1546,12 +2030,20 @@ async function scaffoldLaneInference(targetDir, options, result, tokens) {
|
|
|
1546
2030
|
/**
|
|
1547
2031
|
* WU-1083: Scaffold agent onboarding documentation
|
|
1548
2032
|
* WU-1300: Added starting-prompt.md
|
|
2033
|
+
* WU-1309: Added first-15-mins.md, local-only.md, lane-inference.md; use dynamic docs path
|
|
1549
2034
|
*/
|
|
1550
2035
|
async function scaffoldAgentOnboardingDocs(targetDir, options, result, tokens) {
|
|
1551
|
-
|
|
2036
|
+
// WU-1309: Use dynamic onboarding path from tokens
|
|
2037
|
+
const onboardingDir = path.join(targetDir, tokens.DOCS_ONBOARDING_PATH);
|
|
1552
2038
|
await createDirectory(onboardingDir, result, targetDir);
|
|
1553
2039
|
// WU-1300: Add starting-prompt.md as first file
|
|
1554
2040
|
await createFile(path.join(onboardingDir, 'starting-prompt.md'), processTemplate(STARTING_PROMPT_TEMPLATE, tokens), options.force, result, targetDir);
|
|
2041
|
+
// WU-1309: Add first-15-mins.md
|
|
2042
|
+
await createFile(path.join(onboardingDir, 'first-15-mins.md'), processTemplate(FIRST_15_MINS_TEMPLATE, tokens), options.force, result, targetDir);
|
|
2043
|
+
// WU-1309: Add local-only.md
|
|
2044
|
+
await createFile(path.join(onboardingDir, 'local-only.md'), processTemplate(LOCAL_ONLY_TEMPLATE, tokens), options.force, result, targetDir);
|
|
2045
|
+
// WU-1309: Add lane-inference.md
|
|
2046
|
+
await createFile(path.join(onboardingDir, 'lane-inference.md'), processTemplate(LANE_INFERENCE_DOC_TEMPLATE, tokens), options.force, result, targetDir);
|
|
1555
2047
|
await createFile(path.join(onboardingDir, 'quick-ref-commands.md'), processTemplate(QUICK_REF_COMMANDS_TEMPLATE, tokens), options.force, result, targetDir);
|
|
1556
2048
|
await createFile(path.join(onboardingDir, 'first-wu-mistakes.md'), processTemplate(FIRST_WU_MISTAKES_TEMPLATE, tokens), options.force, result, targetDir);
|
|
1557
2049
|
await createFile(path.join(onboardingDir, 'troubleshooting-wu-done.md'), processTemplate(TROUBLESHOOTING_WU_DONE_TEMPLATE, tokens), options.force, result, targetDir);
|
|
@@ -1587,7 +2079,8 @@ async function scaffoldFrameworkOverlay(targetDir, options, result, tokens) {
|
|
|
1587
2079
|
FRAMEWORK_SLUG: slug,
|
|
1588
2080
|
};
|
|
1589
2081
|
await createFile(path.join(targetDir, FRAMEWORK_HINT_FILE), processTemplate(FRAMEWORK_HINT_TEMPLATE, frameworkTokens), options.force, result, targetDir);
|
|
1590
|
-
|
|
2082
|
+
// WU-1309: Use dynamic operations path from tokens
|
|
2083
|
+
const overlayDir = path.join(targetDir, tokens.DOCS_OPERATIONS_PATH, '_frameworks', slug);
|
|
1591
2084
|
await createDirectory(overlayDir, result, targetDir);
|
|
1592
2085
|
await createFile(path.join(overlayDir, 'README.md'), processTemplate(FRAMEWORK_OVERLAY_TEMPLATE, frameworkTokens), options.force, result, targetDir);
|
|
1593
2086
|
}
|