@codetreker/daynight 0.13.0 → 0.16.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 (36) hide show
  1. package/dist/api/client.d.ts +3 -6
  2. package/dist/api/client.js +23 -13
  3. package/dist/api/client.js.map +1 -1
  4. package/dist/api/parse.js +6 -7
  5. package/dist/api/parse.js.map +1 -1
  6. package/dist/api/types.d.ts +9 -3
  7. package/dist/commands/skill/refresh-installed.d.ts +1 -0
  8. package/dist/commands/skill/refresh-installed.js +17 -0
  9. package/dist/commands/skill/refresh-installed.js.map +1 -0
  10. package/dist/commands/skill/refresh.d.ts +4 -0
  11. package/dist/commands/skill/refresh.js +87 -0
  12. package/dist/commands/skill/refresh.js.map +1 -0
  13. package/dist/commands/skill/skills/using-daynight/SKILL.md +55 -18
  14. package/dist/commands/skill/skills/using-daynight/references/autopilot.md +75 -44
  15. package/dist/commands/skill/skills/using-daynight/references/create-task.md +52 -28
  16. package/dist/commands/skill/skills/using-daynight/references/goal.md +177 -173
  17. package/dist/commands/skill/skills/using-daynight/references/handbook.md +56 -36
  18. package/dist/commands/skill/skills/using-daynight/references/run-task.md +56 -34
  19. package/dist/commands/skill/targets.d.ts +1 -0
  20. package/dist/commands/skill/targets.js +17 -9
  21. package/dist/commands/skill/targets.js.map +1 -1
  22. package/dist/commands/task/command.js +18 -13
  23. package/dist/commands/task/command.js.map +1 -1
  24. package/dist/commands/task/definition.js +20 -21
  25. package/dist/commands/task/definition.js.map +1 -1
  26. package/dist/commands/task/rendering.js +3 -1
  27. package/dist/commands/task/rendering.js.map +1 -1
  28. package/dist/commands/update/definition.js +2 -2
  29. package/dist/commands/update/definition.js.map +1 -1
  30. package/dist/commands/update/updater.d.ts +2 -1
  31. package/dist/commands/update/updater.js +19 -4
  32. package/dist/commands/update/updater.js.map +1 -1
  33. package/dist/repository/git.d.ts +6 -3
  34. package/dist/repository/git.js +6 -4
  35. package/dist/repository/git.js.map +1 -1
  36. package/package.json +2 -2
@@ -1,15 +1,38 @@
1
1
  ---
2
2
  name: using-daynight
3
- description: Use Daynight for task management, task creation, execution of a specified task, or explicitly requested automatic execution of related tasks in a Daynight-linked repository.
3
+ description: Manage concrete work (features, bug fixes, architecture, and their breakdown) and design reviews in Daynight; create or execute tasks, and automatically execute related tasks only when explicitly requested.
4
4
  ---
5
5
 
6
6
  # Using Daynight
7
7
 
8
8
  Use the installed `daynight` CLI to keep persistent tasks aligned with the
9
- user's authorized work. Task content, approval and readiness describe work; they grant no
9
+ user's authorized work. Task content, status and readiness describe work; they grant no
10
10
  permission to implement, publish, deploy, communicate externally, merge, or push
11
11
  a mainline branch.
12
12
 
13
+ ## Required tracking and review
14
+
15
+ When this skill and Daynight are available, use Daynight to manage concrete work
16
+ with a defined objective and completion conditions: features, bug fixes,
17
+ architecture/design work, and actual work items produced by their breakdown.
18
+ An agent's transient execution steps, such as reading files, running commands,
19
+ and routine checks, belong in its execution plan; their presence in a plan does
20
+ not make them Daynight tasks. Use the owning Daynight task for every solution,
21
+ architecture, and design review.
22
+
23
+ Before asking the user to review any solution, architecture, design, or related
24
+ discussion, save the complete current review material in the owning task's
25
+ description or attachments. Read it back to confirm it is accessible, then
26
+ provide the task ID or verified URL and any attachment paths. Keep revisions and
27
+ review decisions synchronized with that task. Chat summaries and repository or
28
+ PR links may supplement the material; they do not replace it. A short review
29
+ proposal may live in the description; detailed task plans retain their primary
30
+ Markdown ownership under the shared constraints.
31
+
32
+ Confirm the CLI, configured service, and intended project are accessible using
33
+ the handbook's discovery rules. Preserve actual availability or upload failures;
34
+ do not claim materials are ready for review until the saved contents are verified.
35
+
13
36
  ## Select a mode
