@curdx/flow 2.0.0-beta.1 → 2.0.0-beta.2

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.
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
9
- "version": "2.0.0-beta.1"
9
+ "version": "2.0.0-beta.2"
10
10
  },
11
11
  "plugins": [
12
12
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "curdx-flow",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "Claude Code Discipline Layer — spec-driven workflow + goal-backward verification + Karpathy 4 principles enforced via gates. Stops Claude from faking \"done\" on non-trivial features.",
5
5
  "author": {
6
6
  "name": "wdx",
package/cli/install.js CHANGED
@@ -237,15 +237,26 @@ export async function install(args = []) {
237
237
  }
238
238
 
239
239
  function printNextSteps() {
240
+ // Detect whether the CLI is globally installed (curdx-flow on PATH) or
241
+ // the user ran us via npx. Tell them the right invocation each time.
242
+ const cliOnPath = has("curdx-flow");
243
+ const cliCmd = cliOnPath ? "curdx-flow" : "npx @curdx/flow";
244
+
240
245
  console.log(`\n${color.bold("✅ Install complete")}\n`);
246
+ console.log(`${color.bold("Restart Claude Code")} so the plugin registers all its commands and hooks.\n`);
241
247
  console.log(`${color.bold("Next steps")}:\n`);
242
248
  console.log(` ${color.dim("# Verify health")}`);
243
- console.log(` curdx-flow doctor\n`);
244
- console.log(` ${color.dim("# Initialize .flow/ in your project")}`);
245
- console.log(` cd ~/your-project && curdx-flow init\n`);
246
- console.log(` ${color.dim("# Start using it (inside Claude Code)")}`);
249
+ console.log(` ${cliCmd} doctor\n`);
250
+ console.log(` ${color.dim("# Inside any project, initialize and start a feature spec")}`);
251
+ console.log(` ${color.cyan("cd ~/your-project")}`);
247
252
  console.log(` ${color.cyan("claude")}`);
248
- console.log(` ${color.cyan("/curdx-flow:start my-feature \"<describe what to build>\"")}\n`);
253
+ console.log(` ${color.cyan("/curdx-flow:init")}`);
254
+ console.log(` ${color.cyan("/curdx-flow:start my-feature \"<one-line goal>\"")}\n`);
255
+ if (!cliOnPath) {
256
+ console.log(
257
+ `${color.dim("Tip: install the CLI globally for shorter commands —")} ${color.cyan("npm i -g @curdx/flow")}\n`
258
+ );
259
+ }
249
260
  console.log(
250
261
  `${color.bold("Learn more")}: https://github.com/curdx/curdx-flow/blob/main/docs/getting-started.md\n`
251
262
  );
@@ -91,6 +91,15 @@ Output: test-gap checklist with suggested test cases.
91
91
 
92
92
  ## Report
93
93
 
94
+ **Landing check**: sub-agent responses can be truncated. After dispatching review agents, verify the report actually landed on disk:
95
+
96
+ ```bash
97
+ REPORT=".flow/specs/$SPEC_NAME/review-report.md"
98
+ if [ ! -f "$REPORT" ] || [ "$(wc -c < "$REPORT" 2>/dev/null | tr -d ' ')" -lt 300 ]; then
99
+ echo "⚠ Report missing or truncated. Re-dispatching flow-reviewer with a terse 'Write the report now, no narration' prompt."
100
+ fi
101
+ ```
102
+
94
103
  Consolidated output: `.flow/specs/$SPEC_NAME/review-report.md`:
95
104
 
96
105
  ```markdown
package/commands/spec.md CHANGED
@@ -98,6 +98,30 @@ After each phase completes successfully, update `.state.json`:
98
98
  }
99
99
  ```
100
100
 
101
+ ### Artifact landing check (mandatory after every phase)
102
+
103
+ Sub-agent responses can be truncated by the model's output-length limit, which means the `Write` tool call for the phase's Markdown artifact may never fire. Do NOT trust the agent's return value alone — always verify the file actually landed.
104
+
105
+ For each phase just dispatched, run:
106
+
107
+ ```bash
108
+ ARTIFACT=".flow/specs/$SPEC_NAME/<phase>.md"
109
+ if [ ! -f "$ARTIFACT" ]; then
110
+ echo "⚠ $ARTIFACT did not land. Re-dispatching <phase> agent with an explicit 'write the file' prompt."
111
+ # Re-dispatch the same agent, but in the prompt, front-load:
112
+ # "Your ONLY job is to call the Write tool with the full <phase>.md content now.
113
+ # Do not explain. Do not narrate. Write the file and stop."
114
+ # This pattern produces an artifact even when prior verbosity caused truncation.
115
+ fi
116
+
117
+ # Minimum-size sanity check — if the file is <500 bytes, the write likely truncated
118
+ if [ -f "$ARTIFACT" ] && [ "$(wc -c < "$ARTIFACT" | tr -d ' ')" -lt 500 ]; then
119
+ echo "⚠ $ARTIFACT looks truncated (<500 bytes). Re-dispatching to complete it."
120
+ fi
121
+ ```
122
+
123
+ Only advance `.state.json.phase` after both the file exists AND passes the size sanity check. If a re-dispatch also fails to produce the artifact, stop and surface the issue to the user instead of silently advancing — that prevents later phases from consuming an empty upstream file.
124
+
101
125
  ## Optional planning review
102
126
 
103
127
  If `--review` (or `--review=<dims>`) is present:
@@ -67,6 +67,19 @@ If `--strict`:
67
67
 
68
68
  ### Step 4: Produce `verification-report.md`
69
69
 
70
+ **Landing check**: sub-agent responses can be truncated by the model's output-length limit. After dispatching `flow-verifier`, verify the report actually landed:
71
+
72
+ ```bash
73
+ REPORT=".flow/specs/$SPEC_NAME/verification-report.md"
74
+ if [ ! -f "$REPORT" ] || [ "$(wc -c < "$REPORT" 2>/dev/null | tr -d ' ')" -lt 300 ]; then
75
+ echo "⚠ Report missing or truncated. Re-dispatching flow-verifier with a terse 'write the report now' prompt."
76
+ # Re-dispatch pattern:
77
+ # "Your only job right now is to Write the verification-report.md using the
78
+ # findings you already gathered. Do not re-scan. Do not narrate. Write
79
+ # the file and stop."
80
+ fi
81
+ ```
82
+
70
83
  Write to `.flow/specs/$SPEC_NAME/verification-report.md`:
71
84
 
72
85
  ```markdown
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curdx/flow",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "CLI installer for CurDX-Flow — AI engineering workflow meta-framework for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {