lee-spec-kit 0.6.26 → 0.6.27

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/README.en.md CHANGED
@@ -365,11 +365,12 @@ npx lee-spec-kit flow F004 --request "promote issue 004 to F004 and proceed" --a
365
365
  npx lee-spec-kit flow F004 --request "promote issue 004 to F004 and proceed"
366
366
 
367
367
  # long-running auto: create checkpoint + resume
368
- npx lee-spec-kit flow F004 --auto-until-category pr_create,code_review,pr_status_update --start-auto --json
369
- npx lee-spec-kit flow --resume <RUN_ID> --json
368
+ npx lee-spec-kit flow F004 --auto-until-category pr_create,code_review,pr_status_update --start-auto --json-compact
369
+ npx lee-spec-kit flow --resume <RUN_ID> --json-compact
370
370
 
371
371
  # JSON output for automation
372
372
  npx lee-spec-kit flow --json
373
+ npx lee-spec-kit flow --json-compact
373
374
 
374
375
  # strict checks (optional)
375
376
  npx lee-spec-kit flow --strict
@@ -380,6 +381,7 @@ npx lee-spec-kit flow --strict
380
381
  | Option | Description |
381
382
  | ----------------- | ----------- |
382
383
  | `--json` | JSON output for agents |
384
+ | `--json-compact` | Compact JSON output for agents (implies `--json`, reduced duplication) |
383
385
  | `--component <id>`| Select target component in multi mode (e.g. `app`, `api`, `worker`) |
384
386
  | `--all` | Include completed features when auto-detecting |
385
387
  | `--done` | Show completed (workflow-done) features only |
@@ -408,9 +410,9 @@ Auto gate mode rules:
408
410
  - With `--start-auto`, JSON also includes `autoRun.run` (`runId`, `status`, `resumeCommand`).
409
411
 
410
412
  Agent resume rules (recommended):
411
- - When `flow --json` returns `autoRun.enabled=true`, resume with `autoRun.resume.flowCommand` after interruption/compression.
413
+ - When `flow --json-compact` (or `flow --json`) returns `autoRun.enabled=true`, resume with `autoRun.resume.flowCommand` after interruption/compression.
412
414
  - If you need a fresh checkpoint before resuming, run `autoRun.resume.contextCommand` first.
413
- - If `context --json` returns `approvalRequest.required=true`, stop immediately and report to the user.
415
+ - If `context --json-compact` (or `context --json`) returns `approvalRequest.required=true`, stop immediately and report to the user.
414
416
  - When `--start-auto` is used, prefer `autoRun.run.resumeCommand` (`flow --resume <runId>`) as the first resume path.
415
417
 
416
418
  ### GitHub helpers
package/README.md CHANGED
@@ -384,11 +384,12 @@ npx lee-spec-kit flow F004 --request "issue 004를 F004로 승격시켜서 진
384
384
  npx lee-spec-kit flow F004 --request "issue 004를 F004로 승격시켜서 진행해"
385
385
 
386
386
  # 장시간 자동 진행: run 체크포인트 생성 + 재개
387
- npx lee-spec-kit flow F004 --auto-until-category pr_create,code_review,pr_status_update --start-auto --json
388
- npx lee-spec-kit flow --resume <RUN_ID> --json
387
+ npx lee-spec-kit flow F004 --auto-until-category pr_create,code_review,pr_status_update --start-auto --json-compact
388
+ npx lee-spec-kit flow --resume <RUN_ID> --json-compact
389
389
 
390
390
  # 에이전트 파이프라인용 JSON
391
391
  npx lee-spec-kit flow --json
392
+ npx lee-spec-kit flow --json-compact
392
393
 
393
394
  # 엄격 검사(선택)
394
395
  npx lee-spec-kit flow --strict
@@ -399,6 +400,7 @@ npx lee-spec-kit flow --strict
399
400
  | 옵션 | 설명 |
400
401
  | ------------------ | ---- |
