@moritakaaz/markflow 0.3.0 → 0.4.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.
package/package.json CHANGED
@@ -19,5 +19,5 @@
19
19
  "test": "node --test"
20
20
  },
21
21
  "type": "module",
22
- "version": "0.3.0"
22
+ "version": "0.4.0"
23
23
  }
package/src/doctor.js CHANGED
@@ -22,6 +22,25 @@ const REQUIRED = [
22
22
 
23
23
  const AGENT_FILES = ["CLAUDE.md", ".cursor/rules/markflow.mdc"];
24
24
 
25
+ // TBD in these files blocks the start. TBD in other docs can wait.
26
+ const TBD_NOW = [
27
+ "markflow/docs/PRD.md",
28
+ "markflow/docs/ARCHITECTURE.md",
29
+ "markflow/docs/STACK.md",
30
+ "markflow/TASKS.md",
31
+ ];
32
+
33
+ function isTbdNow(rel) {
34
+ if (TBD_NOW.includes(rel)) {
35
+ return true;
36
+ }
37
+ return (
38
+ rel.startsWith("markflow/specs/") &&
39
+ !rel.endsWith("/index.md") &&
40
+ !rel.endsWith("/_template.md")
41
+ );
42
+ }
43
+
25
44
  async function walk(dir, out) {
26
45
  let entries;
27
46
  try {
@@ -161,7 +180,8 @@ export async function runDoctor(options) {
161
180
  for (const file of AGENT_FILES) {
162
181
  mdFiles.push(join(root, file));
163
182
  }
164
- let tbd = 0;
183
+ let tbdNow = 0;
184
+ let tbdLater = 0;
165
185
  for (const file of mdFiles) {
166
186
  let text;
167
187
  try {
@@ -182,7 +202,12 @@ export async function runDoctor(options) {
182
202
  break;
183
203
  }
184
204
  }
185
- tbd += text.split("TBD").length - 1;
205
+ const count = text.split("TBD").length - 1;
206
+ if (isTbdNow(rel)) {
207
+ tbdNow += count;
208
+ } else {
209
+ tbdLater += count;
210
+ }
186
211
  for (const link of findLinks(text)) {
187
212
  if (
188
213
  link.startsWith("http") ||
@@ -278,7 +303,8 @@ export async function runDoctor(options) {
278
303
  } catch {
279
304
  // Missing specs folder is already reported above.
280
305
  }
281
- console.log("Info " + tbd + " TBD left in docs.");
306
+ console.log("Info " + tbdNow + " TBD left to decide now.");
307
+ console.log("Info " + tbdLater + " TBD left for later.");
282
308
  console.log("Info " + specTotal + " specs, " + specDraft + " draft.");
283
309
  if (errors.length === 0 && warnings.length === 0) {
284
310
  console.log("Doctor found no issues.");
package/src/versions.js CHANGED
@@ -2,5 +2,5 @@
2
2
  // Bump methodology when the docs in docs change.
3
3
  // Bump template when the files in templates change.
4
4
  // The CLI version comes from package.json.
5
- export const METHODOLOGY_VERSION = "0.3.0";
6
- export const TEMPLATE_VERSION = "0.3.0";
5
+ export const METHODOLOGY_VERSION = "0.4.0";
6
+ export const TEMPLATE_VERSION = "0.4.0";
@@ -8,12 +8,13 @@ Do not read when. The PRD is already filled. Use the other workflows instead.
8
8
 
9
9
  1. Ask one question at a time. Wait for the answer before you ask the next one.
10
10
  2. Start with the problem. What hurts today, and for whom.
11
- 3. Ask who uses the product. Ask what each user must be able to do.
12
- 4. Ask what the product must not do.
13
- 5. Read the code to learn the stack and the layout. Use only what the code shows.
14
- 6. Write PRD.md from the answers. Write ARCHITECTURE.md from the answers and from the code.
15
- 7. Mark anything you do not know as TBD. Never invent a decision or an architecture detail.
16
- 8. End with a list of open questions. The user answers them to clear the TBD marks.
11
+ 3. Ask which language to use in this conversation. Then ask which language to use for docs and code comments. Ask each one as its own question. Code names stay in English.
12
+ 4. Ask who uses the product. Ask what each user must be able to do.
13
+ 5. Ask what the product must not do.
14
+ 6. Read the code to learn the stack and the layout. Use only what the code shows.
15
+ 7. Write PRD.md from the answers. Write ARCHITECTURE.md from the answers and from the code. Write the two language answers in PRD.md.
16
+ 8. Mark anything you do not know as TBD. Never invent a decision or an architecture detail.
17
+ 9. End with a list of open questions. The user answers them to clear the TBD marks.
17
18
 
18
19
  ## Rules
19
20
 
@@ -10,4 +10,5 @@ Do not read when. The spec is still a draft. Wait until it is ready.
10
10
  2. Check each requirement is checkable.
11
11
  3. Check out of scope is written.
12
12
  4. Check acceptance cases exist.
13
- 5. Mark the spec Approved only when all checks pass. If not, list what is missing.
13
+ 5. Run the review and list what is missing. Only the user marks a spec Approved.
14
+ 6. If the user says yes, change Draft to Approved in the spec and in specs/index.md. Then coding starts with implement-spec.
@@ -6,7 +6,11 @@ Do not read when. You only need one spec. Open that spec directly instead.
6
6
 
7
7
  ## Active
8
8
 
9
- - [ ] Add the first spec in `specs/index.md`
9
+ - Finish onboarding in markflow/.agents/workflows/onboarding.md
10
+ - Write spec 01 from markflow/specs/_template.md and list it in markflow/specs/index.md
11
+ - Review spec 01 with review-spec.md and mark it Approved in specs/index.md and in the spec
12
+ - Build spec 01 with implement-spec.md and run the tests
13
+ - Update TASKS.md when spec 01 is done
10
14
 
11
15
  ## Done
12
16
 
@@ -8,6 +8,13 @@ Do not read when. You need code detail. Open a spec in `specs` instead.
8
8
 
9
9
  <!-- Write one short paragraph. What problem does this project solve. Who has that problem today. -->
10
10
 
11
+ ## Language
12
+
13
+ <!-- Write which language to use in this conversation and which language to use for docs and code comments. Code names stay in English. -->
14
+
15
+ - Conversation. TBD
16
+ - Docs. TBD
17
+
11
18
  ## Users
12
19
 
13
20
  <!-- List the main users. Write one line per user type. Say what each type needs most. -->
package/test/cli.test.js CHANGED
@@ -293,6 +293,40 @@ describe("init", () => {
293
293
  assert.ok(text.includes("markflow/.agents/workflows/onboarding.md"));
294
294
  });
295
295
 
296
+ it("onboarding asks the two language questions", async (t) => {
297
+ const dir = await tempDir(t);
298
+ await runInit({ target: dir });
299
+ const workflow = await readFile(
300
+ join(dir, "markflow/.agents/workflows/onboarding.md"),
301
+ "utf8"
302
+ );
303
+ assert.ok(workflow.includes("which language to use in this conversation"));
304
+ assert.ok(workflow.includes("which language to use for docs and code comments"));
305
+ assert.ok(workflow.includes("Code names stay in English"));
306
+ const prd = await readFile(join(dir, "markflow/docs/PRD.md"), "utf8");
307
+ assert.ok(prd.includes("## Language"));
308
+ assert.ok(prd.includes("- Conversation. TBD"));
309
+ assert.ok(prd.includes("- Docs. TBD"));
310
+ });
311
+
312
+ it("tasks list the first five steps and review names the user as approver", async (t) => {
313
+ const dir = await tempDir(t);
314
+ await runInit({ target: dir });
315
+ const tasks = await readFile(join(dir, "markflow/TASKS.md"), "utf8");
316
+ assert.ok(tasks.includes("Finish onboarding in markflow/.agents/workflows/onboarding.md"));
317
+ assert.ok(tasks.includes("Write spec 01 from markflow/specs/_template.md"));
318
+ assert.ok(tasks.includes("Review spec 01 with review-spec.md"));
319
+ assert.ok(tasks.includes("Build spec 01 with implement-spec.md"));
320
+ assert.ok(tasks.includes("Update TASKS.md when spec 01 is done"));
321
+ const review = await readFile(
322
+ join(dir, "markflow/.agents/workflows/review-spec.md"),
323
+ "utf8"
324
+ );
325
+ assert.ok(review.includes("Only the user marks a spec Approved"));
326
+ assert.ok(review.includes("change Draft to Approved in the spec and in specs/index.md"));
327
+ assert.ok(review.includes("Then coding starts with implement-spec"));
328
+ });
329
+
296
330
  it("init suggests onboarding on first run only", async (t) => {
297
331
  const dir = await tempDir(t);
298
332
  const first = await runInit({ target: dir });
@@ -441,6 +475,28 @@ describe("doctor", () => {
441
475
  assert.ok(result.warnings.includes("markflow/docs/PRD.md"));
442
476
  });
443
477
 
478
+ it("splits the TBD count into now and later", async (t) => {
479
+ const dir = await tempDir(t);
480
+ await runInit({ target: dir });
481
+ const result = runCli(["doctor"], dir);
482
+ assert.match(result.stdout, /20 TBD left to decide now\./);
483
+ assert.match(result.stdout, /39 TBD left for later\./);
484
+ assert.ok(!result.stdout.includes("TBD left in docs"));
485
+ });
486
+
487
+ it("moves a real spec TBD into the now count", async (t) => {
488
+ const dir = await tempDir(t);
489
+ await runInit({ target: dir });
490
+ await write(
491
+ dir,
492
+ "markflow/specs/01-test.md",
493
+ "# 01 Test\n\n## Status\n\nDraft\n\nTBD\n"
494
+ );
495
+ const result = runCli(["doctor"], dir);
496
+ assert.match(result.stdout, /21 TBD left to decide now\./);
497
+ assert.match(result.stdout, /39 TBD left for later\./);
498
+ });
499
+
444
500
  it("warns when instruction text is left visible", async (t) => {
445
501
  const dir = await tempDir(t);
446
502
  await runInit({ target: dir });
@@ -709,7 +765,7 @@ describe("parser", () => {
709
765
  const dir = await tempDir(t);
710
766
  const result = runCli(["--version"], dir);
711
767
  assert.equal(result.status, 0);
712
- assert.equal(result.stdout.trim(), "0.3.0");
768
+ assert.equal(result.stdout.trim(), "0.4.0");
713
769
  });
714
770
  });
715
771