@context-forge/cli 0.3.3 → 0.3.6

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.
Files changed (45) hide show
  1. package/README.md +56 -0
  2. package/commands/cf/build.md +1 -1
  3. package/commands/cf/get.md +1 -1
  4. package/commands/cf/next.md +1 -1
  5. package/commands/cf/project.md +1 -1
  6. package/commands/cf/prompt.md +4 -2
  7. package/commands/cf/set.md +1 -1
  8. package/commands/cf/status.md +1 -1
  9. package/dist/commands/arch.d.ts +3 -0
  10. package/dist/commands/arch.d.ts.map +1 -0
  11. package/dist/commands/arch.js +81 -0
  12. package/dist/commands/arch.js.map +1 -0
  13. package/dist/commands/build.js +1 -1
  14. package/dist/commands/build.js.map +1 -1
  15. package/dist/commands/check.d.ts.map +1 -1
  16. package/dist/commands/check.js +89 -4
  17. package/dist/commands/check.js.map +1 -1
  18. package/dist/commands/future.js +1 -1
  19. package/dist/commands/future.js.map +1 -1
  20. package/dist/commands/next.d.ts.map +1 -1
  21. package/dist/commands/next.js +13 -50
  22. package/dist/commands/next.js.map +1 -1
  23. package/dist/commands/plan.d.ts +3 -0
  24. package/dist/commands/plan.d.ts.map +1 -0
  25. package/dist/commands/plan.js +81 -0
  26. package/dist/commands/plan.js.map +1 -0
  27. package/dist/commands/project.d.ts.map +1 -1
  28. package/dist/commands/project.js +55 -6
  29. package/dist/commands/project.js.map +1 -1
  30. package/dist/commands/prompt.js +2 -2
  31. package/dist/commands/prompt.js.map +1 -1
  32. package/dist/commands/slice.d.ts +3 -0
  33. package/dist/commands/slice.d.ts.map +1 -0
  34. package/dist/commands/slice.js +99 -0
  35. package/dist/commands/slice.js.map +1 -0
  36. package/dist/commands/status.d.ts.map +1 -1
  37. package/dist/commands/status.js +23 -41
  38. package/dist/commands/status.js.map +1 -1
  39. package/dist/commands/task.d.ts +3 -0
  40. package/dist/commands/task.d.ts.map +1 -0
  41. package/dist/commands/task.js +160 -0
  42. package/dist/commands/task.js.map +1 -0
  43. package/dist/index.js +8 -0
  44. package/dist/index.js.map +1 -1
  45. package/package.json +2 -2
package/README.md CHANGED
@@ -49,6 +49,14 @@ cf set slice 175
49
49
  # Confirm updates (if you like)
50
50
  cf status
51
51
 
52
+ # Browse project artifacts
53
+ cf arch list # Architecture initiatives
54
+ cf slice list # Slices in the active plan
55
+ cf task list # Task files with progress
56
+
57
+ # What should I do next?
58
+ cf next
59
+
52
60
  # Detailed information
53
61
  cf project get
54
62
 
@@ -85,6 +93,11 @@ Each command runs `cf` under the hood — same CWD-based project resolution, sam
85
93
  | `cf build` | `cf build [--project <id>] [--phase] [--slice] [--instruction] [--tasks] [--additional]` | Generate context prompt to stdout |
86
94
  | `cf set` | `cf set <field> <value>` | Set a project field (shortcut for `cf project set`) |
87
95
  | `cf get` | `cf get [--json]` | Show all project fields (shortcut for `cf project get`) |
96
+ | `cf arch` | `cf arch list [--json]` | List architecture initiatives with progress |
97
+ | `cf plan` | `cf plan list [--json]` | List slice plan files with progress |
98
+ | `cf slice` | `cf slice list [--json]` | List slices from the active plan with status |
99
+ | `cf task` | `cf task list [--json]` | List task files from the plan with progress |
100
+ | `cf task items` | `cf task items [--json]` | Show individual tasks from the active task file |
88
101
  | `cf config` | `cf config list\|get\|set` | Manage configuration |
89
102
  | `cf project` | `cf project list\|get\|set\|rm` | Manage projects |
90
103
  | `cf future` | `cf future [--project <id>] [--status <filter>] [--json]` | Show consolidated future work |
@@ -134,6 +147,41 @@ cf set phase 6
134
147
 
