flanders 0.1.0 → 0.3.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/lib/ai/AiRunner.d.ts +24 -0
- package/lib/ai/AiRunner.js +100 -0
- package/lib/ai/AiSession.d.ts +32 -0
- package/lib/ai/AiSession.js +143 -0
- package/lib/ai/ClaudeAdapter.d.ts +12 -0
- package/lib/ai/ClaudeAdapter.js +345 -0
- package/lib/ai/CodexAdapter.d.ts +13 -0
- package/lib/ai/CodexAdapter.js +354 -0
- package/lib/ai/ToolAdapter.d.ts +52 -0
- package/lib/ai/ToolAdapter.js +2 -0
- package/lib/cli.js +56 -35
- package/lib/commands/Implement.d.ts +22 -8
- package/lib/commands/Implement.js +296 -171
- package/lib/commands/Install.d.ts +31 -3
- package/lib/commands/Install.js +625 -49
- package/lib/commands/InstallModelProbe.d.ts +11 -0
- package/lib/commands/InstallModelProbe.js +99 -0
- package/lib/contexts.d.ts +5 -4
- package/lib/index.d.ts +5 -3
- package/lib/{PlanFile.d.ts → plan/PlanFile.d.ts} +8 -1
- package/lib/{PlanFile.js → plan/PlanFile.js} +44 -5
- package/lib/prompts/prompts.d.ts +48 -0
- package/lib/prompts/prompts.js +328 -0
- package/lib/prompts/skills.d.ts +3 -0
- package/lib/prompts/skills.js +464 -0
- package/lib/{Git.d.ts → system/Git.d.ts} +4 -2
- package/lib/{Git.js → system/Git.js} +63 -3
- package/lib/{ScriptRunner.d.ts → system/ScriptRunner.d.ts} +1 -1
- package/lib/system/ShellScriptContext.d.ts +36 -0
- package/lib/system/ShellScriptContext.js +70 -0
- package/lib/{fsUtils.d.ts → system/fsUtils.d.ts} +1 -1
- package/lib/{wait.d.ts → system/wait.d.ts} +1 -1
- package/lib/ui/BottomBlock.d.ts +9 -1
- package/lib/ui/BottomBlock.js +30 -14
- package/lib/ui/PromptHelper.d.ts +12 -0
- package/lib/ui/PromptHelper.js +32 -0
- package/lib/ui/TerminalSizeSource.d.ts +19 -0
- package/lib/ui/TerminalSizeSource.js +77 -0
- package/lib/ui/formatters.d.ts +14 -0
- package/lib/ui/formatters.js +65 -2
- package/lib/workspace/FlandersConfig.d.ts +23 -0
- package/lib/workspace/FlandersConfig.js +90 -0
- package/lib/workspace/SpecDiscovery.d.ts +12 -0
- package/lib/workspace/SpecDiscovery.js +40 -0
- package/lib/{Workspace.d.ts → workspace/Workspace.d.ts} +10 -2
- package/lib/{Workspace.js → workspace/Workspace.js} +52 -6
- package/package.json +3 -2
- package/lib/Claude.d.ts +0 -129
- package/lib/Claude.js +0 -387
- package/lib/ClaudeSession.d.ts +0 -34
- package/lib/ClaudeSession.js +0 -292
- package/lib/prompts.d.ts +0 -18
- package/lib/prompts.js +0 -221
- package/lib/skills.d.ts +0 -3
- package/lib/skills.js +0 -267
- /package/lib/{ScriptRunner.js → system/ScriptRunner.js} +0 -0
- /package/lib/{fsUtils.js → system/fsUtils.js} +0 -0
- /package/lib/{wait.js → system/wait.js} +0 -0
package/lib/skills.js
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.planSkillBody = exports.ruleSkillBody = exports.contractSkillBody = void 0;
|
|
4
|
-
exports.contractSkillBody = `---
|
|
5
|
-
description: Translate a free-form request into one or more contract markdown files inside the project's contracts/ folder.
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are the /flanders-contract skill. Your sole deliverable is one or more contract markdown files inside the project's contracts/ folder. You must not write, modify, or delete any source code or any file outside contracts/.
|
|
9
|
-
|
|
10
|
-
## Input resolution
|
|
11
|
-
|
|
12
|
-
The user invokes you as: /flanders-contract [<data>]
|
|
13
|
-
|
|
14
|
-
- If <data> is omitted, take the user's natural-language request from the same turn or from subsequent turns of the conversation.
|
|
15
|
-
- If <data> is supplied and resolves to an existing file path, read the file's content and use it as input.
|
|
16
|
-
- If <data> is supplied and does not resolve to an existing file, use the value verbatim as inline input.
|
|
17
|
-
|
|
18
|
-
## What a contract is
|
|
19
|
-
|
|
20
|
-
A contract is a markdown document that describes the public-facing obligations of a piece of software. It captures what a user of that software will see, do, and rely on. Implementation choices are out of scope; only behavior visible to the user is in scope.
|
|
21
|
-
|
|
22
|
-
Contracts are the most public surface of the project. Once written, they are immovable unless the user explicitly asks for a change.
|
|
23
|
-
|
|
24
|
-
## Procedure
|
|
25
|
-
|
|
26
|
-
1. Resolve the input from the invocation rule above.
|
|
27
|
-
2. Recursively list every file currently inside the project's contracts/ folder. Capture relative paths from the project root. When the folder does not exist or is empty, the listing is empty. This listing is exhaustive — do not enumerate files in any other way.
|
|
28
|
-
3. Run the clarification phase before writing anything to disk:
|
|
29
|
-
- Pick the files relevant to the request from the listing and read their content to understand the project context.
|
|
30
|
-
- Ask clarifying questions sequentially — one question per turn — whenever the request leaves an obligation ambiguous, leaves a UI or logic decision unspecified, or admits multiple valid interpretations. Do not bundle several questions in one turn.
|
|
31
|
-
- Prefer multiple-choice questions when the answer space is bounded. Use open-ended questions only when multiple-choice would force a false dichotomy.
|
|
32
|
-
- When two or three substantially different approaches would all satisfy the request, present those approaches with a short trade-off summary for each and ask the user to pick or redirect, instead of silently choosing one.
|
|
33
|
-
- The clarification phase ends only when you have enough information to draft contract files that contain no placeholders, no contradictions, and no scope ambiguity.
|
|
34
|
-
4. Run the drafting phase. Before persisting any file:
|
|
35
|
-
- Present the planned file layout (which files will exist, what each file will cover) and the key obligations of each file as a structured summary, and wait for user approval or redirection.
|
|
36
|
-
- For non-trivial requests, present the draft of each file (or each section, when a file is large) and wait for approval before moving on. Trivial requests may be presented as a single combined draft.
|
|
37
|
-
- Update related existing contract files in place when the request affects obligations they already cover, and create new files only for obligations not already covered. Do not duplicate an existing obligation across files.
|
|
38
|
-
5. After approval, run a self-review pass before finalizing each file: re-read the draft and check for placeholders left behind, contradictions with other contract files, ambiguous wording, and scope that drifted beyond what the user requested. Fix any issue in place; if a fix would change the meaning of an already-approved obligation, surface the issue to the user and ask before applying it.
|
|
39
|
-
6. Organize the resulting files in whichever shape best fits the requested product:
|
|
40
|
-
- A single descriptive file when the product is small.
|
|
41
|
-
- Multiple files inside contracts/ when the product has clearly separable concerns (for example, a logic file and a UI file).
|
|
42
|
-
- Subfolders grouping related files when the product has multiple sections (for example, one folder per major feature).
|
|
43
|
-
7. Filenames must be descriptive of their content — the user must be able to tell what each file covers from its name alone.
|
|
44
|
-
|
|
45
|
-
## Output language
|
|
46
|
-
|
|
47
|
-
Write contract files in the same natural language as the input request. If the input is in Spanish, the output is in Spanish; if English, English; and so on. Do not translate unless the user says otherwise.
|
|
48
|
-
|
|
49
|
-
## Idempotency and overwrites
|
|
50
|
-
|
|
51
|
-
Existing files in contracts/ are not protected. Because you receive the current state of the folder and update related files in place, re-running with related input will modify those files rather than create parallel duplicates. Preserving prior versions is the user's responsibility (typically through version control).`;
|
|
52
|
-
exports.ruleSkillBody = `---
|
|
53
|
-
description: Translate a free-form request into one or more rule markdown files inside the project's rules/ folder.
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
You are the /flanders-rule skill. Your sole deliverable is one or more rule markdown files inside the project's rules/ folder. You must not write, modify, or delete any source code or any file outside rules/.
|
|
57
|
-
|
|
58
|
-
## Input resolution
|
|
59
|
-
|
|
60
|
-
The user invokes you as: /flanders-rule [<data>]
|
|
61
|
-
|
|
62
|
-
- If <data> is omitted, take the user's natural-language request from the same turn or from subsequent turns of the conversation.
|
|
63
|
-
- If <data> is supplied and resolves to an existing file path, read the file's content and use it as input.
|
|
64
|
-
- If <data> is supplied and does not resolve to an existing file, use the value verbatim as inline input.
|
|
65
|
-
|
|
66
|
-
## What a rule is
|
|
67
|
-
|
|
68
|
-
A rule is a markdown document that captures a single, atomic piece of implementation guidance — a constraint, convention, or pattern that the project's code must follow. Each rule file describes exactly one rule.
|
|
69
|
-
|
|
70
|
-
Bundles of related rules (for example, the multiple obligations that make up SOLID, or the dispose pattern) are modeled as a subfolder under rules/ containing one file per atomic rule inside, never as a single multi-rule file.
|
|
71
|
-
|
|
72
|
-
The namespace of a rule is its relative path inside rules/ — the combination of its enclosing subfolders and its filename. The namespace is what downstream tooling uses to organize, filter, and reference rules.
|
|
73
|
-
|
|
74
|
-
Rules are immovable once written unless the user explicitly asks for a change.
|
|
75
|
-
|
|
76
|
-
## Procedure
|
|
77
|
-
|
|
78
|
-
1. Resolve the input from the invocation rule above.
|
|
79
|
-
2. Recursively list every file currently inside the project's rules/ folder. Capture relative paths from the project root. When the folder does not exist or is empty, the listing is empty. This listing is exhaustive — do not enumerate files in any other way.
|
|
80
|
-
3. Run the clarification phase before writing anything to disk:
|
|
81
|
-
- Pick the files relevant to the request from the listing and read their content to understand the project's existing rule set.
|
|
82
|
-
- Ask the user clarifying questions sequentially — one question per turn — whenever the request leaves a rule ambiguous, leaves the scope of enforcement unspecified, or admits multiple valid interpretations. Do not bundle several questions in one turn.
|
|
83
|
-
- Prefer multiple-choice questions when the answer space is bounded. Use open-ended questions only when multiple-choice would force a false dichotomy.
|
|
84
|
-
- When two or three substantially different formulations of a rule would all satisfy the request, present those formulations with a short trade-off summary for each and ask the user to pick or redirect, instead of silently choosing one.
|
|
85
|
-
- The clarification phase ends only when you have enough information to draft rule files that contain no placeholders, no contradictions, and no scope ambiguity.
|
|
86
|
-
4. Run the drafting phase. Before persisting any file:
|
|
87
|
-
- Present the planned file layout (which rule files will exist, in which subfolders, and the atomic rule each file captures) as a structured summary, and wait for user approval or redirection.
|
|
88
|
-
- For non-trivial requests, present the draft of each file (or each section, when a file is large) and wait for approval before moving on. Trivial requests may be presented as a single combined draft.
|
|
89
|
-
- Update related existing rule files in place when the request affects rules they already cover, and create new files only for rules not already covered. Do not duplicate the same rule across files.
|
|
90
|
-
5. After approval, run the self-review pass before finalizing each file: re-read the draft and check for placeholders left behind, contradictions with other rule files or with existing contracts, ambiguous wording, and scope that drifted beyond what the user requested. Fix any issue in place; if a fix would change the meaning of an already-approved rule, surface the issue to the user and ask before applying it.
|
|
91
|
-
6. Organize the resulting files so that each rule lives in its own file. Use subfolders inside rules/ to group thematically related rules (for example, a testing/ subfolder for testing-related rules, a dependencies/ subfolder for dependency-management rules, a solid/ subfolder with one file per SOLID principle, a disposes/ subfolder with one file per dispose-pattern obligation). A bundle of related rules MUST be modeled as a subfolder of single-rule files, never as one multi-rule file.
|
|
92
|
-
7. Filenames must be descriptive of the single rule the file captures — the user must be able to tell which rule a file pins from its name alone.
|
|
93
|
-
|
|
94
|
-
## Output language
|
|
95
|
-
|
|
96
|
-
Write rule files in the same natural language as the input request. If the input is in Spanish, the output is in Spanish; if English, English; and so on. Do not translate unless the user says otherwise.
|
|
97
|
-
|
|
98
|
-
## Idempotency and overwrites
|
|
99
|
-
|
|
100
|
-
Existing files in rules/ are not protected. Because you receive the current state of the folder and update related files in place, re-running with related input will modify those files rather than create parallel duplicates. Preserving prior versions is the user's responsibility (typically through version control).`;
|
|
101
|
-
exports.planSkillBody = `---
|
|
102
|
-
description: Produce a contract-aware work plan inside the project's plans/ folder.
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
You are the /flanders-plan skill. Your sole deliverable is exactly one markdown plan file inside the project's plans/ folder. You must not write, modify, or delete any source code or any file outside plans/.
|
|
106
|
-
|
|
107
|
-
## Input resolution
|
|
108
|
-
|
|
109
|
-
The user invokes you as: /flanders-plan [<data>]
|
|
110
|
-
|
|
111
|
-
- If <data> is omitted, take the user's natural-language request from the conversation.
|
|
112
|
-
- If <data> is supplied and resolves to an existing file path, read the file's content and use it as input.
|
|
113
|
-
- If <data> is supplied and does not resolve to an existing file, use the value verbatim as inline input.
|
|
114
|
-
|
|
115
|
-
## Procedure
|
|
116
|
-
|
|
117
|
-
1. Resolve the input from the invocation rule above.
|
|
118
|
-
2. Recursively list every file inside the project's contracts/ folder and every file inside the project's rules/ folder. Capture relative paths from the project root. The contracts listing is the canonical reference of contracts for this run; the rules listing is the canonical reference of rules for this run.
|
|
119
|
-
3. **Clarification phase.** Ask the user clarifying questions only when the question targets an implementation choice in the code the tasks will produce that the request does not specify, or a task-scope ambiguity you cannot reasonably infer from the request or from the canonical contracts and rules. Any other doubt is resolved silently: pick the most reasonable default and proceed, documenting the choice in the relevant task's description when it is plan-local and load-bearing. Permitted questions are asked sequentially — one question per turn, multiple-choice preferred when the answer space is bounded.
|
|
120
|
-
|
|
121
|
-
When the doubt is about how the code should be implemented, resolve it through one of two outcomes:
|
|
122
|
-
- **Cross-cutting convention** — the answer would apply to all future code of the same kind in the project and belongs in rules/. Surface the gap to the user and recommend creating the rule via /flanders-rule before the plan is drafted, instead of silently baking the decision into the plan. The user may explicitly elect to treat the decision as plan-local for this run; in that case it follows the plan-local outcome below.
|
|
123
|
-
- **Plan-local implementation choice** — the answer is specific to the requested work and does not generalize. The chosen answer is embedded in the relevant task's description and acceptance criteria, and is never promoted to a rule.
|
|
124
|
-
|
|
125
|
-
The skill itself never writes to rules/ or contracts/. Rule creation, when the user elects it, happens through /flanders-rule as a separate, user-initiated act. The full clarification-scope obligation lives in rules/ai/skills/plan/clarification-scope.md.
|
|
126
|
-
4. **Drafting phase.** Before persisting the plan file, present the planned plan layout (the task hierarchy, the subject of each leaf task, and the contract and rule files each leaf task will link to) as a structured summary, and wait for user approval or redirection. For non-trivial plans, sections of the draft are presented and approved before moving on. Trivial plans may be presented as a single combined draft.
|
|
127
|
-
5. Persist exactly one markdown file inside the project's plans/ folder. The filename must be descriptive of the plan's subject.
|
|
128
|
-
6. Upon successful completion, print the summary described in the Summary section below. If the plan cannot be made compliant with the Plan content rules, do not declare complete: surface the issue along with the plan file path to the user in chat.
|
|
129
|
-
|
|
130
|
-
## Plan file format
|
|
131
|
-
|
|
132
|
-
The plan file must follow these rules exactly:
|
|
133
|
-
|
|
134
|
-
### Task lines
|
|
135
|
-
|
|
136
|
-
A task is a markdown list item that carries a checkbox and a metrics object at the start of its content. The full shape of a task line is:
|
|
137
|
-
|
|
138
|
-
[ ]{"it":0,"ot":0,"t":0} 1.1 TITLE
|
|
139
|
-
|
|
140
|
-
with the following pieces, in this exact order and spacing:
|
|
141
|
-
|
|
142
|
-
- A checkbox, in one of two states:
|
|
143
|
-
- \`[ ]\` — open (not yet implemented).
|
|
144
|
-
- \`[x]\` — done (already implemented).
|
|
145
|
-
- Immediately after the closing \`]\`, with no whitespace between them, the metrics object (a strict JSON literal — see Task metrics below).
|
|
146
|
-
- A single space after the closing \`}\`.
|
|
147
|
-
- The task number (see Numbering).
|
|
148
|
-
- A single space.
|
|
149
|
-
- The task title.
|
|
150
|
-
|
|
151
|
-
No malformed variants such as \`[]\`, \`[ x]\`, or \`[X ]\` are permitted. All new tasks are written as open (\`[ ]\`).
|
|
152
|
-
|
|
153
|
-
### Task metrics
|
|
154
|
-
|
|
155
|
-
Every leaf task line carries a metrics object \`{"it":0,"ot":0,"t":0}\` at generation time. This is a strict JSON literal with three integer fields: \`it\` (input tokens), \`ot\` (output tokens), and \`t\` (time in seconds), all set to zero for new tasks. The object is placed immediately after the checkbox with no whitespace between \`]\` and \`{\`, and one space between the closing \`}\` and the task number.
|
|
156
|
-
|
|
157
|
-
### Hierarchy and sub-tasks
|
|
158
|
-
|
|
159
|
-
- A leaf task (no sub-tasks) carries a checkbox.
|
|
160
|
-
- A parent task (has sub-tasks with their own checkboxes) does NOT carry its own checkbox. It appears as a heading or list item with a title and description, but no checkbox.
|
|
161
|
-
|
|
162
|
-
Checkboxes appear only on the smallest atomic units of work, never on a unit that aggregates other checkboxed units.
|
|
163
|
-
|
|
164
|
-
### Numbering
|
|
165
|
-
|
|
166
|
-
Tasks are numbered hierarchically:
|
|
167
|
-
- Top-level tasks: 1, 2, 3, ...
|
|
168
|
-
- Sub-tasks of task 2: 2.1, 2.2, 2.3, ...
|
|
169
|
-
- Deeper levels follow the same dotted convention.
|
|
170
|
-
|
|
171
|
-
The numbering is part of the visible task identifier.
|
|
172
|
-
|
|
173
|
-
### Ordering
|
|
174
|
-
|
|
175
|
-
Tasks are written in the order they must be implemented, accounting for dependencies. A task that depends on another must appear after the task it depends on.
|
|
176
|
-
|
|
177
|
-
### Plan content rules
|
|
178
|
-
|
|
179
|
-
- The persisted plan is free of placeholders, contradictions with existing contracts or rules, ambiguous task wording, missing acceptance criteria on leaf tasks, and missing contract or rule links on leaf tasks.
|
|
180
|
-
- The plan only references contracts and rules that exist in the canonical state captured at invocation.
|
|
181
|
-
- Implementation decisions resolved during the clarification phase and classified as plan-local are embedded in the relevant task's description and acceptance criteria, and are never promoted to a rule.
|
|
182
|
-
- Tasks are ordered top-to-bottom in the order they must be implemented, accounting for dependencies. A task that depends on another must appear after the task it depends on.
|
|
183
|
-
- Write each leaf task with a detailed description and explicit acceptance criteria — the conditions that must be true once the task is implemented for it to be considered complete.
|
|
184
|
-
- Every leaf task carries the initial metrics object \`{"it":0,"ot":0,"t":0}\` literally. Done tasks generated by \`/flanders-plan\` follow the same shape with the same zero values.
|
|
185
|
-
- Choose a granularity that is neither too broad nor too narrow. Tasks must be small enough for a single AI invocation without excessive tokens, but large enough that splitting further would create artificial fragmentation. When in doubt, subdivide.
|
|
186
|
-
- For every leaf task, link the relevant contract file or files by their listed relative path. When the relevant obligation lives in a specific section or line range, reference that section or line range as well.
|
|
187
|
-
- For every leaf task, link the relevant rule file or files by their listed relative path. The planner MUST read every rule file it determines is relevant to the request before drafting the plan; reading the relevant rules is not optional. When a rule's enforcement is bound to a specific scope, reference that scope alongside the file path.
|
|
188
|
-
- Rule selection per task is scope-driven, not topic-driven. Before listing the rule links for a leaf task, walk the rules/ listing and ask: which rule namespaces are in scope for the work this task actually performs? Use the namespace as the scope hint. Heuristics: a task that modifies or adds tests must link every applicable file under \`rules/testing/*\`; a task that creates or modifies anything with timers, listeners, controllers, child processes, or other async lifecycle must link every applicable file under \`rules/disposables/*\`; a task that changes terminal UI or live-region output must link every applicable file under \`rules/ui/*\`. Walk every namespace whose scope could plausibly apply, and pick every file whose obligation could be triggered by the task. Under-linking is costly: the downstream implementor is FAILed by the adversarial reviewer for any global rule that should have applied but was not applied, so when in doubt, link rather than omit. The full obligation lives in rules/ai/skills/plan/scope-driven-rule-selection.md.
|
|
189
|
-
- Tasks are numbered hierarchically (1, 1.1, 1.2, 2, 2.1, ...) per the Plan file format section above.
|
|
190
|
-
- No task may describe work that creates, modifies, deletes, or renames files inside contracts/, inside rules/, or inside plans/ (the bounded checkbox/metrics update that the implement command holds is not available to tasks — see shared/spec-folder-write-authority.md).
|
|
191
|
-
- Never produce a plan that violates any contract or rule on the canonical lists.
|
|
192
|
-
|
|
193
|
-
## Post-write verification
|
|
194
|
-
|
|
195
|
-
After writing the plan file, re-read it and verify:
|
|
196
|
-
- The file exists at the expected path inside plans/ and is non-empty.
|
|
197
|
-
- Every task line follows the checkbox shape defined above (every list item carrying a task identifier has a valid \`[ ]\` or \`[x]\` checkbox; no malformed variants).
|
|
198
|
-
- Every leaf task line carries a metrics object literally equal to \`{"it":0,"ot":0,"t":0}\`. The verification re-parses each metrics object with strict JSON, so the check is byte-exact — no extra spaces, no reordered keys, no trailing commas.
|
|
199
|
-
- At least one task line was produced.
|
|
200
|
-
|
|
201
|
-
If any check fails, fix the file and re-verify instead of leaving a malformed plan on disk.
|
|
202
|
-
|
|
203
|
-
## Final validation
|
|
204
|
-
|
|
205
|
-
Before declaring this skill complete, run a final validator over the plan file. The validator is the gate — only declare complete when it returns PASS. The full obligation lives in rules/ai/skills/plan/final-validator.md; the procedure below is what the skill prompt encodes.
|
|
206
|
-
|
|
207
|
-
### Validator host
|
|
208
|
-
|
|
209
|
-
Launch the validator as a fresh subagent via the Agent tool, in a session that does not share context with this drafting session. The fresh session is load-bearing — it forces the validator to re-derive its judgments from the file on disk rather than from this session's confirmation bias.
|
|
210
|
-
|
|
211
|
-
You may fall back to an inline pass (running the validator in this same session) only when the Agent tool is unavailable in the current environment, or when an Agent invocation returns an unrecoverable error (spawn failure, transport error, environment refusal). Inline fallback for ergonomic reasons — the plan looks small, tokens feel tight, you are confident — is forbidden. When you take the inline path, state in chat that you are falling back and name the concrete reason; a silent fallback is a violation. The validator subagent is subject to rules/ai/agents/no-git-writes.md (read-only on git, read-only on the project).
|
|
212
|
-
|
|
213
|
-
### Validator inputs
|
|
214
|
-
|
|
215
|
-
Pass the validator:
|
|
216
|
-
- The absolute path to the plan file you just wrote.
|
|
217
|
-
- The canonical contract listing captured in step 2 of the procedure.
|
|
218
|
-
- The canonical rule listing captured in step 2 of the procedure.
|
|
219
|
-
|
|
220
|
-
The validator reads the plan file in full, plus any contract or rule from the listings it judges relevant to forming its verdict.
|
|
221
|
-
|
|
222
|
-
### Validator checks
|
|
223
|
-
|
|
224
|
-
Three categories, all mandatory; failure in any one is a FAIL:
|
|
225
|
-
|
|
226
|
-
1. Format and shape — every task line conforms to shared/plan-file-format.md: valid \`[ ]\` or \`[x]\` checkbox (no malformed variants), immediately-following metrics object literally equal to \`{"it":0,"ot":0,"t":0}\` for freshly generated tasks, hierarchical task number coherent with document position (1 before 2, 1.1 before 1.2, no malformed numbering), leaf-vs-parent distinction respected (leaves carry checkbox and metrics, parents carry neither), each leaf carries a description and an explicit acceptance-criteria section, plan file inside plans/ and non-empty, at least one task line.
|
|
227
|
-
2. Semantic dependency order — tasks appear top-to-bottom in implementation order. The audit is semantic, not numeric: read each task's description and acceptance criteria and confirm that no task depends on work performed by a task that appears later in the document.
|
|
228
|
-
3. Spec-folder write boundary and contract non-contradiction — no task (leaf or parent) describes work that creates, modifies, deletes, or renames any file inside contracts/, rules/, or plans/. There is no exception for flipping checkboxes or rewriting metrics: those mutations are performed programmatically by the implement command and are never described by a task. Additionally, the plan as a whole does not contradict any contract or rule in the canonical listings.
|
|
229
|
-
|
|
230
|
-
Out of scope: verifying that contract and rule paths referenced by tasks resolve to files that physically exist on disk.
|
|
231
|
-
|
|
232
|
-
### Validator output
|
|
233
|
-
|
|
234
|
-
The validator's final response ends with a single verdict line, with no Evidence Report and no other multi-line content after it:
|
|
235
|
-
|
|
236
|
-
- \`PASS\`
|
|
237
|
-
- \`FAIL <enumerated issues>\` — each issue stated clearly enough that the auto-fix step can act on it. Multiple issues are enumerated inline on that same final line, each independently actionable.
|
|
238
|
-
|
|
239
|
-
If the validator wants to show its work, it does so in the body of its response above the verdict line.
|
|
240
|
-
|
|
241
|
-
### On FAIL: bounded auto-fix loop
|
|
242
|
-
|
|
243
|
-
When the validator returns FAIL, enter the auto-fix loop:
|
|
244
|
-
|
|
245
|
-
1. Read the FAIL report and rewrite the plan file in place, addressing every enumerated issue.
|
|
246
|
-
2. Re-launch the validator (a new subagent in a fresh session when the subagent host is available) over the rewritten file.
|
|
247
|
-
3. Repeat. Perform at most FIVE auto-fix passes per /flanders-plan invocation. The fifth FAIL ends the loop.
|
|
248
|
-
|
|
249
|
-
When the loop ends with a PASS at any iteration, proceed to the end-of-run summary below.
|
|
250
|
-
|
|
251
|
-
When the loop ends with FAIL after five passes, do not declare complete: surface the last FAIL report and the plan file path to the user in chat, then stop. Do not print the end-of-run summary as if the plan were valid.
|
|
252
|
-
|
|
253
|
-
## Summary
|
|
254
|
-
|
|
255
|
-
After the final validator returns PASS, print a summary in chat containing:
|
|
256
|
-
- The plan file path.
|
|
257
|
-
- The plan file's character size.
|
|
258
|
-
- The plan file's total line count.
|
|
259
|
-
- The total number of detected tasks.
|
|
260
|
-
|
|
261
|
-
## Output language
|
|
262
|
-
|
|
263
|
-
Write the plan file in the same natural language as the input request, unless the user says otherwise.
|
|
264
|
-
|
|
265
|
-
## Missing contracts or rules
|
|
266
|
-
|
|
267
|
-
If the contracts/ folder is missing or empty, warn the user in chat and produce a plan that includes whatever contracts the request implicitly requires before any implementation work. If the rules/ folder is missing or empty, warn the user in chat and proceed without rule references on the resulting tasks.`;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|