Skip to content

Commit 1148cc9

Browse files
authored
feat: add non-interactive commands (#11)
## Summary This PR introduces autonomous variants of the plan creation and refinement commands that resolve ambiguities without user interaction. These new commands are designed for scripted workflows, CI/CD pipelines, and batch processing scenarios where manual feedback is not available. ## Key Changes - **New Commands Added**: - `/tasks:create-plan-auto` - Creates comprehensive plans autonomously by inspecting codebase and documentation instead of asking clarifying questions - `/tasks:refine-plan-auto` - Refines existing plans autonomously using the same codebase-inspection approach - **Command Templates**: - Added `templates/assistant/commands/tasks/create-plan-auto.md` with full autonomous planning workflow - Added `templates/assistant/commands/tasks/refine-plan-auto.md` with autonomous refinement workflow - Both templates include detailed instructions for resolving ambiguities through codebase analysis and documenting assumptions - **Documentation Updates**: - Updated `AGENTS.md` with usage guidance for the new `-auto` commands - Added section explaining when to use auto commands (scripted workflows, CI/CD pipelines, batch processing) - Clarified that auto variants skip user feedback loops and resolve gaps autonomously - **Test Coverage**: - Updated integration tests to verify both new command templates are generated for all assistants (Cursor, Claude, Gemini, OpenCode, Codex) - Updated test expectations to account for 9 total command templates (up from 7) - **CLI Output**: - Updated initialization output to display the new prompt files and command templates ## Implementation Details The autonomous commands follow the same planning structure as their interactive counterparts but with critical differences: - They do NOT ask users clarifying questions - They resolve ambiguities by inspecting the codebase, documentation, README files, and assistant configuration - They document all assumptions in the Plan Clarifications table with clear rationale - They maintain the same output format and plan structure for downstream task generation Both commands include a "Process Checklist" and "Autonomous Clarification Algorithm" to systematically identify and resolve gaps without user input.
1 parent 9a20c1f commit 1148cc9

7 files changed

Lines changed: 405 additions & 18 deletions

File tree

AGENTS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,31 @@ Information flows through the workflow via structured output parsing:
203203
# Create plan for manual review before proceeding
204204
/tasks:create-plan "Implement user authentication system"
205205

206+
# Create plan without user interaction (scripted/automated workflows)
207+
/tasks:create-plan-auto "Implement user authentication system"
208+
206209
# Run a plan refinement session before generating tasks
207210
/tasks:refine-plan 51
208211

212+
# Refine plan without user interaction (scripted/automated workflows)
213+
/tasks:refine-plan-auto 51
214+
209215
# Generate tasks after reviewing and adjusting the plan
210216
/tasks:generate-tasks 51
211217

212218
# Execute a pre-approved and reviewed blueprint
213219
/tasks:execute-blueprint 51
214220
```
215221

222+
#### Use Auto (Non-Interactive) Commands When:
223+
224+
- **Scripted or automated workflows**: No user is available to respond to clarification questions
225+
- **CI/CD pipelines**: Plan creation/refinement runs as part of an automated pipeline
226+
- **Batch processing**: Creating or refining multiple plans without manual intervention
227+
- **The assistant should resolve ambiguity autonomously**: By inspecting the codebase, docs, and project context instead of asking the user
228+
229+
The `-auto` variants (`/tasks:create-plan-auto`, `/tasks:refine-plan-auto`) behave identically to their interactive counterparts except they skip the user feedback loop. Instead of asking clarifying questions and waiting for answers, they resolve gaps by inspecting the codebase and documenting assumptions in the Plan Clarifications table.
230+
216231
#### Use Orchestration Commands When:
217232

218233
- **Executing the complete workflow without interruption**: Full automation from idea to implementation
@@ -298,7 +313,9 @@ project/
298313
**Common Command Examples** (adjust prefix per assistant):
299314
```bash
300315
/tasks:create-plan "Add user authentication"
316+
/tasks:create-plan-auto "Add user authentication" # Non-interactive variant
301317
/tasks:refine-plan 51
318+
/tasks:refine-plan-auto 51 # Non-interactive variant
302319
/tasks:generate-tasks 51
303320
/tasks:execute-blueprint 51
304321
/tasks:full-workflow "Implement dark mode"

src/__tests__/cli.integration.test.ts

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ describe('CLI Integration Tests - Consolidated', () => {
7474

7575
const promptFiles = [
7676
'tasks-create-plan.prompt.md',
77+
'tasks-create-plan-auto.prompt.md',
7778
'tasks-refine-plan.prompt.md',
79+
'tasks-refine-plan-auto.prompt.md',
7880
'tasks-generate-tasks.prompt.md',
7981
'tasks-execute-task.prompt.md',
8082
'tasks-execute-blueprint.prompt.md',
@@ -111,7 +113,9 @@ describe('CLI Integration Tests - Consolidated', () => {
111113
if (assistant === 'cursor') {
112114
const templateFiles = [
113115
'create-plan',
116+
'create-plan-auto',
114117
'refine-plan',
118+
'refine-plan-auto',
115119
'generate-tasks',
116120
'execute-task',
117121
'execute-blueprint',
@@ -126,7 +130,7 @@ describe('CLI Integration Tests - Consolidated', () => {
126130
}
127131

128132
const extension = assistant === 'gemini' ? 'toml' : 'md';
129-
const templateFiles = ['create-plan', 'execute-blueprint', 'generate-tasks', 'refine-plan'];
133+
const templateFiles = ['create-plan', 'create-plan-auto', 'execute-blueprint', 'generate-tasks', 'refine-plan', 'refine-plan-auto'];
130134

131135
for (const template of templateFiles) {
132136
const templatePath = path.join(assistantDir, `${template}.${extension}`);
@@ -231,10 +235,12 @@ describe('CLI Integration Tests - Consolidated', () => {
231235
// Verify directory structure
232236
expect(await fs.pathExists(path.join(testDir, '.cursor/commands/tasks'))).toBe(true);
233237

234-
// Verify all 7 command files exist
238+
// Verify all command files exist
235239
const templateFiles = [
236240
'create-plan.md',
241+
'create-plan-auto.md',
237242
'refine-plan.md',
243+
'refine-plan-auto.md',
238244
'generate-tasks.md',
239245
'execute-task.md',
240246
'execute-blueprint.md',
@@ -303,7 +309,7 @@ describe('CLI Integration Tests - Consolidated', () => {
303309
const tomlFiles = files.filter(f => f.endsWith('.toml'));
304310

305311
// Verify all expected commands generated
306-
expect(tomlFiles.length).toBe(7);
312+
expect(tomlFiles.length).toBe(9);
307313
expect(tomlFiles).toContain('create-plan.toml');
308314
expect(tomlFiles).toContain('generate-tasks.toml');
309315
expect(tomlFiles).toContain('execute-blueprint.toml');
@@ -672,7 +678,7 @@ describe('CLI Integration Tests - Consolidated', () => {
672678
expect(opencodeCreatePlan).toBe(claudeCreatePlan);
673679

674680
// Verify all template files for Open Code
675-
const templates = ['create-plan', 'execute-blueprint', 'generate-tasks', 'refine-plan'];
681+
const templates = ['create-plan', 'create-plan-auto', 'execute-blueprint', 'generate-tasks', 'refine-plan', 'refine-plan-auto'];
676682
for (const template of templates) {
677683
const opencodeTemplatePath = path.join(testDir, `.opencode/command/tasks/${template}.md`);
678684
const claudeTemplatePath = path.join(testDir, `.claude/commands/tasks/${template}.md`);
@@ -769,12 +775,14 @@ describe('CLI Integration Tests - Consolidated', () => {
769775
const promptsDir = path.join(testDir, '.codex/prompts');
770776
const expectedFiles = [
771777
'tasks-create-plan.md',
778+
'tasks-create-plan-auto.md',
772779
'tasks-generate-tasks.md',
773780
'tasks-execute-blueprint.md',
774781
'tasks-execute-task.md',
775782
'tasks-fix-broken-tests.md',
776783
'tasks-full-workflow.md',
777784
'tasks-refine-plan.md',
785+
'tasks-refine-plan-auto.md',
778786
];
779787

780788
for (const file of expectedFiles) {
@@ -792,23 +800,25 @@ describe('CLI Integration Tests - Consolidated', () => {
792800
expect(await fs.pathExists(path.join(promptsDir, 'generate-tasks.md'))).toBe(false);
793801
});
794802

795-
it('should copy all 7 command templates', async () => {
803+
it('should copy all 9 command templates', async () => {
796804
const result = executeCommand(`node "${cliPath}" init --assistants codex`);
797805
expect(result.exitCode).toBe(0);
798806

799-
// Verify exactly 7 files exist
807+
// Verify exactly 9 files exist
800808
const promptsDir = path.join(testDir, '.codex/prompts');
801809
const files = await fs.readdir(promptsDir);
802810
const mdFiles = files.filter(f => f.endsWith('.md'));
803811

804-
expect(mdFiles.length).toBe(7);
812+
expect(mdFiles.length).toBe(9);
805813
expect(mdFiles.sort()).toEqual([
814+
'tasks-create-plan-auto.md',
806815
'tasks-create-plan.md',
807816
'tasks-execute-blueprint.md',
808817
'tasks-execute-task.md',
809818
'tasks-fix-broken-tests.md',
810819
'tasks-full-workflow.md',
811820
'tasks-generate-tasks.md',
821+
'tasks-refine-plan-auto.md',
812822
'tasks-refine-plan.md',
813823
]);
814824
});
@@ -871,14 +881,16 @@ describe('CLI Integration Tests - Consolidated', () => {
871881
expect(await fs.pathExists(commandsDir)).toBe(true);
872882
});
873883

874-
it('should create all 7 command files with correct names', async () => {
884+
it('should create all 9 command files with correct names', async () => {
875885
const result = executeCommand(`node "${cliPath}" init --assistants cursor`);
876886
expect(result.exitCode).toBe(0);
877887

878888
const commandsDir = path.join(testDir, '.cursor/commands/tasks');
879889
const expectedFiles = [
880890
'create-plan.md',
891+
'create-plan-auto.md',
881892
'refine-plan.md',
893+
'refine-plan-auto.md',
882894
'generate-tasks.md',
883895
'execute-task.md',
884896
'execute-blueprint.md',
@@ -958,7 +970,9 @@ describe('CLI Integration Tests - Consolidated', () => {
958970
// Verify all template files match
959971
const templates = [
960972
'create-plan',
973+
'create-plan-auto',
961974
'refine-plan',
975+
'refine-plan-auto',
962976
'generate-tasks',
963977
'execute-task',
964978
'execute-blueprint',
@@ -1026,7 +1040,9 @@ describe('CLI Integration Tests - Consolidated', () => {
10261040
const promptsDir = path.join(testDir, '.github/prompts');
10271041
const expectedFiles = [
10281042
'tasks-create-plan.prompt.md',
1043+
'tasks-create-plan-auto.prompt.md',
10291044
'tasks-refine-plan.prompt.md',
1045+
'tasks-refine-plan-auto.prompt.md',
10301046
'tasks-generate-tasks.prompt.md',
10311047
'tasks-execute-task.prompt.md',
10321048
'tasks-execute-blueprint.prompt.md',

src/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,15 @@ export async function init(options: InitOptions): Promise<CommandResult> {
132132
console.log(
133133
` ${chalk.blue('●')} ${resolvePath(baseDir, '.github/prompts/tasks-create-plan.prompt.md')}`
134134
);
135+
console.log(
136+
` ${chalk.blue('●')} ${resolvePath(baseDir, '.github/prompts/tasks-create-plan-auto.prompt.md')}`
137+
);
135138
console.log(
136139
` ${chalk.blue('●')} ${resolvePath(baseDir, '.github/prompts/tasks-refine-plan.prompt.md')}`
137140
);
141+
console.log(
142+
` ${chalk.blue('●')} ${resolvePath(baseDir, '.github/prompts/tasks-refine-plan-auto.prompt.md')}`
143+
);
138144
console.log(
139145
` ${chalk.blue('●')} ${resolvePath(baseDir, '.github/prompts/tasks-generate-tasks.prompt.md')}`
140146
);
@@ -161,6 +167,9 @@ export async function init(options: InitOptions): Promise<CommandResult> {
161167
console.log(
162168
` ${chalk.blue('●')} ${resolvePath(baseDir, '.codex/prompts/tasks-create-plan.md')}`
163169
);
170+
console.log(
171+
` ${chalk.blue('●')} ${resolvePath(baseDir, '.codex/prompts/tasks-create-plan-auto.md')}`
172+
);
164173
console.log(
165174
` ${chalk.blue('●')} ${resolvePath(baseDir, '.codex/prompts/tasks-execute-blueprint.md')}`
166175
);
@@ -170,6 +179,9 @@ export async function init(options: InitOptions): Promise<CommandResult> {
170179
console.log(
171180
` ${chalk.blue('●')} ${resolvePath(baseDir, '.codex/prompts/tasks-full-workflow.md')}`
172181
);
182+
console.log(
183+
` ${chalk.blue('●')} ${resolvePath(baseDir, '.codex/prompts/tasks-refine-plan-auto.md')}`
184+
);
173185
continue;
174186
}
175187

@@ -407,7 +419,9 @@ async function createAssistantStructure(assistant: Assistant, baseDir: string):
407419
// Copy and process all template files
408420
const templateFiles = [
409421
'create-plan.md',
422+
'create-plan-auto.md',
410423
'refine-plan.md',
424+
'refine-plan-auto.md',
411425
'generate-tasks.md',
412426
'execute-task.md',
413427
'execute-blueprint.md',
@@ -442,12 +456,14 @@ async function createAssistantStructure(assistant: Assistant, baseDir: string):
442456
// Copy and rename templates
443457
const templateFiles = [
444458
'create-plan.md',
459+
'create-plan-auto.md',
445460
'generate-tasks.md',
446461
'execute-blueprint.md',
447462
'execute-task.md',
448463
'fix-broken-tests.md',
449464
'full-workflow.md',
450465
'refine-plan.md',
466+
'refine-plan-auto.md',
451467
];
452468

453469
const templateFormat = getTemplateFormat(assistant);

0 commit comments

Comments
 (0)