fix: add text_mode support to plan-phase workflow
`workflow.text_mode: true` (or `--text` flag) now applies to plan-phase, not just discuss-phase. Fixes #1313. Changes: - `init plan-phase` now exposes `text_mode` from config in its JSON output - plan-phase workflow parses `--text` flag and resolves TEXT_MODE from init JSON or flag, whichever is set - All four AskUserQuestion call sites (no-context gate, research prompt, UI design contract gate, requirements coverage gap) now conditionally present as plain-text numbered lists when TEXT_MODE is active - `--text` added to plan-phase command argument-hint and flags docs - Tests added for init output and workflow references Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,31 @@ describe('workflow.discuss_mode config', () => {
|
||||
assert.ok(workflow.includes('--text'), 'should handle --text flag');
|
||||
});
|
||||
|
||||
test('plan-phase workflow references text_mode', () => {
|
||||
const planPhase = fs.readFileSync(
|
||||
path.join(__dirname, '..', 'get-shit-done', 'workflows', 'plan-phase.md'), 'utf8'
|
||||
);
|
||||
assert.ok(planPhase.includes('text_mode'), 'plan-phase workflow should reference text_mode');
|
||||
assert.ok(planPhase.includes('TEXT_MODE'), 'plan-phase workflow should use TEXT_MODE variable');
|
||||
assert.ok(planPhase.includes('--text'), 'plan-phase workflow should handle --text flag');
|
||||
});
|
||||
|
||||
test('plan-phase command argument-hint includes --text', () => {
|
||||
const command = fs.readFileSync(
|
||||
path.join(__dirname, '..', 'commands', 'gsd', 'plan-phase.md'), 'utf8'
|
||||
);
|
||||
assert.ok(command.includes('--text'), 'argument-hint should include --text flag');
|
||||
});
|
||||
|
||||
test('plan-phase init exposes text_mode in workflow flags', () => {
|
||||
const initSrc = fs.readFileSync(
|
||||
path.join(__dirname, '..', 'get-shit-done', 'bin', 'lib', 'init.cjs'), 'utf8'
|
||||
);
|
||||
// The cmdInitPlanPhase result object must include text_mode
|
||||
const planPhaseBlock = initSrc.slice(initSrc.indexOf('function cmdInitPlanPhase'));
|
||||
assert.ok(planPhaseBlock.includes('text_mode: config.text_mode'), 'init plan-phase must expose text_mode');
|
||||
});
|
||||
|
||||
test('progress workflow references discuss_mode', () => {
|
||||
const progress = fs.readFileSync(
|
||||
path.join(__dirname, '..', 'get-shit-done', 'workflows', 'progress.md'), 'utf8'
|
||||
|
||||
@@ -54,6 +54,25 @@ describe('init commands', () => {
|
||||
assert.strictEqual(output.uat_path, '.planning/phases/03-api/03-UAT.md');
|
||||
});
|
||||
|
||||
test('init plan-phase exposes text_mode from config (defaults false)', () => {
|
||||
const result = runGsdTools('init plan-phase 03', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.text_mode, false, 'text_mode should default to false');
|
||||
});
|
||||
|
||||
test('init plan-phase exposes text_mode true when set in config', () => {
|
||||
const configPath = path.join(tmpDir, '.planning', 'config.json');
|
||||
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
||||
config.workflow = { ...(config.workflow || {}), text_mode: true };
|
||||
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
||||
|
||||
const result = runGsdTools('init plan-phase 03', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
const output = JSON.parse(result.output);
|
||||
assert.strictEqual(output.text_mode, true, 'text_mode should reflect config value');
|
||||
});
|
||||
|
||||
test('init progress returns file paths', () => {
|
||||
const result = runGsdTools('init progress', tmpDir);
|
||||
assert.ok(result.success, `Command failed: ${result.error}`);
|
||||
|
||||
Reference in New Issue
Block a user