@moritakaaz/markflow 0.4.3 → 0.4.4
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 +14 -4
- package/src/versions.js +2 -2
- package/templates/AGENTS.md +7 -3
- package/test/cli.test.js +14 -1
package/package.json
CHANGED
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,7 @@ 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
|
+
if (language !== null && language.some(languageUnanswered)) {
|
|
280
290
|
console.log("Warning Language not answered in markflow/docs/PRD.md");
|
|
281
291
|
warnings.push("markflow/docs/PRD.md");
|
|
282
292
|
}
|
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.
|
|
6
|
-
export const TEMPLATE_VERSION = "0.4.
|
|
5
|
+
export const METHODOLOGY_VERSION = "0.4.4";
|
|
6
|
+
export const TEMPLATE_VERSION = "0.4.4";
|
package/templates/AGENTS.md
CHANGED
|
@@ -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.
|
|
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
|
-
-
|
|
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,19 @@ 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
|
+
|
|
628
641
|
it("no language warning when both languages are answered", async (t) => {
|
|
629
642
|
const dir = await tempDir(t);
|
|
630
643
|
await runInit({ target: dir });
|
|
@@ -961,7 +974,7 @@ describe("parser", () => {
|
|
|
961
974
|
const dir = await tempDir(t);
|
|
962
975
|
const result = runCli(["--version"], dir);
|
|
963
976
|
assert.equal(result.status, 0);
|
|
964
|
-
assert.equal(result.stdout.trim(), "0.4.
|
|
977
|
+
assert.equal(result.stdout.trim(), "0.4.4");
|
|
965
978
|
});
|
|
966
979
|
});
|
|
967
980
|
|