@rt-tools/agent-kit 0.32.0 → 0.34.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.
Files changed (75) hide show
  1. package/README.md +8 -7
  2. package/assets/agents/goal-critic.md +67 -0
  3. package/assets/agents/product-strategist.md +90 -0
  4. package/assets/agents/qa-engineer.md +3 -0
  5. package/assets/checks/board.github.mjs +27 -0
  6. package/assets/checks/check-specs.mjs +11 -2
  7. package/assets/checks/rt-kit-checks.config.mjs +6 -0
  8. package/assets/checks/spec-common.mjs +6 -3
  9. package/assets/checks/spec-scenarios.mjs +9 -1
  10. package/assets/checks/task-new.github.mjs +6 -0
  11. package/assets/checks/tree-assignment.mjs +11 -3
  12. package/assets/defaults/project.sh +10 -81
  13. package/assets/defaults/push.sh +100 -0
  14. package/assets/docs/GLOSSARY.md +4 -0
  15. package/assets/hooks/browser-guard-no-other-drivers.sh +6 -3
  16. package/assets/hooks/claim-guard.sh +6 -6
  17. package/assets/hooks/dispatch.sh +56 -3
  18. package/assets/hooks/exam-guard.sh +1 -1
  19. package/assets/hooks/git-guard-delivery-body.sh +25 -3
  20. package/assets/hooks/git-guard-delivery-folder.sh +17 -1
  21. package/assets/hooks/git-guard-delivery-merged.sh +65 -0
  22. package/assets/hooks/git-guard-delivery-pipeline.sh +99 -0
  23. package/assets/hooks/git-guard-delivery.sh +22 -8
  24. package/assets/hooks/git-guard-main.sh +17 -4
  25. package/assets/hooks/git-guard-push-ahead.sh +89 -0
  26. package/assets/hooks/git-guard-push-marks.sh +99 -0
  27. package/assets/hooks/git-guard-push-tests.sh +101 -83
  28. package/assets/hooks/git-guard-tree-assignment.sh +1 -1
  29. package/assets/hooks/grill-gate-options.sh +50 -0
  30. package/assets/hooks/grill-gate.sh +9 -1
  31. package/assets/hooks/pre-push.sh +113 -0
  32. package/assets/hooks/push-set.sh +150 -0
  33. package/assets/hooks/push-sign.sh +433 -0
  34. package/assets/hooks/rerun-guard.sh +14 -6
  35. package/assets/hooks/turn-exit-guard.sh +2 -2
  36. package/assets/hooks/turn-exit-patterns.sh +4 -3
  37. package/assets/hooks/turn-exit-verdict.sh +18 -1
  38. package/assets/hooks/waiting-turn-guard.sh +2 -1
  39. package/assets/hooks/write-targets.sh +21 -0
  40. package/assets/patterns/dependencies-upgrade.md +5 -1
  41. package/assets/patterns/git-workflow-commit.github.md +14 -0
  42. package/assets/patterns/git-workflow-pr-body.github.md +20 -3
  43. package/assets/patterns/git-workflow-pr.azure.md +30 -0
  44. package/assets/patterns/git-workflow-pr.github.md +57 -1
  45. package/assets/patterns/git-workflow-pr.gitlab.md +33 -0
  46. package/assets/patterns/mockups-measure.needs-mockups.md +19 -3
  47. package/assets/patterns/reuse-first-extend.md +5 -0
  48. package/assets/patterns/task-flow-close.md +27 -16
  49. package/assets/patterns/task-flow-start.md +5 -4
  50. package/assets/pitfalls/task-flow.md +4 -0
  51. package/assets/rules/browser-verification.md +4 -0
  52. package/assets/rules/dependencies.md +3 -1
  53. package/assets/rules/deploy-flow.azure.md +5 -0
  54. package/assets/rules/deploy-flow.github.md +5 -0
  55. package/assets/rules/deploy-flow.gitlab.md +5 -0
  56. package/assets/rules/git-workflow.azure.md +15 -0
  57. package/assets/rules/git-workflow.github.md +15 -0
  58. package/assets/rules/git-workflow.gitlab.md +15 -0
  59. package/assets/rules/mockups.needs-mockups.md +13 -5
  60. package/assets/rules/reuse-first.md +3 -0
  61. package/assets/rules/task-flow.md +21 -16
  62. package/assets/rules/testing.md +5 -0
  63. package/assets/samples/tasks/_template/plan.md +7 -0
  64. package/assets/skills/interface-review-annotate.needs-mockups.md +142 -0
  65. package/assets/skills/interface-review-icons.needs-app.md +136 -0
  66. package/assets/skills/interface-review-motion-states.needs-app.md +230 -0
  67. package/assets/skills/interface-review-motion.needs-app.md +209 -0
  68. package/assets/skills/interface-review-performance.needs-app.md +110 -0
  69. package/assets/skills/interface-review-principles.needs-app.md +263 -0
  70. package/assets/skills/interface-review-surfaces.needs-app.md +249 -0
  71. package/assets/skills/interface-review.needs-app.md +199 -0
  72. package/assets/skills/write-a-skill.md +16 -3
  73. package/assets/workflows/feature.js +33 -5
  74. package/assets/workflows/plan.js +71 -4
  75. package/package.json +1 -1