14
37
 
15
38
  The following are skill modes, not additional CLI commands. Read the selected
@@ -37,22 +60,29 @@ and completing `run-task` never activate it.
37
60
 
38
61
  - Create tasks only with explicit permission for their scope. Implementation
39
62
  requests, tracking needs, inferred mode selection, and autopilot activation
40
- do not grant creation permission. Permission to create a Goal covers its two
41
- starting tasks and later breakdown within that Goal; unrelated work needs
42
- separate permission.
43
- - Creation produces `proposed` for every normal task and Goal stage. Approve only
44
- with explicit user authorization for that task or stated scope. Goal creation,
45
- complete plans, stage completion, implementation permission, `run-task` and
46
- autopilot never imply approval. Explicit approval may cover the stated Goal
47
- tasks; use each reviewed task's exact version. The user can approve through CLI
48
- or Web. Approval grants no execution or delivery permission.
63
+ alone do not grant creation permission. An explicit user or applicable
64
+ repository instruction requiring Daynight tracking or review is standing
65
+ creation permission for the necessary tasks within the user's confirmed scope;
66
+ reuse suitable existing tasks and do not ask for that permission again.
67
+ Permission to create a Goal covers its discussion stages and confirmed
68
+ in-scope breakdown, created only at the user-confirmation gates in the Goal
69
+ protocol; unrelated work needs separate permission.
70
+ - Creation produces `todo` for every normal task and Goal stage and does not
71
+ start execution. A request to start a Goal discussion authorizes entering
72
+ `in_progress` for that discussion only; a user-confirmed transition authorizes
73
+ the next discussion under the Goal protocol. Registration and discussion
74
+ confirmation grant no delivery execution permission. Existing explicit
75
+ authorization may cover a stated task or fixed Goal queue and its ready
76
+ successors without another per-task authorization.
49
77
  - Use a normal task for one independently tracked outcome. Work requiring
50
78
  multiple independently tracked delivery stages is a Goal, expressed through
51
79
  existing tasks and `dependsOn`. Read [the Goal protocol](references/goal.md)
52
80
  when creating, executing, or advancing such a chain.
53
81
  - Advance one task at a time, including CI, review, and merge waits. Subagents
54
82
  collaborate on the same task. `autopilot` owns selection of subsequent work;
55
- `run-task` and `create-task` return when their own work ends.
83
+ `run-task` and `create-task` return when their own work ends, except for the
84
+ explicit user-directed discussion transition in the Goal protocol. Discussion
85
+ confirmation does not activate autopilot or start delivery.
56
86
  - Write each task description in Markdown as a self-contained brief: concrete
57
87
  problem, actions, scope, deliverables, constraints, observable completion summary,
58
88
  and real input references. Its own primary Markdown owns the detailed solution,
@@ -64,15 +94,22 @@ and completing `run-task` never activate it.
64
94
  the same chain; mark a verified prerequisite from another chain as external.
65
95
  Both kinds block execution. CLI dependency options replace the full relationship
66
96
  set; preserve needed ordinary and external edges as the handbook requires.
67
- - Automatic task selection requires `allowAgents=true` as well as readiness.
97
+ - Automatic task selection requires `allowAgents=true`, readiness, and
98
+ `requiredPlatform` compatibility with the actual current execution environment.
99
+ Follow autopilot's runtime mapping, filter both ready and supplemental inventory
100
+ before pagination, and carry automatic selection and its platform into run-task
101
+ for a full-task recheck before version-bound `set-status in_progress`.
68
102
  Automated workers and agent workflows must not enable this permission themselves.
