forge-workflow 0.0.5 → 0.0.7
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/.claude/commands/dev.md +6 -1
- package/.claude/commands/plan.md +59 -14
- package/.claude/commands/premerge.md +10 -0
- package/.claude/commands/review.md +7 -1
- package/.claude/commands/ship.md +95 -47
- package/.claude/commands/status.md +42 -0
- package/.claude/commands/validate.md +7 -1
- package/.claude/commands/verify.md +52 -4
- package/.claude/rules/workflow.md +16 -0
- package/.claude/scripts/greptile-resolve.sh +32 -0
- package/.cline/workflows/dev.md +6 -1
- package/.cline/workflows/plan.md +59 -14
- package/.cline/workflows/premerge.md +10 -0
- package/.cline/workflows/review.md +7 -1
- package/.cline/workflows/ship.md +95 -47
- package/.cline/workflows/status.md +42 -0
- package/.cline/workflows/validate.md +7 -1
- package/.cline/workflows/verify.md +52 -4
- package/.codex/skills/dev/SKILL.md +6 -1
- package/.codex/skills/plan/SKILL.md +59 -14
- package/.codex/skills/premerge/SKILL.md +10 -0
- package/.codex/skills/review/SKILL.md +7 -1
- package/.codex/skills/ship/SKILL.md +95 -47
- package/.codex/skills/status/SKILL.md +42 -0
- package/.codex/skills/validate/SKILL.md +7 -1
- package/.codex/skills/verify/SKILL.md +52 -4
- package/.cursor/commands/dev.md +6 -1
- package/.cursor/commands/plan.md +59 -14
- package/.cursor/commands/premerge.md +10 -0
- package/.cursor/commands/review.md +7 -1
- package/.cursor/commands/ship.md +95 -47
- package/.cursor/commands/status.md +42 -0
- package/.cursor/commands/validate.md +7 -1
- package/.cursor/commands/verify.md +52 -4
- package/.cursorrules +149 -0
- package/.github/prompts/dev.prompt.md +6 -1
- package/.github/prompts/plan.prompt.md +59 -14
- package/.github/prompts/premerge.prompt.md +10 -0
- package/.github/prompts/review.prompt.md +7 -1
- package/.github/prompts/ship.prompt.md +95 -47
- package/.github/prompts/status.prompt.md +42 -0
- package/.github/prompts/validate.prompt.md +7 -1
- package/.github/prompts/verify.prompt.md +52 -4
- package/.kilocode/workflows/dev.md +6 -1
- package/.kilocode/workflows/plan.md +59 -14
- package/.kilocode/workflows/premerge.md +10 -0
- package/.kilocode/workflows/review.md +7 -1
- package/.kilocode/workflows/ship.md +95 -47
- package/.kilocode/workflows/status.md +42 -0
- package/.kilocode/workflows/validate.md +7 -1
- package/.kilocode/workflows/verify.md +52 -4
- package/.opencode/commands/dev.md +6 -1
- package/.opencode/commands/plan.md +59 -14
- package/.opencode/commands/premerge.md +10 -0
- package/.opencode/commands/review.md +7 -1
- package/.opencode/commands/ship.md +95 -47
- package/.opencode/commands/status.md +42 -0
- package/.opencode/commands/validate.md +7 -1
- package/.opencode/commands/verify.md +52 -4
- package/.roo/commands/dev.md +6 -1
- package/.roo/commands/plan.md +59 -14
- package/.roo/commands/premerge.md +10 -0
- package/.roo/commands/review.md +7 -1
- package/.roo/commands/ship.md +95 -47
- package/.roo/commands/status.md +42 -0
- package/.roo/commands/validate.md +7 -1
- package/.roo/commands/verify.md +52 -4
- package/AGENTS.md +97 -0
- package/CLAUDE.md +10 -0
- package/README.md +2 -2
- package/bin/forge-cmd.js +5 -1
- package/bin/forge-preflight.js +15 -2
- package/bin/forge.js +211 -9
- package/docs/ENHANCED_ONBOARDING.md +96 -86
- package/docs/ROADMAP.md +2 -2
- package/docs/TOOLCHAIN.md +23 -0
- package/docs/VALIDATION.md +1 -1
- package/lefthook.yml +11 -0
- package/lib/agents/README.md +46 -1
- package/lib/agents/cline.plugin.json +11 -4
- package/lib/agents/codex.plugin.json +2 -2
- package/lib/agents/copilot.plugin.json +5 -5
- package/lib/agents/cursor.plugin.json +1 -1
- package/lib/agents/kilocode.plugin.json +1 -1
- package/lib/agents/opencode.plugin.json +7 -4
- package/lib/agents/roo.plugin.json +10 -3
- package/lib/agents-config.js +129 -81
- package/lib/codex-skills.js +50 -0
- package/lib/commands/_registry.js +173 -0
- package/lib/commands/clean.js +181 -0
- package/lib/commands/commands-reset.js +147 -0
- package/lib/commands/dev.js +84 -0
- package/lib/commands/plan.js +18 -0
- package/lib/commands/push.js +196 -0
- package/lib/commands/recommend.js +1 -1
- package/lib/commands/setup.js +4295 -0
- package/lib/commands/ship.js +20 -0
- package/lib/commands/status.js +210 -44
- package/lib/commands/sync.js +71 -0
- package/lib/commands/team.js +37 -0
- package/lib/commands/test.js +207 -0
- package/lib/commands/validate.js +13 -0
- package/lib/commands/worktree.js +310 -0
- package/lib/detect-agent.js +38 -8
- package/lib/detection-utils.js +405 -0
- package/lib/docs-command.js +51 -0
- package/lib/docs-copy.js +50 -0
- package/lib/file-utils.js +260 -0
- package/lib/forge-context.js +42 -0
- package/lib/freshness-token.js +148 -0
- package/lib/frontmatter.js +79 -0
- package/lib/greptile-match.js +80 -0
- package/lib/husky-migration.js +113 -12
- package/lib/lefthook-check.js +27 -6
- package/lib/plugin-manager.js +225 -72
- package/lib/project-discovery.js +39 -5
- package/lib/reset.js +309 -0
- package/lib/runtime-health.js +305 -0
- package/lib/shell-utils.js +50 -0
- package/lib/task-ownership.js +117 -0
- package/lib/ui-utils.js +43 -0
- package/lib/validation-utils.js +163 -0
- package/lib/workflow/enforce-stage.js +179 -0
- package/lib/workflow/stages.js +201 -0
- package/lib/workflow/state.js +332 -0
- package/opencode.json +67 -0
- package/package.json +16 -6
- package/scripts/beads-context.sh +165 -22
- package/scripts/beads-context.test.js +5 -1
- package/scripts/check-agents.js +103 -0
- package/scripts/check-forge-token.js +98 -0
- package/scripts/conflict-detect.sh +2 -2
- package/scripts/dep-guard.sh +6 -28
- package/scripts/file-index.sh +117 -23
- package/scripts/forge-team/index.sh +86 -0
- package/scripts/forge-team/lib/agent-prompt.sh +52 -0
- package/scripts/forge-team/lib/claim.sh +256 -0
- package/scripts/forge-team/lib/dashboard.sh +341 -0
- package/scripts/forge-team/lib/epic.sh +332 -0
- package/scripts/forge-team/lib/hooks.sh +253 -0
- package/scripts/forge-team/lib/identity.sh +235 -0
- package/scripts/forge-team/lib/sync-github.sh +317 -0
- package/scripts/forge-team/lib/verify.sh +284 -0
- package/scripts/forge-team/lib/workload.sh +296 -0
- package/scripts/forge-team/tests/agent-prompt.test.sh +72 -0
- package/scripts/forge-team/tests/claim.test.sh +179 -0
- package/scripts/forge-team/tests/dashboard.test.sh +170 -0
- package/scripts/forge-team/tests/dispatcher.test.sh +79 -0
- package/scripts/forge-team/tests/epic.test.sh +176 -0
- package/scripts/forge-team/tests/hooks.test.sh +239 -0
- package/scripts/forge-team/tests/identity.test.sh +176 -0
- package/scripts/forge-team/tests/integration.test.sh +371 -0
- package/scripts/forge-team/tests/sync-github.test.sh +209 -0
- package/scripts/forge-team/tests/verify.test.sh +314 -0
- package/scripts/forge-team/tests/workflow-integration.test.sh +43 -0
- package/scripts/forge-team/tests/workload.test.sh +209 -0
- package/scripts/lib/eval-runner.js +39 -0
- package/scripts/lib/jsonl-lock.sh +48 -0
- package/scripts/lib/sanitize.sh +116 -0
- package/scripts/pr-coordinator.sh +756 -0
- package/scripts/smart-status.sh +58 -21
- package/scripts/sync-commands.js +49 -20
- package/scripts/sync-utils.sh +24 -29
- package/scripts/test.js +18 -1
package/bin/forge.js
CHANGED
|
@@ -48,6 +48,12 @@ const VERSION = packageJson.version;
|
|
|
48
48
|
// Load PluginManager for discoverable agent architecture
|
|
49
49
|
const PluginManager = require('../lib/plugin-manager');
|
|
50
50
|
const { scaffoldGithubBeadsSync } = require('../lib/setup');
|
|
51
|
+
const { copyEssentialDocs } = require('../lib/docs-copy');
|
|
52
|
+
const { listTopics, getTopicContent } = require('../lib/docs-command');
|
|
53
|
+
const { resetSoft, resetHard, reinstall } = require('../lib/reset');
|
|
54
|
+
const { loadCommands, executeCommand } = require('../lib/commands/_registry');
|
|
55
|
+
const { enforceStageEntry } = require('../lib/workflow/enforce-stage');
|
|
56
|
+
const { normalizeStageId } = require('../lib/workflow/stages');
|
|
51
57
|
|
|
52
58
|
// Load enhanced onboarding modules
|
|
53
59
|
const contextMerge = require(path.join(packageDir, 'lib', 'context-merge'));
|
|
@@ -69,8 +75,9 @@ const { renderSetupSummary } = require('../lib/setup-summary-renderer');
|
|
|
69
75
|
const { smartMergeAgentsMd } = require('../lib/smart-merge');
|
|
70
76
|
const { checkLefthookStatus } = require('../lib/lefthook-check');
|
|
71
77
|
const { detectHusky, migrateHusky } = require('../lib/husky-migration');
|
|
72
|
-
// workflowProfiles is
|
|
73
|
-
//
|
|
78
|
+
// workflowProfiles: module exists and is tested but not yet wired into setup flow
|
|
79
|
+
// Will be activated when workflow profile selection is added to interactive setup
|
|
80
|
+
// See: lib/workflow-profiles.js, test/workflow-profiles.test.js
|
|
74
81
|
|
|
75
82
|
// Get the project root (let allows reassignment after --path flag handling)
|
|
76
83
|
let projectRoot = process.env.INIT_CWD || process.cwd();
|
|
@@ -1803,6 +1810,17 @@ function setupCoreDocs() {
|
|
|
1803
1810
|
// docs/planning/ and docs/research/ are created lazily on first use
|
|
1804
1811
|
// by /plan Phase 1 and Phase 2 respectively, via ensureDirWithNote().
|
|
1805
1812
|
// TEMPLATE.md and PROGRESS.md are also deferred to first use.
|
|
1813
|
+
|
|
1814
|
+
// Copy essential docs (TOOLCHAIN.md, VALIDATION.md) to consumer's docs/forge/
|
|
1815
|
+
const result = copyEssentialDocs(projectRoot, packageDir);
|
|
1816
|
+
for (const f of result.created) {
|
|
1817
|
+
console.log(` Created: ${f}`);
|
|
1818
|
+
}
|
|
1819
|
+
for (const f of result.skipped) {
|
|
1820
|
+
if (VERBOSE_MODE) {
|
|
1821
|
+
console.log(` Skipped: ${f} (already exists)`);
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1806
1824
|
}
|
|
1807
1825
|
|
|
1808
1826
|
// Minimal installation (postinstall)
|
|
@@ -2766,6 +2784,15 @@ function showHelp() {
|
|
|
2766
2784
|
console.log('Also works with bun:');
|
|
2767
2785
|
console.log(' bunx forge setup --quick');
|
|
2768
2786
|
console.log('');
|
|
2787
|
+
|
|
2788
|
+
// Append auto-discovered registry commands
|
|
2789
|
+
const helpRegistry = loadCommands(path.join(__dirname, '..', 'lib', 'commands'));
|
|
2790
|
+
const registryHelp = helpRegistry.getHelp();
|
|
2791
|
+
if (registryHelp) {
|
|
2792
|
+
console.log('Additional commands:');
|
|
2793
|
+
console.log(registryHelp);
|
|
2794
|
+
console.log('');
|
|
2795
|
+
}
|
|
2769
2796
|
}
|
|
2770
2797
|
|
|
2771
2798
|
// Detect Husky and offer migration to Lefthook
|
|
@@ -4029,10 +4056,19 @@ async function handleSyncScaffold() {
|
|
|
4029
4056
|
|
|
4030
4057
|
// Helper: Handle setup command in non-quick mode
|
|
4031
4058
|
async function handleSetupCommand(selectedAgents, flags) {
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4059
|
+
// Allow callers (e.g. reinstall) to override projectRoot without process.chdir()
|
|
4060
|
+
const savedRoot = projectRoot;
|
|
4061
|
+
if (flags.projectRoot) {
|
|
4062
|
+
projectRoot = flags.projectRoot;
|
|
4063
|
+
}
|
|
4064
|
+
try {
|
|
4065
|
+
await executeSetup({
|
|
4066
|
+
agents: selectedAgents,
|
|
4067
|
+
skipExternal: flags.skipExternal,
|
|
4068
|
+
});
|
|
4069
|
+
} finally {
|
|
4070
|
+
projectRoot = savedRoot;
|
|
4071
|
+
}
|
|
4036
4072
|
}
|
|
4037
4073
|
|
|
4038
4074
|
// Helper: Handle external services configuration
|
|
@@ -4103,10 +4139,17 @@ async function main() {
|
|
|
4103
4139
|
projectRoot = handlePathSetup(flags.path);
|
|
4104
4140
|
}
|
|
4105
4141
|
|
|
4142
|
+
// Load command registry (auto-discovered commands from lib/commands/)
|
|
4143
|
+
const registry = loadCommands(path.join(__dirname, '..', 'lib', 'commands'));
|
|
4144
|
+
|
|
4106
4145
|
// First-run detection: check if Forge is configured in this project
|
|
4107
|
-
// Skip for: setup (needs to run
|
|
4146
|
+
// Skip for: setup (needs to run), recommend (read-only), docs (read-only),
|
|
4147
|
+
// postinstall (fresh install), registry commands (handle own requirements)
|
|
4108
4148
|
// Note: help and version already returned above, so no need to check here
|
|
4109
|
-
if (command !== 'setup' && command !== 'recommend'
|
|
4149
|
+
if (command !== 'setup' && command !== 'recommend' && command !== 'docs'
|
|
4150
|
+
&& command !== 'reset' && command !== 'reinstall'
|
|
4151
|
+
&& !registry.commands.has(command)
|
|
4152
|
+
&& process.env.npm_lifecycle_event !== 'postinstall') {
|
|
4110
4153
|
const agentsMdPath = path.join(projectRoot, 'AGENTS.md');
|
|
4111
4154
|
if (!fs.existsSync(agentsMdPath)) {
|
|
4112
4155
|
console.error('[FORGE_SETUP_REQUIRED] Forge is not configured in this project.\n');
|
|
@@ -4116,6 +4159,53 @@ async function main() {
|
|
|
4116
4159
|
}
|
|
4117
4160
|
}
|
|
4118
4161
|
|
|
4162
|
+
// Registry command dispatch — auto-discovered commands take priority
|
|
4163
|
+
if (registry.commands.has(command)) {
|
|
4164
|
+
try {
|
|
4165
|
+
const result = await executeCommand(
|
|
4166
|
+
registry.commands,
|
|
4167
|
+
command,
|
|
4168
|
+
args.slice(1),
|
|
4169
|
+
flags,
|
|
4170
|
+
projectRoot,
|
|
4171
|
+
{
|
|
4172
|
+
enforceStage: (context) => enforceStageEntry({
|
|
4173
|
+
commandName: context.commandName,
|
|
4174
|
+
args: context.args,
|
|
4175
|
+
flags: context.flags,
|
|
4176
|
+
projectRoot: context.projectRoot,
|
|
4177
|
+
}),
|
|
4178
|
+
}
|
|
4179
|
+
);
|
|
4180
|
+
if (result && !result.success) {
|
|
4181
|
+
console.error(result.error || result.message || 'Command failed');
|
|
4182
|
+
process.exit(1);
|
|
4183
|
+
}
|
|
4184
|
+
if (result && typeof result.output === 'string' && result.output.length > 0) {
|
|
4185
|
+
process.stdout.write(result.output.endsWith('\n') ? result.output : `${result.output}\n`);
|
|
4186
|
+
}
|
|
4187
|
+
} catch (err) {
|
|
4188
|
+
console.error(`Error running '${command}':`, err.message);
|
|
4189
|
+
process.exit(1);
|
|
4190
|
+
}
|
|
4191
|
+
return;
|
|
4192
|
+
}
|
|
4193
|
+
|
|
4194
|
+
const stageId = normalizeStageId(command);
|
|
4195
|
+
if (stageId) {
|
|
4196
|
+
try {
|
|
4197
|
+
await enforceStageEntry({
|
|
4198
|
+
commandName: stageId,
|
|
4199
|
+
args: args.slice(1),
|
|
4200
|
+
flags,
|
|
4201
|
+
projectRoot,
|
|
4202
|
+
});
|
|
4203
|
+
} catch (err) {
|
|
4204
|
+
console.error(`Error running '${command}':`, err.message);
|
|
4205
|
+
process.exit(1);
|
|
4206
|
+
}
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4119
4209
|
if (command === 'setup') {
|
|
4120
4210
|
// Determine agents to install
|
|
4121
4211
|
let selectedAgents = determineSelectedAgents(flags);
|
|
@@ -4166,11 +4256,123 @@ async function main() {
|
|
|
4166
4256
|
return;
|
|
4167
4257
|
}
|
|
4168
4258
|
console.log(formatRecommendations(result.recommendations));
|
|
4259
|
+
} else if (command === 'docs') {
|
|
4260
|
+
const topic = args[1];
|
|
4261
|
+
if (!topic) {
|
|
4262
|
+
console.log('');
|
|
4263
|
+
console.log(' Available documentation topics:');
|
|
4264
|
+
console.log('');
|
|
4265
|
+
for (const t of listTopics()) {
|
|
4266
|
+
console.log(` - ${t}`);
|
|
4267
|
+
}
|
|
4268
|
+
console.log('');
|
|
4269
|
+
console.log(' Usage: forge docs <topic>');
|
|
4270
|
+
console.log('');
|
|
4271
|
+
} else {
|
|
4272
|
+
const result = getTopicContent(topic, packageDir);
|
|
4273
|
+
if (result.error) {
|
|
4274
|
+
console.error(` Error: ${result.error}`);
|
|
4275
|
+
process.exitCode = 1;
|
|
4276
|
+
} else {
|
|
4277
|
+
console.log(result.content);
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
} else if (command === 'reset') {
|
|
4281
|
+
const isSoft = args.includes('--soft');
|
|
4282
|
+
const isHard = args.includes('--hard');
|
|
4283
|
+
const isForce = args.includes('--force');
|
|
4284
|
+
|
|
4285
|
+
if (isSoft && isHard) {
|
|
4286
|
+
console.error(' Error: --soft and --hard are mutually exclusive. Specify one.');
|
|
4287
|
+
process.exitCode = 1;
|
|
4288
|
+
} else if (!isSoft && !isHard) {
|
|
4289
|
+
console.log('');
|
|
4290
|
+
console.log(' Forge Reset');
|
|
4291
|
+
console.log('');
|
|
4292
|
+
console.log(' Usage:');
|
|
4293
|
+
console.log(' forge reset --soft --force Remove .forge/ config only');
|
|
4294
|
+
console.log(' forge reset --hard --force Remove ALL forge-managed files');
|
|
4295
|
+
console.log('');
|
|
4296
|
+
console.log(' Flags:');
|
|
4297
|
+
console.log(' --soft Remove only .forge/ directory (preserves commands, rules, agents)');
|
|
4298
|
+
console.log(' --hard Remove all forge files (preserves user-created files)');
|
|
4299
|
+
console.log(' --force Required safety flag to confirm destructive operation');
|
|
4300
|
+
console.log('');
|
|
4301
|
+
} else if (isSoft) {
|
|
4302
|
+
try {
|
|
4303
|
+
const result = resetSoft(projectRoot, { force: isForce });
|
|
4304
|
+
console.log('');
|
|
4305
|
+
console.log(' Soft reset complete.');
|
|
4306
|
+
for (const f of result.removed) {
|
|
4307
|
+
console.log(` Removed: ${f}`);
|
|
4308
|
+
}
|
|
4309
|
+
console.log('');
|
|
4310
|
+
} catch (error) {
|
|
4311
|
+
console.error(` Error: ${error.message}`);
|
|
4312
|
+
process.exitCode = 1;
|
|
4313
|
+
}
|
|
4314
|
+
} else if (isHard) {
|
|
4315
|
+
try {
|
|
4316
|
+
const result = resetHard(projectRoot, { force: isForce });
|
|
4317
|
+
console.log('');
|
|
4318
|
+
console.log(' Hard reset complete.');
|
|
4319
|
+
for (const f of result.removed) {
|
|
4320
|
+
console.log(` Removed: ${f}`);
|
|
4321
|
+
}
|
|
4322
|
+
console.log('');
|
|
4323
|
+
} catch (error) {
|
|
4324
|
+
console.error(` Error: ${error.message}`);
|
|
4325
|
+
process.exitCode = 1;
|
|
4326
|
+
}
|
|
4327
|
+
}
|
|
4328
|
+
} else if (command === 'reinstall') {
|
|
4329
|
+
const isForce = args.includes('--force');
|
|
4330
|
+
try {
|
|
4331
|
+
const result = await reinstall(projectRoot, {
|
|
4332
|
+
force: isForce,
|
|
4333
|
+
setupFn: async (root) => {
|
|
4334
|
+
// Re-run default setup (claude agent, skip external prompts)
|
|
4335
|
+
const agents = ['claude'];
|
|
4336
|
+
await handleSetupCommand(agents, { skipExternal: true, yes: true, projectRoot: root });
|
|
4337
|
+
return { agents };
|
|
4338
|
+
},
|
|
4339
|
+
});
|
|
4340
|
+
console.log('');
|
|
4341
|
+
console.log(' Reinstall complete.');
|
|
4342
|
+
for (const f of result.resetResult.removed) {
|
|
4343
|
+
console.log(` Removed: ${f}`);
|
|
4344
|
+
}
|
|
4345
|
+
if (result.setupResult) {
|
|
4346
|
+
console.log('');
|
|
4347
|
+
console.log(' Setup re-run automatically.');
|
|
4348
|
+
}
|
|
4349
|
+
console.log('');
|
|
4350
|
+
} catch (error) {
|
|
4351
|
+
console.error(` Error: ${error.message}`);
|
|
4352
|
+
process.exitCode = 1;
|
|
4353
|
+
}
|
|
4169
4354
|
} else if (command === 'rollback') {
|
|
4170
4355
|
// Execute rollback menu
|
|
4171
4356
|
await showRollbackMenu();
|
|
4357
|
+
} else if (command === 'team') {
|
|
4358
|
+
const { handleTeam } = require('../lib/commands/team.js');
|
|
4359
|
+
handleTeam(process.argv.slice(3));
|
|
4360
|
+
} else if (process.env.npm_lifecycle_event === 'postinstall') {
|
|
4361
|
+
// Postinstall: show success message only, no file changes
|
|
4362
|
+
// Surprising file modifications during npm/bun install break user expectations
|
|
4363
|
+
// Detect package manager from lock files for accurate setup instruction
|
|
4364
|
+
let runCmd = 'npx';
|
|
4365
|
+
if (fs.existsSync(path.join(projectRoot, 'bun.lockb')) || fs.existsSync(path.join(projectRoot, 'bun.lock'))) runCmd = 'bunx';
|
|
4366
|
+
else if (fs.existsSync(path.join(projectRoot, 'pnpm-lock.yaml'))) runCmd = 'pnpm dlx';
|
|
4367
|
+
else if (fs.existsSync(path.join(projectRoot, 'yarn.lock'))) runCmd = 'yarn dlx';
|
|
4368
|
+
console.log('');
|
|
4369
|
+
console.log(' \u2705 Forge installed successfully!');
|
|
4370
|
+
console.log('');
|
|
4371
|
+
console.log(' To set up in your project:');
|
|
4372
|
+
console.log(` ${runCmd} forge setup`);
|
|
4373
|
+
console.log('');
|
|
4172
4374
|
} else {
|
|
4173
|
-
//
|
|
4375
|
+
// Explicit invocation with no command: run minimal install
|
|
4174
4376
|
minimalInstall();
|
|
4175
4377
|
}
|
|
4176
4378
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Enhanced Onboarding Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Intelligent onboarding that adapts to your project and preserves existing content.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Key Features
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Key Features
|
|
10
10
|
|
|
11
11
|
1. **Intelligent File Merging** - Preserves your existing AGENTS.md content
|
|
12
12
|
2. **Auto-Detection** - Automatically detects framework, language, and project stage
|
|
@@ -35,7 +35,7 @@ bunx forge setup --merge=smart
|
|
|
35
35
|
- Tech stack details
|
|
36
36
|
|
|
37
37
|
**What gets updated:**
|
|
38
|
-
- Workflow instructions (
|
|
38
|
+
- Workflow instructions (7-stage TDD process)
|
|
39
39
|
- TDD principles
|
|
40
40
|
- Git conventions
|
|
41
41
|
|
|
@@ -65,9 +65,9 @@ E-commerce platform for selling widgets.
|
|
|
65
65
|
- 80% test coverage
|
|
66
66
|
|
|
67
67
|
## Workflow Configuration
|
|
68
|
-
Use the
|
|
69
|
-
1. /
|
|
70
|
-
2. /
|
|
68
|
+
Use the 7-stage TDD workflow:
|
|
69
|
+
1. /plan - Design intent, research, branch + worktree + task list
|
|
70
|
+
2. /dev - Subagent-driven TDD per task
|
|
71
71
|
...
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -163,96 +163,117 @@ bunx forge setup --interview
|
|
|
163
163
|
|
|
164
164
|
Forge adapts its workflow based on the type of work you're doing.
|
|
165
165
|
|
|
166
|
-
###
|
|
166
|
+
### Six Change Classifications
|
|
167
167
|
|
|
168
|
-
#### 1.
|
|
169
|
-
**Use for:**
|
|
168
|
+
#### 1. Critical (7 stages)
|
|
169
|
+
**Use for:** Security, auth, payments, breaking changes
|
|
170
170
|
|
|
171
171
|
```bash
|
|
172
|
-
bunx forge setup --type=
|
|
173
|
-
# Or create branch: feat/user-
|
|
172
|
+
bunx forge setup --type=critical
|
|
173
|
+
# Or create branch: feat/user-authentication
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
**Workflow:**
|
|
177
|
-
- Full 9-stage workflow
|
|
178
|
-
- Auto-escalates to **Critical** if keywords detected:
|
|
179
|
-
- auth, security, payment, crypto, password, token, session, migration, breaking
|
|
180
|
-
|
|
181
|
-
**Critical Workflow (9 stages):**
|
|
182
177
|
```
|
|
183
|
-
/
|
|
178
|
+
/plan -> /dev -> /validate -> /ship -> /review -> /premerge -> /verify
|
|
184
179
|
```
|
|
185
180
|
|
|
186
|
-
|
|
181
|
+
- Full 7-stage workflow with all gates
|
|
182
|
+
- OWASP analysis required
|
|
183
|
+
- Design docs for strategic changes
|
|
184
|
+
|
|
185
|
+
#### 2. Standard (6 stages)
|
|
186
|
+
**Use for:** Normal features, enhancements
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
bunx forge setup --type=standard
|
|
190
|
+
# Or create branch: feat/user-dashboard
|
|
187
191
|
```
|
|
188
|
-
|
|
192
|
+
|
|
193
|
+
**Workflow:**
|
|
194
|
+
```
|
|
195
|
+
/plan -> /dev -> /validate -> /ship -> /review -> /premerge
|
|
189
196
|
```
|
|
190
197
|
|
|
191
|
-
|
|
192
|
-
**
|
|
198
|
+
- Default for most feature work
|
|
199
|
+
- Auto-escalates to **Critical** if keywords detected:
|
|
200
|
+
- auth, security, payment, crypto, password, token, session, migration, breaking
|
|
201
|
+
|
|
202
|
+
#### 3. Simple (3 stages)
|
|
203
|
+
**Use for:** Bug fixes, small changes
|
|
193
204
|
|
|
194
205
|
```bash
|
|
195
|
-
bunx forge setup --type=
|
|
206
|
+
bunx forge setup --type=simple
|
|
196
207
|
# Or create branch: fix/login-validation
|
|
197
208
|
```
|
|
198
209
|
|
|
199
210
|
**Workflow:**
|
|
200
|
-
- Streamlined 5-stage workflow
|
|
201
|
-
- Auto-escalates to **Hotfix** if keywords detected:
|
|
202
|
-
- urgent, production, emergency, hotfix, critical
|
|
203
|
-
|
|
204
|
-
**Hotfix Workflow (3 stages):**
|
|
205
211
|
```
|
|
206
|
-
/dev
|
|
212
|
+
/dev -> /validate -> /ship
|
|
207
213
|
```
|
|
208
214
|
|
|
209
|
-
|
|
215
|
+
- Streamlined for quick fixes
|
|
216
|
+
- TDD to reproduce bug, then fix
|
|
217
|
+
|
|
218
|
+
#### 4. Hotfix (3 stages)
|
|
219
|
+
**Use for:** Production emergencies
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
bunx forge setup --type=hotfix
|
|
223
|
+
# Or create branch: hotfix/payment-crash
|
|
210
224
|
```
|
|
211
|
-
|
|
225
|
+
|
|
226
|
+
**Workflow:**
|
|
227
|
+
```
|
|
228
|
+
/dev -> /validate -> /ship
|
|
212
229
|
```
|
|
213
230
|
|
|
214
|
-
|
|
215
|
-
|
|
231
|
+
- Emergency fast path (immediate merge)
|
|
232
|
+
- Skip planning and research
|
|
233
|
+
- TDD to reproduce, then fix
|
|
234
|
+
|
|
235
|
+
#### 5. Docs (2 stages)
|
|
236
|
+
**Use for:** Documentation only
|
|
216
237
|
|
|
217
238
|
```bash
|
|
218
|
-
bunx forge setup --type=
|
|
219
|
-
# Or create branch:
|
|
239
|
+
bunx forge setup --type=docs
|
|
240
|
+
# Or create branch: docs/update-readme
|
|
220
241
|
```
|
|
221
242
|
|
|
222
|
-
**Workflow
|
|
243
|
+
**Workflow:**
|
|
223
244
|
```
|
|
224
|
-
/
|
|
245
|
+
/verify -> /ship
|
|
225
246
|
```
|
|
226
247
|
|
|
227
|
-
-
|
|
228
|
-
-
|
|
248
|
+
- Minimal workflow for documentation changes
|
|
249
|
+
- No TDD required
|
|
229
250
|
|
|
230
|
-
####
|
|
231
|
-
**Use for:**
|
|
251
|
+
#### 6. Refactor (5 stages)
|
|
252
|
+
**Use for:** Code cleanup, optimization
|
|
232
253
|
|
|
233
254
|
```bash
|
|
234
|
-
bunx forge setup --type=
|
|
235
|
-
# Or create branch:
|
|
255
|
+
bunx forge setup --type=refactor
|
|
256
|
+
# Or create branch: refactor/extract-payment-service
|
|
236
257
|
```
|
|
237
258
|
|
|
238
|
-
**Workflow
|
|
259
|
+
**Workflow:**
|
|
239
260
|
```
|
|
240
|
-
/
|
|
261
|
+
/plan -> /dev -> /validate -> /ship -> /premerge
|
|
241
262
|
```
|
|
242
263
|
|
|
243
|
-
-
|
|
244
|
-
-
|
|
264
|
+
- Strict TDD to preserve behavior
|
|
265
|
+
- Planning phase for architectural changes
|
|
245
266
|
|
|
246
267
|
### Workflow Mapping
|
|
247
268
|
|
|
248
|
-
|
|
|
249
|
-
|
|
250
|
-
|
|
|
251
|
-
|
|
|
252
|
-
|
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
|
269
|
+
| Classification | Use Case | Stages | Workflow |
|
|
270
|
+
|----------------|----------|--------|---------|
|
|
271
|
+
| Critical | Security, auth, payments, breaking changes | 7 | plan, dev, validate, ship, review, premerge, verify |
|
|
272
|
+
| Standard | Normal features, enhancements | 6 | plan, dev, validate, ship, review, premerge |
|
|
273
|
+
| Simple | Bug fixes, small changes | 3 | dev, validate, ship |
|
|
274
|
+
| Hotfix | Production emergencies | 3 | dev, validate, ship (immediate merge) |
|
|
275
|
+
| Docs | Documentation only | 2 | verify, ship |
|
|
276
|
+
| Refactor | Code cleanup, optimization | 5 | plan, dev, validate, ship, premerge |
|
|
256
277
|
|
|
257
278
|
---
|
|
258
279
|
|
|
@@ -282,9 +303,9 @@ bunx forge setup --merge=smart --type=critical --interview
|
|
|
282
303
|
--skip-external Skip external services
|
|
283
304
|
--agents <list> Specify agents (--agents claude cursor)
|
|
284
305
|
--all Install for all agents
|
|
285
|
-
--merge <mode> Merge strategy
|
|
286
|
-
--type <type> Workflow profile
|
|
287
|
-
--interview Context interview
|
|
306
|
+
--merge <mode> Merge strategy
|
|
307
|
+
--type <type> Workflow profile
|
|
308
|
+
--interview Context interview
|
|
288
309
|
--help, -h Show help
|
|
289
310
|
```
|
|
290
311
|
|
|
@@ -332,10 +353,9 @@ git checkout -b feat/user-authentication
|
|
|
332
353
|
|
|
333
354
|
bunx forge setup --type=critical
|
|
334
355
|
|
|
335
|
-
#
|
|
336
|
-
# - 7-stage workflow
|
|
337
|
-
# -
|
|
338
|
-
# - OWASP analysis
|
|
356
|
+
# Uses Critical profile:
|
|
357
|
+
# - Full 7-stage workflow
|
|
358
|
+
# - OWASP analysis required
|
|
339
359
|
# - Design docs for strategic changes
|
|
340
360
|
```
|
|
341
361
|
|
|
@@ -350,7 +370,7 @@ bunx forge setup --type=hotfix
|
|
|
350
370
|
# Uses Hotfix profile:
|
|
351
371
|
# - 3-stage emergency workflow
|
|
352
372
|
# - TDD to reproduce bug
|
|
353
|
-
# - Skip
|
|
373
|
+
# - Skip planning and research
|
|
354
374
|
# - Fast path to production
|
|
355
375
|
```
|
|
356
376
|
|
|
@@ -360,29 +380,21 @@ bunx forge setup --type=hotfix
|
|
|
360
380
|
# Update README
|
|
361
381
|
git checkout -b docs/update-installation-guide
|
|
362
382
|
|
|
363
|
-
|
|
364
|
-
|
|
383
|
+
bunx forge setup --type=docs
|
|
384
|
+
|
|
385
|
+
# Uses Docs profile:
|
|
386
|
+
# - 2-stage minimal workflow
|
|
365
387
|
# - No TDD required
|
|
366
|
-
# - Just verify
|
|
388
|
+
# - Just verify and ship
|
|
367
389
|
```
|
|
368
390
|
|
|
369
391
|
---
|
|
370
392
|
|
|
371
393
|
## Migration Guide
|
|
372
394
|
|
|
373
|
-
### Upgrading
|
|
374
|
-
|
|
375
|
-
**No breaking changes!** Enhanced onboarding is backwards compatible.
|
|
376
|
-
|
|
377
|
-
**What's new:**
|
|
378
|
-
1. Enhanced file merging options
|
|
379
|
-
2. Auto-detection and context storage
|
|
380
|
-
3. Workflow profiles with auto-escalation
|
|
395
|
+
### Upgrading
|
|
381
396
|
|
|
382
|
-
|
|
383
|
-
- Existing marker-based merge (USER:START/END) still works
|
|
384
|
-
- All CLI flags from v1.5.0 remain functional
|
|
385
|
-
- AGENTS.md format unchanged
|
|
397
|
+
Enhanced onboarding is backwards compatible.
|
|
386
398
|
|
|
387
399
|
**Recommended steps:**
|
|
388
400
|
```bash
|
|
@@ -507,7 +519,7 @@ Edit `.forge/context.json` to add custom fields:
|
|
|
507
519
|
Override specific stages:
|
|
508
520
|
|
|
509
521
|
```bash
|
|
510
|
-
#
|
|
522
|
+
# Standard workflow for a feature
|
|
511
523
|
bunx forge setup --type=standard
|
|
512
524
|
|
|
513
525
|
# Then manually edit AGENTS.md to customize workflow
|
|
@@ -552,10 +564,10 @@ When upgrading existing projects:
|
|
|
552
564
|
### 3. Set Workflow Type Per Branch
|
|
553
565
|
|
|
554
566
|
Different branches, different workflows:
|
|
555
|
-
- `feat/auth-*`
|
|
556
|
-
- `feat/ui-*`
|
|
557
|
-
- `fix/*`
|
|
558
|
-
- `docs/*`
|
|
567
|
+
- `feat/auth-*` -> critical
|
|
568
|
+
- `feat/ui-*` -> standard
|
|
569
|
+
- `fix/*` -> simple
|
|
570
|
+
- `docs/*` -> docs
|
|
559
571
|
|
|
560
572
|
### 4. Review Context Regularly
|
|
561
573
|
|
|
@@ -597,6 +609,4 @@ Found an issue or have a suggestion?
|
|
|
597
609
|
|
|
598
610
|
---
|
|
599
611
|
|
|
600
|
-
**
|
|
601
|
-
**Last Updated**: 2026-02-06
|
|
602
|
-
**Stability**: Stable
|
|
612
|
+
**Last Updated**: 2026-03-24
|
package/docs/ROADMAP.md
CHANGED
|
@@ -308,7 +308,7 @@ Each PR follows the Forge workflow:
|
|
|
308
308
|
|
|
309
309
|
### Plan Files
|
|
310
310
|
|
|
311
|
-
- **Master Plan**:
|
|
311
|
+
- **Master Plan**: `docs/plans/*.md` (global, tracked by Claude Code)
|
|
312
312
|
- **Roadmap**: `docs/ROADMAP.md` (repository, git-tracked)
|
|
313
313
|
- **Beads Tracking**: `.beads/issues.jsonl` (git-tracked)
|
|
314
314
|
|
|
@@ -347,7 +347,7 @@ Each PR is self-contained and can be rolled back independently:
|
|
|
347
347
|
|
|
348
348
|
## Resources
|
|
349
349
|
|
|
350
|
-
- **Master Plan**:
|
|
350
|
+
- **Master Plan**: `docs/plans/*.md`
|
|
351
351
|
- **Beads Issues**: `bd list` or `bd show <issue-id>`
|
|
352
352
|
- **Workflow Guide**: [AGENTS.md](../AGENTS.md)
|
|
353
353
|
- **Architecture Docs**: Coming in PR0 - [ARCHITECTURE.md](./ARCHITECTURE.md)
|
package/docs/TOOLCHAIN.md
CHANGED
|
@@ -537,6 +537,29 @@ gh issue create --title "..." --body "..."
|
|
|
537
537
|
|
|
538
538
|
---
|
|
539
539
|
|
|
540
|
+
## Global CLI Tools
|
|
541
|
+
|
|
542
|
+
### Beads (`bd`) — Minimum Version
|
|
543
|
+
|
|
544
|
+
**Minimum version**: v0.49.x
|
|
545
|
+
**Check installed version**:
|
|
546
|
+
```bash
|
|
547
|
+
bd --version
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
**Install / Update**:
|
|
551
|
+
```bash
|
|
552
|
+
# macOS / Linux
|
|
553
|
+
bun add -g @beads/bd
|
|
554
|
+
|
|
555
|
+
# Windows — use PowerShell installer (npm has EPERM bug)
|
|
556
|
+
irm https://raw.githubusercontent.com/steveyegge/beads/main/install.ps1 | iex
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
> **Why v0.49.x?** Earlier versions lack the `bd ready` dependency-aware query, `bd sync --status`, and the dual-database (JSONL + SQLite) architecture that Forge relies on.
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
540
563
|
## Integration with Forge Stages
|
|
541
564
|
|
|
542
565
|
| Stage | Tools Used |
|
package/docs/VALIDATION.md
CHANGED
|
@@ -124,7 +124,7 @@ Validation Results:
|
|
|
124
124
|
|
|
125
125
|
**Checks**:
|
|
126
126
|
- ✓ On feature branch (`feat/*`, `fix/*`, `docs/*`)
|
|
127
|
-
- ✓ Plan file exists (
|
|
127
|
+
- ✓ Plan file exists (`docs/plans/*.md`)
|
|
128
128
|
- ✓ Research file exists (`docs/research/*.md`)
|
|
129
129
|
- ✓ Test directory exists
|
|
130
130
|
|
package/lefthook.yml
CHANGED
|
@@ -26,14 +26,25 @@ pre-push:
|
|
|
26
26
|
branch-protection:
|
|
27
27
|
run: node scripts/branch-protection.js
|
|
28
28
|
tags: protection
|
|
29
|
+
skip:
|
|
30
|
+
- run: node scripts/check-forge-token.js
|
|
29
31
|
|
|
30
32
|
# 2. ESLint check (strict mode: blocks on errors and warnings)
|
|
31
33
|
# Uses Node.js script for cross-platform compatibility
|
|
32
34
|
lint:
|
|
33
35
|
run: node scripts/lint.js
|
|
34
36
|
tags: lint
|
|
37
|
+
skip:
|
|
38
|
+
- run: node scripts/check-forge-token.js
|
|
35
39
|
|
|
36
40
|
# 3. Test suite (cross-platform Node.js script detects package manager)
|
|
37
41
|
tests:
|
|
38
42
|
run: node scripts/test.js
|
|
39
43
|
tags: tests
|
|
44
|
+
skip:
|
|
45
|
+
- run: node scripts/check-forge-token.js
|
|
46
|
+
|
|
47
|
+
# 4. Team sync — push Beads status to GitHub (non-blocking)
|
|
48
|
+
team-sync:
|
|
49
|
+
run: bash scripts/forge-team/lib/hooks.sh sync --quiet || true
|
|
50
|
+
tags: team
|