@@ -0,0 +1,199 @@
1
+ ---
2
+ name: interface-review
3
+ description: Reviews an interface as one system: accessibility, layout, writing, typography and polish, in that order, into one ranked findings table and one verdict. Load when asked to review or audit a screen, a flow, a component or a Figma frame. The domain rules are in interface-review-principles.
4
+ ---
5
+
6
+ # Review the interface as one system
7
+
8
+ A strong interface is not five independent audits stapled together. Position and spacing carry
9
+ hierarchy before a word is read, the words themselves do the explaining, type makes them legible,
10
+ and polish is what makes the result feel deliberate rather than assembled. Review the whole
11
+ experience, then consolidate into one prioritized verdict.
12
+
13
+ ## When to use
14
+
15
+ - A screen, a flow, a feature or a whole repository is to be reviewed from the side of the person
16
+ who uses it.
17
+ - A Figma frame is to be reviewed and annotated with the findings.
18
+ - Findings of an interface review are to be implemented — then the consolidated report is the
19
+ change scope.
20
+
21
+ The principles each finding is judged by are in `interface-review-principles`. The cards on a Figma
22
+ frame are in `interface-review-annotate`; it is laid out only in a tree with mockups. Recipes:
23
+ surfaces — `interface-review-surfaces`, entrances and exits — `interface-review-motion`, icon swaps,
24
+ press feedback and page load — `interface-review-motion-states`, icons — `interface-review-icons`,
25
+ transitions and compositing — `interface-review-performance`.
26
+
27
+ ## How to look
28
+
29
+ When reviewing, slow the interface down. Walk it as a keyboard-only user first — every flow must
30
+ complete without a mouse. Read the page instead of scanning the code: squint to check the hierarchy
31
+ holds, read one full paragraph for comfort, resize the viewport to catch bad wrapping and truncation
32
+ at real content lengths. Replay motion at 10% speed in the browser's Animations panel and walk every
33
+ state: hover, focus, active, loading, empty. What feels off at 10% speed is what's subtly wrong at
34
+ full speed.
35
+
36
+ **Match the project's styling system.** Before writing any fix, check how the codebase styles
37
+ things and express every change in that system: Tailwind utilities in a Tailwind project, plain
38
+ declarations in CSS, CSS Modules, styled-components or StyleX. Preserve the project's component
39
+ library, tokens, and density, and its established motion language except where a principle in
40
+ `interface-review-principles` prescribes an exact interaction pattern. Never introduce a second styling approach just to apply a
41
+ fix.
42
+
43
+ Treat numeric values as starting points for interfaces without an established density or spacing
44
+ system. Preserve deliberate platform chrome, compact professional tools, and project tokens when
45
+ they remain usable under hit-area, zoom, localization, and viewport stress tests.
46
+
47
+ Color notation, palette construction, and gamut are out of scope; this skill measures and reports
48
+ contrast but does not repaint the project.
49
+
50
+ ## How to run a review
51
+
52
+ ### Resolve scope and mode first
53
+
54
+ Infer the screen, flow, feature, or repository scope from the request and current workspace. State
55
+ the resolved scope in the output. Use `full` when no mode is supplied.
56
+
57
+ | Mode | Coverage | Finding cap |
58
+ | --- | --- | --- |
59
+ | `quick` | Primary user path and highest-traffic states; report only `HIGH` and `MEDIUM` issues | 5 |
60
+ | `full` | Entire requested scope across all five domains, including empty, loading, error, and narrow-width states when present | 15 |
61
+
62
+ If the requested scope is too large to inspect credibly, narrow it to the highest-traffic complete
63
+ flow and state the boundary. Never imply uninspected surfaces were reviewed.
64
+
65
+ ### Recon before judgment
66
+
67
+ Identify the framework, styling system, component library, design tokens, supported viewports, and
68
+ available preview or test commands. For copy, inspect nearby interface text, the product's
69
+ terminology, localization conventions, and any voice or content style guide before proposing a
70
+ change.
71
+
72
+ ### Review in this order
73
+
74
+ Foundational failures must not be hidden by polish:
75
+
76
+ 1. Accessibility
77
+ 2. Layout
78
+ 3. Writing
79
+ 4. Typography
80
+ 5. UI polish
81
+
82
+ When two domains appear to cover the same issue, assign it to the one that owns the underlying rule
83
+ and mention secondary effects in the **Why** cell. Report it once.
84
+
85
+ ### Require evidence
86
+
87
+ Every finding cites `path/to/file:line` and shows the current implementation. If the review
88
+ artifact has no source files, cite the exact screen and component. Do not report a code-level
89
+ finding from visual appearance alone, or a visual finding from source code alone when runtime
90
+ behavior determines the result.
91
+
92
+ ### Review without mutating by default
93
+
94
+ Treat a review request as read-only. Do not edit source code unless the user also asks to implement
95
+ the findings. When implementation is requested, preserve the consolidated report as the change
96
+ scope and re-run the relevant verification afterward.
97
+
98
+ ## Review Output Format
99
+
100
+ Always use the following sections.
101
+
102
+ ### Scope and Coverage
103
+
104
+ State the mode, exact scope, stack and styling conventions, and any review boundary. Then show
105
+ coverage:
106
+
107
+ | Domain | Evidence inspected | Result |
108
+ | --- | --- | --- |
109
+ | Accessibility | Files, components, states, or checks | Findings count or `Clear` |
110
+
111
+ Include all five domains. `Clear` means inspected with no actionable finding; `Not reviewed` must
112
+ explain why.
113
+
114
+ ### Findings
115
+
116
+ Use one table ordered by severity, then reach and payoff:
117
+
118
+ | # | Severity | Domain | Location | Before | After | Why |
119
+ | --- | --- | --- | --- | --- | --- | --- |
120
+ | 1 | HIGH | Accessibility | `src/Dialog.tsx:42` | `<button><XIcon /></button>` | Add `aria-label="Close"` and hide the icon from the accessibility tree | The icon-only control has no accessible name |
121
+
122
+ Severity is one shared scale:
123
+
124
+ - `HIGH`: blocks a task, misleads the user, hides content or controls, causes data-loss risk, or
125
+ creates a repeated systemic failure.
126
+ - `MEDIUM`: meaningfully harms comprehension, efficiency, adaptability, or consistency.
127
+ - `LOW`: isolated polish with limited task impact. Include only in `full` mode.
128
+
129
+ Within a severity, rank by reach and payoff. A token or shared-component fix outranks the same
130
+ symptom in one leaf component.
131
+
132
+ Each row is one root cause: list every confirmed location in the same row rather than producing a
133
+ row per occurrence. Respect the mode's finding cap, and never pad the report to reach it. If there
134
+ are no findings, omit the table and state "No actionable interface findings."
135
+
136
+ ### Annotate the frame
137
+
138
+ Every row in the findings table also lands on the canvas as a card. Where the tree has
139
+ `interface-review-annotate` laid out, the card shape and placement are there. If the file is view-only or the user asked for the report only, output the table alone and say the
140
+ frame was not annotated.
141
+
142
+ ### Considered but Rejected
143
+
144
+ Record candidates considered but deliberately rejected. A candidate is rejected when the principle in
145
+ `interface-review-principles` permits the current implementation, evidence is insufficient, the project convention is
146
+ intentional, or the proposed change would add complexity without user benefit.
147
+
148
+ Include 1–3 candidates in `quick` mode and 2–5 in `full` mode:
149
+
150
+ | Location | Candidate | Rejected because |
151
+ | --- | --- | --- |
152
+ | `src/Card.tsx:28` | Increase the shadow | Existing depth matches the shared surface token; changing one card would reduce consistency |
153
+
154
+ These are real candidates inspected during the review, not invented filler. If the scope genuinely
155
+ contains fewer borderline candidates, include the ones that exist and say so.
156
+
157
+ ### Verification
158
+
159
+ Run safe, relevant checks available in the project. Inspect the rendered interface when runtime
160
+ behavior or visual judgment matters. List each check or interaction, the exact command or steps,
161
+ and the observed result. Separate checks that passed from checks marked **Not verified**; never
162
+ convert a verification gap into a finding.
163
+
164
+ ### Verdict
165
+
166
+ End with exactly one:
167
+
168
+ - `Block` — one or more `HIGH` findings remain.
169
+ - `Needs changes` — only `MEDIUM` or `LOW` findings remain.
170
+ - `Approve` — no actionable findings remain and the claimed coverage was verified.
171
+
172
+ ## Common Mistakes
173
+
174
+ | Mistake | Fix |
175
+ | --- | --- |
176
+ | `outline: none` to remove the focus ring | Style `:focus-visible` instead; mouse clicks won't show it |
177
+ | `<div onClick>` for a button or link | `<button>` for actions, `<a href>` for navigation |
178
+ | Placeholder used as the only label | Add a visible `<label for>`; placeholders disappear on input |
179
+ | Positive `tabindex` to fix focus order | Fix the DOM order; only use `0` and `-1` |
180
+ | `aria-hidden="true"` on a focusable element | Remove it or make the element non-focusable |
181
+ | Submit disabled until the form is valid | Keep it enabled; validate on submit and focus the first error |
182
+ | Separator line where spacing would do | Remove the line, double the gap between groups |
183
+ | `margin-left` / `padding-right` in a localizable layout | `margin-inline-start` / `padding-inline-end` |
184
+ | Breakpoints at 768/1024 because they're the defaults | Break where the content actually stops fitting |
185
+ | Fixed-width text container sized to one language | `max-width` + wrapping; test pseudo-localization and representative locales |
186
+ | `OK` / `Yes` confirming a destructive dialog | Repeat the consequence: "Delete project" |
187
+ | "Click here" or bare "Learn more" link | Describe the destination: "Read the billing docs" |
188
+ | "Oops! Something went wrong." | Say what to do, next to the failing field |
189
+ | "Save Changes" beside "Discard changes" | One capitalization policy per element type |
190
+ | Hard-coded one-off font sizes | Use the type scale |
191
+ | `line-height: 24px` on scalable text | Unitless value (`1.5`) |
192
+ | Full-width paragraphs | Cap around 60–75 characters per line |
193
+ | Numbers cause layout shift | `tabular-nums` |
194
+ | Truncated text with no way to read it | Tooltip or expanded view for the full value |
195
+ | Inputs below `16px` zoom on iOS | `text-base sm:text-sm` |
196
+ | Six disconnected domain reports | Consolidate into one ranked findings table |
197
+ | Visual claim inferred only from source | Inspect the rendered state or mark it not verified |
198
+ | Review silently edits code | Stay read-only unless implementation was requested |
199
+ | "Approve" with pending actionable findings | Use `Needs changes` or `Block` |
@@ -30,6 +30,16 @@ third case, and only it is here.
30
30
  3. **Show the owner.** A skill acts on all future sessions, and creating it silently is not
