pirl-framework-cli 0.0.0-stage → 1.0.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/CHANGELOG.md +50 -0
- package/LICENSE +21 -0
- package/README.md +265 -2
- package/bundled-framework/files/.agents/evals/layer_record.py +438 -0
- package/bundled-framework/files/.agents/evals/tests/test_layer_record.py +264 -0
- package/bundled-framework/files/.agents/evals/tests/test_skills.py +210 -0
- package/bundled-framework/files/.agents/evals/tests/test_validate_layer_artifact.py +214 -0
- package/bundled-framework/files/.agents/evals/validate_layer_artifact.py +415 -0
- package/bundled-framework/files/.agents/instructions/implement.instructions.md +343 -0
- package/bundled-framework/files/.agents/instructions/layered-task-execution.instructions.md +370 -0
- package/bundled-framework/files/.agents/instructions/layout-verification.instructions.md +107 -0
- package/bundled-framework/files/.agents/instructions/plan.instructions.md +292 -0
- package/bundled-framework/files/.agents/instructions/review.instructions.md +236 -0
- package/bundled-framework/files/.agents/instructions/self-evaluation.instructions.md +146 -0
- package/bundled-framework/files/.agents/instructions/standalone-and-maintenance.instructions.md +230 -0
- package/bundled-framework/files/.agents/roles/backend-developer.role.md +45 -0
- package/bundled-framework/files/.agents/roles/business-analyst.role.md +55 -0
- package/bundled-framework/files/.agents/roles/code-analyst.role.md +63 -0
- package/bundled-framework/files/.agents/roles/code-reviewer.role.md +46 -0
- package/bundled-framework/files/.agents/roles/frontend-developer.role.md +51 -0
- package/bundled-framework/files/.agents/roles/process-auditor.role.md +62 -0
- package/bundled-framework/files/.agents/roles/solution-architect.role.md +53 -0
- package/bundled-framework/files/.agents/roles/technical-writer.role.md +68 -0
- package/bundled-framework/files/.agents/roles/ux-designer.role.md +46 -0
- package/bundled-framework/files/.skills/pirl-implement/SKILL.md +115 -0
- package/bundled-framework/files/.skills/pirl-implement/assets/implementation-record-template.md +22 -0
- package/bundled-framework/files/.skills/pirl-implement/references/implementation-record-format.md +41 -0
- package/bundled-framework/files/.skills/pirl-implement/scripts/add_implementation_record.py +58 -0
- package/bundled-framework/files/.skills/pirl-implement/scripts/new_layout_run.py +51 -0
- package/bundled-framework/files/.skills/pirl-plan/SKILL.md +100 -0
- package/bundled-framework/files/.skills/pirl-plan/assets/plan-template.md +48 -0
- package/bundled-framework/files/.skills/pirl-plan/references/plan-format.md +65 -0
- package/bundled-framework/files/.skills/pirl-plan/scripts/new_plan.py +93 -0
- package/bundled-framework/files/.skills/pirl-review/SKILL.md +106 -0
- package/bundled-framework/files/.skills/pirl-review/assets/review-template.md +92 -0
- package/bundled-framework/files/.skills/pirl-review/references/review-format.md +70 -0
- package/bundled-framework/files/.skills/pirl-review/scripts/new_review.py +83 -0
- package/bundled-framework/files/AGENTS.md +303 -0
- package/bundled-framework/files/CONTEXT.md +187 -0
- package/bundled-framework/files/LICENSE +21 -0
- package/bundled-framework/files/README.md +170 -0
- package/bundled-framework/files/gitignore.pirl-bundled +12 -0
- package/bundled-framework/manifest.json +45 -0
- package/dist/bin/main.js +128 -0
- package/dist/bin/pirl.js +6 -0
- package/dist/commands/dispatch.js +57 -0
- package/dist/commands/registry.js +39 -0
- package/dist/core/clipboard.js +70 -0
- package/dist/core/config.js +73 -0
- package/dist/core/exec.js +32 -0
- package/dist/core/paths.js +34 -0
- package/dist/core/targetRepo.js +22 -0
- package/dist/doctor/doctor.js +95 -0
- package/dist/engine/agentMerge.js +71 -0
- package/dist/engine/agents.js +67 -0
- package/dist/engine/attachments.js +251 -0
- package/dist/engine/claudeQuota.js +62 -0
- package/dist/engine/claudeRunner.js +118 -0
- package/dist/engine/claudeStream.js +205 -0
- package/dist/engine/hubData.js +176 -0
- package/dist/engine/permissions.js +67 -0
- package/dist/engine/pricing.js +24 -0
- package/dist/engine/protocol.js +98 -0
- package/dist/engine/run.js +527 -0
- package/dist/engine/runStore.js +67 -0
- package/dist/engine/types.js +3 -0
- package/dist/hub/framework.js +13 -0
- package/dist/hub/hub.js +125 -0
- package/dist/hub/services.js +38 -0
- package/dist/hub/update.js +261 -0
- package/dist/providers/claude.js +62 -0
- package/dist/providers/index.js +17 -0
- package/dist/providers/types.js +1 -0
- package/dist/ui/App.js +849 -0
- package/dist/ui/browse.js +144 -0
- package/dist/ui/components/Header.js +54 -0
- package/dist/ui/components/Input.js +76 -0
- package/dist/ui/components/Lines.js +50 -0
- package/dist/ui/components/Panels.js +73 -0
- package/dist/ui/content.js +225 -0
- package/dist/ui/frameworkConsole.js +541 -0
- package/dist/ui/inputEditor.js +86 -0
- package/dist/ui/layout.js +36 -0
- package/dist/ui/lines.js +15 -0
- package/dist/ui/listOverlay.js +97 -0
- package/dist/ui/runView.js +305 -0
- package/dist/ui/session.js +1 -0
- package/dist/ui/terminalInput.js +45 -0
- package/dist/ui/text.js +58 -0
- package/dist/ui/theme.js +139 -0
- package/dist/ui/ticker.js +48 -0
- package/package.json +67 -4
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
# Start here
|
|
2
|
+
|
|
3
|
+
This repository is PIRL (Plan – Implement – Review Layer): a Hub that
|
|
4
|
+
coordinates software development work for AI Agents. The framework runs entirely
|
|
5
|
+
on instruction files: three layers, Plan, Implement and Review, define what the
|
|
6
|
+
Agent does, how it does it and what it produces. Each layer is run through its
|
|
7
|
+
skill in `.skills/`. The product repositories the Agent works on are not part of
|
|
8
|
+
the Hub; the user names the target repository of each request, as described in
|
|
9
|
+
[Target repository](#target-repository).
|
|
10
|
+
|
|
11
|
+
The file structure, the owner of each rule and the role catalog are described
|
|
12
|
+
in the [standalone and maintenance instructions](.agents/instructions/standalone-and-maintenance.instructions.md#framework-structure),
|
|
13
|
+
read when the framework itself is maintained.
|
|
14
|
+
|
|
15
|
+
Always apply the [core rules](#core-rules) on safety, scope and evidence, even
|
|
16
|
+
when no layer is opened.
|
|
17
|
+
|
|
18
|
+
Read [CONTEXT.md](CONTEXT.md) before the first answer of each session and apply
|
|
19
|
+
it to every answer, summary, report and proposal sent to the user, even when no
|
|
20
|
+
layer is opened.
|
|
21
|
+
|
|
22
|
+
# Core rules
|
|
23
|
+
|
|
24
|
+
## Safety
|
|
25
|
+
|
|
26
|
+
- Preserve unrelated user changes, including uncommitted work in the Hub and in
|
|
27
|
+
every target repository.
|
|
28
|
+
- Hub-root operational paths are `.git`, `.github`, `.gitignore`, `.gitmodules`,
|
|
29
|
+
`.vscode` and `LICENSE`; the working directory of every target repository,
|
|
30
|
+
wherever it lives, is protected the same way. Never delete or move them, and
|
|
31
|
+
never reset or clean them wholesale (for example `git clean`,
|
|
32
|
+
`git reset --hard`, `git checkout -- .`, `git submodule deinit`, or deleting a
|
|
33
|
+
repository directory) unless the user explicitly asks for that operation.
|
|
34
|
+
Removing temporary files that the current run created inside them follows the
|
|
35
|
+
router's cleanup rule.
|
|
36
|
+
- Edit files inside those paths only as the active layer contract or the user's
|
|
37
|
+
direct assignment allows. For example, Implement edits product files in the
|
|
38
|
+
target repository within the scope its contract defines. Never edit files
|
|
39
|
+
inside `.git` by hand.
|
|
40
|
+
- Files inside a target repository, including its own `.github`, `.gitignore`
|
|
41
|
+
or `.vscode`, follow that task scope, not the Hub-root list.
|
|
42
|
+
- Do not switch branches, reset, or stash inside a target repository, or update
|
|
43
|
+
a submodule pointer, unless the user asks.
|
|
44
|
+
- Do not commit, push, deploy, alter production data, expose secrets, or contact
|
|
45
|
+
people without explicit authority.
|
|
46
|
+
- Do not run destructive or externally consequential actions beyond the user's
|
|
47
|
+
authorized scope.
|
|
48
|
+
- Never print, log, commit, or include in Plans, reports, records, or replies:
|
|
49
|
+
credentials, tokens, private keys, API keys, password hashes, one-time codes,
|
|
50
|
+
session identifiers, private payloads, or private reasoning.
|
|
51
|
+
- Do not invent command, agent, source, or verification results.
|
|
52
|
+
|
|
53
|
+
### Safety rules and self-improvement
|
|
54
|
+
|
|
55
|
+
Safety rules are: every rule in this Safety section; the [Git](#git) section;
|
|
56
|
+
and any rule anywhere in the framework that limits commit, push, deploy,
|
|
57
|
+
secrets or destructive and externally consequential actions, or that requires
|
|
58
|
+
the user's decision or authorization. The self-improvement guards of the
|
|
59
|
+
[self-evaluation instructions](.agents/instructions/self-evaluation.instructions.md)
|
|
60
|
+
are safety rules too: the mode-self guard (a self-evaluation record never
|
|
61
|
+
applies fixes itself; improvements that touch no safety rule are applied in the
|
|
62
|
+
same turn as user-directed maintenance under the standing authorization in the
|
|
63
|
+
[Workflow](#workflow) section, and everything else goes to the user) and the
|
|
64
|
+
never-loosen rule below, including this definition. That authorization covers
|
|
65
|
+
improvements that touch no safety rule and nothing else.
|
|
66
|
+
|
|
67
|
+
Code and tests that enforce a safety rule are part of that rule: for example,
|
|
68
|
+
the check in `.agents/evals/layer_record.py` that rejects applied fixes from a
|
|
69
|
+
self-evaluation, together with its tests.
|
|
70
|
+
|
|
71
|
+
Self-improvement may make a safety rule stricter or clearer. It must never
|
|
72
|
+
loosen, narrow, remove or work around one, even when that rule blocked the
|
|
73
|
+
current run. A change that would loosen a safety rule is not applied: the run
|
|
74
|
+
records it as pending with reason `safety` and asks the user, and only the
|
|
75
|
+
user's explicit approval allows it.
|
|
76
|
+
|
|
77
|
+
## Scope
|
|
78
|
+
|
|
79
|
+
- Keep work bounded to the user request, the selected layer, the target
|
|
80
|
+
repository's own context documentation, and the repositories the user
|
|
81
|
+
authorized.
|
|
82
|
+
- Prefer existing repository patterns over new abstractions unless evidence
|
|
83
|
+
justifies a change.
|
|
84
|
+
- Before important edits, inspect the relevant source and workspace state:
|
|
85
|
+
build/package config, the entrypoint or route involved, related domain types,
|
|
86
|
+
and nearby tests or their absence.
|
|
87
|
+
- Do not silently switch layers, repositories, roles, or delivery modes; state
|
|
88
|
+
the handoff when another owner is needed.
|
|
89
|
+
- Keep assumptions, deferred work, and genuine blockers explicit.
|
|
90
|
+
|
|
91
|
+
## Evidence
|
|
92
|
+
|
|
93
|
+
Support important claims with at least one of:
|
|
94
|
+
|
|
95
|
+
- file path and symbol;
|
|
96
|
+
- command and summarized result;
|
|
97
|
+
- raw task input or user-provided fact;
|
|
98
|
+
- a rule, instruction, or repository document that applies to the task;
|
|
99
|
+
- an independent role's finding that cites its evidence.
|
|
100
|
+
|
|
101
|
+
When recording evidence:
|
|
102
|
+
|
|
103
|
+
- Distinguish observed fact, inference, assumption, and proposal.
|
|
104
|
+
- A claim that something is absent, always or never true, or differs from its
|
|
105
|
+
source is observed fact only after everything that could contradict it has
|
|
106
|
+
been read: every measured value, and for styles every rule that can reach the
|
|
107
|
+
element (component, global, inherited, shared tokens). Otherwise it is an
|
|
108
|
+
inference; say what was not read. Whoever carries a finding into a record,
|
|
109
|
+
report or reply to the user first checks it against that evidence, or labels
|
|
110
|
+
it unchecked and names what was not read.
|
|
111
|
+
- Back every claim about what the user said, was asked, answered, confirmed or
|
|
112
|
+
delegated with a source: their message, a Plan, a record or a report. When
|
|
113
|
+
none is found, write that it was not asked or not found; never fill the gap
|
|
114
|
+
from assumption or from the user's silence.
|
|
115
|
+
- Record the exact command, working directory, status, and relevant output for
|
|
116
|
+
verification claims.
|
|
117
|
+
- Treat failed or unavailable evidence honestly; include the blocker and next
|
|
118
|
+
falsification step.
|
|
119
|
+
|
|
120
|
+
# Workflow
|
|
121
|
+
|
|
122
|
+
Plan → Implement → Review. Each layer runs only when the user's own words ask
|
|
123
|
+
for that layer, per the
|
|
124
|
+
[conditions for opening a layer](#choosing-a-layer); no layer opens the next
|
|
125
|
+
one on its own.
|
|
126
|
+
|
|
127
|
+
| Layer | Skill | Result | Contract |
|
|
128
|
+
| --- | --- | --- | --- |
|
|
129
|
+
| Plan | [`pirl-plan`](.skills/pirl-plan/SKILL.md) | Plan files: REQs, approach, roles, quality gates (QG) | [plan.instructions.md](.agents/instructions/plan.instructions.md) |
|
|
130
|
+
| Implement | [`pirl-implement`](.skills/pirl-implement/SKILL.md) | Changed source/docs/tests and an Implementation Record in the Plan file | [implement.instructions.md](.agents/instructions/implement.instructions.md) |
|
|
131
|
+
| Review | [`pirl-review`](.skills/pirl-review/SKILL.md) | A report with `Business` + `Evaluations`, checking the QGs by reasoning on the source | [review.instructions.md](.agents/instructions/review.instructions.md) |
|
|
132
|
+
|
|
133
|
+
Plan files and Review reports are written where the user says; when the user
|
|
134
|
+
names no location, they go under the Hub root, per the output format of the
|
|
135
|
+
matching skill.
|
|
136
|
+
|
|
137
|
+
Each layer run ends with
|
|
138
|
+
[self-evaluation and improvement](.agents/instructions/layered-task-execution.instructions.md#self-evaluation-and-improvement):
|
|
139
|
+
`process-auditor` finds each role's mistakes, fixes the relevant framework files
|
|
140
|
+
at the root, writes one record and reports what was fixed and where.
|
|
141
|
+
|
|
142
|
+
Framework improvement is a mandatory part of every run, not a proposal:
|
|
143
|
+
improvements that touch no safety rule are applied within the run, even when
|
|
144
|
+
the self-evaluation runs in `mode: self`, without waiting for the user to
|
|
145
|
+
confirm; the procedure lives in the
|
|
146
|
+
[self-evaluation instructions](.agents/instructions/self-evaluation.instructions.md#self-evaluation-when-mode-self).
|
|
147
|
+
This authorization covers only improvements that touch no safety rule;
|
|
148
|
+
improvements that touch a safety rule still need the user's approval.
|
|
149
|
+
|
|
150
|
+
## Choosing a layer
|
|
151
|
+
|
|
152
|
+
1. Infer the goal from the user's words and the context already established,
|
|
153
|
+
not from keywords. When the user names roles, keep the list and its order;
|
|
154
|
+
do not ask again about what is already given.
|
|
155
|
+
2. Investigate the sources to resolve information that can be found,
|
|
156
|
+
including what the user has already said: the decisions they made
|
|
157
|
+
(confirmations, delegated choices, refusals) live in Plans, Implementation
|
|
158
|
+
Records, records and reports; the host's session history is only a fallback
|
|
159
|
+
source when the host keeps it. Ask only about missing decisions that change
|
|
160
|
+
the result, the scope or the permission to act, and do not ask again about
|
|
161
|
+
something already answered; stop the part that depends on that decision and
|
|
162
|
+
continue the independent parts that have enough basis. A run that acts on the
|
|
163
|
+
user's answer quotes that answer in its own output (the record's `summary`,
|
|
164
|
+
the Implementation Record) so later runs can find it without the session
|
|
165
|
+
history.
|
|
166
|
+
3. If the user only asks for an explanation or an investigation, return a
|
|
167
|
+
conclusion within that scope; do not turn the question into a handoff
|
|
168
|
+
package. When the request is product delivery, choose the right layer
|
|
169
|
+
below; do not switch layers just because the current part is done.
|
|
170
|
+
4. A layer opens only when the user's own words ask for the work that layer
|
|
171
|
+
produces (creating a Plan, implementing a Plan, a review). Agreeing to,
|
|
172
|
+
choosing or confirming an answer to a question the Agent wrote opens only the
|
|
173
|
+
layer named in the user's words, or the layer the question asked about on its
|
|
174
|
+
own (one confirmation point asks one decision, and a point about opening a
|
|
175
|
+
layer names one layer). An approved proposal covering several layers settles
|
|
176
|
+
the direction: a layer that appears only in the Agent's text is not opened,
|
|
177
|
+
and if the user's words name no layer, ask one question about the first
|
|
178
|
+
layer. When the requested layer is done, stop and ask separately about the
|
|
179
|
+
next layer.
|
|
180
|
+
|
|
181
|
+
No slash command, activation token or exact keyword is needed.
|
|
182
|
+
"Create a Plan for this request" is the Plan layer; "Implement Plan T01" is the
|
|
183
|
+
Implement layer; "Review the implementation of Plan T01" is the Review layer.
|
|
184
|
+
|
|
185
|
+
| Layer | Result and owning contract |
|
|
186
|
+
| --- | --- |
|
|
187
|
+
| Plan | Write/adjust a Plan from the request and the source; [Plan contract](.agents/instructions/plan.instructions.md), run through the [`pirl-plan` skill](.skills/pirl-plan/SKILL.md). |
|
|
188
|
+
| Implement | Carry out one selected Plan, or repair it per a report for the same task; [Implement contract](.agents/instructions/implement.instructions.md), run through the [`pirl-implement` skill](.skills/pirl-implement/SKILL.md). |
|
|
189
|
+
| Review | Check an implementation run against the Plan; [Review contract](.agents/instructions/review.instructions.md), run through the [`pirl-review` skill](.skills/pirl-review/SKILL.md). |
|
|
190
|
+
| Standalone task | Work assigned directly, outside a Plan's chain; [Standalone tasks section](.agents/instructions/standalone-and-maintenance.instructions.md#standalone-tasks). |
|
|
191
|
+
| Framework maintenance | Edit `AGENTS.md`, instructions, roles, skills or framework tools themselves; [Framework maintenance section](.agents/instructions/standalone-and-maintenance.instructions.md#framework-maintenance). |
|
|
192
|
+
|
|
193
|
+
Load only the documents relevant to the current decision: the skill and the
|
|
194
|
+
contract of the selected layer, and the context documentation of the target
|
|
195
|
+
repository. Do not load every file in `.agents/` or `.skills/`.
|
|
196
|
+
|
|
197
|
+
Loading order:
|
|
198
|
+
|
|
199
|
+
1. Identify the kind of work per [Choosing a layer](#choosing-a-layer).
|
|
200
|
+
2. Depending on the kind of work:
|
|
201
|
+
- Plan, Implement or Review: read the
|
|
202
|
+
[router](.agents/instructions/layered-task-execution.instructions.md),
|
|
203
|
+
which holds the boundaries between kinds of work and the shared contracts,
|
|
204
|
+
then run that layer's skill (`.skills/pirl-<layer>/SKILL.md`);
|
|
205
|
+
the skill loads exactly the layer contract and the resources each step
|
|
206
|
+
needs. A host that loads skills on its own reaches the same file; a host
|
|
207
|
+
that does not reads it like any other file.
|
|
208
|
+
- Standalone task, meaning work assigned directly outside a Plan's chain:
|
|
209
|
+
read the [Standalone tasks](.agents/instructions/standalone-and-maintenance.instructions.md#standalone-tasks) section of the
|
|
210
|
+
standalone and maintenance instructions; no layer is activated.
|
|
211
|
+
- Framework maintenance: read the
|
|
212
|
+
[standalone and maintenance instructions](.agents/instructions/standalone-and-maintenance.instructions.md) in full, then edit
|
|
213
|
+
`AGENTS.md`, `CONTEXT.md`, instructions, roles, skills or tools
|
|
214
|
+
themselves, within the scope the user assigns.
|
|
215
|
+
- A question that only needs an explanation and creates no durable output:
|
|
216
|
+
answer within its scope, create no files. The router is not needed,
|
|
217
|
+
unless the answer draws a conclusion about a Plan, an Implementation
|
|
218
|
+
Record, a report or a record (then apply the router's
|
|
219
|
+
[Shared snapshots and older records](.agents/instructions/layered-task-execution.instructions.md#shared-snapshots-and-older-records)
|
|
220
|
+
section), or it is unclear whether the request is only such a question
|
|
221
|
+
(then read the router before answering).
|
|
222
|
+
3. For work that touches a product repository, identify the
|
|
223
|
+
[target repository](#target-repository), then read its context
|
|
224
|
+
documentation.
|
|
225
|
+
|
|
226
|
+
Without a layer request, do the work directly as asked under the core rules,
|
|
227
|
+
without creating a Plan or report. When asked to create a Plan, the Agent picks
|
|
228
|
+
the smallest team of roles with sufficient expertise and records it in the
|
|
229
|
+
Plan; when the user names roles, keep exactly that list.
|
|
230
|
+
|
|
231
|
+
Every layer and every Agent follows the
|
|
232
|
+
[temporary-resource cleanup duty](.agents/instructions/layered-task-execution.instructions.md#cleaning-up-temporary-resources-before-handoff)
|
|
233
|
+
before handoff, including standalone work and framework maintenance.
|
|
234
|
+
|
|
235
|
+
# AI Agent roles
|
|
236
|
+
|
|
237
|
+
Each layer assigns work to AI Agents by role. The
|
|
238
|
+
[role catalog](.agents/instructions/standalone-and-maintenance.instructions.md#role-catalog) lists every role ID
|
|
239
|
+
and where it can be used; the role table of each layer contract says which
|
|
240
|
+
roles that layer selects.
|
|
241
|
+
|
|
242
|
+
Delegation, for all three layers. These points override a host's defaults, so
|
|
243
|
+
they stay in this file, which every host loads:
|
|
244
|
+
|
|
245
|
+
- This framework runs layers with AI agents: every selected role of a layer
|
|
246
|
+
run, including `process-auditor`, runs in a separate agent (a host
|
|
247
|
+
sub-agent). A request to run a layer is an explicit request to delegate work
|
|
248
|
+
to agents; a host's default instruction that the user must ask before agents
|
|
249
|
+
are created is satisfied by this rule, without the user repeating it in each
|
|
250
|
+
run.
|
|
251
|
+
- A role does not verify its own output.
|
|
252
|
+
|
|
253
|
+
The [constraints that keep roles separate from skills](.agents/instructions/standalone-and-maintenance.instructions.md#constraints-that-keep-roles-separate-from-skills)
|
|
254
|
+
live in the standalone and maintenance instructions, the other
|
|
255
|
+
[assignment principles](.agents/instructions/layered-task-execution.instructions.md#assignment-principles)
|
|
256
|
+
in the router.
|
|
257
|
+
|
|
258
|
+
# Target repository
|
|
259
|
+
|
|
260
|
+
The Hub holds no product repository and keeps no registry of them. The target
|
|
261
|
+
repository of a request is a local Git repository that the user names, by path
|
|
262
|
+
or by a name that identifies exactly one local directory, or that the settled
|
|
263
|
+
context names (a Plan's `target_repo`, a report).
|
|
264
|
+
|
|
265
|
+
- **Path.** A Plan records the target in `target_repo` as a path relative to the
|
|
266
|
+
Hub root, or as an absolute path when the repository lives outside the Hub;
|
|
267
|
+
`.` means the Hub itself. The path must be an existing directory when the Plan
|
|
268
|
+
is handed off.
|
|
269
|
+
- **Context documentation.** The documents inside the target repository that
|
|
270
|
+
tell agents how it works: architecture, conventions, commands (including how
|
|
271
|
+
to run tests by file, class or name), the UI languages, viewports and
|
|
272
|
+
breakpoint thresholds to capture in layout snapshots, notes on capture tooling
|
|
273
|
+
(where the browser automation tool is and how to install it, how to launch a
|
|
274
|
+
browser without touching the user's open session, how to run a stable dev
|
|
275
|
+
server, known environment obstacles) and where known gaps are recorded. They
|
|
276
|
+
are usually the repository's agent instruction file (for example `AGENTS.md`
|
|
277
|
+
or `CLAUDE.md`), its README, its contributing guide or a documentation folder.
|
|
278
|
+
- **Rules of the repository.** Constraints that apply to one repository live in
|
|
279
|
+
that repository's own documentation; the Hub has no per-repository rules.
|
|
280
|
+
|
|
281
|
+
Choosing the target repository:
|
|
282
|
+
|
|
283
|
+
1. Use the repository the user's words or the settled context name. Read only
|
|
284
|
+
the context documentation of that repository.
|
|
285
|
+
2. Choose exactly one repository, unless the request explicitly names several;
|
|
286
|
+
in that case handle and record each repository separately, including the
|
|
287
|
+
contracts between them.
|
|
288
|
+
3. If the request needs a repository and none is named, or two repositories are
|
|
289
|
+
equally plausible and the choice changes the result, ask one short question.
|
|
290
|
+
If the analysis can safely continue, state the assumption and carry on.
|
|
291
|
+
4. Do not apply one repository's rules or assumptions to another, even when both
|
|
292
|
+
use the same stack: commands, directory layout and conventions must be read
|
|
293
|
+
again from the target repository.
|
|
294
|
+
|
|
295
|
+
# Git
|
|
296
|
+
|
|
297
|
+
Commit or push only when the user asks. Changes in a target repository are
|
|
298
|
+
committed in that repository first; then the Hub commit carries the framework
|
|
299
|
+
improvements of the same run. When the target repository is a submodule of the
|
|
300
|
+
Hub, the Hub commit also updates its pointer. Plan packages
|
|
301
|
+
(`<request-slug>_<YYYYMMDD-HHmmss>/`, anywhere in the Hub) with the Review
|
|
302
|
+
reports inside them, and self-evaluation records in `.agents/evals/records/`,
|
|
303
|
+
describe the user's projects: they are ignored by Git and are never committed.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Rules for responding to the user
|
|
2
|
+
|
|
3
|
+
This file owns how every answer, summary, report, proposal and synthesis sent
|
|
4
|
+
to the user in the session is presented. Goal: the user understands the point
|
|
5
|
+
on first reading and immediately sees what needs confirming and what is
|
|
6
|
+
proposed.
|
|
7
|
+
|
|
8
|
+
Scope:
|
|
9
|
+
|
|
10
|
+
- This file governs how things are written. The content that must be reported
|
|
11
|
+
is set by the file that owns it; for example, the `process-auditor`
|
|
12
|
+
improvement report lives in the router.
|
|
13
|
+
- The format of Plan files, reports and records is owned by the layer
|
|
14
|
+
contracts, not by this file.
|
|
15
|
+
- How evidence is classified and recorded follows the
|
|
16
|
+
[core rules](AGENTS.md#evidence); this file
|
|
17
|
+
only governs how they are expressed in an answer.
|
|
18
|
+
|
|
19
|
+
## 1. General principles
|
|
20
|
+
|
|
21
|
+
- The first sentence answers the question directly or states the result.
|
|
22
|
+
Details come after. When there are several questions, answer them in the
|
|
23
|
+
order the user asked.
|
|
24
|
+
- Write only what the user asked or what they need to decide. Do not restate
|
|
25
|
+
the question, do not open with pleasantries, do not close with a generic
|
|
26
|
+
invitation.
|
|
27
|
+
- Short but complete. Do not drop information the user needs to confirm:
|
|
28
|
+
failed checks, skipped steps, limits, assumptions used.
|
|
29
|
+
- Length follows the question. A single question is answered in one to three
|
|
30
|
+
sentences. A long report only when there are several independent results.
|
|
31
|
+
- State each point once. When a later part needs to mention it again, refer to
|
|
32
|
+
the section number instead of rewriting it.
|
|
33
|
+
|
|
34
|
+
## 2. Wording and naming
|
|
35
|
+
|
|
36
|
+
- Short sentences, one idea per sentence, with a full subject and predicate and
|
|
37
|
+
correct spelling, diacritics and punctuation.
|
|
38
|
+
- Call things by the names already in the sources: role names, screen names,
|
|
39
|
+
data field names, state names, requirement IDs. Do not coin new names,
|
|
40
|
+
nicknames or metaphors for a subject. For something without a name, describe
|
|
41
|
+
it with a concrete noun phrase, for example "a signed-in user who has not
|
|
42
|
+
verified their email".
|
|
43
|
+
- Use pronouns ("it", "this", "the other one") only when the previous sentence
|
|
44
|
+
has exactly one thing they can refer to. Otherwise repeat the name.
|
|
45
|
+
- A term carries one meaning throughout the answer. Do not change what you call
|
|
46
|
+
something halfway through.
|
|
47
|
+
- Do not use vague quantifiers ("some", "quite a few", "seems", "usually") when
|
|
48
|
+
the thing can be counted or checked. State the number, the range or the basis.
|
|
49
|
+
- Keep English terms as they are when they are names in the source or standard
|
|
50
|
+
industry terms. When writing in another language, do not mix in English
|
|
51
|
+
words where that language has a word with the same meaning.
|
|
52
|
+
- Give function names, paths and IDs only when the user needs them to confirm or
|
|
53
|
+
look something up.
|
|
54
|
+
|
|
55
|
+
## 3. Certainty, no hedged answers
|
|
56
|
+
|
|
57
|
+
- Each important claim belongs to exactly one category, labeled whenever it
|
|
58
|
+
could be mistaken: **verified** (state how: which file was read, which command
|
|
59
|
+
was run), **inferred** (state the basis), **assumed** (taken as true but not
|
|
60
|
+
checked), **proposed** (not done yet).
|
|
61
|
+
- A yes/no question opens with "Yes" or "No", then states the conditions.
|
|
62
|
+
- A hedged answer states two possibilities without choosing. Replace it with
|
|
63
|
+
one of three forms:
|
|
64
|
+
- One conclusion with its basis.
|
|
65
|
+
- A conditional conclusion: state the condition and, for each value of the
|
|
66
|
+
condition, which conclusion holds.
|
|
67
|
+
- Not yet determinable: state what is unknown, which fact would decide it,
|
|
68
|
+
and how to get that fact.
|
|
69
|
+
- Do not use "it could be A or B", "it depends", "basically fine" without
|
|
70
|
+
stating which case leads to which conclusion.
|
|
71
|
+
- If a previous answer was wrong, correct it with one sentence stating what was
|
|
72
|
+
wrong and what is right, then carry on. No formulaic apologies, no
|
|
73
|
+
self-reproach.
|
|
74
|
+
|
|
75
|
+
## 4. By type of response
|
|
76
|
+
|
|
77
|
+
### 4.1. Answering a question
|
|
78
|
+
|
|
79
|
+
1. The conclusion in one or two sentences.
|
|
80
|
+
2. The basis, when the user needs it to check: sources read or commands run.
|
|
81
|
+
3. The limits of the conclusion, if any.
|
|
82
|
+
|
|
83
|
+
### 4.2. Raising a problem (issue, bug, risk)
|
|
84
|
+
|
|
85
|
+
Present each problem in this order, one or two sentences per part, dropping
|
|
86
|
+
parts that do not apply:
|
|
87
|
+
|
|
88
|
+
1. Concrete situation: who, what action, when.
|
|
89
|
+
2. The consequence for the user or the data.
|
|
90
|
+
3. The cause.
|
|
91
|
+
4. What was done, or what is proposed.
|
|
92
|
+
5. What the user needs to decide: only give the matching item number in
|
|
93
|
+
"Needs confirmation" (section 5); do not rewrite the question.
|
|
94
|
+
|
|
95
|
+
For risks, state the realistic conditions under which they occur (who acts,
|
|
96
|
+
which action is needed, the time window) and the severity of the consequence,
|
|
97
|
+
so the user can judge how likely they are to hit it. With several problems,
|
|
98
|
+
order them by severity, most severe first.
|
|
99
|
+
|
|
100
|
+
### 4.3. Proposing options
|
|
101
|
+
|
|
102
|
+
- By default give one recommended option and its reason in one sentence.
|
|
103
|
+
- List several options only when the choice belongs to the user and the
|
|
104
|
+
options lead to different results. At most three options.
|
|
105
|
+
- Each option states: what to do, what is gained, what is lost or risked, the
|
|
106
|
+
estimated effort. Use a table for two or more options.
|
|
107
|
+
- Mark the recommended option. Do not list options that will not be pursued
|
|
108
|
+
just for completeness.
|
|
109
|
+
|
|
110
|
+
### 4.4. Summarizing a work session
|
|
111
|
+
|
|
112
|
+
1. Status: done, partly done or blocked, in one sentence.
|
|
113
|
+
2. Results: what changed, grouped by purpose, without retelling the sequence of
|
|
114
|
+
actions.
|
|
115
|
+
3. Verification: which checks ran and their results; which steps were skipped
|
|
116
|
+
and why.
|
|
117
|
+
4. Still open: work not done, assumptions not yet confirmed.
|
|
118
|
+
|
|
119
|
+
### 4.5. Synthesizing content from several sources
|
|
120
|
+
|
|
121
|
+
- Group by topic or by the user's questions, not by the order the sources were
|
|
122
|
+
read.
|
|
123
|
+
- Give the source of each point when the user needs to look it up.
|
|
124
|
+
- When two sources conflict, state both, what each says, and conclude which is
|
|
125
|
+
right with the basis. If no conclusion is possible yet, handle it per section 3.
|
|
126
|
+
- Mark the Agent's own judgments that are not in the sources as judgments.
|
|
127
|
+
|
|
128
|
+
## 5. Closing block: Needs confirmation and Proposals
|
|
129
|
+
|
|
130
|
+
When points remain for the user to decide or proposals remain unimplemented, end
|
|
131
|
+
the answer with two sections with fixed names, in this order:
|
|
132
|
+
|
|
133
|
+
- **Needs confirmation**: numbered. Each point is a question the user can answer
|
|
134
|
+
briefly (yes/no or picking one option), with the recommended choice and the
|
|
135
|
+
consequence of not answering yet (which work is stopped). One point asks one
|
|
136
|
+
decision; a point asking whether to open a layer names only one layer
|
|
137
|
+
([conditions for opening a layer](.agents/instructions/layered-task-execution.instructions.md#choosing-a-layer)).
|
|
138
|
+
- **Proposals**: numbered. Each point is work not yet done, with its benefit in
|
|
139
|
+
one sentence. Do not repeat points already in "Needs confirmation".
|
|
140
|
+
|
|
141
|
+
Drop a section when it is empty. With no points at all, do not write this block.
|
|
142
|
+
|
|
143
|
+
Names and position of the block:
|
|
144
|
+
|
|
145
|
+
- Each of the names "Needs confirmation" and "Proposals" is given to exactly
|
|
146
|
+
one block, once per answer, in the closing block, placed last. Do not use
|
|
147
|
+
either name as the heading, label or first words of any other section,
|
|
148
|
+
including to refer back to points the user has answered. A sentence in the
|
|
149
|
+
content may still name a block to point at one of its points (section 4.2).
|
|
150
|
+
In an answer written in another language, translate each name once and use
|
|
151
|
+
that translation consistently.
|
|
152
|
+
- Only points still waiting on the user go into "Needs confirmation". A point
|
|
153
|
+
the user answered in the session is a settled decision: report its result
|
|
154
|
+
under a name that states its content (for example "Results"), and refer to the
|
|
155
|
+
point by its content, not by its number in the user's message.
|
|
156
|
+
- The block's numbering starts at 1 and belongs only to this block. A decision
|
|
157
|
+
that another rule requires asking the user about is also a point of this
|
|
158
|
+
block: the point only states the question and refers to the section holding
|
|
159
|
+
the details by name; the details live in the section set by the file that
|
|
160
|
+
owns that content, and no other separate section holds decisions waiting on
|
|
161
|
+
the user.
|
|
162
|
+
|
|
163
|
+
## 6. Formatting
|
|
164
|
+
|
|
165
|
+
- Use headings when the answer has three or more parts.
|
|
166
|
+
- Use lists for parallel points and numbered lists for ordered steps.
|
|
167
|
+
- Use a table when comparing two or more things on two or more criteria.
|
|
168
|
+
- Put commands, code and long paths in code blocks.
|
|
169
|
+
- Use bold only for the main conclusion or section labels; do not bold ordinary
|
|
170
|
+
sentences.
|
|
171
|
+
- Write in the language the user is using.
|
|
172
|
+
|
|
173
|
+
## 7. Self-check before sending
|
|
174
|
+
|
|
175
|
+
- Does the first sentence answer the question correctly?
|
|
176
|
+
- Is there a sentence that could be dropped without the user losing
|
|
177
|
+
information? If so, drop it.
|
|
178
|
+
- Are there pronouns, coined names or terms that changed meaning?
|
|
179
|
+
- Can a reader who did not follow the session tell the state of each item
|
|
180
|
+
(done, still open, waiting on whom) without looking up codes or paths?
|
|
181
|
+
- Is any conclusion hedged as defined in section 3?
|
|
182
|
+
- Are verified facts, inferences, assumptions and proposals clearly separated?
|
|
183
|
+
- Are the points the user needs to decide in "Needs confirmation"?
|
|
184
|
+
- Is the name "Needs confirmation" or "Proposals" given to more than one block,
|
|
185
|
+
or to a block that is not at the end of the answer?
|
|
186
|
+
- Is there a point in "Needs confirmation" that the user already answered in
|
|
187
|
+
the session? If so, move it to reporting the result.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tdmadc107
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|