401
402
  | `--json` | 에이전트용 JSON 출력 |
403
+ | `--json-compact` | 에이전트용 압축 JSON 출력 (`--json` 포함, 중복 필드 최소화) |
402
404
  | `--component <id>` | multi에서 대상 컴포넌트 지정 (예: `app`, `api`, `worker`) |
403
405
  | `--all` | 자동 감지 실패 시 완료된 Feature까지 포함해서 표시 |
404
406
  | `--done` | 완료(workflow-done) Feature만 표시 |
@@ -427,9 +429,9 @@ npx lee-spec-kit flow --strict
427
429
  - `--start-auto`를 사용하면 JSON `autoRun.run`에 `runId`, `status`, `resumeCommand`가 포함됩니다.
428
430
 
429
431
  에이전트 재개 규칙(권장):
430
- - `flow --json` 결과에 `autoRun.enabled=true`가 있으면, 중단/압축 후에도 `autoRun.resume.flowCommand`를 그대로 재실행해 이어갑니다.
432
+ - `flow --json-compact`(또는 `flow --json`) 결과에 `autoRun.enabled=true`가 있으면, 중단/압축 후에도 `autoRun.resume.flowCommand`를 그대로 재실행해 이어갑니다.
431
433
  - 재개 전 현재 지점 확인이 필요하면 `autoRun.resume.contextCommand`를 먼저 실행합니다.
432
- - `context --json` 확인 결과 `approvalRequest.required=true`면 즉시 멈추고 사용자에게 보고합니다.
434
+ - `context --json-compact`(또는 `context --json`) 확인 결과 `approvalRequest.required=true`면 즉시 멈추고 사용자에게 보고합니다.
433
435
  - `--start-auto`를 사용하는 경우에는 `autoRun.run.resumeCommand`(`flow --resume <runId>`)를 우선 재개 경로로 사용합니다.
434
436
 
435
437
  ### GitHub helper
package/dist/index.js CHANGED
@@ -7125,7 +7125,7 @@ function buildAgentOrchestrationPolicy(actionOptions, autoRunAvailable) {
7125
7125
  resumePriority: [
7126
7126
  "flow --resume <RUN_ID>",
7127
7127
  "autoRun.resume.flowCommand",
7128
- "context --json"
7128
+ "context --json-compact"
7129
7129
  ]
7130
7130
  };
7131
7131
  }
@@ -9530,6 +9530,108 @@ function buildAgentOrchestrationPolicy2(autoRun) {
9530
9530
  preferredResumeCommand
9531
9531
  };
9532
9532
  }
