@difflab/difflab-cli 0.7.1-rc.63 → 0.8.0

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 (3) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +184 -27
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -66,11 +66,11 @@ difflab-cli templates list
66
66
  difflab-cli templates scaffold spec-driven-plan docs/plans first-plan.md --cwd /absolute/project/path
67
67
  ```
68
68
 
69
- The CLI defaults `--cwd` to its current directory. The MCP server exposes `template_list({})` and `scaffold({"name":"spec-driven-plan","cwd":"/absolute/project/path","path":"docs/plans","filename":"first-plan.md"})`. Both interfaces take a hyphenated template name, a relative destination **directory** (`path`, or `.` for `cwd`), and a separate **filename**. MCP always requires an absolute existing `cwd`. Missing destination directories are created. Available names: `spec-driven-plan`, `software-architecture-design`, `architecture-decision-record`, `product-requirements-document`, `code-review`, `planning-intent`, `ui-component-architecture`, `pull-request-description` (adapted from Diffpi's PR template), `flow-definition`, and `flow-instance`.
69
+ The CLI defaults `--cwd` to its current directory. The MCP server exposes `template_list({})` and `scaffold({"name":"spec-driven-plan","cwd":"/absolute/project/path","path":"docs/plans","filename":"first-plan.md"})`. Both interfaces take a hyphenated template name, a relative destination **directory** (`path`, or `.` for `cwd`), and a separate **filename**. MCP always requires an absolute existing `cwd`. Missing destination directories are created. Available names: `spec-driven-plan`, `software-architecture-design`, `architecture-decision-record`, `product-requirements-document`, `code-review`, `planning-intent`, `ui-component-architecture`, `pull-request-description` (adapted from Diffpi's PR template), `flow-definition`, `flow-instance`, `exploration-summary`, `exploration-research`, `exploration-proposal`, and `poc-readme`.
70
70
 
71
71
  On first use, missing bundled templates and filled examples are copied to `~/.difflab/templates` and `~/.difflab/templates/examples`. Edit the installed templates to customize future documents. Later runs add missing files but never replace existing ones, even after an upgrade. Examples are for reference, not selectable templates. Copying is literal: prompts and placeholders are not substituted. An unknown name, missing or invalid source, unsafe path, symlink, or existing destination causes an error; destination files are never overwritten. The target directory must remain inside `cwd` and the filename must be a single file name without separators. The one symlink exception is an initialized repository's `.difflab` link to its own user project store: `templates scaffold spec-driven-plan .difflab/plans/YYMMDD-name PLAN.md --cwd /absolute/repo` works in Git worktrees as well. To restore a bundled default, move your installed copy aside before listing again.
72
72
 
73
- The portable `skills/difflab-plan`, `skills/difflab-review`, and `skills/difflab-flow` directories contain natural-language agent workflows for these templates. Install each skill in your client's Agent Skills directory. The MCP-only `log_append({"path":"/absolute/physical/project-store/plans/YYMMDD-name/logs.txt","message":"Phase started"})` tool creates an append-only progress log on first use; pass the physical path, not the `.difflab` symlink. There is no log CLI command.
73
+ The portable `skills/difflab-plan`, `skills/difflab-review`, `skills/difflab-flow`, `skills/difflab-explore`, `skills/difflab-adr`, and `skills/difflab-poc` directories contain natural-language agent workflows for these templates. Install each skill in your client's Agent Skills directory. The MCP-only `log_append({"path":"/absolute/physical/project-store/plans/YYMMDD-name/logs.txt","message":"Phase started"})` tool creates an append-only progress log on first use; pass the physical path, not the `.difflab` symlink. There is no log CLI command.
74
74
 
75
75
  ## Flow definitions and runs
76
76
 
package/dist/index.js CHANGED
@@ -12793,7 +12793,7 @@ var init_registry = __esm(() => {
12793
12793
  };
12794
12794
  });
12795
12795
 
12796
- // ../../libs/difflab-ts/src/gitx.ts
12796
+ // ../../libs/utils/src/gitx.ts
12797
12797
  import { execFileSync } from "child_process";
12798
12798
  import { appendFile, readFile } from "fs/promises";
12799
12799
  import { isAbsolute, resolve as resolve2 } from "path";
@@ -19440,7 +19440,7 @@ var init_src = __esm(() => {
19440
19440
  });
19441
19441
 
19442
19442
  // src/errors.ts
19443
- var DifflabError, ConfigurationError, ProjectSetupError, RepoStoreError, MissingRepoConfig, InvalidRepoConfig, MissingGlobalConfig, CommandExecutionError;
19443
+ var DifflabError, ConfigurationError, ProjectSetupError, RepoStoreError, MissingRepoConfig, InvalidRepoConfig, MissingGlobalConfig;
19444
19444
  var init_errors3 = __esm(() => {
19445
19445
  DifflabError = class DifflabError extends Error {
19446
19446
  constructor(message, options) {
@@ -19484,12 +19484,6 @@ var init_errors3 = __esm(() => {
19484
19484
  this.name = "MissingGlobalConfig";
19485
19485
  }
19486
19486
  };
19487
- CommandExecutionError = class CommandExecutionError extends DifflabError {
19488
- constructor(command, message, options) {
19489
- super(`Could not configure ${command}: ${message}`, options);
19490
- this.name = "CommandExecutionError";
19491
- }
19492
- };
19493
19487
  });
19494
19488
 
19495
19489
  // ../../node_modules/yaml/dist/nodes/identity.js
@@ -26628,12 +26622,7 @@ var init_user_store = __esm(() => {
26628
26622
  };
26629
26623
  });
26630
26624
 
26631
- // src/extensions/gitx.ts
26632
- var init_gitx2 = __esm(() => {
26633
- init_gitx();
26634
- });
26635
-
26636
- // src/extensions/osx.ts
26625
+ // ../../libs/utils/src/osx.ts
26637
26626
  import { homedir as homedir2 } from "os";
26638
26627
  function resolveHomeDirectory(home) {
26639
26628
  return home ?? homedir2();
@@ -26643,7 +26632,7 @@ function hasErrorCode(error, code) {
26643
26632
  }
26644
26633
  var init_osx = () => {};
26645
26634
 
26646
- // src/extensions/pathx.ts
26635
+ // ../../libs/utils/src/pathx.ts
26647
26636
  import { lstat as lstat4, realpath, stat } from "fs/promises";
26648
26637
  import { isAbsolute as isAbsolute2, join as join3, relative, resolve as resolve4, sep } from "path";
26649
26638
  async function resolvePath(cwd, path) {
@@ -26678,7 +26667,7 @@ var init_pathx = __esm(() => {
26678
26667
  init_osx();
26679
26668
  });
26680
26669
 
26681
- // src/extensions/fsx.ts
26670
+ // ../../libs/utils/src/fsx.ts
26682
26671
  import { randomUUID as randomUUID3 } from "crypto";
26683
26672
  import { lstat as lstat5, mkdir as mkdir2, readFile as readFile3, rename, rm, writeFile as writeFile2 } from "fs/promises";
26684
26673
  import { dirname } from "path";
@@ -26789,7 +26778,7 @@ async function ensureRepoStore(root, target, excludePath) {
26789
26778
  }
26790
26779
  var init_repo_store = __esm(() => {
26791
26780
  init_errors3();
26792
- init_gitx2();
26781
+ init_gitx();
26793
26782
  init_fsx();
26794
26783
  });
26795
26784
 
@@ -48181,7 +48170,7 @@ var init_tools = __esm(() => {
48181
48170
  ];
48182
48171
  });
48183
48172
 
48184
- // src/extensions/zodx.ts
48173
+ // ../../libs/utils/src/zodx.ts
48185
48174
  import { isAbsolute as isAbsolute4 } from "path";
48186
48175
  var absolutePath, relativePath, fileName;
48187
48176
  var init_zodx = __esm(() => {
@@ -48457,13 +48446,23 @@ var architecture_decision_record_default = `# [Decision: problem and chosen solu
48457
48446
 
