pi-dev-flow 0.85.1 → 0.86.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/CHANGELOG.md +23 -0
- package/README.md +2 -1
- package/docs/development.md +10 -0
- package/docs/gates.md +1 -1
- package/docs/guardrails.md +1 -1
- package/docs/playbook.md +17 -2
- package/extensions/dev-flow.ts +114 -2652
- package/package.json +1 -1
- package/skills/dev-flow/SKILL.md +52 -75
- package/skills/dev-flow/references/finish.md +41 -58
- package/skills/dev-flow/references/implement.md +62 -152
- package/skills/dev-flow/references/plan.md +40 -68
- package/skills/dev-flow/references/pre-release.md +39 -50
- package/skills/dev-flow/references/reflect.md +51 -85
- package/skills/dev-flow/references/release.md +31 -64
- package/skills/dev-flow/references/start.md +50 -69
- package/src/core.ts +44 -20
- package/src/present.ts +224 -0
- package/src/projectmd.ts +6 -1
- package/src/runtime/base.ts +554 -0
- package/src/runtime/checks.ts +358 -0
- package/src/runtime/gates.ts +719 -0
- package/src/runtime/reflect.ts +160 -0
- package/src/runtime/setup.ts +85 -0
- package/src/runtime/ship.ts +629 -0
- package/src/runtime/workers.ts +170 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/** dev-flow runtime — Reflections and the upstream issue fold. Moved out of extensions/dev-flow.ts as is (exports added). */
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { appendReflection, doneItemCount, githubSlug, pluginVersion, guessReflectSections, reflectItems, reflectMove, reflectDone, reflectLegacyPluginCount, reflectionNudges, pluginIssueRecipe, reflectionLine, reflectionsTidy, openChecklistItems, type ReflectTarget, type ReflectItem, type ReflectSection } from "../core.ts";
|
|
5
|
+
import { dedupeReflections, linkedTag, parseGhIssues, similarNote, type FoldResult, type GhIssue } from "../fold.ts";
|
|
6
|
+
import { dfDir, now, originUrl, readReflections, readReflectionsText, sh } from "./base.ts";
|
|
7
|
+
import { type RunResult, type Session } from "./checks.ts";
|
|
8
|
+
import { isSelfRepo } from "./setup.ts";
|
|
9
|
+
|
|
10
|
+
/** The dev-flow repo plugin notes are filed against: the manifest's repository field; the dev-flow
|
|
11
|
+
* checkout itself falls back to its origin. */
|
|
12
|
+
export async function pluginUpstream(root: string): Promise<string> {
|
|
13
|
+
return pluginVersion(import.meta.dirname).repo || (isSelfRepo(root) ? githubSlug((await originUrl(root)) ?? "") : "");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** `flow reflect <note>` — this project's queue, operator decides. `--playbook` / `--code` states the
|
|
17
|
+
* section (the agent knows what its own note is about); `--plugin` is dev-flow feedback, which never
|
|
18
|
+
* lands in a project's file — it prints the upstream issue recipe instead (in the dev-flow repo itself
|
|
19
|
+
* plugin IS code, so it files under `## code`). With no flag the wording guesses and the echo prints why. */
|
|
20
|
+
export async function reflectNote(root: string, sess: Session, note: string[], forced: ReflectTarget | null): Promise<RunResult> {
|
|
21
|
+
const file = path.join(dfDir(root), "reflections.md");
|
|
22
|
+
const text = existsSync(file) ? readFileSync(file, "utf8") : "";
|
|
23
|
+
const guess = guessReflectSections(note.join(" "));
|
|
24
|
+
const self = isSelfRepo(root);
|
|
25
|
+
const target = forced ?? guess.target;
|
|
26
|
+
const why = forced ? "as told" : guess.why;
|
|
27
|
+
const date = now().slice(0, 10);
|
|
28
|
+
if (target === "plugin" && !self) return { text: [...pluginIssueRecipe(note.join(" "), await pluginUpstream(root), sess.slug, date), ...(forced ? [] : [`(filed as plugin: ${why} — a project note: flow reflect --playbook|--code "<note>")`])].join("\n") };
|
|
29
|
+
const section: ReflectSection = target === "plugin" ? "code" : target;
|
|
30
|
+
const line = reflectionLine(note.join(" "), sess.slug, date);
|
|
31
|
+
const next = appendReflection(text, [section], line);
|
|
32
|
+
if (next === text) return { text: `already reflected (duplicate): ${line}` };
|
|
33
|
+
writeFileSync(file, next);
|
|
34
|
+
// queueing is exactly when the operator hears about the checked-off pile — nudge only once it is worth a tidy
|
|
35
|
+
const { tidy } = reflectionNudges(next, date);
|
|
36
|
+
return { text: `reflected (${section} — ${target === "plugin" ? "dev-flow repo: plugin feedback is this project's code" : why}): ${line}` + (tidy ? `\n${tidy}` : "") };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** In-process TTL cache per repo slug — repeat doctor runs in one session must not re-hit the API. */
|
|
40
|
+
export const ghFoldCache = new Map<string, { at: number; issues: GhIssue[] }>();
|
|
41
|
+
export const GH_FOLD_TTL_MS = 5 * 60_000;
|
|
42
|
+
|
|
43
|
+
/** Open GitHub issues of the repo's own origin — the channel external parties can file through.
|
|
44
|
+
* Three outcomes, only the third ever speaks: absent (no GitHub remote — not every repo has one,
|
|
45
|
+
* say nothing), skipped (gh missing / unauthenticated / offline / DEV_FLOW_NO_ISSUES — one line
|
|
46
|
+
* with the reason, never a guess), ok (the parsed list). */
|
|
47
|
+
export async function fetchUpstream(root: string): Promise<{ slug: string; issues: GhIssue[] } | { skipped: string } | { absent: true }> {
|
|
48
|
+
if (process.env.DEV_FLOW_NO_ISSUES) return { skipped: "disabled (DEV_FLOW_NO_ISSUES)" };
|
|
49
|
+
const slug = githubSlug((await originUrl(root)) ?? "");
|
|
50
|
+
if (!slug) return { absent: true };
|
|
51
|
+
const hit = ghFoldCache.get(slug);
|
|
52
|
+
if (hit && Date.now() - hit.at < GH_FOLD_TTL_MS) return { slug, issues: hit.issues };
|
|
53
|
+
const r = await sh(`gh issue list --repo ${slug} --state open --json number,title,body --limit 100`, root, 10_000);
|
|
54
|
+
if (!r.ok) return { skipped: `gh: ${r.out.split("\n").find(Boolean)?.slice(0, 140) || "failed"}` };
|
|
55
|
+
const parsed = parseGhIssues(r.out);
|
|
56
|
+
if (parsed === null) return { skipped: "unparseable gh output" };
|
|
57
|
+
ghFoldCache.set(slug, { at: Date.now(), issues: parsed });
|
|
58
|
+
return { slug, issues: parsed };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type FoldView = { state: "absent" } | { state: "skipped"; why: string } | { state: "ok"; slug: string; result: FoldResult; open: number };
|
|
62
|
+
|
|
63
|
+
export async function foldView(root: string, items: ReflectItem[]): Promise<FoldView> {
|
|
64
|
+
const up = await fetchUpstream(root);
|
|
65
|
+
if ("absent" in up) return { state: "absent" };
|
|
66
|
+
if ("skipped" in up) return { state: "skipped", why: up.skipped };
|
|
67
|
+
return { state: "ok", slug: up.slug, result: dedupeReflections(items, up.issues), open: up.issues.length };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The fold block shared by flow doctor and flow reflect list: header, one row per unmatched
|
|
71
|
+
* issue with its route, then the unmerged near-miss hints. Local rows carry their ⟷ gh#N tag
|
|
72
|
+
* at the call site — the fold lists upstream items, it never re-numbers the local queue. */
|
|
73
|
+
export function foldRows(fold: FoldView, selfRepo: boolean): string[] {
|
|
74
|
+
if (fold.state === "absent") return [];
|
|
75
|
+
if (fold.state === "skipped") return [`upstream issues: skipped (${fold.why})`];
|
|
76
|
+
if (!fold.open) return [];
|
|
77
|
+
const rows = [`upstream on ${fold.slug} — ${fold.open} open issue(s) on GitHub (canonical there — close on GitHub, never here; this is a fold, not a copy):`];
|
|
78
|
+
for (const i of fold.result.upstreamOnly) rows.push(` gh#${i.number} ${i.title} → ${selfRepo ? "fix in a flow here (patch flow if small)" : "fix in a flow here, or close won't-fix on GitHub"}`);
|
|
79
|
+
for (const s of fold.result.similar) rows.push(` ${similarNote(s, s.item + 1)}`);
|
|
80
|
+
return rows;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** `flow reflect list` — the queue numbered, so `move <n>` can address an item (same numbering as
|
|
84
|
+
* `flow roadmap`). Upstream items ride below the local queue as gh#N — never numbered, never
|
|
85
|
+
* addressable by move: each item keeps the home it is resolved in. */
|
|
86
|
+
export async function reflectList(root: string): Promise<RunResult> {
|
|
87
|
+
const items = readReflections(root);
|
|
88
|
+
const fold = await foldView(root, items);
|
|
89
|
+
const local = items.length
|
|
90
|
+
? [
|
|
91
|
+
`reflections — ${items.length} open:`,
|
|
92
|
+
...items.map((it, i) => {
|
|
93
|
+
const link = fold.state === "ok" ? fold.result.linked.find((l) => l.item === i) : undefined;
|
|
94
|
+
return ` ${i + 1}. [${it.section}] ${it.line.replace(/^- \[ \] /, "")}${link ? linkedTag(link.issue) : ""}`;
|
|
95
|
+
}),
|
|
96
|
+
]
|
|
97
|
+
: fold.state === "absent" || fold.state === "skipped"
|
|
98
|
+
? ["reflections: nothing open"]
|
|
99
|
+
: ["reflections: nothing open locally"];
|
|
100
|
+
return { text: [...local, ...legacyPluginRows(readReflectionsText(root), isSelfRepo(root)), ...foldRows(fold, isSelfRepo(root))].join("\n") };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Open rows still under the legacy `## plugin` heading: they belong on GitHub, not in a project's queue. */
|
|
104
|
+
export function legacyPluginRows(text: string, selfRepo: boolean): string[] {
|
|
105
|
+
const n = reflectLegacyPluginCount(text);
|
|
106
|
+
if (!n) return [];
|
|
107
|
+
return [
|
|
108
|
+
selfRepo
|
|
109
|
+
? `reflections: ${n} open item(s) under the legacy ## plugin heading — in the dev-flow repo plugin is code: flow reflect move <n> --code`
|
|
110
|
+
: `reflections: ${n} open item(s) under the legacy ## plugin heading belong on GitHub, not here — file each upstream (flow reflect --plugin "<note>" prints the recipe), then check it off '— filed: gh#NNN'`,
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** `flow reflect move <n> --playbook|--code` — re-file an item under the other heading, so fixing a
|
|
115
|
+
* misfile is one command instead of hand-editing markdown. Nothing moves INTO `## plugin`: dev-flow
|
|
116
|
+
* feedback is filed upstream (flow reflect --plugin prints the recipe), then the row is checked off. */
|
|
117
|
+
export function reflectMoveNote(root: string, args: string[], forced: ReflectTarget | null): RunResult {
|
|
118
|
+
if (forced === "plugin") return { text: "move: plugin notes are not kept in reflections.md — file the item upstream (flow reflect --plugin \"<note>\" prints the recipe), then check the row off '— filed: gh#NNN' (in the dev-flow repo itself: move <n> --code)", isError: true };
|
|
119
|
+
if (!forced) return { text: "usage: flow reflect move <n> --playbook | --code", isError: true };
|
|
120
|
+
const section = forced;
|
|
121
|
+
const n = Number(args[0]);
|
|
122
|
+
const text = readReflectionsText(root);
|
|
123
|
+
const items = reflectItems(text);
|
|
124
|
+
if (!Number.isInteger(n) || n < 1 || n > items.length) return { text: `move: open item 1–${items.length} required — flow reflect list numbers them`, isError: true };
|
|
125
|
+
if (items[n - 1].section === section) return { text: `reflect: item ${n} is already under ## ${section}` };
|
|
126
|
+
// the same note open under both headings (an old --both filing): the move merges it, it does not copy it
|
|
127
|
+
const twin = items.some((it, i) => i !== n - 1 && it.section === section && it.body === items[n - 1].body);
|
|
128
|
+
const next = reflectMove(text, n, section);
|
|
129
|
+
if (next === null) return { text: `move: open item 1–${items.length} required — flow reflect list numbers them`, isError: true };
|
|
130
|
+
writeFileSync(path.join(dfDir(root), "reflections.md"), next);
|
|
131
|
+
const note = items[n - 1].line.replace(/^- \[ \] /, "");
|
|
132
|
+
return { text: twin ? `reflect: item ${n} was already recorded under ## ${section} — the duplicate is gone (${note})` : `reflect: item ${n} re-filed under ## ${section} — ${note}` };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** `flow reflect done <n> [what fixed it]` — check a folded/fixed item off, so doctor stops re-reporting it (#165). */
|
|
136
|
+
export function reflectDoneNote(root: string, sess: Session, args: string[]): RunResult {
|
|
137
|
+
const text = readReflectionsText(root);
|
|
138
|
+
const items = reflectItems(text);
|
|
139
|
+
const n = Number(args[0]);
|
|
140
|
+
if (!Number.isInteger(n) || n < 1 || n > items.length)
|
|
141
|
+
return { text: items.length ? `done: open item 1–${items.length} required — flow reflect list numbers them` : "done: nothing open in reflections.md", isError: true };
|
|
142
|
+
const stamp = [now().slice(0, 10), sess.slug].filter(Boolean).join(" ");
|
|
143
|
+
const what = args.slice(1).join(" ").trim();
|
|
144
|
+
const next = reflectDone(text, n, what ? `${stamp} — ${what}` : stamp)!;
|
|
145
|
+
writeFileSync(path.join(dfDir(root), "reflections.md"), next);
|
|
146
|
+
const { tidy } = reflectionNudges(next, now().slice(0, 10));
|
|
147
|
+
return { text: `reflect: item ${n} checked off — ${items[n - 1].body}` + (tidy ? `\n${tidy}` : "") };
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** `flow reflect tidy` — drop the closed (`- [x]`) items; the `— fixed:` note already recorded the outcome. */
|
|
151
|
+
export function reflectTidy(root: string): RunResult {
|
|
152
|
+
const file = path.join(dfDir(root), "reflections.md");
|
|
153
|
+
if (!existsSync(file)) return { text: "reflections: nothing to tidy (no queue yet)" };
|
|
154
|
+
const text = readFileSync(file, "utf8");
|
|
155
|
+
const closed = doneItemCount(text);
|
|
156
|
+
const open = openChecklistItems(text).length;
|
|
157
|
+
if (!closed) return { text: `reflections: nothing to tidy (${open} open, 0 closed)` };
|
|
158
|
+
writeFileSync(file, reflectionsTidy(text));
|
|
159
|
+
return { text: `reflections: dropped ${closed} closed item(s) — ${open} open` };
|
|
160
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** dev-flow runtime — flow init's setup questions and repo evidence. Moved out of extensions/dev-flow.ts as is (exports added). */
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { type Detection } from "../detect.ts";
|
|
5
|
+
import { AGENT_MARK } from "../present.ts";
|
|
6
|
+
import { sh } from "./base.ts";
|
|
7
|
+
|
|
8
|
+
/** Is this checkout the dev-flow repo itself? Plugin reflections are fixable in-repo only here. */
|
|
9
|
+
export function isSelfRepo(root: string): boolean {
|
|
10
|
+
try {
|
|
11
|
+
return (JSON.parse(readFileSync(path.join(root, "package.json"), "utf8")) as { name?: unknown }).name === "pi-dev-flow";
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Which tag convention the repo already uses — read off its newest tags, like the merge style is read off
|
|
18
|
+
* its history. null = no version-like tags yet (the v{version} default stands, and is asked about). */
|
|
19
|
+
export async function tagPatternEvidence(root: string): Promise<{ pattern: string; note: string } | null> {
|
|
20
|
+
const r = await sh("git tag --list --sort=-creatordate", root, 10_000);
|
|
21
|
+
if (!r.ok) return null;
|
|
22
|
+
const tags = r.out.split("\n").map((t) => t.trim()).filter((t) => /\d+\.\d+\.\d+/.test(t)).slice(0, 20);
|
|
23
|
+
if (!tags.length) return null;
|
|
24
|
+
const prefix = (t: string) => t.slice(0, t.search(/\d+\.\d+\.\d+/));
|
|
25
|
+
const counts = new Map<string, number>();
|
|
26
|
+
for (const t of tags) counts.set(prefix(t), (counts.get(prefix(t)) ?? 0) + 1);
|
|
27
|
+
const [top] = [...counts.entries()].sort((x, y) => y[1] - x[1]);
|
|
28
|
+
return { pattern: `${top[0]}{version}`, note: `${tags.length} version tag(s), newest ${tags[0]}${counts.size > 1 ? ` (mixed prefixes: ${[...counts.keys()].map((k) => k || "none").join(", ")})` : ""}` };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** One setup question: what to ask, what detection found, why it matters, and the answer that accepts it. */
|
|
32
|
+
export interface SetupQuestion {
|
|
33
|
+
key: string;
|
|
34
|
+
ask: string;
|
|
35
|
+
detected?: string;
|
|
36
|
+
/** `flow init --answers` token(s) that accept the detected/suggested value */
|
|
37
|
+
accept?: string;
|
|
38
|
+
why: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The questions `flow init` asks before writing a playbook — detection fills what it can, the operator
|
|
42
|
+
* answers the rest (the agent relays them). Every question says why it matters and what skipping costs,
|
|
43
|
+
* so it is answerable without reading docs/playbook.md first. */
|
|
44
|
+
export function setupQuestions(det: Detection, ev: { merge?: { note: string; recent: string | null } | null; tag?: { pattern: string; note: string } | null }): SetupQuestion[] {
|
|
45
|
+
const sug = (k: string) => det.suggestions.filter((x) => x.key === k);
|
|
46
|
+
const q: SetupQuestion[] = [];
|
|
47
|
+
const forge = det.partial.forge;
|
|
48
|
+
q.push({ key: "forge", ask: "Where is the repo hosted: github, gitlab or self (plain git)?", detected: forge ? `${forge} (from the origin URL)` : "no origin remote", accept: forge ? `forge=${forge}` : undefined, why: "decides who creates the release and how dev-flow proves a PR really merged (gh/glab); self = git only, no automatic releases" });
|
|
49
|
+
const vf = det.partial.versioning?.file;
|
|
50
|
+
q.push({ key: "versionFile", ask: vf ? `Version lives in ${vf} — keep it?` : "Which file holds the version? (VERSION recommended for non-package repos; or answer that releases carry no version)", detected: vf, accept: vf ? `versionFile=${vf}` : undefined, why: "a release bumps this file and the tag must match it; without one, every release is merge-only (no bump, no tag)" });
|
|
51
|
+
const tag = ev.tag?.pattern ?? "v{version}";
|
|
52
|
+
q.push({ key: "versionTag", ask: `Tag pattern: ${tag}?`, detected: ev.tag ? `${ev.tag.note}` : "no version tags yet — default v{version}", accept: `versionTag=${tag}`, why: "release tags and the manifest are checked against each other; a pattern that differs from your existing tags breaks the last-release lookup" });
|
|
53
|
+
q.push({ key: "merge", ask: "How should a merged PR land on the default branch: squash, merge (a merge commit), rebase, or any (no policy)?", detected: ev.merge?.note ?? "no history to read a style from", accept: ev.merge?.recent ? `merge=${ev.merge.recent}` : undefined, why: "the guard blocks a PR merge in a different style and release-done proves what landed; flow start refuses until this is answered" });
|
|
54
|
+
q.push({ key: "releases", ask: "Should release-done create the forge release automatically (gh/glab release from the changelog entry)?", detected: forge === "self" ? "forge = self: no CLI to create one" : undefined, accept: forge === "self" ? "releases=false" : "releases=true", why: "off = the tag is pushed and publishing the release page stays your manual step" });
|
|
55
|
+
const art = sug("artifact");
|
|
56
|
+
q.push({ key: "artifact", ask: art.length ? "Verify the published artifact after release with this command?" : "Do you publish anything to a registry (npm, crates.io, a container image)? If so, which command proves the version is out?", detected: art.map((a) => a.why).join("; ") || undefined, accept: art[0] ? `artifact=${art[0].value}` : undefined, why: "release-done refuses to finish until the artifact is really there — catches a CI publish that silently failed; none = no check" });
|
|
57
|
+
const pre = sug("preflight");
|
|
58
|
+
if (pre.length) q.push({ key: "preflight", ask: `Run \`${pre[0].value}\` before anything ships?`, detected: pre[0].why, accept: `preflight=${pre[0].value}`, why: "flow release runs it in the worktree first — a build the tag would trigger, proven before the tag exists" });
|
|
59
|
+
const checks = det.partial.checks ?? {};
|
|
60
|
+
q.push({
|
|
61
|
+
key: "check.<name>",
|
|
62
|
+
ask: `Tier-1 checks: ${det.missing.length ? `not detected: ${det.missing.join(", ")}` : "test/build/run detected"}${Object.keys(checks).length ? `; drafted extra checks: ${Object.keys(checks).join(", ")}` : ""}. Correct? Anything CI runs that is missing (lint, typecheck, e2e)?`,
|
|
63
|
+
detected: Object.entries(det.partial.commands).filter(([k]) => k !== "setup").map(([k, v]) => `${k}: ${v}`).join(" · ") || undefined,
|
|
64
|
+
why: "flow check runs every one of these and the gates refuse while any fails — a check missing here is a failure only CI will see; answer test=… / build=… / check.<name>=<cmd> (empty value removes)",
|
|
65
|
+
});
|
|
66
|
+
const dev = sug("dev");
|
|
67
|
+
q.push({ key: "health", ask: `Does the app expose a health probe (e.g. curl -fs localhost:PORT/healthz)?${dev.length ? ` And use \`${dev[0].value}\` as the dev deploy reviewed before verify?` : " Is there a dev deploy reviewed before verify?"}`, detected: dev[0]?.why, accept: dev[0] ? `dev=${dev[0].value}` : undefined, why: "verify proves the running build is healthy only with a probe; none is fine for libraries and CLIs" });
|
|
68
|
+
if (det.partial.changelog === "") q.push({ key: "changelog", ask: "No changelog found — create CHANGELOG.md, or run without one?", accept: "changelog=", why: "the release gates fold the branch's entry into the version heading; empty = no changelog checks at all" });
|
|
69
|
+
q.push({ key: "guard", ask: `Any commands the agent must never run, or files it must never touch?${det.partial.guards?.length ? ` (drafted from disk: ${det.partial.guards.map((g) => g.split(" :: ")[0].replace(/\s+/g, " ")).join(", ")})` : ""}`, why: "flow-guard rules are hard blocks or operator confirmations on every shell call and edit; added with flow init --write-file (free text)" });
|
|
70
|
+
q.push({ key: "checklist", ask: "Anything you want to tick off by hand per stage (e.g. 'migration tested on a prod copy'), or standing guidance the agent should read at a stage?", why: "checklist items are confirmed as a set at the gate; prose is injected when the stage begins — both are free text: flow init --write-file" });
|
|
71
|
+
return q;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function renderQuestions(qs: SetupQuestion[]): string[] {
|
|
75
|
+
const out: string[] = [];
|
|
76
|
+
qs.forEach((x, i) => {
|
|
77
|
+
out.push(` ${i + 1}. [${x.key}] ${x.ask}`);
|
|
78
|
+
if (x.detected) out.push(` detected: ${x.detected}`);
|
|
79
|
+
if (x.accept) out.push(` accept: ${x.accept}`);
|
|
80
|
+
out.push(` why: ${x.why}`);
|
|
81
|
+
});
|
|
82
|
+
return out;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const GIT_TRACK_NOTE = AGENT_MARK + 'the playbook belongs in git: git add -f .dev-flow/project.md && DEV_FLOW_ALLOW_MAIN=1 git commit -m "track project.md" (force-add: a root .gitignore may exclude .dev-flow/ entirely — tracked once, the ignore stops mattering; the env prefix is for the pre-commit hook, dev-flow itself lets a main commit whose only change is the playbook)';
|