@codetreker/daynight 0.26.0 → 0.29.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 (90) hide show
  1. package/README.md +128 -17
  2. package/dist/api/client.d.ts +7 -2
  3. package/dist/api/client.js +46 -18
  4. package/dist/api/client.js.map +1 -1
  5. package/dist/api/index.d.ts +1 -0
  6. package/dist/api/index.js +1 -0
  7. package/dist/api/index.js.map +1 -1
  8. package/dist/api/json.js +27 -6
  9. package/dist/api/json.js.map +1 -1
  10. package/dist/api/parse.d.ts +4 -6
  11. package/dist/api/parse.js +51 -93
  12. package/dist/api/parse.js.map +1 -1
  13. package/dist/api/resource-path.d.ts +1 -0
  14. package/dist/api/resource-path.js +8 -0
  15. package/dist/api/resource-path.js.map +1 -0
  16. package/dist/api/task-properties.d.ts +7 -0
  17. package/dist/api/task-properties.js +81 -0
  18. package/dist/api/task-properties.js.map +1 -0
  19. package/dist/api/types.d.ts +95 -6
  20. package/dist/api/validation.d.ts +15 -0
  21. package/dist/api/validation.js +43 -0
  22. package/dist/api/validation.js.map +1 -0
  23. package/dist/cli/schema.d.ts +3 -0
  24. package/dist/cli/schema.js +14 -4
  25. package/dist/cli/schema.js.map +1 -1
  26. package/dist/commands/completion/bash.d.ts +1 -1
  27. package/dist/commands/completion/bash.js +6 -3
  28. package/dist/commands/completion/bash.js.map +1 -1
  29. package/dist/commands/completion/zsh.d.ts +1 -1
  30. package/dist/commands/completion/zsh.js +7 -7
  31. package/dist/commands/completion/zsh.js.map +1 -1
  32. package/dist/commands/skill/skills/using-daynight/SKILL.md +52 -162
  33. package/dist/commands/skill/skills/using-daynight/references/authorization.md +36 -0
  34. package/dist/commands/skill/skills/using-daynight/references/autopilot-managed-task.md +77 -193
  35. package/dist/commands/skill/skills/using-daynight/references/create-task.md +31 -186
  36. package/dist/commands/skill/skills/using-daynight/references/final-acceptance.md +25 -0
  37. package/dist/commands/skill/skills/using-daynight/references/goal.md +46 -243
  38. package/dist/commands/skill/skills/using-daynight/references/handbook.md +38 -294
  39. package/dist/commands/skill/skills/using-daynight/references/handoff.md +33 -91
  40. package/dist/commands/skill/skills/using-daynight/references/project-management.md +24 -0
  41. package/dist/commands/skill/skills/using-daynight/references/run-task.md +18 -59
  42. package/dist/commands/skill/skills/using-daynight/references/setup.md +16 -0
  43. package/dist/commands/skill/skills/using-daynight/references/task-content.md +80 -177
  44. package/dist/commands/skill/skills/using-daynight/references/task-execution.md +34 -126
  45. package/dist/commands/skill/skills/using-daynight/references/task-management.md +162 -0
  46. package/dist/commands/skill/skills/using-daynight/references/write-safety.md +34 -0
  47. package/dist/commands/task/command.js +12 -14
  48. package/dist/commands/task/command.js.map +1 -1
  49. package/dist/commands/task/definition.js +32 -13
  50. package/dist/commands/task/definition.js.map +1 -1
  51. package/dist/commands/task/property.d.ts +6 -0
  52. package/dist/commands/task/property.js +51 -0
  53. package/dist/commands/task/property.js.map +1 -0
  54. package/dist/commands/task/rendering.d.ts +4 -1
  55. package/dist/commands/task/rendering.js +35 -9
  56. package/dist/commands/task/rendering.js.map +1 -1
  57. package/dist/commands/worker/control.js +10 -6
  58. package/dist/commands/worker/control.js.map +1 -1
  59. package/dist/commands/worker/coordinator.d.ts +3 -1
  60. package/dist/commands/worker/coordinator.js +28 -17
  61. package/dist/commands/worker/coordinator.js.map +1 -1
  62. package/dist/commands/worker/herdr/command.d.ts +11 -2
  63. package/dist/commands/worker/herdr/command.js +23 -8
  64. package/dist/commands/worker/herdr/command.js.map +1 -1
  65. package/dist/commands/worker/herdr/instance.d.ts +5 -1
  66. package/dist/commands/worker/herdr/instance.js +30 -0
  67. package/dist/commands/worker/herdr/instance.js.map +1 -1
  68. package/dist/commands/worker/herdr/preflight.js +4 -6
  69. package/dist/commands/worker/herdr/preflight.js.map +1 -1
  70. package/dist/commands/worker/herdr/version-probe.d.ts +13 -0
  71. package/dist/commands/worker/herdr/version-probe.js +21 -0
  72. package/dist/commands/worker/herdr/version-probe.js.map +1 -0
  73. package/dist/commands/worker/herdr.js +2 -6
  74. package/dist/commands/worker/herdr.js.map +1 -1
  75. package/dist/commands/worker/index.d.ts +2 -0
  76. package/dist/commands/worker/index.js +1 -1
  77. package/dist/commands/worker/index.js.map +1 -1
  78. package/dist/commands/worker/remote.d.ts +3 -1
  79. package/dist/commands/worker/remote.js +11 -6
  80. package/dist/commands/worker/remote.js.map +1 -1
  81. package/dist/commands/worker/reporter.d.ts +14 -0
  82. package/dist/commands/worker/reporter.js +174 -0
  83. package/dist/commands/worker/reporter.js.map +1 -0
  84. package/dist/commands/worker/runtime.d.ts +2 -0
  85. package/dist/commands/worker/runtime.js +14 -1
  86. package/dist/commands/worker/runtime.js.map +1 -1
  87. package/dist/commands/worker/telemetry.d.ts +22 -0
  88. package/dist/commands/worker/telemetry.js +265 -0
  89. package/dist/commands/worker/telemetry.js.map +1 -0
  90. package/package.json +2 -2
