@rasensio/aidlc 1.97.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -9
- package/dist/autopilot/cap.d.ts +39 -0
- package/dist/autopilot/cap.d.ts.map +1 -0
- package/dist/autopilot/cap.js +55 -0
- package/dist/autopilot/cap.js.map +1 -0
- package/dist/autopilot/driver.d.ts.map +1 -1
- package/dist/autopilot/driver.js +79 -15
- package/dist/autopilot/driver.js.map +1 -1
- package/dist/autopilot/presets.d.ts +12 -6
- package/dist/autopilot/presets.d.ts.map +1 -1
- package/dist/autopilot/presets.js +9 -3
- package/dist/autopilot/presets.js.map +1 -1
- package/dist/autopilot/questions.d.ts +1 -1
- package/dist/autopilot/questions.d.ts.map +1 -1
- package/dist/autopilot/questions.js +22 -8
- package/dist/autopilot/questions.js.map +1 -1
- package/dist/autopilot/result.d.ts +2 -0
- package/dist/autopilot/result.d.ts.map +1 -1
- package/dist/autopilot/result.js +40 -1
- package/dist/autopilot/result.js.map +1 -1
- package/dist/autopilot/state.d.ts +8 -0
- package/dist/autopilot/state.d.ts.map +1 -1
- package/dist/autopilot/state.js.map +1 -1
- package/dist/autopilot/team.d.ts +2 -0
- package/dist/autopilot/team.d.ts.map +1 -1
- package/dist/autopilot/team.js +13 -2
- package/dist/autopilot/team.js.map +1 -1
- package/dist/autopilot/watch-view.d.ts +21 -0
- package/dist/autopilot/watch-view.d.ts.map +1 -1
- package/dist/autopilot/watch-view.js +63 -24
- package/dist/autopilot/watch-view.js.map +1 -1
- package/dist/commands/add-skill.d.ts.map +1 -1
- package/dist/commands/add-skill.js +9 -1
- package/dist/commands/add-skill.js.map +1 -1
- package/dist/commands/autopilot.d.ts +3 -0
- package/dist/commands/autopilot.d.ts.map +1 -1
- package/dist/commands/autopilot.js +42 -8
- package/dist/commands/autopilot.js.map +1 -1
- package/dist/commands/cost.d.ts +11 -0
- package/dist/commands/cost.d.ts.map +1 -1
- package/dist/commands/cost.js +38 -8
- package/dist/commands/cost.js.map +1 -1
- package/dist/commands/docs.js +1 -1
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/init.d.ts +3 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +115 -66
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/metrics.d.ts.map +1 -1
- package/dist/commands/metrics.js +9 -2
- package/dist/commands/metrics.js.map +1 -1
- package/dist/commands/roadmap.d.ts.map +1 -1
- package/dist/commands/roadmap.js +10 -0
- package/dist/commands/roadmap.js.map +1 -1
- package/dist/commands/status.d.ts +1 -3
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +19 -5
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +16 -8
- package/dist/commands/update.js.map +1 -1
- package/dist/compile/adapters/codex.d.ts +2 -3
- package/dist/compile/adapters/codex.d.ts.map +1 -1
- package/dist/compile/adapters/codex.js +4 -5
- package/dist/compile/adapters/codex.js.map +1 -1
- package/dist/compile/adapters/index.d.ts +27 -1
- package/dist/compile/adapters/index.d.ts.map +1 -1
- package/dist/compile/adapters/index.js +47 -9
- package/dist/compile/adapters/index.js.map +1 -1
- package/dist/compile/loaders.d.ts.map +1 -1
- package/dist/compile/loaders.js +7 -9
- package/dist/compile/loaders.js.map +1 -1
- package/dist/compile/naming.d.ts +12 -50
- package/dist/compile/naming.d.ts.map +1 -1
- package/dist/compile/naming.js +12 -54
- package/dist/compile/naming.js.map +1 -1
- package/dist/compile/skill-format.d.ts +8 -12
- package/dist/compile/skill-format.d.ts.map +1 -1
- package/dist/compile/skill-format.js +10 -17
- package/dist/compile/skill-format.js.map +1 -1
- package/dist/console/index.js +0 -6
- package/dist/console/index.js.map +1 -1
- package/dist/console/operator/app.d.ts.map +1 -1
- package/dist/console/operator/app.js +3 -2
- package/dist/console/operator/app.js.map +1 -1
- package/dist/console/operator/attended.d.ts +18 -0
- package/dist/console/operator/attended.d.ts.map +1 -0
- package/dist/console/operator/attended.js +79 -0
- package/dist/console/operator/attended.js.map +1 -0
- package/dist/console/operator/effects.d.ts +2 -2
- package/dist/console/operator/effects.d.ts.map +1 -1
- package/dist/console/operator/effects.js +18 -22
- package/dist/console/operator/effects.js.map +1 -1
- package/dist/console/operator/keymap.d.ts.map +1 -1
- package/dist/console/operator/keymap.js +13 -13
- package/dist/console/operator/keymap.js.map +1 -1
- package/dist/console/operator/keys.d.ts.map +1 -1
- package/dist/console/operator/keys.js +21 -12
- package/dist/console/operator/keys.js.map +1 -1
- package/dist/console/operator/layout.d.ts +12 -7
- package/dist/console/operator/layout.d.ts.map +1 -1
- package/dist/console/operator/layout.js +35 -30
- package/dist/console/operator/layout.js.map +1 -1
- package/dist/console/operator/model.d.ts +22 -5
- package/dist/console/operator/model.d.ts.map +1 -1
- package/dist/console/operator/model.js +1 -1
- package/dist/console/operator/model.js.map +1 -1
- package/dist/console/operator/palette.d.ts.map +1 -1
- package/dist/console/operator/palette.js +1 -2
- package/dist/console/operator/palette.js.map +1 -1
- package/dist/console/operator/panels.d.ts +23 -5
- package/dist/console/operator/panels.d.ts.map +1 -1
- package/dist/console/operator/panels.js +53 -70
- package/dist/console/operator/panels.js.map +1 -1
- package/dist/console/operator/read.d.ts +10 -1
- package/dist/console/operator/read.d.ts.map +1 -1
- package/dist/console/operator/read.js +61 -5
- package/dist/console/operator/read.js.map +1 -1
- package/dist/core/host.d.ts +39 -0
- package/dist/core/host.d.ts.map +1 -0
- package/dist/core/host.js +99 -0
- package/dist/core/host.js.map +1 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/cost/report.d.ts +14 -0
- package/dist/cost/report.d.ts.map +1 -1
- package/dist/cost/report.js +17 -2
- package/dist/cost/report.js.map +1 -1
- package/dist/doctor/migrations/artifact-source-drift.d.ts.map +1 -1
- package/dist/doctor/migrations/artifact-source-drift.js +8 -7
- package/dist/doctor/migrations/artifact-source-drift.js.map +1 -1
- package/dist/doctor/migrations/roadmap-sync-gh-missing.d.ts.map +1 -1
- package/dist/doctor/migrations/roadmap-sync-gh-missing.js +7 -0
- package/dist/doctor/migrations/roadmap-sync-gh-missing.js.map +1 -1
- package/dist/events/event-bus.d.ts.map +1 -1
- package/dist/events/event-bus.js +18 -1
- package/dist/events/event-bus.js.map +1 -1
- package/dist/metrics/report.d.ts +5 -0
- package/dist/metrics/report.d.ts.map +1 -1
- package/dist/metrics/report.js +12 -0
- package/dist/metrics/report.js.map +1 -1
- package/dist/operational/packagers.d.ts +6 -10
- package/dist/operational/packagers.d.ts.map +1 -1
- package/dist/operational/packagers.js +6 -125
- package/dist/operational/packagers.js.map +1 -1
- package/dist/roadmap/sync/config.js +4 -4
- package/dist/roadmap/sync/config.js.map +1 -1
- package/dist/setup/host.d.ts +51 -0
- package/dist/setup/host.d.ts.map +1 -0
- package/dist/setup/host.js +67 -0
- package/dist/setup/host.js.map +1 -0
- package/dist/setup/setup-compute.d.ts +6 -0
- package/dist/setup/setup-compute.d.ts.map +1 -1
- package/dist/setup/setup-compute.js +10 -4
- package/dist/setup/setup-compute.js.map +1 -1
- package/package.json +2 -2
- package/dist/compile/adapters/copilot.d.ts +0 -64
- package/dist/compile/adapters/copilot.d.ts.map +0 -1
- package/dist/compile/adapters/copilot.js +0 -272
- package/dist/compile/adapters/copilot.js.map +0 -1
- package/dist/compile/adapters/cursor.d.ts +0 -21
- package/dist/compile/adapters/cursor.d.ts.map +0 -1
- package/dist/compile/adapters/cursor.js +0 -171
- package/dist/compile/adapters/cursor.js.map +0 -1
- package/dist/compile/adapters/kiro.d.ts +0 -24
- package/dist/compile/adapters/kiro.d.ts.map +0 -1
- package/dist/compile/adapters/kiro.js +0 -206
- package/dist/compile/adapters/kiro.js.map +0 -1
- package/dist/compile/adapters/windsurf.d.ts +0 -25
- package/dist/compile/adapters/windsurf.d.ts.map +0 -1
- package/dist/compile/adapters/windsurf.js +0 -246
- package/dist/compile/adapters/windsurf.js.map +0 -1
- package/dist/compile/limits.d.ts +0 -30
- package/dist/compile/limits.d.ts.map +0 -1
- package/dist/compile/limits.js +0 -30
- package/dist/compile/limits.js.map +0 -1
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Copilot platform adapter.
|
|
3
|
-
*
|
|
4
|
-
* Generates:
|
|
5
|
-
* - Canonical skill bodies copied to `.aidlc/skills/`
|
|
6
|
-
* - One Copilot agent skill per lifecycle skill at
|
|
7
|
-
* `.github/skills/<dir>/SKILL.md`, carrying the FULL canonical body
|
|
8
|
-
* - An `aidlc` merge-block in `.github/copilot-instructions.md`
|
|
9
|
-
*
|
|
10
|
-
* Two path choices deserve their reasons recorded, because both had a cheaper
|
|
11
|
-
* wrong answer:
|
|
12
|
-
*
|
|
13
|
-
* **`.github/skills/`, not `.claude/skills/` or `.agents/skills/`.** Copilot
|
|
14
|
-
* searches all three, so reusing an existing platform's directory would have made
|
|
15
|
-
* this adapter a no-op alias. That is wrong twice over: `.claude/skills/` receives
|
|
16
|
-
* *shims* (`claude-code.ts` emits a pointer sentence, not a body), which is the
|
|
17
|
-
* second-class packaging `agent-portability` removed for Codex; and
|
|
18
|
-
* `.agents/skills/` is Codex's own path, paired with an `AGENTS.md` instruction
|
|
19
|
-
* surface that fewer Copilot clients read. `.github/skills/` is Copilot's
|
|
20
|
-
* first-party location, so this adapter owns its output outright and depends on no
|
|
21
|
-
* other vendor's directory.
|
|
22
|
-
*
|
|
23
|
-
* **`.github/copilot-instructions.md`, not `AGENTS.md`.** Per GitHub's own
|
|
24
|
-
* support matrix, `copilot-instructions.md` is the only customization type read by
|
|
25
|
-
* every Copilot client — web chat, cloud agent, code review, VS Code, Visual
|
|
26
|
-
* Studio, JetBrains, Xcode, Eclipse and the CLI. `AGENTS.md` is narrower (VS Code
|
|
27
|
-
* chat and code review accept it, Visual Studio chat accepts neither it nor
|
|
28
|
-
* `CLAUDE.md`). This adapter deliberately writes no other vendor's entry file.
|
|
29
|
-
*
|
|
30
|
-
* The emitted body is the canonical body itself, never a pointer to it: a pointer
|
|
31
|
-
* forces the agent to open a second file before it can act, which is precisely
|
|
32
|
-
* what made Codex second-class before `agent-portability`.
|
|
33
|
-
*
|
|
34
|
-
* Requirements: copilot-platform-support/AC-6, AC-7, AC-8, AC-9, AC-10, AC-13,
|
|
35
|
-
* AC-14, AC-15, AC-16, AC-17, AC-18, AC-19, AC-21, AC-35, AC-36
|
|
36
|
-
*
|
|
37
|
-
* @module
|
|
38
|
-
*/
|
|
39
|
-
import { BARE_ENTRY_POINT, MAX_SKILL_NAME_LENGTH, SKILL_NAME_RE, canonicalSkillFilename, normalizeSkillName, } from '../naming.js';
|
|
40
|
-
import { COPILOT_MAX_DESCRIPTION_CHARS } from '../limits.js';
|
|
41
|
-
import { formatCanonicalSkill } from '../skill-format.js';
|
|
42
|
-
import { resolveActivation, validateCapabilityMap } from '../capability-resolve.js';
|
|
43
|
-
// ---------------------------------------------------------------------------
|
|
44
|
-
// Constants
|
|
45
|
-
// ---------------------------------------------------------------------------
|
|
46
|
-
/** Copilot's first-party project skill directory. */
|
|
47
|
-
export const COPILOT_SKILLS_DIR = '.github/skills';
|
|
48
|
-
/** The instruction file every Copilot client reads. */
|
|
49
|
-
export const COPILOT_INSTRUCTIONS_PATH = '.github/copilot-instructions.md';
|
|
50
|
-
/** Merge-block id inside the instruction file. */
|
|
51
|
-
export const COPILOT_BLOCK_ID = 'aidlc';
|
|
52
|
-
/**
|
|
53
|
-
* Hint shown in the chat input when the entry point is invoked as `/aidlc`.
|
|
54
|
-
*
|
|
55
|
-
* The entry-point skill accepts free text ("continue my-feature", "check
|
|
56
|
-
* status"), and without a hint a Copilot user has no way to discover that.
|
|
57
|
-
*/
|
|
58
|
-
const ENTRY_POINT_ARGUMENT_HINT = '[what you want to do — e.g. "continue my-feature", "start something new", "status"]';
|
|
59
|
-
// ---------------------------------------------------------------------------
|
|
60
|
-
// Helpers
|
|
61
|
-
// ---------------------------------------------------------------------------
|
|
62
|
-
/**
|
|
63
|
-
* Directory name for a Copilot skill: `aidlc-<name>`, or bare `aidlc` for the
|
|
64
|
-
* entry point.
|
|
65
|
-
*
|
|
66
|
-
* Uses the shared helper, whose charset substitution and 64-character truncation
|
|
67
|
-
* happen to be exactly Copilot's documented name constraints.
|
|
68
|
-
*/
|
|
69
|
-
export function skillDirName(skill) {
|
|
70
|
-
return normalizeSkillName(skill.meta.name, { prefix: true });
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* A Copilot agent skill file.
|
|
74
|
-
*
|
|
75
|
-
* `name` must equal the directory name and `description` is what Copilot matches
|
|
76
|
-
* a request against — so the trigger words have to live in it. A skill whose name
|
|
77
|
-
* is invalid, or whose name and directory disagree, fails to load with no error
|
|
78
|
-
* message at all, which is why `validate` checks both.
|
|
79
|
-
*/
|
|
80
|
-
export function formatCopilotSkill(skill, dirName, activation) {
|
|
81
|
-
const lines = ['---'];
|
|
82
|
-
lines.push(`name: ${dirName}`);
|
|
83
|
-
lines.push(`description: ${skill.meta.description}`);
|
|
84
|
-
if (dirName === BARE_ENTRY_POINT) {
|
|
85
|
-
lines.push(`argument-hint: ${ENTRY_POINT_ARGUMENT_HINT}`);
|
|
86
|
-
}
|
|
87
|
-
lines.push('---');
|
|
88
|
-
lines.push('');
|
|
89
|
-
if (activation) {
|
|
90
|
-
lines.push(activation);
|
|
91
|
-
lines.push('');
|
|
92
|
-
}
|
|
93
|
-
lines.push(skill.body);
|
|
94
|
-
return lines.join('\n');
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Build the `.github/copilot-instructions.md` managed block.
|
|
98
|
-
*
|
|
99
|
-
* Context docs and guidance layers are listed as PATHS ONLY. Inlining a guidance
|
|
100
|
-
* body here would duplicate the single source every other platform points at, and
|
|
101
|
-
* a duplicated layer drifts from the file it was copied out of.
|
|
102
|
-
*/
|
|
103
|
-
function buildInstructionsBlock(skills, phaseMap, ctx) {
|
|
104
|
-
const lines = [];
|
|
105
|
-
lines.push('# AIDLC Framework');
|
|
106
|
-
lines.push('');
|
|
107
|
-
lines.push('This project uses the AI Development Lifecycle (AIDLC) framework. ' +
|
|
108
|
-
'Follow the lifecycle phases and state protocol below.');
|
|
109
|
-
lines.push('');
|
|
110
|
-
lines.push('## State Protocol');
|
|
111
|
-
lines.push('');
|
|
112
|
-
lines.push('- Lifecycle state: `.aidlc/state/<instance>/instance.yaml`');
|
|
113
|
-
lines.push('- Phase state: `.aidlc/state/<instance>/phase-<name>.yaml`');
|
|
114
|
-
lines.push('- Transition log: `.aidlc/state/<instance>/transitions.log` (NDJSON)');
|
|
115
|
-
lines.push('- Before mutating state, claim the instance');
|
|
116
|
-
lines.push('- Read the overview skill for the full protocol: `.aidlc/skills/aidlc-overview.md`');
|
|
117
|
-
lines.push('- Use `aidlc status` to see current progress across all instances');
|
|
118
|
-
lines.push('');
|
|
119
|
-
lines.push('## Phase Skills');
|
|
120
|
-
lines.push('');
|
|
121
|
-
lines.push(`Installed as Copilot agent skills under \`${COPILOT_SKILLS_DIR}/\`. ` +
|
|
122
|
-
'Copilot selects one automatically by matching your request against its description, ' +
|
|
123
|
-
'or you can invoke one directly as a slash command — type `/` to list them. ' +
|
|
124
|
-
'The entry point is `/aidlc`.');
|
|
125
|
-
lines.push('');
|
|
126
|
-
for (const skill of skills) {
|
|
127
|
-
const dirName = skillDirName(skill);
|
|
128
|
-
const activation = resolveActivation(skill, 'copilot', phaseMap);
|
|
129
|
-
let entry = `- **${skill.meta.phase}**: \`/${dirName}\``;
|
|
130
|
-
if (activation) {
|
|
131
|
-
entry += ` — ${activation}`;
|
|
132
|
-
}
|
|
133
|
-
lines.push(entry);
|
|
134
|
-
}
|
|
135
|
-
lines.push('');
|
|
136
|
-
const contextNames = Object.keys(ctx.contextDocs);
|
|
137
|
-
if (contextNames.length > 0) {
|
|
138
|
-
lines.push('## Context Documents');
|
|
139
|
-
lines.push('');
|
|
140
|
-
for (const name of contextNames.sort()) {
|
|
141
|
-
lines.push(`- \`.aidlc/context/${ctx.contextDocs[name]}\` — ${name}`);
|
|
142
|
-
}
|
|
143
|
-
lines.push('');
|
|
144
|
-
}
|
|
145
|
-
const layerNames = Object.keys(ctx.guidanceLayers);
|
|
146
|
-
if (layerNames.length > 0) {
|
|
147
|
-
lines.push('## Guidance Layers');
|
|
148
|
-
lines.push('');
|
|
149
|
-
for (const name of layerNames.sort()) {
|
|
150
|
-
lines.push(`- \`.aidlc/guidance/${ctx.guidanceLayers[name]}\` — ${name}`);
|
|
151
|
-
}
|
|
152
|
-
lines.push('');
|
|
153
|
-
}
|
|
154
|
-
// Knowledge graph context (KG Req 6.4) — omitted when the project has no graph
|
|
155
|
-
if (ctx.knowledgeSection) {
|
|
156
|
-
lines.push(ctx.knowledgeSection);
|
|
157
|
-
lines.push('');
|
|
158
|
-
}
|
|
159
|
-
return lines.join('\n');
|
|
160
|
-
}
|
|
161
|
-
/** Read the `name:` value out of a SKILL.md frontmatter block, if present. */
|
|
162
|
-
function frontmatterName(content) {
|
|
163
|
-
if (!content.startsWith('---\n'))
|
|
164
|
-
return null;
|
|
165
|
-
const endIdx = content.indexOf('\n---\n', 4);
|
|
166
|
-
if (endIdx === -1)
|
|
167
|
-
return null;
|
|
168
|
-
const match = content.slice(4, endIdx).match(/^name:\s*(.+)$/m);
|
|
169
|
-
return match ? match[1].trim() : null;
|
|
170
|
-
}
|
|
171
|
-
/** Read the `description:` value out of a SKILL.md frontmatter block, if present. */
|
|
172
|
-
function frontmatterDescription(content) {
|
|
173
|
-
if (!content.startsWith('---\n'))
|
|
174
|
-
return null;
|
|
175
|
-
const endIdx = content.indexOf('\n---\n', 4);
|
|
176
|
-
if (endIdx === -1)
|
|
177
|
-
return null;
|
|
178
|
-
const match = content.slice(4, endIdx).match(/^description:\s*(.+)$/m);
|
|
179
|
-
return match ? match[1].trim() : null;
|
|
180
|
-
}
|
|
181
|
-
// ---------------------------------------------------------------------------
|
|
182
|
-
// Adapter Implementation
|
|
183
|
-
// ---------------------------------------------------------------------------
|
|
184
|
-
export const copilotAdapter = {
|
|
185
|
-
id: 'copilot',
|
|
186
|
-
plan(skills, caps, ctx) {
|
|
187
|
-
const ops = [];
|
|
188
|
-
const warnings = [];
|
|
189
|
-
let phaseMap = null;
|
|
190
|
-
if (caps) {
|
|
191
|
-
phaseMap = validateCapabilityMap(caps, warnings);
|
|
192
|
-
}
|
|
193
|
-
// 1. Canonical bodies, as every adapter emits them.
|
|
194
|
-
for (const skill of skills) {
|
|
195
|
-
ops.push({
|
|
196
|
-
kind: 'create',
|
|
197
|
-
path: `.aidlc/skills/${canonicalSkillFilename(skill.meta.name)}`,
|
|
198
|
-
content: formatCanonicalSkill(skill),
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
// 2. One Copilot agent skill per lifecycle skill, carrying the full body.
|
|
202
|
-
for (const skill of skills) {
|
|
203
|
-
const dirName = skillDirName(skill);
|
|
204
|
-
const activation = resolveActivation(skill, 'copilot', phaseMap);
|
|
205
|
-
ops.push({
|
|
206
|
-
kind: 'create',
|
|
207
|
-
path: `${COPILOT_SKILLS_DIR}/${dirName}/SKILL.md`,
|
|
208
|
-
content: formatCopilotSkill(skill, dirName, activation),
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
// 3. The always-on instruction surface.
|
|
212
|
-
ops.push({
|
|
213
|
-
kind: 'merge-block',
|
|
214
|
-
path: COPILOT_INSTRUCTIONS_PATH,
|
|
215
|
-
blockId: COPILOT_BLOCK_ID,
|
|
216
|
-
content: buildInstructionsBlock(skills, phaseMap, ctx),
|
|
217
|
-
});
|
|
218
|
-
return { ops, warnings };
|
|
219
|
-
},
|
|
220
|
-
validate(op) {
|
|
221
|
-
const errors = [];
|
|
222
|
-
const warnings = [];
|
|
223
|
-
// Bounds before existence, and before anything reads the content: a path is
|
|
224
|
-
// rejected on its shape, not on what it happens to resolve to.
|
|
225
|
-
if (op.path.split('/').includes('..')) {
|
|
226
|
-
errors.push(`path '${op.path}' must not contain a '..' segment`);
|
|
227
|
-
return { valid: false, errors, warnings };
|
|
228
|
-
}
|
|
229
|
-
if (op.kind === 'merge-block') {
|
|
230
|
-
// Plain markdown between managed delimiters — structurally always valid.
|
|
231
|
-
return { valid: true, errors: [], warnings: [] };
|
|
232
|
-
}
|
|
233
|
-
if (op.path.startsWith(`${COPILOT_SKILLS_DIR}/`) && op.path.endsWith('/SKILL.md')) {
|
|
234
|
-
// `.github/skills/<dirName>/SKILL.md`
|
|
235
|
-
const segments = op.path.split('/');
|
|
236
|
-
const dirName = segments[2];
|
|
237
|
-
if (!dirName || !SKILL_NAME_RE.test(dirName)) {
|
|
238
|
-
errors.push(`skill directory name '${dirName}' must be lowercase letters, numbers and hyphens, starting with a letter`);
|
|
239
|
-
}
|
|
240
|
-
if (dirName && dirName.length > MAX_SKILL_NAME_LENGTH) {
|
|
241
|
-
errors.push(`skill directory name '${dirName}' exceeds ${MAX_SKILL_NAME_LENGTH} character limit`);
|
|
242
|
-
}
|
|
243
|
-
const content = op.content;
|
|
244
|
-
if (!content.startsWith('---\n')) {
|
|
245
|
-
errors.push('SKILL.md must begin with YAML frontmatter (---)');
|
|
246
|
-
return { valid: false, errors, warnings };
|
|
247
|
-
}
|
|
248
|
-
if (content.indexOf('\n---\n', 4) === -1) {
|
|
249
|
-
errors.push('SKILL.md has unclosed frontmatter');
|
|
250
|
-
return { valid: false, errors, warnings };
|
|
251
|
-
}
|
|
252
|
-
const name = frontmatterName(content);
|
|
253
|
-
if (name === null) {
|
|
254
|
-
errors.push("SKILL.md frontmatter missing required field 'name'");
|
|
255
|
-
}
|
|
256
|
-
else if (name !== dirName) {
|
|
257
|
-
// Copilot drops a skill whose name and directory disagree, silently.
|
|
258
|
-
errors.push(`SKILL.md frontmatter 'name' (${name}) must match directory name (${dirName})`);
|
|
259
|
-
}
|
|
260
|
-
const description = frontmatterDescription(content);
|
|
261
|
-
if (description === null) {
|
|
262
|
-
errors.push("SKILL.md frontmatter missing required field 'description'");
|
|
263
|
-
}
|
|
264
|
-
else if (description.length > COPILOT_MAX_DESCRIPTION_CHARS) {
|
|
265
|
-
errors.push(`SKILL.md frontmatter 'description' is ${description.length} characters, ` +
|
|
266
|
-
`exceeding Copilot's ${COPILOT_MAX_DESCRIPTION_CHARS}-character limit`);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
return { valid: errors.length === 0, errors, warnings };
|
|
270
|
-
},
|
|
271
|
-
};
|
|
272
|
-
//# sourceMappingURL=copilot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/compile/adapters/copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAaH,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEpF,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,qDAAqD;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD,uDAAuD;AACvD,MAAM,CAAC,MAAM,yBAAyB,GAAG,iCAAiC,CAAC;AAE3E,kDAAkD;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAExC;;;;;GAKG;AACH,MAAM,yBAAyB,GAC7B,qFAAqF,CAAC;AAExF,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAY;IACvC,OAAO,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,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E,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;YAC5C,CAAC;YAED,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;YACtC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAClB,MAAM,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YACpE,CAAC;iBAAM,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBAC5B,qEAAqE;gBACrE,MAAM,CAAC,IAAI,CACT,gCAAgC,IAAI,gCAAgC,OAAO,GAAG,CAC/E,CAAC;YACJ,CAAC;YAED,MAAM,WAAW,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;YACpD,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;gBACzB,MAAM,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;YAC3E,CAAC;iBAAM,IAAI,WAAW,CAAC,MAAM,GAAG,6BAA6B,EAAE,CAAC;gBAC9D,MAAM,CAAC,IAAI,CACT,yCAAyC,WAAW,CAAC,MAAM,eAAe;oBACxE,uBAAuB,6BAA6B,kBAAkB,CACzE,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC1D,CAAC;CACF,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor platform adapter.
|
|
3
|
-
*
|
|
4
|
-
* Generates:
|
|
5
|
-
* - Canonical skill bodies copied to `.aidlc/skills/`
|
|
6
|
-
* - `.cursor/rules/aidlc-<name>.mdc` per skill (Modern .mdc format)
|
|
7
|
-
* with frontmatter: `description`, `globs` (empty for phase skills),
|
|
8
|
-
* `alwaysApply` (true for overview, false for others)
|
|
9
|
-
* - `.cursor/rules/aidlc-overview.mdc` with `alwaysApply: true`
|
|
10
|
-
* - Legacy `.cursorrules` touched ONLY via `merge-block` when file already exists
|
|
11
|
-
*
|
|
12
|
-
* Requirements: 1.1, 1.6
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
*/
|
|
16
|
-
import type { PlatformAdapter } from '../../core/types.js';
|
|
17
|
-
/**
|
|
18
|
-
* Cursor platform adapter implementation.
|
|
19
|
-
*/
|
|
20
|
-
export declare const cursorAdapter: PlatformAdapter;
|
|
21
|
-
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/compile/adapters/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EACV,eAAe,EAOhB,MAAM,qBAAqB,CAAC;AA+G7B;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,eAsE3B,CAAC"}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor platform adapter.
|
|
3
|
-
*
|
|
4
|
-
* Generates:
|
|
5
|
-
* - Canonical skill bodies copied to `.aidlc/skills/`
|
|
6
|
-
* - `.cursor/rules/aidlc-<name>.mdc` per skill (Modern .mdc format)
|
|
7
|
-
* with frontmatter: `description`, `globs` (empty for phase skills),
|
|
8
|
-
* `alwaysApply` (true for overview, false for others)
|
|
9
|
-
* - `.cursor/rules/aidlc-overview.mdc` with `alwaysApply: true`
|
|
10
|
-
* - Legacy `.cursorrules` touched ONLY via `merge-block` when file already exists
|
|
11
|
-
*
|
|
12
|
-
* Requirements: 1.1, 1.6
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
*/
|
|
16
|
-
import { existsSync } from 'node:fs';
|
|
17
|
-
import { join } from 'node:path';
|
|
18
|
-
import { formatCanonicalSkill } from '../skill-format.js';
|
|
19
|
-
import { canonicalSkillFilename, prefixedRuleFilename } from '../naming.js';
|
|
20
|
-
/**
|
|
21
|
-
* Derive a filesystem-safe filename from a skill name.
|
|
22
|
-
* Pass-through by convention — shared so it cannot drift (AC-34).
|
|
23
|
-
*/
|
|
24
|
-
function skillFileName(skill) {
|
|
25
|
-
return canonicalSkillFilename(skill.meta.name);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Find the activation directive for a skill's phase from the capability map.
|
|
29
|
-
*/
|
|
30
|
-
function getCapabilityDirective(skill, caps) {
|
|
31
|
-
if (!caps)
|
|
32
|
-
return null;
|
|
33
|
-
// Check skill-level native_mode_hint first
|
|
34
|
-
const hint = skill.meta.native_mode_hint?.cursor;
|
|
35
|
-
if (hint) {
|
|
36
|
-
const entry = caps.capabilities[hint];
|
|
37
|
-
if (entry)
|
|
38
|
-
return entry.activation;
|
|
39
|
-
}
|
|
40
|
-
// Look for any capability covering this skill's phase
|
|
41
|
-
for (const entry of Object.values(caps.capabilities)) {
|
|
42
|
-
if (entry.phases.includes(skill.meta.phase)) {
|
|
43
|
-
return entry.activation;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Generate the content of a .cursor/rules/aidlc-<name>.mdc file.
|
|
50
|
-
*
|
|
51
|
-
* Cursor .mdc format uses a YAML-like frontmatter with fields:
|
|
52
|
-
* - description: controls agent-requested activation
|
|
53
|
-
* - globs: file patterns (empty for phase skills)
|
|
54
|
-
* - alwaysApply: true for overview, false for phase skills
|
|
55
|
-
*
|
|
56
|
-
* Body contains activation text + pointer to canonical skill body.
|
|
57
|
-
*/
|
|
58
|
-
function buildMdcContent(skill, caps, isOverview) {
|
|
59
|
-
const lines = [];
|
|
60
|
-
// Frontmatter
|
|
61
|
-
lines.push('---');
|
|
62
|
-
lines.push(`description: ${skill.meta.description}`);
|
|
63
|
-
lines.push('globs:');
|
|
64
|
-
lines.push(`alwaysApply: ${isOverview ? 'true' : 'false'}`);
|
|
65
|
-
lines.push('---');
|
|
66
|
-
lines.push('');
|
|
67
|
-
// Body: activation + pointer
|
|
68
|
-
const directive = getCapabilityDirective(skill, caps);
|
|
69
|
-
if (directive) {
|
|
70
|
-
lines.push(directive);
|
|
71
|
-
lines.push('');
|
|
72
|
-
}
|
|
73
|
-
const filename = skillFileName(skill);
|
|
74
|
-
lines.push(`Read and follow the full skill instructions at \`.aidlc/skills/${filename}\`.`);
|
|
75
|
-
return lines.join('\n');
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Build the content for the legacy .cursorrules merge-block.
|
|
79
|
-
* Only used when .cursorrules already exists on disk.
|
|
80
|
-
*/
|
|
81
|
-
function buildLegacyBlock(skills, ctx) {
|
|
82
|
-
const lines = [];
|
|
83
|
-
lines.push('# AIDLC Framework');
|
|
84
|
-
lines.push('');
|
|
85
|
-
lines.push('This project uses the AIDLC framework. Phase skills are in `.aidlc/skills/`.');
|
|
86
|
-
lines.push('');
|
|
87
|
-
for (const skill of skills) {
|
|
88
|
-
const filename = skillFileName(skill);
|
|
89
|
-
lines.push(`- ${skill.meta.phase}: .aidlc/skills/${filename}`);
|
|
90
|
-
}
|
|
91
|
-
const contextEntries = Object.entries(ctx.contextDocs);
|
|
92
|
-
if (contextEntries.length > 0) {
|
|
93
|
-
lines.push('');
|
|
94
|
-
lines.push('Context docs:');
|
|
95
|
-
for (const [name, relPath] of contextEntries) {
|
|
96
|
-
lines.push(`- ${name}: .aidlc/context/${relPath}`);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// Knowledge graph context (KG Req 6.4) — omitted when the project has no graph
|
|
100
|
-
if (ctx.knowledgeSection) {
|
|
101
|
-
lines.push('');
|
|
102
|
-
lines.push(ctx.knowledgeSection);
|
|
103
|
-
}
|
|
104
|
-
return lines.join('\n');
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Cursor platform adapter implementation.
|
|
108
|
-
*/
|
|
109
|
-
export const cursorAdapter = {
|
|
110
|
-
id: 'cursor',
|
|
111
|
-
plan(skills, caps, ctx) {
|
|
112
|
-
const ops = [];
|
|
113
|
-
const warnings = [];
|
|
114
|
-
// 1. Copy canonical skill bodies to .aidlc/skills/
|
|
115
|
-
for (const skill of skills) {
|
|
116
|
-
const filename = skillFileName(skill);
|
|
117
|
-
const content = formatCanonicalSkill(skill);
|
|
118
|
-
ops.push({
|
|
119
|
-
kind: 'create',
|
|
120
|
-
path: `.aidlc/skills/${filename}`,
|
|
121
|
-
content,
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
// 2. Generate .cursor/rules/aidlc-<name>.mdc per skill
|
|
125
|
-
for (const skill of skills) {
|
|
126
|
-
const isOverview = skill.meta.name === 'aidlc-overview';
|
|
127
|
-
const mdcContent = buildMdcContent(skill, caps, isOverview);
|
|
128
|
-
ops.push({
|
|
129
|
-
kind: 'create',
|
|
130
|
-
path: `.cursor/rules/${prefixedRuleFilename(skill.meta.name, '.mdc')}`,
|
|
131
|
-
content: mdcContent,
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
// 3. Legacy .cursorrules — only via merge-block if file already exists
|
|
135
|
-
const cursorrules = join(ctx.root, '.cursorrules');
|
|
136
|
-
if (existsSync(cursorrules)) {
|
|
137
|
-
const blockContent = buildLegacyBlock(skills, ctx);
|
|
138
|
-
ops.push({
|
|
139
|
-
kind: 'merge-block',
|
|
140
|
-
path: '.cursorrules',
|
|
141
|
-
blockId: 'aidlc',
|
|
142
|
-
content: blockContent,
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
return { ops, warnings };
|
|
146
|
-
},
|
|
147
|
-
validate(op) {
|
|
148
|
-
const errors = [];
|
|
149
|
-
const warnings = [];
|
|
150
|
-
if (op.kind === 'create' || op.kind === 'replace') {
|
|
151
|
-
// .mdc files should have frontmatter
|
|
152
|
-
if (op.path.endsWith('.mdc')) {
|
|
153
|
-
if (!op.content.startsWith('---')) {
|
|
154
|
-
errors.push(`${op.path}: .mdc file must begin with YAML frontmatter (---)`);
|
|
155
|
-
}
|
|
156
|
-
// Check for required frontmatter fields
|
|
157
|
-
if (!op.content.includes('description:')) {
|
|
158
|
-
errors.push(`${op.path}: .mdc file must include 'description' in frontmatter`);
|
|
159
|
-
}
|
|
160
|
-
if (!op.content.includes('alwaysApply:')) {
|
|
161
|
-
errors.push(`${op.path}: .mdc file must include 'alwaysApply' in frontmatter`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (!op.content || op.content.trim().length === 0) {
|
|
165
|
-
warnings.push(`${op.path}: empty content`);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return { valid: errors.length === 0, errors, warnings };
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
//# sourceMappingURL=cursor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/compile/adapters/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAUjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE5E;;;GAGG;AACH,SAAS,aAAa,CAAC,KAAY;IACjC,OAAO,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB,CAC7B,KAAY,EACZ,IAA0B;IAE1B,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,2CAA2C;IAC3C,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACjD,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,UAAU,CAAC;IACrC,CAAC;I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
/**
|
|
2
|
-
* Kiro platform adapter for the AIDLC install pipeline.
|
|
3
|
-
*
|
|
4
|
-
* Emits an InstallPlan that:
|
|
5
|
-
* 1. Copies canonical skill bodies to `.aidlc/skills/`
|
|
6
|
-
* 2. Generates `.kiro/skills/aidlc-<name>/SKILL.md` per skill with:
|
|
7
|
-
* - YAML frontmatter (name, description)
|
|
8
|
-
* - Body: activation directive (from capability map) + pointer to canonical skill
|
|
9
|
-
* 3. Generates a `merge-block` steering file `.kiro/steering/aidlc.md`
|
|
10
|
-
* (always-included, carries overview + context-doc references)
|
|
11
|
-
*
|
|
12
|
-
* Requirements: 1.1, 18.1
|
|
13
|
-
*
|
|
14
|
-
* @module
|
|
15
|
-
*/
|
|
16
|
-
import type { PlatformAdapter } from '../../core/types.js';
|
|
17
|
-
/**
|
|
18
|
-
* Kiro platform adapter.
|
|
19
|
-
*
|
|
20
|
-
* Implements the PlatformAdapter interface to produce an InstallPlan
|
|
21
|
-
* for Kiro's `.kiro/skills/` and `.kiro/steering/` layout.
|
|
22
|
-
*/
|
|
23
|
-
export declare const kiroAdapter: PlatformAdapter;
|
|
24
|
-
//# sourceMappingURL=kiro.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kiro.d.ts","sourceRoot":"","sources":["../../../src/compile/adapters/kiro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EACV,eAAe,EAShB,MAAM,qBAAqB,CAAC;AAuI7B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,eA8FzB,CAAC"}
|