@moritakaaz/markflow 0.4.3 → 0.4.5

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.4.3"
22
+ "version": "0.4.5"
23
23
  }
package/src/doctor.js CHANGED
@@ -127,6 +127,19 @@ function sectionLines(text, heading) {
127
127
  return out;
128
128
  }
129
129
 
130
+ // A language line is unanswered when it still says TBD or when the
131
+ // value after the label is empty.
132
+ function languageUnanswered(line) {
133
+ if (line.includes("TBD")) {
134
+ return true;
135
+ }
136
+ const dot = line.indexOf(".");
137
+ if (dot === -1) {
138
+ return false;
139
+ }
140
+ return line.slice(dot + 1).trim() === "";
141
+ }
142
+
130
143
  // A spec counts as listed only when its exact file name appears.
131
144
  // A substring match would also match old-login.md for login.md.
132
145
  // A path form such as specs/login.md also counts.
@@ -273,10 +286,12 @@ export async function runDoctor(options) {
273
286
  "utf8"
274
287
  );
275
288
  const language = sectionLines(prdText, "Language");
276
- if (
277
- language !== null &&
278
- language.some((line) => line.includes("TBD"))
279
- ) {
289
+ const languageMissing =
290
+ language === null ||
291
+ !language.some((line) => line.includes("Conversation language")) ||
292
+ !language.some((line) => line.includes("Docs language")) ||
293
+ language.some(languageUnanswered);
294
+ if (languageMissing) {
280
295
  console.log("Warning Language not answered in markflow/docs/PRD.md");
281
296
  warnings.push("markflow/docs/PRD.md");
282
297
  }
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.4.3";
6
- export const TEMPLATE_VERSION = "0.4.3";
5
+ export const METHODOLOGY_VERSION = "0.4.5";
6
+ export const TEMPLATE_VERSION = "0.4.5";
@@ -20,18 +20,22 @@ Start with these files in order.
20
20
  - Code is in English. Docs are in English for this template. Change the doc language in `markflow/docs/PRD.md` when the project needs another language. The Markflow repo itself is English only. Your project is not.
21
21
  - Use English in file and folder names too.
22
22
  - Keep these words in English in every doc. Status, Acceptance, Approved, Draft, and TBD. Doctor reads them. Write the rest in any language.
23
- - Write short sentences. Write like you talk to a teammate. Avoid em dashes. Avoid colons in prose. Avoid formal and cliché words. Avoid words like delve, leverage, seamless, robust, and cutting edge.
24
- - Use contractions in English. Write don't instead of do not when it sounds natural.
23
+ - Write short sentences. Write like you talk to a teammate. Avoid em dashes. Avoid colons in prose.
25
24
  - Keep commits small. One logical change per commit. Use the imperative mood. Keep the subject short and clear. Good examples are Add README and Fix typo in PRINCIPLES.
26
25
  - Do not invent architecture or decisions. If you do not know something, say so and ask. Do not overwrite user files without approval. Do not change code outside the scope of your task.
27
26
  - Every doc file starts with a short note on what it is for and when to read it. Keep the README short. Put details in docs.
28
- - Name files the way the language expects. Use kebab-case when the language has no rule.
27
+ - Follow the file naming style of the language. Use English words, and kebab-case when the language has no rule.
29
28
  - Write a comment only when logic is hard to follow without it. Use simple comments. For one line use //. For many lines use /* */. Do not use decorative comment lines.
30
29
  - All code lives in the source folder found during discovery. Tests live in the test folder found during discovery. Do not create new top level folders for code.
31
30
  - Specs in `markflow/specs` are the source for intent and requirements. If code differs from a spec, stop and check both. Do not assume the spec is always right.
32
31
  - Every claim in a doc comes from one of three places. What the user said. What the code shows. Or TBD. Never invent a decision or an architecture detail.
33
32
  - All links inside `markflow` must be relative to that folder. Do not use absolute paths from the root.
34
33
 
34
+ ### When the docs are in English
35
+
36
+ - Avoid formal and cliché words. Avoid words like delve, leverage, seamless, robust, and cutting edge.
37
+ - Use contractions. Write don't instead of do not when it sounds natural.
38
+
35
39
  ## If you are human and you do not use AI
36
40
 
37
41
  Ignore the `markflow/.agents` folder. Read `README.md` and `CONTRIBUTING.md` in this project instead.
package/test/cli.test.js CHANGED
@@ -625,6 +625,41 @@ describe("doctor", () => {
625
625
  assert.ok(result.warnings.includes("markflow/docs/PRD.md"));
626
626
  });
627
627
 
628
+ it("warns when a language value is empty", async (t) => {
629
+ const dir = await tempDir(t);
630
+ await runInit({ target: dir });
631
+ await write(
632
+ dir,
633
+ "markflow/docs/PRD.md",
634
+ "Our own product.\n\n## Language\n\n- Conversation language. Indonesian\n- Docs language. \n"
635
+ );
636
+ const result = await runDoctor({ target: dir });
637
+ assert.equal(result.ok, true);
638
+ assert.ok(result.warnings.includes("markflow/docs/PRD.md"));
639
+ });
640
+
641
+ it("warns when a language line is deleted", async (t) => {
642
+ const dir = await tempDir(t);
643
+ await runInit({ target: dir });
644
+ await write(
645
+ dir,
646
+ "markflow/docs/PRD.md",
647
+ "Our own product.\n\n## Language\n\n- Conversation language. Indonesian\n"
648
+ );
649
+ const result = await runDoctor({ target: dir });
650
+ assert.equal(result.ok, true);
651
+ assert.ok(result.warnings.includes("markflow/docs/PRD.md"));
652
+ });
653
+
654
+ it("warns when the Language section is deleted", async (t) => {
655
+ const dir = await tempDir(t);
656
+ await runInit({ target: dir });
657
+ await write(dir, "markflow/docs/PRD.md", "Our own product.\n");
658
+ const result = await runDoctor({ target: dir });
659
+ assert.equal(result.ok, true);
660
+ assert.ok(result.warnings.includes("markflow/docs/PRD.md"));
661
+ });
662
+
628
663
  it("no language warning when both languages are answered", async (t) => {
629
664
  const dir = await tempDir(t);
630
665
  await runInit({ target: dir });
@@ -741,7 +776,11 @@ describe("doctor", () => {
741
776
  it("no template warnings when all three are filled", async (t) => {
742
777
  const dir = await tempDir(t);
743
778
  await runInit({ target: dir });
744
- await write(dir, "markflow/docs/PRD.md", "Our own product.\n");
779
+ await write(
780
+ dir,
781
+ "markflow/docs/PRD.md",
782
+ "Our own product.\n\n## Language\n\n- Conversation language. Indonesian\n- Docs language. Indonesian\n"
783
+ );
745
784
  await write(dir, "markflow/docs/ARCHITECTURE.md", "Our own stack.\n");
746
785
  await write(dir, "markflow/TASKS.md", "Our own tasks.\n");
747
786
  const result = await runDoctor({ target: dir });
@@ -754,7 +793,11 @@ describe("doctor", () => {
754
793
  it("no PRD warning when PRD is filled", async (t) => {
755
794
  const dir = await tempDir(t);
756
795
  await runInit({ target: dir });
757
- await write(dir, "markflow/docs/PRD.md", "Our own product.\n");
796
+ await write(
797
+ dir,
798
+ "markflow/docs/PRD.md",
799
+ "Our own product.\n\n## Language\n\n- Conversation language. Indonesian\n- Docs language. Indonesian\n"
800
+ );
758
801
  const result = await runDoctor({ target: dir });
759
802
  assert.equal(result.ok, true);
760
803
  assert.ok(!result.warnings.includes("markflow/docs/PRD.md"));
@@ -961,7 +1004,7 @@ describe("parser", () => {
961
1004
  const dir = await tempDir(t);
962
1005
  const result = runCli(["--version"], dir);
963
1006
  assert.equal(result.status, 0);
964
- assert.equal(result.stdout.trim(), "0.4.3");
1007
+ assert.equal(result.stdout.trim(), "0.4.5");
965
1008
  });
966
1009
  });
967
1010