@@ -1,211 +1,95 @@
1
- # Autopilot one managed task
1
+ # Managed task execution
2
2
 
3
- Use this mode only when the worker's startup prompt explicitly declares the
4
- `worker-managed` environment, the `using-daynight` skill, and the
5
- `autopilot-managed-task` mode. It delivers one already-claimed assignment through
6
- its authorized implementation, validation, PR review, merge, and acceptance.
7
- Read [the handbook](handbook.md) for CLI operations and failure semantics.
3
+ Use only when the worker startup prompt explicitly selects this workflow; see [SKILL.md](../SKILL.md) for entry conditions.
4
+ This workflow sustains delivery of the single originally assigned task, without executing its predecessors, successors, or siblings.
8
5
 
9
- ## Establish the assignment
6
+ ## Preserve the assignment and read the task
10
7
 
11
- The startup prompt supplies `projectId`, `taskId`, the original `claimId`,
12
- `worktreeId`, the actual worktree path and branch, and the configuration selected
13
- for this invocation. Use that explicit assignment throughout execution and recovery.
14
- Task properties, the working directory, environment variables, and an ordinary
15
- conversation request do not establish this managed context.
8
+ Preserve the project ID, task ID, original claim ID, workspace, and native session identity supplied by the startup prompt, including through context compaction or recovery.
9
+ The worker has already started the task in the specified directory. Read the latest complete task with an explicit project:
16
10
 
17
- If a call is presented as managed but its launch declaration or assignment is
18
- missing, incomplete, or mismatched, return waiting without task or business
19
- writes. Do not infer replacement values or fall back to ordinary execution,
20
- claiming, starting, or selecting another task.
11
+ ```bash
12
+ daynight task show <task-id> --project <project-id> --json
13
+ ```
21
14
 
22
- A valid worker-managed assignment already carries sufficient authorization for
23
- its in-scope delivery, including PR merge. Do not request additional permission
24
- for those steps. Honor explicit user restrictions, pause requests, and
25
- revocation. The assignment does not authorize unrelated backlog work, production
26
- deployment, destructive data operations, or changes to permissions or protections.
27
- Reading, editing, or mentioning this mode does not establish a managed assignment
28
- or activate the separately installed `autopilot` skill, which is not a runtime
29
- dependency.
15
+ Check `allowAgents` first; if false, stop execution immediately without enabling it yourself.
16
+ Confirm that the task still belongs to the original active claim; on a mismatch, stop task-related writes and report it, without acquiring a new claim.
17
+ Verify inputs, scope, and completion conditions using [shared task execution](task-execution.md).
30
18
 
31
- The worker produces the launch prompt and decides subsequent scheduling. A new
32
- agent started to recover the same claim receives the original mode and
33
- assignment again. Reconnecting an existing live agent does not imply that the
34
- startup prompt should be submitted again.
19
+ ## Complete delivery standard
35
20
 
36
- ## Verify the existing execution
21
+ | Task type | Required results |
22
+ | --- | --- |
23
+ | Research | Provide the full research report as a task attachment. |
24
+ | Design or architecture | Provide the full solution as a task attachment after multiple independent reviews, with no Critical/Major issues; attach a separate review file for remaining nonblocking issues. |
25
+ | Development | All required delivery PRs are actually merged, and task acceptance criteria are met. |
26
+ | Acceptance | Complete acceptance against the criteria, collect evidence, and upload it as task attachments. |
37
27
 
