@moritakaaz/markflow 0.3.0 → 0.4.1
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 +1 -1
- package/src/doctor.js +29 -3
- package/src/versions.js +2 -2
- package/templates/markflow/.agents/workflows/onboarding.md +8 -7
- package/templates/markflow/.agents/workflows/review-spec.md +2 -1
- package/templates/markflow/TASKS.md +5 -1
- package/templates/markflow/docs/PRD.md +7 -0
- package/test/cli.test.js +61 -1
package/package.json
CHANGED
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
|
|
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
|
-
|
|
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 " +
|
|
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.
|
|
6
|
-
export const TEMPLATE_VERSION = "0.
|
|
5
|
+
export const METHODOLOGY_VERSION = "0.4.1";
|
|
6
|
+
export const TEMPLATE_VERSION = "0.4.1";
|
|
@@ -7,13 +7,14 @@ Do not read when. The PRD is already filled. Use the other workflows instead.
|
|
|
7
7
|
## Steps
|
|
8
8
|
|
|
9
9
|
1. Ask one question at a time. Wait for the answer before you ask the next one.
|
|
10
|
-
2.
|
|
11
|
-
3.
|
|
12
|
-
4. Ask
|
|
13
|
-
5.
|
|
14
|
-
6.
|
|
15
|
-
7.
|
|
16
|
-
8.
|
|
10
|
+
2. 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.
|
|
11
|
+
3. Start with the problem. What hurts today, and for whom.
|
|
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.
|
|
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
|
-
-
|
|
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,44 @@ 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
|
+
assert.ok(
|
|
307
|
+
workflow.indexOf("which language to use in this conversation") <
|
|
308
|
+
workflow.indexOf("Start with the problem")
|
|
309
|
+
);
|
|
310
|
+
const prd = await readFile(join(dir, "markflow/docs/PRD.md"), "utf8");
|
|
311
|
+
assert.ok(prd.includes("## Language"));
|
|
312
|
+
assert.ok(prd.includes("- Conversation. TBD"));
|
|
313
|
+
assert.ok(prd.includes("- Docs. TBD"));
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it("tasks list the first five steps and review names the user as approver", async (t) => {
|
|
317
|
+
const dir = await tempDir(t);
|
|
318
|
+
await runInit({ target: dir });
|
|
319
|
+
const tasks = await readFile(join(dir, "markflow/TASKS.md"), "utf8");
|
|
320
|
+
assert.ok(tasks.includes("Finish onboarding in markflow/.agents/workflows/onboarding.md"));
|
|
321
|
+
assert.ok(tasks.includes("Write spec 01 from markflow/specs/_template.md"));
|
|
322
|
+
assert.ok(tasks.includes("Review spec 01 with review-spec.md"));
|
|
323
|
+
assert.ok(tasks.includes("Build spec 01 with implement-spec.md"));
|
|
324
|
+
assert.ok(tasks.includes("Update TASKS.md when spec 01 is done"));
|
|
325
|
+
const review = await readFile(
|
|
326
|
+
join(dir, "markflow/.agents/workflows/review-spec.md"),
|
|
327
|
+
"utf8"
|
|
328
|
+
);
|
|
329
|
+
assert.ok(review.includes("Only the user marks a spec Approved"));
|
|
330
|
+
assert.ok(review.includes("change Draft to Approved in the spec and in specs/index.md"));
|
|
331
|
+
assert.ok(review.includes("Then coding starts with implement-spec"));
|
|
332
|
+
});
|
|
333
|
+
|
|
296
334
|
it("init suggests onboarding on first run only", async (t) => {
|
|
297
335
|
const dir = await tempDir(t);
|
|
298
336
|
const first = await runInit({ target: dir });
|
|
@@ -441,6 +479,28 @@ describe("doctor", () => {
|
|
|
441
479
|
assert.ok(result.warnings.includes("markflow/docs/PRD.md"));
|
|
442
480
|
});
|
|
443
481
|
|
|
482
|
+
it("splits the TBD count into now and later", async (t) => {
|
|
483
|
+
const dir = await tempDir(t);
|
|
484
|
+
await runInit({ target: dir });
|
|
485
|
+
const result = runCli(["doctor"], dir);
|
|
486
|
+
assert.match(result.stdout, /20 TBD left to decide now\./);
|
|
487
|
+
assert.match(result.stdout, /39 TBD left for later\./);
|
|
488
|
+
assert.ok(!result.stdout.includes("TBD left in docs"));
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
it("moves a real spec TBD into the now count", async (t) => {
|
|
492
|
+
const dir = await tempDir(t);
|
|
493
|
+
await runInit({ target: dir });
|
|
494
|
+
await write(
|
|
495
|
+
dir,
|
|
496
|
+
"markflow/specs/01-test.md",
|
|
497
|
+
"# 01 Test\n\n## Status\n\nDraft\n\nTBD\n"
|
|
498
|
+
);
|
|
499
|
+
const result = runCli(["doctor"], dir);
|
|
500
|
+
assert.match(result.stdout, /21 TBD left to decide now\./);
|
|
501
|
+
assert.match(result.stdout, /39 TBD left for later\./);
|
|
502
|
+
});
|
|
503
|
+
|
|
444
504
|
it("warns when instruction text is left visible", async (t) => {
|
|
445
505
|
const dir = await tempDir(t);
|
|
446
506
|
await runInit({ target: dir });
|
|
@@ -709,7 +769,7 @@ describe("parser", () => {
|
|
|
709
769
|
const dir = await tempDir(t);
|
|
710
770
|
const result = runCli(["--version"], dir);
|
|
711
771
|
assert.equal(result.status, 0);
|
|
712
|
-
assert.equal(result.stdout.trim(), "0.
|
|
772
|
+
assert.equal(result.stdout.trim(), "0.4.1");
|
|
713
773
|
});
|
|
714
774
|
});
|
|
715
775
|
|