31
31
  allowed.
32
32
 
33
+ ## When the owner hands over the text
34
+
35
+ A text the owner wrote is carried, not rewritten. Before the first split it lands whole in the
36
+ task folder: a request cut with `[…]` leaves nothing to compare against. Headings keep their case
37
+ and wording, sentences their words, code samples stay whole. What the shape of a skill forces —
38
+ the declaration, "When to use", a link in place of "above" — goes into a list of deviations, one
39
+ line each. Before the first commit a script compares every heading and paragraph of the source
40
+ with the skill files and prints what is missing or changed. A size limit the text does not fit
41
+ splits the text into files, never shortens it.
42
+
33
43
  ## What is in the file
34
44
 
35
45
  ```
@@ -49,8 +59,9 @@ not. It stands in the system prompt next to the descriptions of all the others,
49
59
  goes by them.
50
60
 
51
61
  It answers two questions: what the skill gives and when to load it. Write in the third person,
52
- up to 1024 characters: the first sentence — what it does, the second — "Load when…", the third —
53
- what is not in it and where to look for that.
62
+ up to three hundred characters: the first sentence — what it does, the second — "Load when…", the
63
+ third — what is not in it and where to look for that. Where the tree has the descriptions check
64
+ laid out, it refuses a longer declaration.
54
65
 
55
66
  ```