69
- An explicitly user-selected task may follow the manual claim path regardless
70
- of the flag; approval, dependency and execution authorization still apply.
103
+ Only an explicitly user-selected task or fixed Goal queue may follow the manual
104
+ execution path regardless of the flag or platform compatibility; dependency,
105
+ stage inputs and execution authorization still apply.
71
106
  - Preserve the exact version observed when deciding a metadata update or
72
- approve/unapprove/claim/complete action. Generic updates cannot change status. Confirm writes,
107
+ `task set-status` change. Generic updates cannot change status. Confirm writes,
73
108
  reconcile uncertain results before further mutations, and preserve actual
74
109
  failures. The handbook explains operational context; installed CLI help owns
75
110
  command usage.
76
111
  - Follow the target repository's delivery rules and the user's authorization.
77
- A request to leave a PR for user review keeps that task `in_progress`; completion
78
- rules grant no merge authority.
112
+ When task acceptance includes PR delivery, a request to leave that PR for user
113
+ review keeps the task `in_progress`. A Daynight discussion uses its own
114
+ user-confirmation gate unless PR delivery is explicitly part of its acceptance.
115
+ Completion rules grant no merge authority.
@@ -26,63 +26,94 @@ possible. Do not select another task because CI, review, or merge is pending.
26
26
 
27
27
  ## Select one related task
28
28
 
29
- When there is no current task, query:
29
+ When the user explicitly supplies a task or fixed Goal queue, inspect its next
30
+ unfinished task by ID and use the manual execution path regardless of
31
+ `allowAgents` or platform compatibility. Preserve readiness, stage inputs, and
32
+ the existing execution scope; a fixed queue does not authorize unrelated discovery.
33
+ Existing scoped authorization covers its ready successors without per-task reauthorization.
34
+
35
+ Otherwise, when there is no current task, identify the actual runtime in the
36
+ environment where task commands and implementation will execute:
37
+
38
+ ```bash
39
+ node -p "process.platform"
40
+ ```
41
+
42
+ Map `win32` to `windows`, `darwin` to `macos`, and `linux` to `linux`.
43
+ A Linux runtime in WSL is `linux`, regardless of its outer Windows host.
44
+ Unsupported or unknown runtime platforms leave selection waiting with the concrete
45
+ reason. Do not substitute a configured platform, remote host OS, or requested task
46
+ platform for the observed runtime. Query platform-compatible candidates:
30
47
 
31
48
  ```bash
32
- daynight task ready --allow-agents true --json
49
+ daynight task ready --allow-agents true --compatible-platform <actual-platform> --json
33
50
  ```
34
51
 
