@codetreker/daynight 0.8.1 → 0.8.5
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/dist/api/client.d.ts +1 -0
- package/dist/api/client.js +17 -0
- package/dist/api/client.js.map +1 -1
- package/dist/cli/cancellation.d.ts +5 -0
- package/dist/cli/cancellation.js +24 -0
- package/dist/cli/cancellation.js.map +1 -0
- package/dist/cli/commands.js +2 -0
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/prompts.d.ts +16 -3
- package/dist/cli/prompts.js +38 -10
- package/dist/cli/prompts.js.map +1 -1
- package/dist/commands/review/adapters/copilot.js +3 -3
- package/dist/commands/review/adapters/copilot.js.map +1 -1
- package/dist/commands/review/skill.js +5 -83
- package/dist/commands/review/skill.js.map +1 -1
- package/dist/commands/review/skills/daynight-review/SKILL.md +43 -14
- package/dist/commands/skill/agents.d.ts +23 -0
- package/dist/commands/skill/agents.js +14 -0
- package/dist/commands/skill/agents.js.map +1 -0
- package/dist/commands/skill/command.d.ts +12 -0
- package/dist/commands/skill/command.js +76 -0
- package/dist/commands/skill/command.js.map +1 -0
- package/dist/commands/skill/definition.d.ts +2 -0
- package/dist/commands/skill/definition.js +12 -0
- package/dist/commands/skill/definition.js.map +1 -0
- package/dist/commands/skill/install.d.ts +12 -0
- package/dist/commands/skill/install.js +118 -0
- package/dist/commands/skill/install.js.map +1 -0
- package/dist/commands/skill/skills/daynight/SKILL.md +95 -0
- package/dist/commands/skill/skills/daynight/references/commands.md +155 -0
- package/dist/commands/skill/targets.d.ts +10 -0
- package/dist/commands/skill/targets.js +29 -0
- package/dist/commands/skill/targets.js.map +1 -0
- package/dist/commands/task/command.js +9 -0
- package/dist/commands/task/command.js.map +1 -1
- package/dist/commands/task/definition.js +6 -0
- package/dist/commands/task/definition.js.map +1 -1
- package/dist/config/setup.js +5 -24
- package/dist/config/setup.js.map +1 -1
- package/dist/platform/skill-bundle.d.ts +10 -0
- package/dist/platform/skill-bundle.js +82 -0
- package/dist/platform/skill-bundle.js.map +1 -0
- package/dist/repository/git.d.ts +1 -0
- package/dist/repository/git.js +6 -3
- package/dist/repository/git.js.map +1 -1
- package/package.json +6 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: daynight-review
|
|
3
|
-
description:
|
|
3
|
+
description: Enforce a clear, focused pull-request scope and verify introduced Critical or Major defects.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Daynight Review
|
|
@@ -10,14 +10,35 @@ reconciliation rules and completion protocol. Those values belong to the current
|
|
|
10
10
|
attempt, including when the conversation contains an earlier review. Repository
|
|
11
11
|
instructions remain applicable within that target and the authorized review.
|
|
12
12
|
|
|
13
|
-
## Establish the
|
|
13
|
+
## Establish and gate the scope
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
Use gh with the supplied host, repository and PR number to read the current PR
|
|
16
|
+
title and description, plus relevant linked requirements that establish its
|
|
17
|
+
scope. Use available evidence of the original delivery goal; do not claim access
|
|
18
|
+
to unavailable discussion or description history.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Apply both PR-quality gates to the complete diff between the supplied merge-base
|
|
21
|
+
and head:
|
|
22
|
+
|
|
23
|
+
- The description clearly explains one concrete problem, intended outcome and
|
|
24
|
+
scope. Multiple independent objectives or a change too broad to review as one
|
|
25
|
+
focused delivery require splitting, even under a common umbrella title.
|
|
26
|
+
- Every change serves that original delivery goal. Implementation,
|
|
27
|
+
structural changes, tests and documentation serving the same outcome belong
|
|
28
|
+
together. Independent features, unrelated fixes and incidental cleanup must
|
|
29
|
+
be removed or delivered separately. Broadening the description alone cannot
|
|
30
|
+
legitimize unrelated changes.
|
|
31
|
+
|
|
32
|
+
Judge purpose, dependencies and reviewability, without arbitrary line or file
|
|
33
|
+
limits. Each failed gate is an approval blocker in its own right, without a
|
|
34
|
+
runtime failure or a Critical/Major severity label. An unclear description that
|
|
35
|
+
prevents establishing scope also blocks approval; request the missing scope.
|
|
36
|
+
|
|
37
|
+
Read the surrounding implementation and trace changed behavior through callers,
|
|
38
|
+
consumers and persisted or exchanged data. Derive expected behavior from relevant
|
|
39
|
+
contracts; do not treat a plausible alternative design as a defect.
|
|
40
|
+
|
|
41
|
+
For each suspected code defect, identify the concrete trigger, affected caller,
|
|
21
42
|
observable failure and changed line that introduces it. Compare the original
|
|
22
43
|
behavior when needed to distinguish an introduced defect from an existing one.
|
|
23
44
|
Include adjacent code only when its interaction with this change causes the
|
|
@@ -42,22 +63,30 @@ captured target, and obey the task's foreground-process and cleanup rules.
|
|
|
42
63
|
|
|
43
64
|
## Select and publish findings
|
|
44
65
|
|
|
45
|
-
Report
|
|
66
|
+
Report PR-quality blockers and actionable Critical or Major defects introduced
|
|
67
|
+
by the change.
|
|
46
68
|
Critical defects have severe, broad consequences such as destructive data loss
|
|
47
69
|
or a fundamental security failure. Major defects break required behavior for a
|
|
48
70
|
concrete supported use case. Judge severity by the demonstrated consequence and
|
|
49
71
|
reach, not by how small the fix appears.
|
|
50
72
|
|
|
51
|
-
Defer minor
|
|
52
|
-
|
|
73
|
+
Defer minor improvement requests, style preferences and pre-existing defects.
|
|
74
|
+
Do not grow the review into a repository-wide audit. If an uncertain code-defect
|
|
53
75
|
candidate cannot be established with the available evidence, leave it out of
|
|
54
76
|
published findings.
|
|
55
77
|
|
|
56
|
-
Write English
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
Write English comments and identify the reviewing agent as required by the task.
|
|
79
|
+
Put out-of-scope changes and code defects on the relevant changed lines. Put
|
|
80
|
+
description or PR-wide blockers in the review body when no suitable changed line
|
|
81
|
+
exists; a COMMENT review may contain only a body. State the violated scope or
|
|
82
|
+
behavior, its concrete effect, and the necessary correction concisely. Keep
|
|
59
83
|
investigation narration, reproduction transcripts and lists of things checked
|
|
60
|
-
out of
|
|
84
|
+
out of comments. Combine duplicate manifestations of one cause.
|
|
85
|
+
|
|
86
|
+
Approve only when both PR-quality gates pass and no Critical or Major defect
|
|
87
|
+
remains. Before publication or retry confirmation, re-read the current title and
|
|
88
|
+
description and evaluate the gates again. A matching stable identity on an old
|
|
89
|
+
APPROVE does not establish that the current description and scope pass.
|
|
61
90
|
|
|
62
91
|
Follow the current task's result-publication and retry-reconciliation protocol.
|
|
63
92
|
Only its successful publication or confirmation permits its completion marker.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const skillAgents: readonly [{
|
|
2
|
+
readonly id: "codex";
|
|
3
|
+
readonly name: "Codex";
|
|
4
|
+
readonly command: "codex";
|
|
5
|
+
readonly directory: ".agents";
|
|
6
|
+
readonly reload: "Codex discovers skills automatically; restart the session if it is not listed.";
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "copilot";
|
|
9
|
+
readonly name: "Copilot CLI";
|
|
10
|
+
readonly command: "copilot";
|
|
11
|
+
readonly directory: ".agents";
|
|
12
|
+
readonly reload: "In Copilot CLI, run /skills reload and /skills info daynight.";
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "claude";
|
|
15
|
+
readonly name: "Claude Code";
|
|
16
|
+
readonly command: "claude";
|
|
17
|
+
readonly directory: ".claude";
|
|
18
|
+
readonly reload: "Claude Code discovers existing skill directories automatically; run /reload-skills after creating a new top-level directory.";
|
|
19
|
+
}];
|
|
20
|
+
export type SkillAgent = typeof skillAgents[number];
|
|
21
|
+
export type SkillAgentId = SkillAgent["id"];
|
|
22
|
+
export type AgentLookup = (command: string) => Promise<string | null>;
|
|
23
|
+
export declare const detectSkillAgents: (lookup?: AgentLookup) => Promise<SkillAgent[]>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import which from "which";
|
|
2
|
+
export const skillAgents = [
|
|
3
|
+
{ id: "codex", name: "Codex", command: "codex", directory: ".agents", reload: "Codex discovers skills automatically; restart the session if it is not listed." },
|
|
4
|
+
{ id: "copilot", name: "Copilot CLI", command: "copilot", directory: ".agents", reload: "In Copilot CLI, run /skills reload and /skills info daynight." },
|
|
5
|
+
{ id: "claude", name: "Claude Code", command: "claude", directory: ".claude", reload: "Claude Code discovers existing skill directories automatically; run /reload-skills after creating a new top-level directory." },
|
|
6
|
+
];
|
|
7
|
+
export const detectSkillAgents = async (lookup = async (command) => which(command, { nothrow: true })) => {
|
|
8
|
+
const detected = [];
|
|
9
|
+
for (const agent of skillAgents)
|
|
10
|
+
if (await lookup(agent.command) !== null)
|
|
11
|
+
detected.push(agent);
|
|
12
|
+
return detected;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/commands/skill/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,gFAAgF,EAAE;IAChK,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,+DAA+D,EAAE;IACzJ,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,8HAA8H,EAAE;CAC9M,CAAC;AAMX,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACpC,MAAM,GAAgB,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EACnD,EAAE;IACzB,MAAM,QAAQ,GAAiB,EAAE,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,WAAW;QAAE,IAAI,MAAM,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI;YAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChG,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CliContext } from "../../cli/context.js";
|
|
2
|
+
import type { SkillAgent } from "./agents.js";
|
|
3
|
+
import type { SkillBundle } from "./install.js";
|
|
4
|
+
import type { SkillTarget } from "./targets.js";
|
|
5
|
+
export type SkillCommandDependencies = {
|
|
6
|
+
detectAgents: () => Promise<SkillAgent[]>;
|
|
7
|
+
projectRoot: (cwd: string, signal: AbortSignal) => Promise<string>;
|
|
8
|
+
captureBundle: (packageDirectory: string) => Promise<SkillBundle>;
|
|
9
|
+
planTargets: (base: string, agents: readonly SkillAgent[]) => Promise<SkillTarget[]>;
|
|
10
|
+
install: (targets: readonly SkillTarget[], bundle: SkillBundle, signal: AbortSignal, installed: (target: SkillTarget) => void) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export declare const runSkillCommand: (args: readonly string[], context: CliContext, dependencies?: SkillCommandDependencies, suppliedSignal?: AbortSignal) => Promise<void>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { withCliCancellation } from "../../cli/cancellation.js";
|
|
2
|
+
import { parseCommand, renderCommandHelp } from "../../cli/schema.js";
|
|
3
|
+
import { skillDefinition } from "./definition.js";
|
|
4
|
+
const defaultDependencies = {
|
|
5
|
+
detectAgents: async () => (await import("./agents.js")).detectSkillAgents(),
|
|
6
|
+
projectRoot: async (cwd, signal) => {
|
|
7
|
+
const { createOperation } = await import("../../api/operation.js");
|
|
8
|
+
const operation = createOperation({ signal, limits: { totalMs: 30_000 } });
|
|
9
|
+
try {
|
|
10
|
+
return await (await import("../../repository/git.js")).discoverWorktreeRoot(cwd, operation);
|
|
11
|
+
}
|
|
12
|
+
finally {
|
|
13
|
+
operation.dispose();
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
captureBundle: async (packageDirectory) => (await import("./install.js")).captureInstalledSkill(packageDirectory),
|
|
17
|
+
planTargets: async (...args) => (await import("./targets.js")).planSkillTargets(...args),
|
|
18
|
+
install: async (...args) => (await import("./install.js")).installSkillTargets(...args),
|
|
19
|
+
};
|
|
20
|
+
export const runSkillCommand = async (args, context, dependencies = defaultDependencies, suppliedSignal) => {
|
|
21
|
+
const command = parseCommand(skillDefinition, args, ["daynight", "skill"], "daynight skill --help");
|
|
22
|
+
if (command.kind !== "run") {
|
|
23
|
+
context.stdout(renderCommandHelp(command.command, command.path));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
await withCliCancellation(context, async (signal) => {
|
|
27
|
+
const prompt = context.prompt;
|
|
28
|
+
if (prompt?.isInteractive !== true)
|
|
29
|
+
throw new Error("Skill installation requires terminal input and stderr. Run daynight skill install from an interactive terminal.");
|
|
30
|
+
signal.throwIfAborted();
|
|
31
|
+
const detected = await dependencies.detectAgents();
|
|
32
|
+
signal.throwIfAborted();
|
|
33
|
+
if (detected.length === 0)
|
|
34
|
+
throw new Error("No supported agent launchers were detected on PATH (codex, copilot, claude). Install an agent and run daynight skill install again.");
|
|
35
|
+
const selection = await prompt.selectMany({
|
|
36
|
+
message: "Install the Daynight skill for which agents?",
|
|
37
|
+
choices: detected.map(({ id, name }) => ({ name, value: id })),
|
|
38
|
+
requiredMessage: "Select at least one agent.",
|
|
39
|
+
}, signal);
|
|
40
|
+
signal.throwIfAborted();
|
|
41
|
+
const agents = detected.filter(({ id }) => selection.includes(id));
|
|
42
|
+
if (agents.length === 0)
|
|
43
|
+
throw new Error("Select at least one detected agent to install the Daynight skill.");
|
|
44
|
+
const scope = await prompt.select({
|
|
45
|
+
message: "Where should the skill be installed?",
|
|
46
|
+
choices: [{ name: "User", value: "user" }, { name: "Project", value: "project" }],
|
|
47
|
+
default: "user",
|
|
48
|
+
}, signal);
|
|
49
|
+
signal.throwIfAborted();
|
|
50
|
+
const scopeName = scope === "user" ? "User" : "Project";
|
|
51
|
+
const base = scope === "user" ? context.homeDirectory() : await dependencies.projectRoot(context.workingDirectory(), signal);
|
|
52
|
+
const bundle = await dependencies.captureBundle(context.packageDirectory);
|
|
53
|
+
const targets = await dependencies.planTargets(base, agents);
|
|
54
|
+
signal.throwIfAborted();
|
|
55
|
+
try {
|
|
56
|
+
await dependencies.install(targets, bundle, signal, (target) => {
|
|
57
|
+
for (const [index, agent] of target.agents.entries()) {
|
|
58
|
+
context.stdout(`Installed ${agent.name}: ${scopeName} skill at ${target.path} (package ${context.version}${index === 0 ? "" : "; shared installation"}).\n${agent.reload}\n`);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
catch (cause) {
|
|
63
|
+
const { SkillInstallationError } = await import("./install.js");
|
|
64
|
+
if (cause instanceof SkillInstallationError) {
|
|
65
|
+
if (cause.failed !== undefined)
|
|
66
|
+
for (const agent of cause.failed.agents)
|
|
67
|
+
context.stderr(`Failed ${agent.name}: ${scopeName} skill at ${cause.failed.path}.\n`);
|
|
68
|
+
for (const target of cause.unattempted)
|
|
69
|
+
for (const agent of target.agents)
|
|
70
|
+
context.stderr(`Not attempted ${agent.name}: ${scopeName} skill at ${target.path}.\n`);
|
|
71
|
+
}
|
|
72
|
+
throw cause;
|
|
73
|
+
}
|
|
74
|
+
}, suppliedSignal);
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/commands/skill/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAalD,MAAM,mBAAmB,GAA6B;IACpD,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MA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CAAC;YACf,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC;YAChE,IAAI,KAAK,YAAY,sBAAsB,EAAE,CAAC;gBAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;oBAAE,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM;wBAAE,OAAO,CAAC,MAAM,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,SAAS,aAAa,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC;gBAC/J,KAAK,MAAM,MAAM,IAAI,KAAK,CAAC,WAAW;oBAAE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM;wBAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,KAAK,CAAC,IAAI,KAAK,SAAS,aAAa,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC;YACpK,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,EAAE,cAAc,CAAC,CAAC;AACrB,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const skillDefinition = {
|
|
2
|
+
name: "skill",
|
|
3
|
+
description: "Install the Daynight project and task skill for coding agents",
|
|
4
|
+
commands: [{
|
|
5
|
+
name: "install",
|
|
6
|
+
description: "Choose detected agents and install or replace their Daynight skill",
|
|
7
|
+
options: [{ names: ["-h", "--help"], description: "Show this help", action: "help" }],
|
|
8
|
+
details: "Requires interactive terminal input and stderr. Choose agents, then User or Project scope.\nReplaces the complete daynight skill directory, including local edits and obsolete files.",
|
|
9
|
+
}],
|
|
10
|
+
options: [{ names: ["-h", "--help"], description: "Show this help", action: "help" }],
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/commands/skill/definition.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,+DAA+D;IAC5E,QAAQ,EAAE,CAAC;YACT,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,oEAAoE;YACjF,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACrF,OAAO,EAAE,uLAAuL;SACjM,CAAC;IACF,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;CACtF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BundleEntry } from "../../platform/skill-bundle.js";
|
|
2
|
+
import type { SkillTarget } from "./targets.js";
|
|
3
|
+
export type SkillBundle = readonly BundleEntry[];
|
|
4
|
+
export type SkillInstallFilesystem = Pick<typeof import("node:fs/promises"), "mkdir" | "mkdtemp" | "rename" | "rm" | "rmdir" | "writeFile">;
|
|
5
|
+
export declare const captureInstalledSkill: (packageDirectory: string) => Promise<SkillBundle>;
|
|
6
|
+
export declare class SkillInstallationError extends Error {
|
|
7
|
+
readonly completed: readonly SkillTarget[];
|
|
8
|
+
readonly failed: SkillTarget | undefined;
|
|
9
|
+
readonly unattempted: readonly SkillTarget[];
|
|
10
|
+
constructor(completed: readonly SkillTarget[], failed: SkillTarget | undefined, unattempted: readonly SkillTarget[], message: string, options: ErrorOptions);
|
|
11
|
+
}
|
|
12
|
+
export declare const installSkillTargets: (targets: readonly SkillTarget[], bundle: SkillBundle, signal: AbortSignal, installed: (target: SkillTarget) => void, fs?: SkillInstallFilesystem) => Promise<void>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { mkdir, mkdtemp, rename, rm, rmdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { captureSkillBundle, validateSkillEntrypoint } from "../../platform/skill-bundle.js";
|
|
4
|
+
const filesystem = { mkdir, mkdtemp, rename, rm, rmdir, writeFile };
|
|
5
|
+
const hasCode = (cause, code) => cause instanceof Error && "code" in cause && cause.code === code;
|
|
6
|
+
export const captureInstalledSkill = async (packageDirectory) => {
|
|
7
|
+
const source = path.join(packageDirectory, "dist", "commands", "skill", "skills", "daynight");
|
|
8
|
+
try {
|
|
9
|
+
const bundle = await captureSkillBundle(source, "Daynight skill");
|
|
10
|
+
validateSkillEntrypoint(bundle, "daynight", "Daynight skill");
|
|
11
|
+
return bundle;
|
|
12
|
+
}
|
|
13
|
+
catch (cause) {
|
|
14
|
+
throw new Error(`Cannot capture installed Daynight skill bundle ${source}. Reinstall the npm package and try again.`, { cause });
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export class SkillInstallationError extends Error {
|
|
18
|
+
completed;
|
|
19
|
+
failed;
|
|
20
|
+
unattempted;
|
|
21
|
+
constructor(completed, failed, unattempted, message, options) {
|
|
22
|
+
super(message, options);
|
|
23
|
+
this.completed = completed;
|
|
24
|
+
this.failed = failed;
|
|
25
|
+
this.unattempted = unattempted;
|
|
26
|
+
this.name = "SkillInstallationError";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const replaceTarget = async (target, bundle, signal, fs) => {
|
|
30
|
+
const created = [];
|
|
31
|
+
let stage;
|
|
32
|
+
let phase = "create parent directories";
|
|
33
|
+
let removed = false;
|
|
34
|
+
let failure;
|
|
35
|
+
try {
|
|
36
|
+
signal.throwIfAborted();
|
|
37
|
+
let cursor = target.ancestor;
|
|
38
|
+
for (const component of target.missingParents) {
|
|
39
|
+
cursor = path.join(cursor, component);
|
|
40
|
+
try {
|
|
41
|
+
await fs.mkdir(cursor);
|
|
42
|
+
created.push(cursor);
|
|
43
|
+
}
|
|
44
|
+
catch (cause) {
|
|
45
|
+
if (!hasCode(cause, "EEXIST"))
|
|
46
|
+
throw cause;
|
|
47
|
+
}
|
|
48
|
+
signal.throwIfAborted();
|
|
49
|
+
}
|
|
50
|
+
phase = "stage bundle";
|
|
51
|
+
stage = await fs.mkdtemp(path.join(target.parent, ".daynight-install-"));
|
|
52
|
+
for (const entry of bundle) {
|
|
53
|
+
signal.throwIfAborted();
|
|
54
|
+
const destination = path.join(stage, ...entry.relativePath.split("/"));
|
|
55
|
+
if (entry.type === "directory")
|
|
56
|
+
await fs.mkdir(destination);
|
|
57
|
+
else
|
|
58
|
+
await fs.writeFile(destination, entry.contents, { flag: "wx" });
|
|
59
|
+
}
|
|
60
|
+
signal.throwIfAborted();
|
|
61
|
+
phase = "remove existing skill";
|
|
62
|
+
// Cancellation is observed after publishing, so removal cannot interrupt replacement.
|
|
63
|
+
await fs.rm(target.path, { recursive: true, force: true });
|
|
64
|
+
removed = true;
|
|
65
|
+
phase = "publish staged bundle";
|
|
66
|
+
await fs.rename(stage, target.path);
|
|
67
|
+
stage = undefined;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
catch (cause) {
|
|
71
|
+
failure = new Error(`Cannot ${phase} at ${target.path}.${removed ? " The previous skill was removed; the target may now be absent. Run daynight skill install again to restore it." : ""}`, { cause });
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
const cleanup = [];
|
|
75
|
+
if (stage !== undefined) {
|
|
76
|
+
try {
|
|
77
|
+
await fs.rm(stage, { recursive: true, force: true });
|
|
78
|
+
}
|
|
79
|
+
catch (cause) {
|
|
80
|
+
cleanup.push(new Error(`Cannot remove skill installation stage ${stage}.`, { cause }));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (failure !== undefined)
|
|
84
|
+
for (const directory of created.toReversed()) {
|
|
85
|
+
try {
|
|
86
|
+
await fs.rmdir(directory);
|
|
87
|
+
}
|
|
88
|
+
catch (cause) {
|
|
89
|
+
if (!hasCode(cause, "ENOTEMPTY") && !hasCode(cause, "EEXIST") && !hasCode(cause, "ENOENT"))
|
|
90
|
+
cleanup.push(new Error(`Cannot remove newly created skill parent ${directory}.`, { cause }));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (cleanup.length !== 0)
|
|
94
|
+
throw new AggregateError(cleanup, "Skill installation cleanup failed.", { cause: failure });
|
|
95
|
+
}
|
|
96
|
+
throw failure;
|
|
97
|
+
};
|
|
98
|
+
export const installSkillTargets = async (targets, bundle, signal, installed, fs = filesystem) => {
|
|
99
|
+
const completed = [];
|
|
100
|
+
for (const [index, target] of targets.entries()) {
|
|
101
|
+
try {
|
|
102
|
+
signal.throwIfAborted();
|
|
103
|
+
}
|
|
104
|
+
catch (cause) {
|
|
105
|
+
throw new SkillInstallationError(completed, undefined, targets.slice(index), "Skill installation cancelled before the next target.", { cause });
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
await replaceTarget(target, bundle, signal, fs);
|
|
109
|
+
}
|
|
110
|
+
catch (cause) {
|
|
111
|
+
throw new SkillInstallationError(completed, target, targets.slice(index + 1), "Skill installation stopped at the failed target; completed targets are preserved.", { cause });
|
|
112
|
+
}
|
|
113
|
+
completed.push(target);
|
|
114
|
+
installed(target);
|
|
115
|
+
}
|
|
116
|
+
signal.throwIfAborted();
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../../src/commands/skill/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAM7F,MAAM,UAAU,GAA2B,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CA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,CAAC;QAChM,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,SAAS,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,CAAC,cAAc,EAAE,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: daynight
|
|
3
|
+
description: Use Daynight to restore project context and actively query, organize, and maintain persistent tasks during development in a Daynight-linked repository, including work resumed in a new session or worktree.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Daynight
|
|
7
|
+
|
|
8
|
+
Keep the project's durable task record aligned with authorized work. Daynight
|
|
9
|
+
task data describes work; it does not grant permission to implement, publish,
|
|
10
|
+
deploy, communicate externally, merge, or push a mainline branch.
|
|
11
|
+
|
|
12
|
+
Read [the command reference](references/commands.md) before creating or updating
|
|
13
|
+
tasks, or when project discovery, a query, or a write fails.
|
|
14
|
+
|
|
15
|
+
## Restore context
|
|
16
|
+
|
|
17
|
+
At work start, context recovery, or a worktree switch, query from the current
|
|
18
|
+
repository through a noninteractive shell. To select the next work, use:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
daynight task ready --json
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This returns at most 10 ready tasks, earliest created first. Use `--limit <N>`
|
|
25
|
+
for 1–100 candidates. It reads one task page; the result is not the complete
|
|
26
|
+
backlog. An empty result does not mean there are no in-progress or blocked tasks.
|
|
27
|
+
|
|
28
|
+
Let the CLI resolve the current project. A new worktree without
|
|
29
|
+
`.daynight/project.yml` is normal: repository discovery can find the existing
|
|
30
|
+
project and save a local binding. Do not gate queries on that file's presence,
|
|
31
|
+
reuse remembered IDs as current facts, or edit bindings directly.
|
|
32
|
+
|
|
33
|
+
For work already being resumed, refresh its task with
|
|
34
|
+
`daynight task show <task-id> --json`. If its identity is unknown, query
|
|
35
|
+
`daynight task list --status in_progress --json` as needed. Show selected ready
|
|
36
|
+
tasks too before acting. Use `daynight task graph --json` when dependency or
|
|
37
|
+
project-wide context is needed; it has title previews, not full descriptions or
|
|
38
|
+
versions. If it reports `graph_limit_exceeded`, continue with bounded ready and
|
|
39
|
+
selected task reads; the error does not mean the project is unlinked. Full lists
|
|
40
|
+
traverse every page, so request them only when a complete inventory is needed.
|
|
41
|
+
|
|
42
|
+
If configuration, discovery, or a service request fails, preserve its actual
|
|
43
|
+
cause. Follow the CLI's setup guidance or obtain an explicit project selection
|
|
44
|
+
when needed; do not guess a server, choose among ambiguous projects, or create a
|
|
45
|
+
project merely to make task recovery succeed.
|
|
46
|
+
|
|
47
|
+
## Maintain useful tasks
|
|
48
|
+
|
|
49
|
+
Reuse an existing task whose scope matches the authorized work. Create durable
|
|
50
|
+
tasks for independently understandable outcomes that need cross-session
|
|
51
|
+
tracking, delivery verification, or handoff. Keep transient command steps in
|
|
52
|
+
the agent's own execution plan. Repository requirements and design documents
|
|
53
|
+
continue to own their full specifications.
|
|
54
|
+
|
|
55
|
+
Write an outcome-focused title and a coherent description containing scope,
|
|
56
|
+
acceptance, necessary decisions, current progress, blockers, and next action.
|
|
57
|
+
Rewrite that description as the work changes; do not accumulate a running log.
|
|
58
|
+
Express real prerequisites with dependencies.
|
|
59
|
+
|
|
60
|
+
Start authorized work by setting `in_progress`. The only states are `todo`,
|
|
61
|
+
`in_progress`, and `done`; readiness means a todo task's direct prerequisites are
|
|
62
|
+
done. Neither readiness nor `in_progress` is an exclusive claim, lock, lease, or
|
|
63
|
+
ownership guarantee. Coordinate concurrent work using observed task facts and
|
|
64
|
+
the project's existing communication rules.
|
|
65
|
+
|
|
66
|
+
Before changing any field, read the complete task and pass that exact observed
|
|
67
|
+
version as `--if-version`. Preserve the full int64 decimal value. A conflict
|
|
68
|
+
requires rereading and reconsidering the intended change, not replaying it with
|
|
69
|
+
a newer version. Descriptions and dependency sets are complete replacements;
|
|
70
|
+
the command reference explains clearing and omitted fields.
|
|
71
|
+
|
|
72
|
+
Only report a write as successful after service confirmation. When a result is
|
|
73
|
+
unconfirmed, reconcile it with service reads before taking another write action;
|
|
74
|
+
do not blindly resend a create or update.
|
|
75
|
+
|
|
76
|
+
## Verify delivery before completion
|
|
77
|
+
|
|
78
|
+
Development tasks, and design or documentation tasks delivered through PRs,
|
|
79
|
+
remain `in_progress` until the hosting platform confirms that **all necessary
|
|
80
|
+
delivery PRs are merged** and the task's acceptance criteria are satisfied.
|
|
81
|
+
Code completion, an open PR, approved review, or passing CI does not meet this
|
|
82
|
+
condition. Record PR URLs, outstanding checks, and waiting items while delivery
|
|
83
|
+
is pending.
|
|
84
|
+
|
|
85
|
+
Before setting `done`, query the platform's actual merge state for every required
|
|
86
|
+
PR and retain its PR URL and merge commit reference in the task description.
|
|
87
|
+
Then reread the task and update with its observed version. Missing merge
|
|
88
|
+
visibility, a missing permission, or an unmet merge check keeps the task
|
|
89
|
+
`in_progress`; the completion rule grants no merge authority. Tasks with no
|
|
90
|
+
development or PR delivery path use their stated acceptance criteria.
|
|
91
|
+
|
|
92
|
+
After confirmed completion, query `daynight task ready --json` to see which
|
|
93
|
+
dependent tasks became available. A ready successor still needs authorization within the
|
|
94
|
+
current scope before work starts. Refresh task facts at these semantic
|
|
95
|
+
checkpoints; do not reload the full project on every conversational turn.
|