135
148
  Setting `instruction` directly does not change `developmentPhase`.
136
149
 
150
+ ## Smart Index Resolution
151
+
152
+ Setting artifact fields by numeric index resolves to the matching file on disk:
153
+
154
+ ```bash
155
+ cf set slice 175
156
+ # Updated slice = 175-slice.context-output-consolidation on project my-project
157
+ # Updated tasks = 175-tasks.context-output-consolidation (auto-set from slice)
158
+ ```
159
+
160
+ When no file exists yet, the CLI derives the stem from the slice plan entry:
161
+
162
+ ```bash
163
+ cf set slice 166
164
+ # (no 166-slice.*.md on disk — derives from plan entry "Consistency Checker")
165
+ # Updated slice = 166-slice.consistency-checker on project my-project
166
+ # Updated tasks = 166-tasks.consistency-checker (auto-set from slice)
167
+ ```
168
+
169
+ Setting `fileSlice` always auto-sets `fileTasks` to match.
170
+
171
+ ## Discovery Commands
172
+
173
+ Browse project artifacts at every level:
174
+
175
+ ```bash
176
+ cf arch list # Architecture initiatives with slice counts
177
+ cf plan list # Slice plan files with completion progress
178
+ cf slice list # Slices from the active plan with status markers
179
+ cf task list # Task files from the plan with completion counts
180
+ cf task items # Individual task items from the active task file
181
+ ```
182
+
183
+ All accept `--json` and `--project <name|id>`.
184
+
137
185
  ## Architecture
138
186
 
139
187
  The CLI wraps `@context-forge/core` directly (no MCP layer), following the same pattern as the Electron package. All core services are imported from `@context-forge/core/node`.
@@ -149,6 +197,14 @@ pnpm --filter @context-forge/cli typecheck # Type check
149
197
 
150
198
  ## Changelog
151
199
 
200
+ ### v0.4.0
201
+
202
+ - **Discovery commands** — `cf arch list`, `cf plan list`, `cf slice list`, `cf task list`, `cf task items` for browsing project artifacts at every level
203
+ - **Smart index resolution** — `cf set slice 166` derives the filename from the slice plan when no file exists on disk
204
+ - **Auto-set fileTasks** — setting `fileSlice` always auto-sets `fileTasks`, even when the task file doesn't exist yet
205
+ - **Enhanced `cf status`** — now shows Date, Arch, and Plan fields
206
+ - **Workflow navigation** — `cf status` and `cf next` powered by `WorkflowNavigator` with slice status derivation and priority-ordered next-action recommendations
207
+
152
208
  ### v0.3.0
153
209
 
154
210
  - **Template variable completion** — artifact fields (`fileArch`, `fileSlicePlan`, `fileHLD`, `fileSpec`) and aliases (`arch`, `plan`, `hld`, `spec`) available in prompt templates, with index extraction (`archIndex`, `planIndex`)
@@ -4,6 +4,6 @@ argument-hint: [--phase <phase>] [--slice <slice>]
4
4
  allowed-tools: Bash(cf:*)
5
5
  ---
6
6
 
7
- Present the following context prompt exactly as shown, with no additional commentary or interpretation:
7
+ Use the following as your working context and immediately begin the work it describes. Confirm receipt with a one-line summary: "Context loaded: {project} | {phase} | {slice}" — then proceed.
8
8
 
9
9
  !`cf build $ARGUMENTS`
@@ -3,6 +3,6 @@ description: Show all fields for the active Context Forge project
3
3
  allowed-tools: Bash(cf:*)
4
4
  ---
5
5
 
6
- Present the following project details exactly as shown, with no additional commentary or interpretation:
6
+ Display this output without commentary:
7
7
 
8
8
  !`cf get`
@@ -3,6 +3,6 @@ description: Show recommended next action for the current Context Forge project
3
3
  allowed-tools: Bash(cf:*)
4
4
  ---
5
5
 
6
- Present the following recommendation exactly as shown, with no additional commentary or interpretation:
6
+ Display this output without commentary:
7
7
 
8
8
  !`cf next`
@@ -4,6 +4,6 @@ argument-hint: [list | get | set <field> <value> | rm | --schema]
4
4
  allowed-tools: Bash(cf:*)
5
5
  ---
6
6
 
7
- Present the following output exactly as shown, with no additional commentary or interpretation:
7
+ Display this output without commentary:
8
8
 