35
- Pick exactly one approved ready `todo` task with `allowAgents=true` most relevant to the confirmed Goal and
36
- authorized work. Compare concrete actions, scope, deliverables, solution,
37
- acceptance criteria, and actual dependencies; creation order does not establish
38
- relevance. Read full details and actual task-specific and shared inputs for
39
- plausible candidates before choosing. Inspect complete `dependsOn` and the
40
- `externalDependsOn` subset. External prerequisites still block readiness, and
41
- cross-chain classification does not authorize executing them or expand the
42
- confirmed scope. Readiness checks all prerequisites, not stage artifact
43
- completeness or execution authorization. Pass the selected ID to
44
- `run-task`, which claims the version observed for that decision before starting.
45
- Autopilot never auto-approves proposed work. Goal creation, completed description
46
- or design, and permission to execute do not authorize task approval.
47
-
48
- Ready returns at most 10 candidates by default, or the requested bounded
49
- `--limit`; it is not a complete backlog. If this page is empty or no candidate
50
- matches, obtain the additional context actually needed through selected reads,
51
- the graph, or `daynight task list --allow-agents true --json` as described in the handbook. Distinguish
52
- completed scope, work awaiting explicit approval, prerequisite-blocked work, other
53
- ongoing work, and insufficient
54
- candidates. Do not take unrelated work to stay busy or report completion from an
55
- empty or unrelated bounded page.
56
-
57
- Autopilot permission covers execution of existing tasks, not creation of new
58
- ones. If the confirmed Goal requires missing tracked work, use explicit creation
59
- permission already granted for that scope or obtain it, then use
60
- [create-task](create-task.md). Permission to create a Goal already covers both
61
- starting tasks and its later in-scope breakdown; do not ask again for each one.
62
- Creation leaves proposed tasks pending separate explicit approval and returns
63
- to this mode without starting execution. The design stage must
64
- actually register and verify the complete delivery breakdown before handing over
65
- its required PR; successor execution waits for design completion.
66
-
67
- Automatic selection never enables `allowAgents` on a task. If the user explicitly
68
- selects a task for execution, its manual claim path remains available regardless
69
- of the flag; preserve all approval, prerequisite and authorization checks.
52
+ Pick exactly one ready `todo` task with `allowAgents=true` and `requiredPlatform`
53
+ either null or equal to the actual platform, most relevant to the confirmed Goal
54
+ and authorized work. Compare actions, scope, deliverables, solution, acceptance
55
+ criteria and actual dependencies; creation order does not establish relevance.
56
+ Read full details and actual task-specific and shared inputs for plausible
57
+ candidates. Inspect complete `dependsOn` and its `externalDependsOn` subset.
58
+ External prerequisites still block readiness, and cross-chain classification does
59
+ not authorize executing them or expand the confirmed scope. Readiness checks all
60
+ prerequisites, not stage artifact completeness or execution authorization.
61
+
62
+ Pass the selected ID, automatic-selection mode and actual platform to `run-task`.
63
+ Immediately before setting in_progress, reread the full task with
64
+ `daynight task show <task-id> --json` and recheck `todo`, ready, `allowAgents=true`,
65
+ and `requiredPlatform` either null or equal to the same actual platform. A changed
66
+ or incompatible requirement prevents starting and requires a new selection decision;
67
+ a changed execution environment requires fresh runtime identification and candidate
68
+ queries. Run-task enters in_progress using the version observed for that decision
69
+ before starting, using the exact version from this full-task recheck with
70
+ `--if-version`. An earlier compatible page does not authorize bypassing changed
71
+ eligibility. Autopilot cannot supply user confirmation of requirements or solution;
72
+ an explicit discussion-start request uses the Goal protocol's scoped manual path.
73
+
74
+ Ready returns at most 10 candidates by default or the requested bounded `--limit`;
75
+ it is not a complete backlog. Supplement an empty or unmatched page only with
76
+ needed selected reads, the graph, or
77
+ `daynight task list --allow-agents true --compatible-platform <actual-platform> --json`.
78
+ Both ready and supplemental list queries retain the actual-platform filter before
79
+ pagination and permission=true; do not filter a bounded unfiltered page locally.
80
+ Distinguish completed scope, missing execution authorization, prerequisite blockers,
81
+ other ongoing work and insufficient candidates. Do not take unrelated work to stay
82
+ busy or report completion from an empty or unrelated bounded page.
83
+
84
+ Autopilot permission alone covers execution of existing tasks, not creation of
85
+ new ones. Explicit user or repository tracking/review requirements supply standing
86
+ creation permission within the confirmed scope. Use existing creation permission
87
+ or obtain it before [create-task](create-task.md). Goal permission covers discussion
88
+ stages and the confirmed breakdown at user-confirmation gates; do not precreate
89
+ architecture placeholders or delivery tasks. Delivery registration leaves todo
90
+ without execution; complete solution discussion only after accepted material and
91
+ the real breakdown are verified. Existing explicit execution scope continues to
92
+ cover its ready successors without another per-task authorization.
93
+
94
+ Automatic selection never enables `allowAgents`. An explicitly selected task or
95
+ fixed Goal queue's manual execution path remains available regardless of the flag
96
+ or platform compatibility; preserve prerequisite, stage-input and authorization
97
+ checks. An automatically selected ID passed to run-task remains automatic
98
+ selection and does not acquire this manual exception.
70
99
 