56
67
  ✓ Creating a new skill — one with no law above it. Load when asked to create, write or
@@ -104,7 +115,9 @@ link deeper than one level is not followed at all.
104
115
  - [ ] not one line repeats the neighbouring skill;
105
116
  - [ ] nothing that goes stale by itself: versions, numbers, dates;
106
117
  - [ ] at least one ready-made sample, not only an explanation;
107
- - [ ] links go one level deep, no deeper.
118
+ - [ ] links go one level deep, no deeper;
119
+ - [ ] where the tree has the descriptions check laid out, it is green before the first commit,
120
+ not only before the push.
108
121
 
109
122
  ## So that the skill gets loaded
110
123
 
@@ -7,13 +7,16 @@ export const meta = {
7
7
  { title: 'Implementation', detail: 'one step at a time — the working tree is shared by all' },
8
8
  { title: 'Check', detail: 'QA as a fan: tests, build, browser, adversarial review' },
9
9
  { title: 'Acceptance', detail: 'the PM checks what was done against the original request' },
10
+ { title: 'Points', detail: 'the signs of the points are run, and the miss is proved or refuted' },
11
+ { title: 'Goal', detail: 'the critic compares the result with the original request' },
10
12
  ],
11
13
  };
12
14
 
13
- // The task arrives as a string in args; without it the scenario is meaningless.
14
- const task = typeof args === 'string' ? args : (args?.task ?? '');
15
- if (!task) {
16
- throw new Error('A task is needed: pass it as a string in args');
15
+ // The grill is required alongside the task: without the owner's words the Goal phase has nothing to
16
+ // compare the result with, and a string call would spend the whole run to learn that at the end.
17
+ const task = args?.task ?? '';
18
+ if (!task || !args?.grill) {
19
+ throw new Error('A task and the grill are needed: pass { task, grill } in args');
17
20
  }
18
21
 
19
22
  const PLAN = {
@@ -131,4 +134,29 @@ const verdict = await agent(
131
134
  { agentType: 'project-manager', label: 'acceptance', phase: 'Acceptance' }
132
135
  );
133
136
 
134
- return { plan, done, findings, blockers, verdict };
137
+ phase('Points');
138
+ // A role a session has not registered costs this phase, not the done work above it.
139
+ let points = null;
140
+ try {
141
+ points = await agent(
142
+ `The user's original request:\n\n${task}\n\nWhat was done:\n${done.join('\n')}\n\n` +
143
+ `This is the review mode. Read the points in the task plan and the epic plan, run the sign of each ` +
144
+ `and try to prove the miss.`,
145
+ { agentType: 'product-strategist', label: 'points', phase: 'Points' }
146
+ );
147
+ } catch (error) {
148
+ log(`Points: the role did not run: ${error.message}`);
149
+ }
150
+
151
+ phase('Goal');
152
+ // The critic gets the request and nothing the pipeline wrote about the work: that is its whole value.
153
+ // A run without it ends in a failure and not in a result that looks judged.
154
+ // Only the grill holds a quote: the task string is the session's wording.
155
+ const goal = await agent(
156
+ `The owner's words are the quoted request in \`${args.grill}\`; read that section only.\n\n` +
157
+ `This is the result mode. The result is the working tree and its diff against the base ` +
158
+ `branch. Try to prove the goal is not met.`,
159
+ { agentType: 'goal-critic', label: 'goal', phase: 'Goal' }
160
+ );
161
+
162
+ return { plan, done, findings, blockers, verdict, points, goal };
@@ -1,12 +1,14 @@
1
1
  export const meta = {
2
2
  name: 'plan',
3
- description: 'After the grill with the owner: whether the work is needed, the product agreement, its adversarial review and the implementation plan',
3
+ description: 'After the grill with the owner: whether the work is needed, whether it reaches its points, the product agreement, its adversarial review and the implementation plan',
4
4
  whenToUse: 'The grill of the owner\'s request is closed, the task folder is created, the code is not written yet',
5
5
  phases: [
6
6
  { title: 'Need', detail: 'what the work gives and what is dropped from it' },
7
+ { title: 'Points', detail: 'where the product stands, the point of the work and the milestone' },
7
8
  { title: 'Agreement', detail: 'the feature spec in proposed/ from the grill' },
8
9
  { title: 'Critique', detail: 'what is left unsaid in the agreement' },
9
10
  { title: 'Plan', detail: 'stages with readiness signs and the split into tasks' },
11
+ { title: 'Goal', detail: 'the critic compares the plan with the owner\'s words' },
10
12
  ],
11
13
  };
12
14
 
@@ -32,6 +34,34 @@ const WORTH = {
32
34
  },
33
35
  };
34
36
 
37
+ const POINTS = {
38
+ type: 'object',
39
+ additionalProperties: false,
40
+ required: ['verdict', 'passport', 'pointA', 'point', 'sign', 'milestone', 'misses'],
41
+ properties: {
42
+ verdict: { type: 'string', enum: ['reaches', 'longer route', 'does not reach'] },
43
+ passport: { type: 'string', description: 'the product passport, five to seven lines' },
44
+ pointA: { type: 'string', description: 'point A: where the product stands now' },
45
+ point: { type: 'string', description: 'the change a person will see after this work' },
46
+ sign: { type: 'string', description: 'what shows the point is reached, and who sees it' },
47
+ milestone: { type: 'string', description: 'point G: the milestone of the epic; empty for work outside an epic' },
48
+ misses: {
49
+ type: 'array',
50
+ description: 'the proved misses of the route',
51
+ items: {
52
+ type: 'object',
53
+ additionalProperties: false,
54
+ required: ['miss', 'proof', 'step'],
55
+ properties: {
56
+ miss: { type: 'string' },
57
+ proof: { type: 'string', description: 'what proves it, with its source' },
58
+ step: { type: 'string', description: 'the shortest step that closes it, and its cost' },
59
+ },
60
+ },
61
+ },
62
+ },
63
+ };
64
+
35
65
  const DRAFT = {
36
66
  type: 'object',
37
67
  additionalProperties: false,
@@ -75,11 +105,13 @@ const PLAN = {
75
105
  items: {
76
106
  type: 'object',
77
107
  additionalProperties: false,
78
- required: ['title', 'slug', 'why'],
108
+ required: ['title', 'slug', 'why', 'point', 'sign'],
79
109
  properties: {
80
110
  title: { type: 'string' },
81
111
  slug: { type: 'string' },
82
112
  why: { type: 'string', description: 'why this is rolled back separately' },
113
+ point: { type: 'string', description: 'the change a person will see after this task' },
114
+ sign: { type: 'string', description: 'what shows the point is reached, and who sees it' },
83
115
  },
84
116
  },
85
117
  },
@@ -115,11 +147,33 @@ if (worth.verdict === 'postpone') {
115
147
  return { worth, stopped: 'the analyst proposed to postpone — the decision is the owner\'s' };
116
148
  }
117
149
 
150
+ phase('Points');
151
+ // The role advises and stops nothing: whether work goes on is the owner's decision, and they read
152
+ // the misses in the result. A role that is missing or returned nothing costs the phase, not the
153
+ // pipeline: a session registers roles when it starts, so a new role is unknown to an older session.
154
+ let points = null;
155
+ try {
156
+ points = await agent(
157
+ `The grill of the owner's request — \`${grill}\`. Read it in full, together with the epic plan when ` +
158
+ `the work has one.\n\n` +
159
+ `Dropped from the work: ${worth.drop.join('; ') || '— nothing'}.\n\n` +
160
+ `This is the planning mode. Name where the product stands, the point this work must reach and ` +
161
+ `the milestone of the epic, and try to prove that the route misses them.`,
162
+ { agentType: 'product-strategist', label: 'points', schema: POINTS }
163
+ );
164
+ } catch (error) {
165
+ log(`Points: the role did not run: ${error.message}`);
166
+ }
167
+ const misses = points?.misses ?? [];
168
+ const missesText = misses.map((m) => `- ${m.miss}: ${m.step}`).join('\n') || '— none';
169
+ log(`Points: ${points?.verdict ?? 'no reply'}; misses: ${misses.length}`);
170
+
118
171
  phase('Agreement');
119
172
  const draft = await agent(
120
173
  `The grill of the owner's request — \`${grill}\`. Read it in full and write the product agreement ` +
121
174
  `from it: \`docs/specs/<домен>/proposed/<фича>/\`.\n\n` +
122
175
  `Dropped from the work: ${worth.drop.join('; ') || '— nothing'}.\n\n` +
176
+ `Proved misses of the route:\n${missesText}\n\n` +
123
177
  `Gaps that the grill does not close — do not guess them, return them as a list.`,
124
178
  { agentType: 'spec-writer', label: 'agreement', schema: DRAFT }
125
179
  );
@@ -138,13 +192,26 @@ phase('Plan');
138
192
  const plan = await agent(
139
193
  `The grill of the owner's request — \`${grill}\`, the agreement — \`${draft.path}\`.\n\n` +
140
194
  `Findings of the adversarial review:\n${critique.findings.map((f) => `- ${f.what} (${f.where})`).join('\n') || '— none'}\n\n` +
195
+ `Point A: ${points?.pointA || '— not named'}.\nThe milestone of the epic: ${points?.milestone || '— none'}.\n` +
196
+ `Proved misses of the route:\n${missesText}\n\n` +
141
197
  `Assemble the implementation plan: stages with boundaries and a checkable readiness sign for each. ` +
142
198
  `Say separately how many tasks the work splits into: what splits is what would have to be rolled back ` +
143
- `separately, not what is merely large. One task is the usual case.`,
199
+ `separately, not what is merely large. One task is the usual case. Name the point and the sign of ` +
200
+ `each task, so that the tasks add up to the milestone.`,
144
201
  { agentType: 'project-manager', label: 'plan', schema: PLAN }
145
202
  );
146
203
  log(`Plan: tasks: ${plan.tasks.length}, stages: ${plan.steps.length}`);
147
204
 
205
+ phase('Goal');
206
+ // The critic is the check that does not stand on what the session wrote, so a run without it ends
207
+ // in a failure and not in a plan that looks judged. A resumed run keeps the phases above.
208
+ const goal = await agent(
209
+ `The owner's words are the quoted request in \`${grill}\`; read that section only.\n\n` +
210
+ `The plan under review:\n${JSON.stringify(plan, null, 1)}\n\n` +
211
+ `This is the plan mode. Try to prove the plan does not lead to what the owner asked for.`,
212
+ { agentType: 'goal-critic', label: 'goal', phase: 'Goal' }
213
+ );
214
+
148
215
  // Nothing is written to disk from here: the plan and the gaps go to the owner, and `plan.md`
149
216
  // is written by the main agent — only it asks the owner questions.
150
- return { worth, draft, critique: critique.findings, plan };
217
+ return { worth, points, draft, critique: critique.findings, plan, goal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rt-tools/agent-kit",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "Переносимый слой правил для агента: законы, хуки, проверки и агенты, раскладываемые в репозиторий одной командой",
5
5
  "author": "RT Team",
6
6
  "license": "Apache-2.0",