48458
48447
  ### [Option A]
48459
48448
 
48460
- - Good: [reason.]
48461
- - Bad: [reason.]
48449
+ #### Pros
48450
+
48451
+ - [Benefit.]
48452
+
48453
+ #### Cons
48454
+
48455
+ - [Drawback.]
48462
48456
 
48463
48457
  ### [Option B]
48464
48458
 
48465
- - Good: [reason.]
48466
- - Bad: [reason.]
48459
+ #### Pros
48460
+
48461
+ - [Benefit.]
48462
+
48463
+ #### Cons
48464
+
48465
+ - [Drawback.]
48467
48466
 
48468
48467
  ## Decision Outcome
48469
48468
 
@@ -48803,6 +48802,146 @@ This is the frozen execution snapshot. Include only selected executable steps; n
48803
48802
  `;
48804
48803
  var init_flow_instance = () => {};
48805
48804
 
48805
+ // templates/exploration-summary.md
48806
+ var exploration_summary_default = `# Exploration: {{topic}}
48807
+
48808
+ - **Status:** research in progress
48809
+ - **Started:** {{YYYY-MM-DD}}
48810
+ - **Updated:** {{YYYY-MM-DD}}
48811
+ - **Scope:** {{question and constraints}}
48812
+
48813
+ ## Question
48814
+
48815
+ {{What is being investigated, and why?}}
48816
+
48817
+ ## Findings
48818
+
48819
+ {{Evidence-backed findings with links to research notes. Separate facts from inference.}}
48820
+
48821
+ ## Prior art and options
48822
+
48823
+ {{Existing codebase approaches, comparable open-source implementations, and distinct possible directions. No recommendation is required.}}
48824
+
48825
+ ## Proposals
48826
+
48827
+ {{Optional: links to proposals/*.md. If research-only, say "Not requested".}}
48828
+
48829
+ ## Evidence and freshness
48830
+
48831
+ {{Fetched primary-source URLs, dates accessed and relevant versions; note what changed since the previous revision, if any.}}
48832
+
48833
+ ## Unknowns and next questions
48834
+
48835
+ {{Unverified claims, constraints to confirm, and follow-up research.}}
48836
+
48837
+ ## Revisit history
48838
+
48839
+ {{For updates, date, request (including a revisit without feedback), revision number, and changed evidence. Never replace earlier revisions.}}
48840
+ `;
48841
+ var init_exploration_summary = () => {};
48842
+
48843
+ // templates/exploration-research.md
48844
+ var exploration_research_default = `# Research: {{angle}}
48845
+
48846
+ - **Exploration:** {{topic}}
48847
+ - **Researched:** {{YYYY-MM-DD}}
48848
+ - **Scope:** {{angle and constraints}}
48849
+
48850
+ ## Existing approaches and prior art
48851
+
48852
+ {{Local code paths and comparable external projects; distinguish direct observations from inference.}}
48853
+
48854
+ ## Evidence
48855
+
48856
+ {{Findings with inline citations to fetched primary documentation, source code, or release notes. Cite specific URLs and relevant versions/dates.}}
48857
+
48858
+ ## Library and tool landscape
48859
+
48860
+ {{Relevant alternatives, maintenance activity, licensing, compatibility, and integration constraints. Say when these were not verified.}}
48861
+
48862
+ ## Trade-offs
48863
+
48864
+ {{Supported benefits, drawbacks, and applicability to this repository.}}
48865
+
48866
+ ## Unknowns
48867
+
48868
+ {{Gaps, stale evidence, conflicting sources, and follow-up checks.}}
48869
+
48870
+ ## Sources fetched
48871
+
48872
+ - {{Title \u2014 primary URL \u2014 accessed YYYY-MM-DD \u2014 version/commit where applicable \u2014 what this source supports}}
48873
+ `;
48874
+ var init_exploration_research = () => {};
48875
+
48876
+ // templates/exploration-proposal.md
48877
+ var exploration_proposal_default = `# Proposal: {{distinct approach}}
48878
+
48879
+ - **Exploration:** {{topic}}
48880
+ - **Status:** option, not a decision
48881
+
48882
+ ## Fit
48883
+
48884
+ {{When this approach makes sense and the constraints it meets.}}
48885
+
48886
+ ## Evidence and prior art
48887
+
48888
+ {{Link to research notes, fetched primary sources, and analogous implementations. Label inferences.}}
48889
+
48890
+ ## Design shape
48891
+
48892
+ {{Integration boundary, likely components and interfaces, without writing implementation code or a task plan. Use Mermaid if a diagram clarifies structure.}}
48893
+
48894
+ ## Trade-offs
48895
+
48896
+ {{Costs, risks, maintenance and licensing considerations, and differences from other approaches.}}
48897
+
48898
+ ## Open questions
48899
+
48900
+ {{Unverified claims and checks needed before choosing this approach.}}
48901
+
48902
+ ## Sources
48903
+
48904
+ - {{Primary URL \u2014 accessed YYYY-MM-DD \u2014 version/commit where relevant}}
48905
+ `;
48906
+ var init_exploration_proposal = () => {};
48907
+
48908
+ // templates/poc-readme.md
48909
+ var poc_readme_default = `---
48910
+ base_commit: '{{full SHA of origin/main at branch creation}}'
48911
+ ---
48912
+
48913
+ # PoC: {{name}}
48914
+
48915
+ > Experimental branch only. Do not merge into production or publish as a release.
48916
+
48917
+ ## Purpose
48918
+
48919
+ {{Question to answer and the smallest useful success criterion.}}
48920
+
48921
+ ## Alternatives
48922
+
48923
+ - {{Alternative or variation to compare, if any.}}
48924
+
48925
+ ## Experiments
48926
+
48927
+ | Approach | What changed | How to run | Result |
48928
+ | ------------ | ------------ | ------------- | --------------- |
48929
+ | {{approach}} | {{scope}} | \`{{command}}\` | {{observation}} |
48930
+
48931
+ ## Learnings
48932
+
48933
+ - {{Evidence-based result, caveat, and what remains unknown.}}
48934
+
48935
+ ## Compare with main at branch creation
48936
+
48937
+ The \`base_commit\` is the full SHA of \`origin/main\` when this branch was created; do not update it when main moves. Compare this PoC with its starting point using \`git diff <base_commit> HEAD\`.
48938
+
48939
+ ## Disposition
48940
+
48941
+ {{Follow-up decision or experiment; freeze with an annotated tag, never merge this branch.}}
48942
+ `;
48943
+ var init_poc_readme = () => {};
48944
+
48806
48945
  // templates/examples/plan-feature.md
48807
48946
  var plan_feature_default = `# Invite teammates to a project
48808
48947
 
@@ -49320,6 +49459,10 @@ var init_source = __esm(() => {
49320
49459
  init_pull_request_description();
49321
49460
  init_flow_definition();
49322
49461
  init_flow_instance();
49462
+ init_exploration_summary();
49463
+ init_exploration_research();
49464
+ init_exploration_proposal();
49465
+ init_poc_readme();
49323
49466
  init_plan_feature();
49324
49467
  init_plan_migration();
49325
49468
  init_design_service();
@@ -49340,7 +49483,11 @@ var init_source = __esm(() => {
49340
49483
  { name: "ui-component-architecture", description: "UI component design and implementation" },
49341
49484
  { name: "pull-request-description", description: "Draft pull request description" },
49342
49485
  { name: "flow-definition", description: "Reusable global Agent Skill flow definition" },
49343
- { name: "flow-instance", description: "Frozen repository-local flow run" }
49486
+ { name: "flow-instance", description: "Frozen repository-local flow run" },
49487
+ { name: "exploration-summary", description: "Source-grounded technical exploration summary" },
49488
+ { name: "exploration-research", description: "Technical exploration research notes" },
49489
+ { name: "exploration-proposal", description: "Optional technical exploration approach" },
49490
+ { name: "poc-readme", description: "Disposable proof-of-concept branch README" }
49344
49491
  ];
49345
49492
  contents = {
49346
49493
  "spec-driven-plan.md": spec_driven_plan_default,
@@ -49353,6 +49500,10 @@ var init_source = __esm(() => {
49353
49500
  "pull-request-description.md": pull_request_description_default,
49354
49501
  "flow-definition.md": flow_definition_default,
49355
49502
  "flow-instance.md": flow_instance_default,
49503
+ "exploration-summary.md": exploration_summary_default,
49504
+ "exploration-research.md": exploration_research_default,
49505
+ "exploration-proposal.md": exploration_proposal_default,
49506
+ "poc-readme.md": poc_readme_default,
49356
49507
  "examples/plan-feature.md": plan_feature_default,
49357
49508
  "examples/plan-migration.md": plan_migration_default,
49358
49509
  "examples/design-service.md": design_service_default,
@@ -49504,7 +49655,7 @@ var init_service = __esm(() => {
49504
49655
  init_fsx();
49505
49656
  init_osx();
49506
49657
  init_pathx();
49507
- init_gitx2();
49658
+ init_gitx();
49508
49659
  init_config();
49509
49660
  init_repo_store();
49510
49661
  init_user_store();
@@ -49574,7 +49725,7 @@ var init_server3 = __esm(() => {
49574
49725
  init_tools4();
49575
49726
  });
49576
49727
 
49577
- // src/extensions/processx.ts
49728
+ // ../../libs/utils/src/processx.ts
49578
49729
  import { execFileSync as execFileSync2 } from "child_process";
49579
49730
  function runCommand(command, args, cwd) {
49580
49731
  try {
@@ -49583,8 +49734,14 @@ function runCommand(command, args, cwd) {
49583
49734
  throw new CommandExecutionError(command, error instanceof Error ? error.message : String(error), { cause: error });
49584
49735
  }
49585
49736
  }
49737
+ var CommandExecutionError;
49586
49738
  var init_processx = __esm(() => {
49587
- init_errors3();
49739
+ CommandExecutionError = class CommandExecutionError extends Error {
49740
+ constructor(command, message, options) {
49741
+ super(`Could not execute ${command}: ${message}`, options);
49742
+ this.name = "CommandExecutionError";
49743
+ }
49744
+ };
49588
49745
  });
49589
49746
 
49590
49747
  // src/agents/adapter.ts
@@ -51913,7 +52070,7 @@ function createProgram(write = console.log, version = "0.1.0", options = {}) {
51913
52070
 
51914
52071
  // src/index.ts
51915
52072
  init_errors3();
51916
- var version2 = "0.7.1-rc.63";
52073
+ var version2 = "0.8.0";
51917
52074
  try {
51918
52075
  await createProgram(console.log, version2).parseAsync(process.argv);
51919
52076
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@difflab/difflab-cli",
3
- "version": "0.7.1-rc.63",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "description": "A minimal Bun CLI starter built with Commander",
6
6
  "license": "Apache-2.0",
@@ -48,8 +48,8 @@
48
48
  "devDependencies": {
49
49
  "@types/bun": "1.4.2",
50
50
  "difflab-db": "workspace:*",
51
- "difflab-ts": "workspace:*",
52
51
  "prettier": "3.9.8",
53
- "typescript": "7.0.2"
52
+ "typescript": "7.0.2",
53
+ "utils": "workspace:*"
54
54
  }
55
55
  }