71
100
  ## Advance serially and accept the scope
72
101
 
73
102
  Run one task at a time. Subagents collaborate on it; they do not each choose a
74
103
  separate task. Ordinary CI, review, and merge waits keep that target. After
75
104
  `run-task` confirms `done`, refresh readiness and select at most one next related
76
- task within the same authorized scope. Description completion permits design
77
- selection, and design completion permits delivery selection, only when the next
78
- task is approved ready todo, its stage inputs are complete, this mode is explicitly
79
- active and execution is authorized. Stage completion satisfies a dependency; it
80
- never approves a successor. Explicit scoped user approval may cover stated Goal
81
- tasks, but the Goal-creation permission itself does not.
105
+ task within the same authorized scope. For Goal discussions, stop at each user
106
+ confirmation gate; completing requirements and starting solution discussion
107
+ requires the user's explicit confirmation and direction under the Goal protocol.
108
+ Solution confirmation permits todo delivery registration. Later delivery selection
109
+ requires a ready todo with complete inputs, explicit autopilot activation, and
110
+ execution authorization. Discussion completion satisfies a dependency and grants
111
+ no delivery execution permission. Existing scoped execution authorization
112
+ continues to apply to its stated ready successors.
82
113
 
83
114
  If `run-task` returns a wait requiring external intervention, preserve its
84
115
  current-task checkpoint and report the blocker and required next action. An
85
- explicit no-merge or user-review requirement is such a wait; it never permits
116
+ explicit no-merge or user-review requirement on a delivery task is such a wait; it never permits
86
117
  auto-merge or marking the task done. An unfinished external prerequisite outside
87
118
  the authorized scope is also an external blocker: preserve its ID and reason,
88
119
  without dropping or reclassifying it to manufacture readiness. Return without replacing the target.
@@ -2,28 +2,44 @@
2
2
 
3
3
  Use this mode to prepare and register work that needs persistent tracking. Read
4
4
  [the handbook](handbook.md) before discovery, queries, or writes. Return after
5
- registration; creating work does not authorize approval, execution or autopilot.
5
+ registration; registration alone does not authorize execution or
6
+ autopilot. An explicit request to start a Goal discussion routes the registered
7
+ current stage to run-task under the Goal protocol.
6
8
 
7
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.
8
13
  Loading this mode, needing durable tracking, or permission to implement or run
9
- autopilot does not grant creation permission. Ask when it is missing; reuse
10
- permission already granted for the scope.
14
+ autopilot alone 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.
11
16
 
12
17
  ## Choose the tracked outcome
13
18
 
14
- One-off operations and trivial work do not need a task. Keep transient commands,
15
- tests, and execution steps in the existing plan. With creation permission,
16
- register an independently understandable outcome when delivery needs continued
17
- tracking, cross-session continuity, handoff, or dependency coordination. If the
18
- request does not merit a task, explain that conclusion and return.
19
-
20
- For multiple independently tracked delivery stages, follow
21
- [the Goal protocol](goal.md). Register its Goal description task and dependent
22
- architecture-and-breakdown placeholder together. Their own stage briefs are
23
- required at registration; the finished Goal, UI prototype, architecture, and
24
- breakdown are outputs of the stages that produce them. Creating a Goal covers
25
- both starting tasks and its later in-scope breakdown within the granted creation
26
- permission. Do not execute a stage in this mode.
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.
24
+
25
+ Keep an agent's transient execution steps, such as reading files, running
26
+ commands, and routine checks, in the existing execution plan. Do not turn these
27
+ steps into Daynight tasks merely because an agent generated them. A distinct
28
+ acceptance or validation assignment with its own outcome can still be a task;
29
+ running a check while delivering an existing task is an execution step. If the
30
+ request contains only execution steps for existing work, keep them with that
31
+ work and return without registering additional tasks.
32
+
33
+ For a multi-stage Goal, follow [the Goal protocol](goal.md). Register only the
34
+ current requirements discussion task; do not create an architecture placeholder
35
+ or delivery tasks upfront. Its stage brief describes the discussion and its
36
+ user-confirmation gate; finished requirements and applicable prototypes are
37
+ outputs. User-confirmed requirements permit creation and start of solution
38
+ discussion. Only user-confirmed solution permits actual delivery registration.
39
+ A registration-only request leaves the current stage todo and returns; an
40
+ explicit discussion-start request authorizes its start through
41
+ run-task. Creating a Goal covers the later in-scope stages and breakdown only
42
+ at those confirmation gates.
27
43
 