9
9
  !`cf project $ARGUMENTS`
@@ -4,6 +4,8 @@ argument-hint: [phase-name | list]
4
4
  allowed-tools: Bash(cf:*)
5
5
  ---
6
6
 
7
- Present the following output exactly as shown, with no additional commentary or interpretation:
7
+ If the result is a prompt template (from `cf prompt get`), use it as your working context and immediately begin the work it describes. Confirm receipt with a one-line summary: "Received prompt: {phase name}" — then proceed.
8
8
 
9
- !`cf prompt get $ARGUMENTS 2>/dev/null || cf prompt list`
9
+ If the result is a list of available prompts (from `cf prompt list`), present it to the user without commentary.
10
+
11
+ !`ARGS="$ARGUMENTS"; ARGS="${ARGS#get }"; if [ -z "$ARGS" ] || [ "$ARGS" = "list" ]; then cf prompt list; else cf prompt get "$ARGS"; fi`
@@ -4,6 +4,6 @@ argument-hint: <field> <value>
4
4
  allowed-tools: Bash(cf:*)
5
5
  ---
6
6
 
7
- Present the following output exactly as shown, with no additional commentary or interpretation:
7
+ Display this output without commentary:
8
8
 
9
9
  !`cf set $ARGUMENTS`
@@ -3,6 +3,6 @@ description: Show Context Forge project status (phase, slice, task progress)
3
3
  allowed-tools: Bash(cf:*)
4
4
  ---
5
5
 
6
- Present the following project status exactly as shown, with no additional commentary or interpretation:
6
+ Display this output without commentary:
7
7
 
8
8
  !`cf status`
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerArchCommand(program: Command): void;
3
+ //# sourceMappingURL=arch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arch.d.ts","sourceRoot":"","sources":["../../src/commands/arch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiG1D"}
@@ -0,0 +1,81 @@
1
+ import { FileProjectStore, buildModel } from '@context-forge/core/node';
2
+ import { extractSliceIndex } from '@context-forge/core/node';
3
+ import { resolveProjectId } from '../utils/project.js';
4
+ import { handleError, UserError } from '../utils/errors.js';
5
+ import { printJson } from '../output/formatter.js';
6
+ import { renderTable } from '../output/tables.js';
7
+ import { label, success, dim } from '../output/styles.js';
8
+ export function registerArchCommand(program) {
9
+ const cmd = program
10
+ .command('arch')
11
+ .description('Manage architecture');
12
+ cmd
13
+ .command('list')
14
+ .description('List architecture initiatives from the project')
15
+ .option('--json', 'Output as JSON')
16
+ .option('--project <name|id>', 'Project name or ID (overrides default)')
17
+ .action(async (opts) => {
18
+ try {
19
+ const store = new FileProjectStore();
20
+ const { id } = await resolveProjectId(opts.project, store);
21
+ const project = await store.getById(id);
22
+ if (!project) {
23
+ throw new UserError(`Project not found: '${id}'.`);
24
+ }
25
+ if (!project.projectPath) {
26
+ throw new UserError('No projectPath configured. Set one with: cf set projectPath /path/to/project');
27
+ }
28
+ const model = await buildModel(project.projectPath);
29
+ const initiativeKeys = Object.keys(model.initiatives).sort((a, b) => parseInt(a, 10) - parseInt(b, 10));
30
+ if (initiativeKeys.length === 0) {
31
+ console.log(dim('No initiatives found in project.'));
32
+ return;
33
+ }
34
+ const activeIndex = extractSliceIndex(project.fileSlice);
35
+ const entries = initiativeKeys.map((key) => {
36
+ const init = model.initiatives[key];
37
+ const baseIndex = parseInt(key, 10);
38
+ const archName = init.arch?.name ?? '—';
39
+ const planName = init.slicePlan?.name ?? '—';
40
+ const completedSlices = init.slices.filter((s) => s.status === 'complete').length;
41
+ const totalSlices = init.slices.length;
42
+ const progress = totalSlices > 0
43
+ ? `${completedSlices}/${totalSlices}`
44
+ : '—';
45
+ // Determine if this initiative contains the active slice
46
+ const isActive = activeIndex !== null && init.slices.some((s) => parseInt(s.index, 10) === activeIndex);
47
+ return {
48
+ index: key,
49
+ baseIndex,
50
+ name: init.name,
51
+ archDoc: archName,
52
+ slicePlan: planName,
53
+ progress,
54
+ completedSlices,
55
+ totalSlices,
56
+ isActive,
57
+ };
58
+ });
59
+ if (opts.json) {
60
+ printJson(entries);
61
+ return;
62
+ }
63
+ console.log(label('\nArchitecture Initiatives'));
64
+ const rows = entries.map((e) => {
65
+ const indicator = e.isActive ? success(' ← active') : '';
66
+ return [
67
+ e.index,
68
+ e.name,
69
+ dim(e.archDoc),
70
+ dim(e.slicePlan),
71
+ e.progress + indicator,
72
+ ];
73
+ });
74
+ console.log(renderTable(['Index', 'Initiative', 'Arch Doc', 'Slice Plan', 'Progress'], rows));
75
+ }
76
+ catch (err) {
77
+ handleError(err);
78
+ }
79
+ });
80
+ }
81
+ //# sourceMappingURL=arch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arch.js","sourceRoot":"","sources":["../../src/commands/arch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,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AS,EAAE,QAAQ;oBACnB,QAAQ;oBACR,eAAe;oBACf,WAAW;oBACX,QAAQ;iBACT,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,SAAS,CAAC,OAAO,CAAC,CAAC;gBACnB,OAAO;YACT,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;YAEjD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC7B,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzD,OAAO;oBACL,CAAC,CAAC,KAAK;oBACP,CAAC,CAAC,IAAI;oBACN,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;oBACd,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;oBAChB,CAAC,CAAC,QAAQ,GAAG,SAAS;iBACvB,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,WAAW,CACrB,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,EAC7D,IAAI,CACL,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -7,7 +7,7 @@ export function registerBuildCommand(program) {
7
7
  program
