lightspec 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/configurators/skills/base.js +1 -1
- package/dist/core/templates/agent-skill-templates.d.ts +1 -1
- package/dist/core/templates/agent-skill-templates.js +3 -0
- package/dist/core/templates/loop-template.d.ts +3 -0
- package/dist/core/templates/loop-template.js +62 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import os from 'os';
|
|
|
2
2
|
import { FileSystemUtils } from '../../../utils/file-system.js';
|
|
3
3
|
import { TemplateManager } from '../../templates/index.js';
|
|
4
4
|
import { LIGHTSPEC_MARKERS, normalizeToolId } from '../../config.js';
|
|
5
|
-
const ALL_SKILL_IDS = ['proposal', 'apply', 'archive', 'agentsmd-check'];
|
|
5
|
+
const ALL_SKILL_IDS = ['proposal', 'apply', 'archive', 'agentsmd-check', 'loop'];
|
|
6
6
|
const TOOL_SKILL_DESCRIPTORS = {
|
|
7
7
|
'amazon-q': {
|
|
8
8
|
projectSkillDir: '.amazonq/skills',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AgentSkillId = 'proposal' | 'apply' | 'archive' | 'agentsmd-check';
|
|
1
|
+
export type AgentSkillId = 'proposal' | 'apply' | 'archive' | 'agentsmd-check' | 'loop';
|
|
2
2
|
export declare const agentSkillBodies: Record<AgentSkillId, string>;
|
|
3
3
|
export declare const agentSkillFrontmatter: Record<AgentSkillId, string>;
|
|
4
4
|
export declare function getAgentSkillBody(id: AgentSkillId): string;
|
|
@@ -2,17 +2,20 @@ import { applyTemplate, applyFrontmatter } from './apply-template.js';
|
|
|
2
2
|
import { archiveTemplate, archiveFrontmatter } from './archive-template.js';
|
|
3
3
|
import { proposalTemplate, proposalFrontmatter } from './proposal-template.js';
|
|
4
4
|
import { agentsmdCheckTemplate, agentsmdCheckFrontmatter, } from './agentsmd-check-template.js';
|
|
5
|
+
import { loopTemplate, loopFrontmatter } from './loop-template.js';
|
|
5
6
|
export const agentSkillBodies = {
|
|
6
7
|
proposal: proposalTemplate,
|
|
7
8
|
apply: applyTemplate,
|
|
8
9
|
archive: archiveTemplate,
|
|
9
10
|
'agentsmd-check': agentsmdCheckTemplate,
|
|
11
|
+
loop: loopTemplate,
|
|
10
12
|
};
|
|
11
13
|
export const agentSkillFrontmatter = {
|
|
12
14
|
proposal: proposalFrontmatter,
|
|
13
15
|
apply: applyFrontmatter,
|
|
14
16
|
archive: archiveFrontmatter,
|
|
15
17
|
'agentsmd-check': agentsmdCheckFrontmatter,
|
|
18
|
+
loop: loopFrontmatter,
|
|
16
19
|
};
|
|
17
20
|
export function getAgentSkillBody(id) {
|
|
18
21
|
return agentSkillBodies[id];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const loopFrontmatter = "---\nname: lightspec-loop\ndescription: Use when systematically implementing LightSpec change proposals through clean, sequential delegation. For instance, when the user applies the plan using /lightspec:apply.\ndisable-model-invocation: false\nuser-invocable: true\nmetadata:\n source: lightspec\n workflow: loop\n---";
|
|
2
|
+
export declare const loopTemplate = "# LightSpec Loop: Subagent-Driven Implementation\n\nImplement LightSpec changes by dispatching a fresh subagent per change, with clean context isolation and sequential execution.\n\n**Core principle:** fresh subagent per change + sequential execution + clean context = isolated, predictable implementation.\n\n## When To Use\n- You have multiple active LightSpec changes to implement.\n- The changes are mostly independent.\n- You want strict context isolation between change implementations.\n\n## Process\n1. Run `lightspec list` to discover active changes.\n2. Present active change IDs to the user and confirm the execution order.\n3. For each change ID, execute the cycle below sequentially:\n - Dispatch a fresh general-purpose subagent.\n - First subagent action: clear context (for example, `/clear` if your assistant supports it).\n - Run `lightspec apply <change-id>`.\n - Implement all required code/docs/tests.\n - Run `lightspec archive <change-id> --yes` once implementation is complete.\n - Verify the archive succeeded before moving to the next change.\n4. After all requested changes are processed, provide a concise completion summary.\n\n## Subagent Instruction Template\n```\nYou are implementing one specific LightSpec change. Follow this workflow:\n1. First action: clear your context to avoid contamination from prior work.\n2. Run: lightspec apply <change-id>\n3. Implement all tasks in the change proposal.\n4. Archive the completed change: lightspec archive <change-id> --yes\n5. Report completion status and stop.\n```\n\n## Operational Constraints\n**Never**\n- Implement LightSpec changes in parallel.\n- Skip context reset between change implementations.\n- Move to the next change before confirming archive success for the current one.\n\n**Always**\n- Confirm the change ID exists before starting.\n- Ask the user how to proceed on failure (retry, skip, abort).\n- Keep a running status list: total, current, completed, remaining.\n\n## Error Handling\n- If a subagent fails implementation, report the failure and ask whether to retry with a fresh subagent, skip, or abort.\n- If `lightspec apply` or `lightspec archive` fails, stop and request user confirmation before continuing.\n\n## Integration\n- Uses `lightspec-apply` workflow semantics through `lightspec apply <change-id>`.\n- Uses `lightspec-archive` workflow semantics through `lightspec archive <change-id> --yes`.\n";
|
|
3
|
+
//# sourceMappingURL=loop-template.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const loopFrontmatter = `---
|
|
2
|
+
name: lightspec-loop
|
|
3
|
+
description: Use when systematically implementing LightSpec change proposals through clean, sequential delegation. For instance, when the user applies the plan using /lightspec:apply.
|
|
4
|
+
disable-model-invocation: false
|
|
5
|
+
user-invocable: true
|
|
6
|
+
metadata:
|
|
7
|
+
source: lightspec
|
|
8
|
+
workflow: loop
|
|
9
|
+
---`;
|
|
10
|
+
export const loopTemplate = `# LightSpec Loop: Subagent-Driven Implementation
|
|
11
|
+
|
|
12
|
+
Implement LightSpec changes by dispatching a fresh subagent per change, with clean context isolation and sequential execution.
|
|
13
|
+
|
|
14
|
+
**Core principle:** fresh subagent per change + sequential execution + clean context = isolated, predictable implementation.
|
|
15
|
+
|
|
16
|
+
## When To Use
|
|
17
|
+
- You have multiple active LightSpec changes to implement.
|
|
18
|
+
- The changes are mostly independent.
|
|
19
|
+
- You want strict context isolation between change implementations.
|
|
20
|
+
|
|
21
|
+
## Process
|
|
22
|
+
1. Run \`lightspec list\` to discover active changes.
|
|
23
|
+
2. Present active change IDs to the user and confirm the execution order.
|
|
24
|
+
3. For each change ID, execute the cycle below sequentially:
|
|
25
|
+
- Dispatch a fresh general-purpose subagent.
|
|
26
|
+
- First subagent action: clear context (for example, \`/clear\` if your assistant supports it).
|
|
27
|
+
- Run \`lightspec apply <change-id>\`.
|
|
28
|
+
- Implement all required code/docs/tests.
|
|
29
|
+
- Run \`lightspec archive <change-id> --yes\` once implementation is complete.
|
|
30
|
+
- Verify the archive succeeded before moving to the next change.
|
|
31
|
+
4. After all requested changes are processed, provide a concise completion summary.
|
|
32
|
+
|
|
33
|
+
## Subagent Instruction Template
|
|
34
|
+
\`\`\`
|
|
35
|
+
You are implementing one specific LightSpec change. Follow this workflow:
|
|
36
|
+
1. First action: clear your context to avoid contamination from prior work.
|
|
37
|
+
2. Run: lightspec apply <change-id>
|
|
38
|
+
3. Implement all tasks in the change proposal.
|
|
39
|
+
4. Archive the completed change: lightspec archive <change-id> --yes
|
|
40
|
+
5. Report completion status and stop.
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
## Operational Constraints
|
|
44
|
+
**Never**
|
|
45
|
+
- Implement LightSpec changes in parallel.
|
|
46
|
+
- Skip context reset between change implementations.
|
|
47
|
+
- Move to the next change before confirming archive success for the current one.
|
|
48
|
+
|
|
49
|
+
**Always**
|
|
50
|
+
- Confirm the change ID exists before starting.
|
|
51
|
+
- Ask the user how to proceed on failure (retry, skip, abort).
|
|
52
|
+
- Keep a running status list: total, current, completed, remaining.
|
|
53
|
+
|
|
54
|
+
## Error Handling
|
|
55
|
+
- If a subagent fails implementation, report the failure and ask whether to retry with a fresh subagent, skip, or abort.
|
|
56
|
+
- If \`lightspec apply\` or \`lightspec archive\` fails, stop and request user confirmation before continuing.
|
|
57
|
+
|
|
58
|
+
## Integration
|
|
59
|
+
- Uses \`lightspec-apply\` workflow semantics through \`lightspec apply <change-id>\`.
|
|
60
|
+
- Uses \`lightspec-archive\` workflow semantics through \`lightspec archive <change-id> --yes\`.
|
|
61
|
+
`;
|
|
62
|
+
//# sourceMappingURL=loop-template.js.map
|