9533
+ function getFeatureRef2(feature) {
9534
+ return feature.folderName;
9535
+ }
9536
+ function toCompactFlowFeature(feature) {
9537
+ if (!feature) return null;
9538
+ return {
9539
+ ref: getFeatureRef2(feature),
9540
+ id: feature.id,
9541
+ slug: feature.slug,
9542
+ type: feature.type,
9543
+ issueNumber: feature.issueNumber,
9544
+ specStatus: feature.specStatus,
9545
+ planStatus: feature.planStatus,
9546
+ tasksDocStatus: feature.tasksDocStatus,
9547
+ currentStep: feature.currentStep,
9548
+ completion: {
9549
+ implementationDone: feature.completion.implementationDone,
9550
+ workflowDone: feature.completion.workflowDone
9551
+ },
9552
+ tasks: feature.tasks,
9553
+ completionChecklist: feature.completionChecklist,
9554
+ warnings: feature.warnings
9555
+ };
9556
+ }
9557
+ function toCompactFlowActionOption(option) {
9558
+ const base = {
9559
+ label: option.label,
9560
+ summary: option.summary,
9561
+ detail: option.detail,
9562
+ approvalPrompt: option.approvalPrompt,
9563
+ requiresRequestText: option.requiresRequestText,
9564
+ replyExample: option.replyExample,
9565
+ actionType: option.action.type,
9566
+ category: option.action.category,
9567
+ operationType: option.action.operationType,
9568
+ requiresUserCheck: !!option.action.requiresUserCheck
9569
+ };
9570
+ if (option.action.type === "command") {
9571
+ base.scope = option.action.scope;
9572
+ base.cwd = option.action.cwd;
9573
+ base.cmd = option.action.cmd;
9574
+ return base;
9575
+ }
9576
+ base.message = option.action.message;
9577
+ return base;
9578
+ }
9579
+ function toCompactFlowContextSnapshot(state) {
9580
+ const primaryAction = state.actionOptions[0] ?? null;
9581
+ return {
9582
+ status: state.status,
9583
+ reasonCode: toReasonCode(state.status),
9584
+ selectionMode: state.selectionMode,
9585
+ selectionFallback: state.selectionFallback,
9586
+ branches: state.branches,
9587
+ warnings: state.warnings,
9588
+ contextVersion: state.contextVersion,
9589
+ matchedFeature: toCompactFlowFeature(state.matchedFeature),
9590
+ candidateRefs: state.targetFeatures.length > 1 ? state.targetFeatures.map((feature) => getFeatureRef2(feature)) : [],
9591
+ completedCandidateRefs: state.selectionMode === "open" ? state.doneFeatures.map((feature) => getFeatureRef2(feature)) : [],
9592
+ openCandidateRefs: state.selectionMode === "open" ? state.openFeatures.map((feature) => getFeatureRef2(feature)) : [],
9593
+ inProgressCandidateRefs: state.selectionMode === "open" ? state.inProgressFeatures.map((feature) => getFeatureRef2(feature)) : [],
9594
+ readyToCloseCandidateRefs: state.selectionMode === "open" ? state.readyToCloseFeatures.map((feature) => getFeatureRef2(feature)) : [],
9595
+ actionOptions: state.actionOptions.map(
9596
+ (option) => toCompactFlowActionOption(option)
9597
+ ),
9598
+ primaryActionLabel: primaryAction?.label ?? null,
9599
+ primaryActionType: primaryAction?.action.type ?? null,
9600
+ primaryActionCategory: primaryAction?.action.category ?? null,
9601
+ primaryActionOperationType: primaryAction?.action.operationType ?? null
9602
+ };
9603
+ }
9604
+ function toCompactAutoRun(autoRun) {
9605
+ if (!autoRun) return null;
9606
+ const lastExecution = autoRun.executions.length > 0 ? autoRun.executions[autoRun.executions.length - 1] : null;
9607
+ return {
9608
+ enabled: autoRun.enabled,
9609
+ status: autoRun.status,
9610
+ reasonCode: autoRun.reasonCode,
9611
+ untilCategories: autoRun.untilCategories,
9612
+ request: autoRun.request,
9613
+ preset: autoRun.preset ?? null,
9614
+ source: autoRun.source ?? null,
9615
+ iterations: autoRun.iterations,
9616
+ executionCount: autoRun.executions.length,
9617
+ lastExecution,
9618
+ gate: autoRun.gate ?? null,
9619
+ manual: autoRun.manual ?? null,
9620
+ resume: autoRun.resume,
9621
+ run: autoRun.run ?? null,
9622
+ error: autoRun.error ?? null
9623
+ };
9624
+ }
9625
+ function toCompactStatusReport(report) {
9626
+ if (!report || typeof report !== "object") return null;
9627
+ const payload = report;
9628
+ return {
9629
+ status: payload.status ?? null,
9630
+ reasonCode: payload.reasonCode ?? null,
9631
+ counts: payload.counts ?? null,
9632
+ recommendation: payload.recommendation ?? null
9633
+ };
9634
+ }
9533
9635
  async function runAutoUntilCategory(config, featureName, selectionOptions, untilCategories, requestText, metadata) {
9534
9636
  const contextArgs = ["context", ...buildSelectionArgs(featureName, selectionOptions)];
9535
9637
  const gateSet = new Set(untilCategories);
@@ -9794,7 +9896,10 @@ async function runAutoUntilCategory(config, featureName, selectionOptions, until
9794
9896
  }
9795
9897
  }