8
8
  .command('build')
9
9
  .description('Generate and output a context prompt to stdout (--json not applicable)')
10
- .option('--project <id>', 'Project ID (overrides default)')
10
+ .option('--project <id>', 'Project ID or name (overrides default)')
11
11
  .option('--phase <phase>', 'Override development phase')
12
12
  .option('--slice <slice>', 'Override slice name')
13
13
  .option('--instruction <instruction>', 'Override instruction type')
@@ -1 +1 @@
1
- {"version":3,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,aAAa,GAAG,GAAG,aAAa,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;YAC3D,CAAC;YAED,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC1B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAU3D"}
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6CpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2E3D"}
@@ -1,13 +1,98 @@
1
- import { dim } from '../output/styles.js';
1
+ import { FileProjectStore, ArtifactIntrospector, ConsistencyChecker, ConfigManager, } from '@context-forge/core/node';
2
+ import { resolveProjectId } from '../utils/project.js';
3
+ import { handleError, UserError } from '../utils/errors.js';
4
+ import { printJson } from '../output/formatter.js';
5
+ import { label, dim, error as errorStyle, warn as warnStyle } from '../output/styles.js';
6
+ const SEVERITY_ICON = {
7
+ error: '✗',
8
+ warning: '⚠',
9
+ info: 'ℹ',
10
+ };
11
+ function isFixResult(result) {
12
+ return 'fixLog' in result;
13
+ }
14
+ function formatFinding(finding, fixResult) {
15
+ const icon = SEVERITY_ICON[finding.severity] ?? '?';
16
+ const colorFn = finding.severity === 'error' ? errorStyle : finding.severity === 'warning' ? warnStyle : dim;
17
+ const lines = [];
18
+ lines.push(colorFn(` ${icon} ${finding.description}`));
19
+ if (fixResult && finding.fixable) {
20
+ const logEntry = fixResult.fixLog.find((e) => e.rule === finding.rule);
21
+ if (logEntry) {
22
+ lines.push(dim(` → Fixed: ${logEntry.before} → ${logEntry.after} in ${logEntry.filePath}`));
23
+ }
24
+ }
25
+ else {
26
+ lines.push(dim(` → ${finding.suggestedFix}`));
27
+ }
28
+ return lines.join('\n');
29
+ }
2
30
  export function registerCheckCommand(program) {
3
31
  program
4
32
  .command('check')
5
33
  .description('Run consistency checks on project artifacts')
6
34
  .option('--json', 'Output as JSON')
7
- .option('--project <id>', 'Project ID (overrides default)')
35
+ .option('--project <id>', 'Project ID or name (overrides default)')
8
36
  .option('--fix', 'Apply non-destructive corrections (when available)')
9
- .action(async () => {
10
- console.log(dim('cf check: Consistency checker not yet available. Depends on slice 166.'));
37
+ .action(async (opts) => {
38
+ try {
39
+ const store = new FileProjectStore();
40
+ const { id } = await resolveProjectId(opts.project, store);
41
+ const project = await store.getById(id);
42
+ if (!project) {
43
+ throw new UserError(`Project not found: '${id}'. Run cf project list to see available projects.`);
44
+ }
45
+ const introspector = new ArtifactIntrospector();
46
+ const checker = new ConsistencyChecker(introspector);
47
+ // Determine fix mode: explicit flag > config key > false
48
+ let fixMode = opts.fix ?? false;
49
+ if (!fixMode) {
50
+ try {
51
+ const cm = new ConfigManager(project.projectPath);
52
+ const autoFixResult = await cm.get('workflow.auto_fix');
53
+ if (autoFixResult.value === true) {
54
+ fixMode = true;
55
+ }
56
+ }
57
+ catch {
58
+ // Config read failed — default to check-only
59
+ }
60
+ }
61
+ const result = fixMode
62
+ ? await checker.fix(project)
63
+ : await checker.check(project);
64
+ if (opts.json) {
65
+ printJson(result);
66
+ return;
67
+ }
68
+ // Terminal output
69
+ const modeLabel = fixMode ? ' (fix mode)' : '';
70
+ console.log(label(`Consistency Check: ${project.name}${modeLabel}`));
71
+ console.log('');
72
+ if (result.totalFindings === 0) {
73
+ console.log(' No inconsistencies found');
74
+ return;
75
+ }
76
+ const fixRes = isFixResult(result) ? result : undefined;
77
+ for (const finding of result.findings) {
78
+ console.log(formatFinding(finding, fixRes));
79
+ }
80
+ console.log('');
81
+ if (fixRes) {
82
+ console.log(label(`Fixed ${fixRes.fixed} of ${result.totalFindings} findings`));
83
+ if (fixRes.fixErrors.length > 0) {
84
+ for (const err of fixRes.fixErrors) {
85
+ console.log(errorStyle(` Fix error: ${err}`));
86
+ }
87
+ }
88
+ }
89
+ else {
90
+ console.log(dim(result.summary));
91
+ }
92
+ }
93
+ catch (err) {
94
+ handleError(err);
95
+ }
11
96
  });
12
97
  }
13
98
  //# sourceMappingURL=check.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAE1C,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,6CAA6C,CAAC;SAC1D,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,gBAAgB,EAAE,gCAAgC,CAAC;SAC1D,MAAM,CAAC,OAAO,EAAE,oDAAoD,CAAC;SACrE,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACP,CAAC"}
1
+ {"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,IAAI,UAAU,EAAE,IA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BACnC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC,CAAC;oBACjD,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -8,7 +8,7 @@ export function registerFutureCommand(program) {
8
8
  .command('future')
9
9
  .description('Show consolidated future work across slice plans')
10
10
  .option('--json', 'Output as JSON')
11
- .option('--project <id>', 'Project ID (overrides default)')
11
+ .option('--project <id>', 'Project ID or name (overrides default)')
12
12
  .option('--status <filter>', 'Filter by status: all, pending, completed', 'all')
13
13
  .action(async (opts) => {
14
14
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"future.js","sourceRoot":"","sources":["../../src/commands/future.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE/E,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,gBAAgB,EAAE,gCAAgC,CAAC;SAC1D,MAAM,CAAC,mBAA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I,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC1C,CAAC;gBACD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,UAAU,WAAW,CAAC,CAAC,CAAC;YAC7E,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CACT,UAAU,CAAC,UAAU,MAAM,CAAC,UAAU,WAAW,MAAM,CAAC,YAAY,UAAU,CAAC,CAChF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/commands/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiDpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyC1D"}
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/commands/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuC1D"}
@@ -1,49 +1,14 @@
1
- import { FileProjectStore, ArtifactIntrospector } from '@context-forge/core/node';
1
+ import { FileProjectStore, WorkflowNavigator } from '@context-forge/core/node';
2
2
  import { resolveProjectId } from '../utils/project.js';
3
3
  import { handleError, UserError } from '../utils/errors.js';
4
4
  import { printJson } from '../output/formatter.js';
5
5
  import { label, value as valueStyle, dim } from '../output/styles.js';
6
- /**
7
- * Derive a basic "next action" recommendation from project data and introspection.
8
- *
9
- * NOTE: This is a provisional implementation. Full workflow navigation
10
- * (WorkflowNavigator.getNext()) depends on slice 165, which is not yet complete.
11
- * This version uses ArtifactIntrospector to provide basic guidance.
12
- */
13
- function deriveRecommendation(project, introspection) {
14
- const phase = project.developmentPhase ?? 'Not set';
15
- const slice = project.fileSlice;
16
- if (introspection?.currentTasks) {
17
- const { completedTasks, totalTasks, inferredStatus } = introspection.currentTasks;
18
- if (inferredStatus === 'complete') {
19
- return {
20
- recommendation: 'Advance to next phase or slice',
21
- slice,
22
- phase,
23
- rationale: `All ${totalTasks} tasks complete in current task file.`,
24
- };
25
- }
26
- const remaining = totalTasks - completedTasks;
27
- return {
28
- recommendation: 'Continue current tasks',
29
- slice,
30
- phase,
31
- rationale: `${remaining} of ${totalTasks} tasks remaining in ${project.fileTasks}.`,
32
- };
33
- }
34
- return {
35
- recommendation: 'Review project configuration',
36
- slice,
37
- phase,
38
- rationale: 'No task file data available. Verify fileTasks and projectPath are set.',
39
- };
40
- }
41
6
  export function registerNextCommand(program) {
42
7
  program
43
8
  .command('next')
44
9
  .description('Show recommended next action for the active project')
45
10
  .option('--json', 'Output as JSON')
46
- .option('--project <id>', 'Project ID (overrides default)')
11
+ .option('--project <id>', 'Project ID or name (overrides default)')
47
12
  .action(async (opts) => {
48
13
  try {
49
14
  const store = new FileProjectStore();
@@ -52,25 +17,23 @@ export function registerNextCommand(program) {
52
17
  if (!project) {
53
18
  throw new UserError(`Project not found: '${id}'. Run cf project list to see available projects.`);
54
19
  }
55
- let introspection;
56
- if (project.projectPath) {
57
- try {
58
- const introspector = new ArtifactIntrospector();
59
- introspection = await introspector.summarize(project);
60
- }
61
- catch {
62
- // Graceful degradation
63
- }
64
- }
65
- const result = deriveRecommendation(project, introspection);
20
+ const nav = new WorkflowNavigator();
21
+ const result = await nav.getNext(project);
66
22
  if (opts.json) {
67
23
  printJson(result);
68
24
  return;
69
25
  }
70
26
  console.log(label('Next: ') + valueStyle(result.recommendation));
71
- console.log(label('Slice: ') + valueStyle(result.slice));
72
- console.log(label('Phase: ') + valueStyle(result.phase));
27
+ if (result.slice) {
28
+ console.log(label('Slice: ') + valueStyle(result.slice));
29
+ }
30
+ if (result.phase) {
31
+ console.log(label('Phase: ') + valueStyle(result.phase));
32
+ }
73
33
  console.log(label('Rationale: ') + dim(result.rationale));
34
+ if (result.suggestedCommand) {
35
+ console.log(label('Run: ') + valueStyle(result.suggestedCommand));
36
+ }
74
37
  }
75
38
  catch (err) {
76
39
  handleError(err);
@@ -1 +1 @@
1
- {"version":3,"file":"next.js","sourceRoot":"","sources":["../../src/commands/next.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,UAAU,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAEtE;;;;;;GAMG;AACH,SAAS,oBAAoB,CAC3B,OAA4E,EAC5E,aAAoC;IAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,gBAAgB,IAAI,SAAS,CAAC;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC;IAEhC,IAAI,aAAa,EAAE,YAAY,EAAE,CAAC;QAChC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,YAAY,CAAC;QAClF,IAAI,cAAc,KAAK,UAAU,EAAE,CAAC;YAClC,OAAO;gBACL,cAAc,EAAE,gCAAgC;gBAChD,KAAK;gBACL,KAAK;gBACL,SAAS,EAAE,OAAO,UAAU,uCAAuC;aACpE,CAAC;QACJ,CAAC;QACD,MAAM,SAAS,GAAG,UAAU,GAAG,cAAc,CAAC;QAC9C,OAAO;YACL,cAAc,EAAE,wBAAwB;YACxC,KAAK;YACL,KAAK;YACL,SAAS,EAAE,GAAG,SAAS,OAAO,U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,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function registerPlanCommand(program: Command): void;
3
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/commands/plan.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsF1D"}
@@ -0,0 +1,81 @@
1
+ import { join } from 'node:path';
2
+ import { readdir } from 'node:fs/promises';
3
+ import { FileProjectStore, parseSlicePlan, } from '@context-forge/core/node';
4
+ import { resolveProjectId } from '../utils/project.js';
5
+ import { handleError, UserError } from '../utils/errors.js';
6
+ import { printJson } from '../output/formatter.js';
7
+ import { renderTable } from '../output/tables.js';
8
+ import { label, success, dim } from '../output/styles.js';
9
+ export function registerPlanCommand(program) {
10
+ const cmd = program
11
+ .command('plan')
12
+ .description('Manage slice plans');
13
+ cmd
14
+ .command('list')
15
+ .description('List slice plan files from the architecture directory')
16
+ .option('--json', 'Output as JSON')
17
+ .option('--project <name|id>', 'Project name or ID (overrides default)')
18
+ .action(async (opts) => {
19
+ try {
20
+ const store = new FileProjectStore();
21
+ const { id } = await resolveProjectId(opts.project, store);
22
+ const project = await store.getById(id);
23
+ if (!project) {
24
+ throw new UserError(`Project not found: '${id}'.`);
25
+ }
26
+ if (!project.projectPath) {
27
+ throw new UserError('No projectPath configured. Set one with: cf set projectPath /path/to/project');
28
+ }
29
+ const archDir = join(project.projectPath, 'project-documents/user/architecture');
30
+ let files;
31
+ try {
32
+ files = await readdir(archDir);
33
+ }
34
+ catch {
35
+ throw new UserError('Architecture directory not found: project-documents/user/architecture/');
36
+ }
37
+ const planFiles = files
38
+ .filter((f) => /^\d+-slices\..*\.md$/.test(f))
39
+ .sort();
40
+ if (planFiles.length === 0) {
41
+ console.log(dim('No slice plans found in project.'));
42
+ return;
43
+ }
44
+ // Determine active plan stem (without .md)
45
+ const activeStem = project.fileSlicePlan ?? null;
46
+ const entries = await Promise.all(planFiles.map(async (f) => {
47
+ const stem = f.replace(/\.md$/, '');
48
+ const indexMatch = /^(\d+)-/.exec(f);
49
+ const index = indexMatch ? indexMatch[1] : '—';
50
+ const planPath = join(archDir, f);
51
+ const result = await parseSlicePlan(planPath);
52
+ const isActive = stem === activeStem;
53
+ return {
54
+ index,
55
+ file: stem,
56
+ completed: result.completedSlices,
57
+ total: result.totalSlices,
58
+ isActive,
59
+ };
60
+ }));
61
+ if (opts.json) {
62
+ printJson(entries);
63
+ return;
64
+ }
65
+ console.log(label('\nSlice Plans'));
66
+ const rows = entries.map((e) => {
67
+ const progress = e.total > 0
68
+ ? `${e.completed}/${e.total}`
69
+ : '—';
70
+ const active = e.isActive ? success(' ← active') : '';
71
+ const icon = e.total > 0 && e.completed === e.total ? success('✓') : dim('○');
72
+ return [e.index, icon + ' ' + e.file, progress + active];
73
+ });
74
+ console.log(renderTable(['#', 'Plan', 'Progress'], rows));
75
+ }
76
+ catch (err) {
77
+ handleError(err);
78
+ }
79
+ });
80
+ }
81
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/commands/plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EACL,gBAAgB,EAChB,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,oBAAo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B,CACpC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAoEf;AAED,+DAA+D;AAC/D,wBAAsB,gBAAgB,CACpC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CA4Cf;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2H7D"}
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/commands/project.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiGpC,sEAAsE;AACtE,wBAAgB,uBAAuB,IAAI,MAAM,CA0BhD;AAED,+DAA+D;AAC/D,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAkGf;AAED,+DAA+D;AAC/D,wBAAsB,gBAAgB,CACpC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,OAAO,CAAC,IAAI,CAAC,CA4Cf;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2H7D"}