38
- Read the latest complete task using the supplied project and task IDs:
28
+ These requirements supplement the [shared completion conditions](task-execution.md#completion-conditions).
29
+ Task descriptions and source organization follow the [task content standard](task-content.md); inline content cannot replace attachments explicitly required by this table.
30
+ Goal confirmation points still require human confirmation; the assignment does not authorize executing other stages.
39
31
 
40
- ```bash
41
- daynight task show <task-id> --project <project-id> --json
42
- ```
32
+ ## Sustain complete delivery
33
+
34
+ A valid assignment includes the authorization needed for complete delivery of this task; see [authorization and scope](authorization.md) for the boundaries.
35
+ Keep advancing the task proactively; occasional user interaction does not authorize stopping, while explicit pauses, restrictions, and revocations still apply.
36
+ Continue while useful, authorized actions remain available.
37
+
38
+ Implement, synchronize related documents, and verify in the assigned workspace; collaborating agents share the task scope.
39
+ Use research and independent review agents when available and authorized; reassess the design when repeated failures expose structural problems.
40
+ For tasks without PR delivery, apply the complete delivery standard directly rather than inventing a PR workflow.
41
+
42
+ For PR delivery, sustain the following workflow:
43
43
 
44
- Verify its `projectId` and `id`, `status=in_progress`, and
45
- `properties.worker.state=active` with the supplied `claimId` and `worktreeId`.
46
- Verify the actual working directory and Git branch match the supplied worktree.
47
- Use the configuration supplied for this invocation. The controller selects the
48
- current settings appropriate to the recorded agent when it launches or resumes
49
- a native process; an executor does not independently replace that assignment.
50
- If the same claim is already `completed` and the task is `done`, report the
51
- existing completion and return without reexecuting it. Any other state or
52
- identity mismatch leaves execution waiting; an observed claim change stops
53
- business writes immediately.
54
-
55
- The worker has already claimed and started this task. Do not claim it, set it
56
- to `in_progress`, select candidates, or rerun automatic candidate qualification.
57
- Read and apply [shared task execution](task-execution.md) for the complete task
58
- and stage inputs, current prerequisites, authorized work, results, and
59
- acceptance. A missing required input or unmet prerequisite keeps this assignment
60
- waiting in `in_progress`; it does not authorize another task.
61
-
62
- Before resuming interrupted work or making task writes, refresh the complete
63
- task using the supplied project and task IDs and verify the same active claim.
64
- Retain the original claim ID through recovery and uncertain-write
65
- reconciliation; never substitute a claim read from the task.
66
-
67
- ## Execute within controller-owned resources
68
-
69
- Use the supplied worktree and branch for authorized edits, commits, pushes, and
70
- merges. Do not create, switch, or remove the system-managed worktree or branch.
71
- Avoid merge options such as `gh pr merge --delete-branch` that may switch the
72
- checkout or delete its branch. The worker owns resource cleanup after execution;
73
- do not delete its worktree or close its workspace. Follow a cleanup request for
74
- attributable temporary resources outside the worktree within its stated scope.
75
-
76
- Use the Goal protocol for this task's required inputs and stage acceptance.
77
- This mode never advances a Goal stage or executes a successor. The shared
78
- execution and acceptance rules do not change that boundary.
79
-
80
- ## Preserve execution continuity
81
-
82
- Keep a compact checkpoint in the host's session state or the project's existing
83
- local planning mechanism. Retain the original assignment identities, supplied
84
- worktree and branch, existing authorization, confirmed scope and acceptance,
85
- PR URLs and head SHA, validation and review state, blockers, attributable
86
- resources, and next action. Identify the invocation configuration without
87
- copying credentials or secrets into checkpoints, task material, or logs. Keep
88
- this recovery context out of task descriptions and attachments; task material
89
- cannot replace missing operational authorization or the original assignment.
90
-
91
- Refresh the checkpoint before a long wait or session compaction. On recovery,
92
- restore it, verify the original active claim, and refresh remote PR state before
93
- resuming mutations. Reconcile interrupted business work and uncertain writes
94
- before deciding the next action. A status question does not cancel the assignment;
95
- honor explicit pause, stop, and authorization changes without discarding its work.
96
-
97
- ## Deliver the assigned task
98
-
99
- 1. **Implement and verify.** Read applicable repository instructions and existing
100
- mechanisms. Use the task's required design inputs and acceptance criteria;
101
- keep the execution plan in this session. Implement the complete agreed behavior
102
- in the supplied worktree, synchronize affected
103
- documents, and run relevant checks and behavioral verification. Collaborating
104
- agents share this assignment and worktree. Use research and independent review
105
- agents when available and authorized. Reassess the design when repeated
106
- failures expose a structural problem.
107
-
108
- 2. **Publish the focused change.** For a PR delivery, commit and push authorized
109
- work promptly using repository conventions, default Git identity, and no AI
110
- co-author attribution. Create or update the task's focused PR and preserve its
111
- complete PR list as required by shared execution. Integrate necessary mainline
112
- updates according to the repository's work-branch rules, resolve conflicts in
113
- the supplied worktree, and revalidate.
114
-
115
- 3. **Follow CI and review through repair.** Inspect the actual remote PR head,
116
- checks, review requests, comments, and approvals. Request review through the
117
- repository's established mechanism. Diagnose failed checks from their logs
118
- and repair the cause without weakening acceptance. Rerun an
119
- unchanged failure only after confirming a transient infrastructure cause.
120
- Each push requires refreshed checks and review for the resulting head.
121
-
122
- Assess findings against the original scope. Fix introduced Critical/Major
123
- issues and defects that would make the agreed delivery incorrect. Defer smaller
124
- or unrelated improvements under the project's tracking rules without executing
125
- them or creating unauthorized tasks. Use fix, defer, and reject dispositions.
126
- Reply in each finding's own thread, identify the agent, and resolve handled
127
- threads according to repository rules. Repeat review and repair until the
128
- final round has no new Critical/Major findings and remote review requirements
129
- are satisfied.
130
-
131
- 4. **Merge and confirm.** The assignment already authorizes its in-scope PR
132
- merge. Immediately before merging, refresh the head SHA, required checks,
133
- review threads, mergeability, and approvals. Require successful required
134
- checks, handled blocking review threads, and actual reviewer approval for the
135
- current head. When required checks, current-head approvals, blocking-thread
136
- resolution, and mergeability all satisfy the repository's rules, merge
137
- immediately without requesting additional permission. Never infer approval
138
- from silence, approve your own PR, weaken checks or protections, or use an
139
- administrative override. Use the repository's
140
- permitted linear-history method and bind the merge to the verified head when
141
- the platform supports it. A changed head or failed precondition requires a
142
- fresh decision from current state.
143
-
144
- Confirm the platform reports every necessary delivery PR as merged and retain
145
- its merge result in the session. A final revision may identify the task's
146
- delivered artifact. An accepted auto-merge request or merge-queue
147
- entry is not completion. Do not wait for post-merge mainline CI unless the user
148
- explicitly requires that verification. Continue with required task acceptance
149
- and results after the platform confirms the merge.
150
-
151
- 5. **Record acceptance and close this claim.** Complete the task's confirmed
152
- acceptance and save its readable results at their actual owners, including the
153
- acceptance conclusion and material limitations. Keep verification procedures
154
- and CI/review/merge history in the session. Release attributable temporary
155
- services,
156
- probes, and monitoring resources, including those left by failed collaborators,
157
- while preserving controller-owned resources. Finish that cleanup before
158
- [original-claim completion](#complete-the-original-claim), because confirmed
159
- completion allows the worker to stop the agent and remove its workspace.
160
-
161
- For tasks without a PR delivery path, verify the actual artifact against their
162
- confirmed acceptance criteria. Do not invent a PR or reviewer gate for those
163
- tasks. Goal discussion confirmation gates remain mandatory; this assignment
164
- never authorizes execution of a later Goal stage.
165
-
166
- ## Wait for delivery results
167
-
168
- Pending PR CI or review is ongoing execution, not external intervention. Use
169
- bounded watches or yielding polls at reasonable intervals, inspect new results,
170
- and act on failures and feedback. A polling timeout ends only that poll; keep
171
- waiting and inspecting results. Do not return merely because a required PR
172
- remains unmerged while its CI or review is pending. Use the worker's existing
173
- continuation mechanism; do not claim monitoring continues without one or start
174
- an independent scheduling service.
175
-
176
- Continue while useful authorized actions remain. A demonstrated blocker such as
177
- missing credentials, an unavailable required reviewer, a material unresolved
178
- decision, an unmet human confirmation gate, or an explicit user restriction or
179
- revocation that prevents delivery requires external intervention. This is a
180
- background task: do not ask the user questions. Preserve the concrete blocker, actual task and PR state,
181
- completed work, minimum needed intervention, and next action in the checkpoint,
182
- then return waiting to the controller. Preserve the assignment in `in_progress`;
183
- never treat a blocker or ordinary waiting as completion.
44
+ 1. Commit, push, and create or update focused PRs promptly under repository conventions; use the default Git identity and omit AI co-author attribution.
45
+ Integrate necessary mainline updates, resolve conflicts, and verify in that workspace.
46
+ 2. Actively monitor remote HEAD, CI, reviews, and conflicts.
47
+ Diagnose failures; rerun an unchanged failure only after confirming a transient infrastructure cause.
48
+ Refresh checks and reviews after every push.
49
+ Fix Critical/Major issues in the current change and defects that would make delivery incorrect; defer smaller or unrelated improvements under project rules, without creating tasks on your own.
50
+ Respond in each thread with the fix, deferral, or reason for not adopting the finding, identify the agent, and resolve threads under repository rules.
51
+ Continue until the final round has no new Critical/Major issues and remote review requirements are met.
52
+ 3. Immediately before merging, refresh HEAD, required checks, blocking threads, mergeability, and approvals for the current HEAD.
53
+ Once all requirements are met, merge using a linear method permitted by the repository; bind the operation to the verified HEAD when the platform supports it.
54
+ Do not infer approval from silence, self-approve, bypass protections, or weaken checks.
55
+ Reassess if HEAD or conditions change.
56
+ 4. Verify that every required PR is actually merged, then complete task acceptance and save the results.
57
+ Do not additionally wait for post-merge mainline CI unless the user explicitly requires it.
58
+
59
+ ## Ongoing waits
60
+
61
+ Pending CI and reviews are part of continued execution.
62
+ Use bounded listeners or reasonable polling that yields execution; one wait timing out does not end the task.
63
+ Prefer the worker's existing continuation mechanism, without creating another scheduling service or claiming continued monitoring after it has stopped.
64
+ Inspect new results and handle failures, feedback, and conflicts; ordinary waits do not end the task.
65
+
66
+ ## Request user interaction
67
+
68
+ Request user intervention when a goal, architecture, execution plan, or acceptance criteria necessary to complete the task are missing, when a problem is not covered by the design, or when another blocker arises.
69
+ Do not invent missing decisions or treat the problem as completion.
70
+
71
+ 1. Record the specific issue on the current task: `daynight task set-property <task-id> worker.signaling "<reason>"`.
72
+ 2. Also print the issue to the terminal, preserve the [waiting context](task-execution.md#waiting-context), exit the execution loop, and wait for the user to address it; keep the task `in_progress` and do not select other work.
73
+ 3. After receiving feedback, verify the original assignment and confirm that the problem is solved, then clear the signal with `daynight task remove-property <task-id> worker.signaling`.
74
+ 4. Confirm the removal before resuming automatic execution of the current task. If the problem remains unresolved, retain the signal and keep waiting.
75
+
76
+ Signal writes and removal also follow [write safety](write-safety.md).
77
+ Recording a signal does not complete the task; do not resume blocked operations until the problem is solved.
184
78
 
185
79
  ## Complete the original claim
186
80
 
187
- When [shared acceptance readiness](task-execution.md#confirm-acceptance-readiness)
188
- is satisfied, all required task results are readable, and attributable temporary
189
- resources have been released, reread the complete task, verify the same active
190
- claim, and finish with the original claim ID and the version observed for that
191
- decision:
81
+ Once shared completion conditions are met and required results are readable, clean up this task's temporary services, probes, and monitoring, including resources left by failed collaborators; preserve controller-owned resources. Clean up before completing, because the worker may stop the agent and remove the workspace after confirming completion.
82
+
83
+ Read back the complete task, verify the same original active claim, and use the version observed at that point:
192
84
 
193
85
  ```bash
194
86
  daynight task set-status <task-id> done --project <project-id> --claim-id <claim-id> --if-version <observed-version>
195
87
  ```
196
88
 
197
- This is the final task mutation. Confirm `done`,
198
- `properties.worker.state=completed`, and the original claim ID in the service
199
- result. A refused or unconfirmed write never falls back to ordinary completion
200
- or automatic replay: read the actual task using the supplied project and task
201
- IDs and reconcile only the original claim. An unreadable result remains
202
- unconfirmed; an observed claim change stops further business writes.
203
-
204
- ## Return to the controller
205
-
206
- Return after this task completes or requires demonstrated external intervention.
207
- Preserve the assignment and waiting checkpoint when a human gate, an explicit
208
- user restriction or revocation, or unmet acceptance requires that intervention.
209
- A required PR with pending CI or review follows the ongoing wait above. The worker decides subsequent work
210
- and owns system-resource cleanup; this mode does not select a successor or advance
211
- a Goal stage.
89
+ The claim ID must be the UUID explicitly supplied in the startup assignment, used only for done, never inferred from the environment or task data.
90
+ This is the final task write. Confirm that the response is done, `properties.worker.state=completed`, and the original claim ID is retained.
91
+
92
+ If rejected or the response is uncertain, follow [write safety](write-safety.md) to reconcile the original claim read-only; do not automatically replay the operation or fall back to ordinary completion.
93
+ An unreadable result remains unconfirmed; stop task-related writes immediately if the claim has changed.
94
+ Return to the controller after completion; when user intervention is needed, enter the wait defined under [Request user interaction](#request-user-interaction).
95
+ The worker manages subsequent work and system resources.
@@ -1,198 +1,43 @@
1
- # Create a task
1
+ # Create task
2
2
 
3
- Use this mode to prepare and register work that needs persistent tracking. Read
4
- [the handbook](handbook.md) before discovery, queries, or writes and
5
- [the task content standard](task-content.md) for content preparation. Return after
6
- registration; registration alone does not authorize execution. An explicit request to start a Goal discussion routes the registered
7
- current stage to run-task under the Goal protocol.
3
+ Prepare and register authorized work, then return without automatic execution.
4
+ Apply [authorization and scope](authorization.md) first, find commands in the [CLI handbook](handbook.md), and prepare content under the [task content standard](task-content.md).
8
5
 
9
- Create tasks only with the user's explicit permission for the relevant scope.
10
- An explicit user or applicable repository instruction requiring Daynight tracking
11
- or review supplies standing creation permission for necessary tasks within the
12
- confirmed scope. Reuse suitable tasks and do not ask for that permission again.
13
- Loading this mode, needing durable tracking, or permission to implement alone
14
- does not grant creation permission. Ask when it is missing; reuse
15
- permission already granted for the scope. Creation does not authorize execution or delivery.
6
+ ## Select and check for duplicates
16
7
 
17
- ## Choose the tracked outcome
8
+ Use one task per independently tracked result. For multi-stage objectives, follow the [Goal protocol](goal.md) and register only the currently permitted stage.
9
+ See [final acceptance](final-acceptance.md) for the scope and results of independent acceptance tasks. Do not register routine execution steps as separate tasks.
18
10
 
19
- With creation permission, register or reuse a task for concrete work such as a
20
- feature, bug fix, architecture/design assignment, or actual work item produced by
21
- its breakdown. Each task has its own objective, scope, and observable completion
22
- conditions. Solution, architecture, and design reviews use their owning task
23
- under the entrypoint's required tracking and review rules.
11
+ Confirm the [target project](project-management.md) and search for existing work on the same problem and scope, including completed tasks.
12
+ Read full descriptions, actual sources, dependencies, and acceptance criteria before deciding to reuse a task; similar titles do not establish identity.
13
+ After an interruption, verify existing resources before creating anything again.
24
14
 
25
- Keep an agent's transient execution steps, such as reading files, running
26
- commands, and routine checks, in the session's execution plan. Do not put these
27
- steps in task descriptions or attachments or turn them into Daynight tasks
28
- merely because an agent generated them. A distinct acceptance or validation
29
- assignment with its own outcome can still be a task.
30
- For [final acceptance](../SKILL.md#final-acceptance), identify the entire task or
31
- Goal being assessed and its confirmed requirement sources. Define the deliverable
32
- as the requirement-based acceptance conclusion, supporting observations, defects,
33
- and unverified items. Apply the shared rule to temporary helpers; do not make
34
- their development or repository
35
- delivery the acceptance outcome.
15
+ ## Prepare content
36
16
 
37
- Running a check while delivering an existing task is an execution step. If the
38
- request contains only execution steps for existing work, keep them in that
39
- work's session and return without registering additional tasks.
17
+ Write an outcome-oriented title and a task-specific Markdown description that meet the content standard and current stage requirements.
18
+ Genuinely required sources must be readable, and future outputs must be explicitly assigned to prerequisite tasks.
19
+ Keep shared inputs in their owning tasks; do not copy the full set of material.
40
20
 
41
- For a multi-stage Goal, follow [the Goal protocol](goal.md). Register only the
42
- current requirements discussion task; do not create an architecture placeholder
43
- or delivery tasks upfront. Its stage brief describes the discussion and its
44
- user-confirmation gate; finished requirements and applicable prototypes are
45
- outputs. User-confirmed requirements permit creation and start of solution
46
- discussion. Only user-confirmed solution permits actual delivery registration.
47
- A registration-only request leaves the current stage todo and returns; an
48
- explicit discussion-start request authorizes its start through
49
- run-task. Creating a Goal covers the later in-scope stages and breakdown only
50
- at those confirmation gates.
21
+ Frontend delivery requires an interactive prototype that runs entirely on the frontend and matches the final visual style, covering applicable populated, empty, loading, failure, disabled, long-content, and narrow-screen states.
22
+ Include all resources with valid references, and view and actually interact with the prototype. Static sketches or simplified styling do not satisfy the requirement.
23
+ A discussion task that produces a prototype treats it as a result, not a prerequisite for starting.
51
24
 
52
- For a single tracked outcome, prepare its stage-appropriate task definition,
53
- actual required inputs, and acceptance criteria before registration. A frontend
54
- delivery task also needs its applicable mock UI under the artifact rules below.
55
- A design-producing task does not require its unfinished design as an input.
25
+ Mock UI data and interaction state must remain only in the current page's memory.
26
+ Do not use storage mechanisms such as `localStorage`, `sessionStorage`, Cookie, or IndexedDB, or perform other operations that persistently change local state; dependency libraries must not perform these operations indirectly either.
27
+ Reloading or reopening the prototype must restore its initial state.
56
28
 
57
- Look for existing work with the same problem and scope, including completed
58
- tasks; the default list contains only unfinished work. Inspect full descriptions,
59
- actual dependencies, content sources, and acceptance criteria. For a Goal,
60
- inspect the existing chain and its owning inputs. Titles alone do not establish
61
- identity. Reuse suitable work and preserve valid requirements; interrupted
62
- registration does not justify a duplicate task or chain.
29
+ Select necessary direct prerequisites under [dependency classification and reduction](task-management.md#dependency-classification), verifying whether they belong to the same chain or another chain.
30
+ Platform requirements must come only from confirmed task needs. Do not add dependencies for visual grouping or duplicate the full relationship list in the body.
63
31
 
64
- ## Write task-specific content
32
+ ## Register and read back
65
33
 
66
- Use the target repository's document and workspace rules and the shared task
67
- content standard. Give each task an outcome-focused title and a Markdown
68
- description that identifies its concrete work, responsibility, and actual content
69
- sources. The description and readable references together provide its objective
70
- and requirements, scope and constraints, inputs and sources, deliverables and
71
- contracts, and acceptance criteria. Complete inline content needs no primary
72
- attachment; reference-owned and mixed content are also valid without repeating
73
- complete documents. Save results as they are produced. Stage briefs describe
74
- work that produces the stage's outputs; do not claim unfinished outputs already
75
- exist or require an execution plan, confirmation log, or evidence attachment.
34
+ 1. Register with `task create` and retain the returned ID. New task status and permissions follow [task management](task-management.md).
35
+ 2. If the task owns attachments, upload and verify their content before adding actual references to the description. Follow [write safety](write-safety.md) for all writes.
36
+ 3. Read back the full task, required attachments, and shared inputs to verify sufficient content and valid resources.
37
+ Check dependencies through [post-change verification](task-management.md#verify-dependency-changes).
38
+ For Goal delivery items, also check the [architecture source index](goal.md#register-the-delivery-breakdown).
39
+ 4. Report the task ID, registration result, and specific gaps.
40
+ After partial success, retain existing IDs and resume unfinished operations; unreadable required sources still mean failure.
76
41
 
77
- Attach only resources this task needs or owns. Keep shared Goal requirements
78
- with the requirements task and architecture and breakdown with the solution
79
- task. Reference the owning task ID and its description with applicable sections
80
- for inline content, full paths for actual attachments, or verified immutable
81
- repository sources. Read source descriptions through `task show --json` and
82
- attachment bytes through the attachment commands. For every Goal delivery task,
83
- list the architecture task ID and all required architecture source locations
84
- directly in its description, including indirect successors, as
85
- [the Goal protocol](goal.md) requires. Do not copy the whole shared packet
86
- into every task. An independently needed snapshot records its purpose, original
87
- source, and source revision or content identity.
88
-
89
- A frontend delivery task requires an interactive mock UI that runs with frontend code
90
- alone, matches final visual styling, and represents relevant data and interaction
91
- states. Include applicable populated, empty, loading, failure, disabled, long
92
- content, and narrow-screen cases. Provide required CSS, JavaScript, images, and
93
- other resources with working relative references. A static sketch or simplified
94
- styling does not satisfy this requirement. For a UI Goal, this prototype is
95
- produced by the Goal description stage and referenced by later tasks.
96
-
97
- Use established task IDs for necessary direct prerequisites. Before registration,
98
- apply [the handbook's dependency reduction rule](handbook.md#dependency-reduction)
99
- to omit relationships already supplied by another retained path. Confirmed
100
- same-chain stages use `--depends-on`; a verified prerequisite owned by another
101
- same-project chain uses `--external-depends-on`. The CLI sends their complete
102
- union and explicit external subset. Do not infer ownership from status, title,
103
- graph roots or array order, and do not add a dependency only to make tasks appear
104
- together. Resolve unclear
105
- ownership before registering the relationship. A top-level task has no ordinary
106
- prerequisites; it may still have real external prerequisites that block execution.
107
- Do not add a Dependencies section or duplicate the relationship lists in task
108
- prose. Repository specifications and design documents retain their full contracts;
109
- the current task identifies its required design inputs and verifiable acceptance
110
- criteria directly or through their actual owners.
111
-
112
- ## Author Markdown
113
-
114
- Use headings, paragraphs, lists, quotes, fenced code, tables, links, and images
115
- when they help readers understand the assignment. The Web renders CommonMark
116
- and GFM; raw HTML appears as text. API and CLI reads retain the original Markdown
117
- string, with no separate format field. Preserve its syntax, whitespace, code,
118
- and valid references when replacing the complete description.
119
-
120
- A relative link or image in a description starts at this task's attachment root.
121
- A link inside a Markdown attachment starts at that file's directory. Keep paths
122
- inside the task root and preserve the actual case and resource identity. Confirm
123
- an upload and read back its contents before adding its link. Reference shared
124
- inputs by their verified owning task ID and description/sections or actual
125
- attachment path, or by an immutable repository URL. A relative link cannot
126
- identify another task's content.
127
-
128
- For example, the following brief applies to a task whose confirmed, readable
129
- attachments include the complete `mockui/index.html` prototype and its resources.
130
- Use this path only when those files actually belong to that task; adapt the
131
- content and references to the actual assignment. A Goal stage that produces a
132
- prototype links it only after producing and confirming it.
133
-
134
- ```markdown
135
- ## 问题与要求
136
- 登录失败后,用户无法判断是否可以重试。显示明确的失败原因和重试入口,保留当前登录表单输入。
137
-
138
- ## 范围与交付
139
- 交付登录页的错误提示、重试交互和中英文文案;沿用现有认证接口与会话边界。
140
-
141
- ## 输入
142
- [交互原型](mockui/index.html) 定义相关视觉样式和交互状态;认证接口沿用仓库现有契约,无新增任务间交换。
143
-
144
- ## 完成条件
145
- 网络失败和凭据错误均显示对应提示;重试成功后进入工作区。桌面与窄屏、两种语言的交互正确,表单输入保持。
146
- ```
147
-
148
- This example defines the task inline and references its actual prototype. Shared
149
- design inputs retain their real owner under the source rules above. Neither the
150
- brief nor an attachment needs the session's implementation steps, tool choices,
151
- or review schedule. A filename such as `plan.md` does not determine whether its
152
- contents belong to the task.
153
-
154
- ## Register and verify
155
-
156
- New tasks have `allowAgents=false`; creation cannot enable the permission.
157
- Creation and breakdown do not enable it. A separate, explicitly requested
158
- [handoff](handoff.md) reviews each task before enabling permission. Execution
159
- authorization and automatic-discovery permission remain separate decisions.
160
-
161
- Tasks without `--required-platform` are unrestricted. Set windows, linux or macos
162
- only when the confirmed task needs that execution environment. Platform requirements
163
- do not start tasks or enable automatic execution; they survive all status changes.
164
-
165
- Reuse the established project and suitable tasks. Create new tasks in `todo`,
166
- retaining each confirmed ID. Set concrete descriptions and actual ordinary and
167
- external prerequisites using the handbook's full CLI replacement rule. Upload
168
- required task-owned resources when the content uses attachments; add actual
169
- references to the complete description using the observed task version. Reference
170
- already readable shared inputs at their source. Do not present planned uploads as existing attachments.
171
-
172
- Read back each complete task, its attachment inventory and required contents,
173
- and its referenced shared inputs. Verify self-contained Markdown descriptions,
174
- valid links and images, the stage-appropriate task definition, produced results,
175
- real source identities, complete necessary direct prerequisites
176
- and their intended external subset, absence of redundant dependencies under the
177
- handbook's reduction rule, and applicable mock UI resources and interaction. For a
178
- Goal, verify only the current discussion stage and its brief;
179
- verify later stages and delivery tasks when their confirmation gate permits
180
- registration. When registering delivery work, check every task's description,
181
- including indirect successors, for its architecture task ID and required document
182
- references, and read the referenced contents under the Goal protocol.
183
- Registration is complete only when required artifacts and associations are
184
- confirmed readable. Registration leaves work todo and does not execute it. A Goal
185
- discussion-start request is scoped execution authorization for that discussion,
186
- as the Goal protocol specifies. User solution confirmation permits registration
187
- of todo delivery tasks and grants no delivery execution permission. Apply any
188
- existing explicit execution authorization only within its stated task or Goal
189
- scope. Registration does not select or start a later task.
190
-
191
- If creation succeeds but a later operation fails, retain the confirmed IDs and
192
- resume missing operations there. Tasks remain `todo`. Reconcile uncertain results through the handbook before another
193
- mutation. Report incomplete registration with the exact missing operation or
194
- artifact and next step. An unreadable required source is still a failure; do
195
- not silently replace it with invented or weaker content. Return after verified
196
- registration without selecting or executing a task for registration-only requests. If the user explicitly requested
197
- the current Goal discussion to start, pass its confirmed ID to run-task under
198
- the Goal protocol.
42
+ A registration-only request ends here, with the task remaining `todo`.
43
+ When explicitly asked to start the current Goal discussion, pass the confirmed ID to [ordinary task execution](run-task.md) under the Goal protocol.
@@ -0,0 +1,25 @@
1
+ # Final acceptance
2
+
3
+ Use to determine whether the complete task or Goal requested by the user meets confirmed requirements.
4
+ Define the acceptance scope, requirement sources, actual delivery inputs, and observable completion conditions during creation or breakdown; do not limit acceptance to an implementation fragment or helper script.
5
+
6
+ ## Verify complete outcomes
7
+
8
+ Read the complete confirmed requirements and changes, actual deliverables, and acceptance criteria.
9
+ Use manual verification, existing checks, or temporary helpers as needed to verify required implementation and actual PR merges.
10
+ Conclusions must cover the entire agreed scope; do not report the original task or Goal as having passed when required outcomes are unmet or unverified.
11
+
12
+ Deliver requirement-based conclusions, defects, unverified items, and the evaluated sources, key observations, and material limitations needed to support those conclusions in the owning task.
13
+ Content ownership follows the [task content standard](task-content.md); managed acceptance must also meet the evidence attachment requirements of the [complete delivery standard](autopilot-managed-task.md#complete-delivery-standard).
14
+ Keep verification commands, debugging history, and progress in the session unless they are themselves required deliverables.
15
+
16
+ ## Helper boundaries
17
+
18
+ Keep temporary acceptance scripts in the project's temporary area.
19
+ Do not commit them, integrate them into repository tests, fixtures, runners, CI, or tooling, or make an ongoing verification system an acceptance deliverable.
20
+ Completing or passing a helper script does not prove that user requirements are met and does not create a separate PR requirement for it.
21
+ Review findings in helpers do not authorize scope expansion.
22
+
23
+ Implementation and authorized defect fixes still retain normal unit, integration, and regression tests and required repository checks.
24
+ User-requested persistent tests or automation are separately confirmed development deliverables, not something inferred from an acceptance task.
25
+ Fix product defects only within the authorized implementation scope; handle the rest under [authorization and scope](authorization.md).