9796
9898
  function flowCommand(program2) {
9797
- program2.command("flow [feature-name]").description("Run combined workflow checks (context + status + doctor)").option("--json", "Output in JSON format for agents").option("--component <component>", "Component name for multi projects").option("--all", "Include completed features when auto-detecting").option("--done", "Show completed (workflow-done) features only").option(
9899
+ program2.command("flow [feature-name]").description("Run combined workflow checks (context + status + doctor)").option("--json", "Output in JSON format for agents").option(
9900
+ "--json-compact",
9901
+ "Output compact JSON for agents (implies --json, reduced duplication)"
9902
+ ).option("--component <component>", "Component name for multi projects").option("--all", "Include completed features when auto-detecting").option("--done", "Show completed (workflow-done) features only").option(
9798
9903
  "--request <text>",
9799
9904
  "Apply a new user request first via user_request_replan when auto mode is enabled"
9800
9905
  ).option(
@@ -9823,7 +9928,7 @@ function flowCommand(program2) {
9823
9928
  const lang = config?.lang ?? DEFAULT_LANG;
9824
9929
  const cliError = toCliError(error);
9825
9930
  const suggestions = getCliErrorSuggestions(cliError.code, lang);
9826
- if (options.json) {
9931
+ if (options.json || options.jsonCompact) {
9827
9932
  console.log(
9828
9933
  JSON.stringify({
9829
9934
  status: "error",
@@ -10070,12 +10175,38 @@ async function runFlow(featureName, options) {
10070
10175
  );
10071
10176
  }
10072
10177
  }
10073
- if (options.json) {
10178
+ const jsonMode = !!options.json || !!options.jsonCompact;
10179
+ if (jsonMode) {
10074
10180
  const autoRunFailed = !!(autoRun && isAutoRunFailureStatus(autoRun.status));
10075
10181
  const agentOrchestration2 = buildAgentOrchestrationPolicy2(autoRun);
10182
+ const status = autoRunFailed ? "error" : "ok";
10183
+ const reasonCode = autoRunFailed ? autoRun?.reasonCode || "AUTO_EXECUTION_FAILED" : "FLOW_SUMMARY";
10184
+ if (options.jsonCompact) {
10185
+ const compactPayload = {
10186
+ schema: "flow.v2.compact",
10187
+ status,
10188
+ reasonCode,
10189
+ context: {
10190
+ before: toCompactFlowContextSnapshot(before),
10191
+ after: toCompactFlowContextSnapshot(after)
10192
+ },
10193
+ approval: approvalResult,
10194
+ autoRun: toCompactAutoRun(autoRun),
10195
+ agentOrchestration: agentOrchestration2,
10196
+ statusReport: toCompactStatusReport(statusReport),
10197
+ doctorReport: toCompactStatusReport(doctorReport),
10198
+ strictChecks,
10199
+ suggestion: after.matchedFeature ? `npx lee-spec-kit context ${after.matchedFeature.folderName}${componentHint}` : `npx lee-spec-kit context${componentHint}`
10200
+ };
10201
+ console.log(JSON.stringify(compactPayload, null, 2));
10202
+ if (autoRunFailed) {
10203
+ process.exitCode = 1;
10204
+ }
10205
+ return;
10206
+ }
10076
10207
  const payload = {
10077
- status: autoRunFailed ? "error" : "ok",
10078
- reasonCode: autoRunFailed ? autoRun?.reasonCode || "AUTO_EXECUTION_FAILED" : "FLOW_SUMMARY",
10208
+ status,
10209
+ reasonCode,
10079
10210
  context: {
10080
10211
  before: {
10081
10212
  status: before.status,