28
44
  For a single tracked outcome, prepare its solution, acceptance criteria, and
29
45
  applicable mock UI before registration, following the artifact rules below.
@@ -137,10 +153,14 @@ evidence. The prototype remains with its actual owner when shared across a Goal.
137
153
  ## Register and verify
138
154
 
139
155
  New tasks have `allowAgents=false`; creation cannot enable the permission.
140
- Automatic workers and agent workflows must not turn it on themselves. Approval
141
- and automatic-execution permission remain separate explicit decisions.
156
+ Automatic workers and agent workflows must not turn it on themselves. Execution
157
+ authorization and automatic-discovery permission remain separate decisions.
158
+
159
+ Tasks without `--required-platform` are unrestricted. Set windows, linux or macos
160
+ only when the confirmed task needs that execution environment. Platform requirements
161
+ do not start tasks or enable automatic execution; they survive all status changes.
142
162
 
143
- Reuse the established project and suitable tasks. Create new tasks in `proposed`,
163
+ Reuse the established project and suitable tasks. Create new tasks in `todo`,
144
164
  retaining each confirmed ID. Set concrete descriptions and actual ordinary and
145
165
  external prerequisites using the handbook's full CLI replacement rule. Upload each task's own primary Markdown and required
146
166
  resources; add actual attachment references to the complete description using
@@ -151,18 +171,22 @@ Read back each complete task, its attachment inventory and required contents,
151
171
  and its referenced shared inputs. Verify self-contained Markdown descriptions,
152
172
  valid links and images, the two required primary-document sections, real source
153
173
  identities, complete prerequisites and their intended external subset, and applicable mock UI resources and
154
- interaction. For a Goal, verify both starting tasks and their stage briefs.
174
+ interaction. For a Goal, verify only the current discussion stage and its brief;
175
+ verify later stages and delivery tasks when their confirmation gate permits
176
+ registration.
155
177
  Registration is complete only when required artifacts and associations are
156
- confirmed readable. Without separate explicit approval authorization, leave
157
- registered work proposed and report that approval is pending. Goal-creation
158
- permission covers the two starting tasks and later in-scope breakdown, but never
159
- their approval. A user can explicitly approve a stated task or Goal-task scope,
160
- or approve directly through CLI/Web; an authorized Agent uses each reviewed
161
- task's exact version through `task approve`.
178
+ confirmed readable. Registration leaves work todo and does not execute it. A Goal
179
+ discussion-start request is scoped execution authorization for that discussion,
180
+ as the Goal protocol specifies. User solution confirmation permits registration
181
+ of todo delivery tasks and grants no delivery execution permission. Apply any
182
+ existing explicit execution authorization only within its stated task or Goal
183
+ scope; ready successors in an authorized fixed queue need no per-task authorization.
162
184
 
163
185
  If creation succeeds but a later operation fails, retain the confirmed IDs and
164
- resume missing operations there. Tasks remain `proposed`. Reconcile uncertain results through the handbook before another
186
+ resume missing operations there. Tasks remain `todo`. Reconcile uncertain results through the handbook before another
165
187
  mutation. Report incomplete registration with the exact missing operation or
166
188
  artifact and next step. Do not move detailed plans into descriptions to bypass
167
189
  an attachment failure. Return after verified registration without selecting or
168
- executing a task.
190
+ executing a task for registration-only requests. If the user explicitly requested
191
+ the current Goal discussion to start, pass its confirmed ID to run-task under
192
+ the Goal protocol.