@juancr11/sibu 0.6.0 → 0.8.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/bin/admin/changelog.js +155 -0
- package/bin/admin/release.js +217 -0
- package/bin/entrypoints/cli/create-program.js +1 -1
- package/bin/entrypoints/cli/execute-command.js +6 -6
- package/bin/modules/interactive-guidance/index.js +1 -0
- package/bin/{shared → modules/interactive-guidance}/prompts.js +17 -1
- package/bin/modules/maintainer-release-support/generate-changelog/changelog-format.js +213 -0
- package/bin/modules/maintainer-release-support/generate-changelog/changelog-writer.js +91 -0
- package/bin/modules/maintainer-release-support/generate-changelog/git-history.js +93 -0
- package/bin/modules/maintainer-release-support/generate-changelog/handler.js +167 -0
- package/bin/modules/maintainer-release-support/generate-changelog/semver.js +40 -0
- package/bin/modules/maintainer-release-support/index.js +2 -0
- package/bin/modules/maintainer-release-support/release-workflow/git-release.js +114 -0
- package/bin/modules/maintainer-release-support/release-workflow/handler.js +369 -0
- package/bin/modules/maintainer-release-support/release-workflow/package-json.js +181 -0
- package/bin/modules/maintainer-release-support/release-workflow/release-plan.js +87 -0
- package/bin/{features/init-project → modules/project-adoption}/handler.js +7 -5
- package/bin/modules/project-adoption/index.js +1 -0
- package/bin/modules/skill-selection-management/index.js +3 -0
- package/bin/{features → modules/skill-selection-management}/list-skills/handler.js +14 -4
- package/bin/{features → modules/skill-selection-management}/stop-managing-file/handler.js +15 -8
- package/bin/modules/skill-selection-management/use-skill/command.js +1 -0
- package/bin/{features → modules/skill-selection-management}/use-skill/handler.js +42 -8
- package/bin/{features/sync-project → modules/sync-review}/apply-action.js +5 -3
- package/bin/modules/sync-review/command.js +1 -0
- package/bin/{features/sync-project → modules/sync-review}/handler.js +4 -4
- package/bin/modules/sync-review/index.js +5 -0
- package/bin/{shared → modules/sync-review}/sync-preview.js +11 -7
- package/bin/modules/template-catalog-rendering/index.js +1 -0
- package/bin/modules/template-catalog-rendering/templates.js +60 -0
- package/bin/modules/version-advisory/index.js +1 -0
- package/bin/{shared → modules/version-advisory}/npm-version.js +29 -2
- package/bin/modules/workflow-health-diagnosis/command.js +1 -0
- package/bin/{features/doctor-project → modules/workflow-health-diagnosis}/handler.js +13 -7
- package/bin/modules/workflow-health-diagnosis/index.js +1 -0
- package/bin/modules/workflow-mutation-readiness/index.js +1 -0
- package/bin/{shared → modules/workflow-mutation-readiness}/workflow-mutation-readiness.js +3 -3
- package/bin/modules/workflow-state-registry/index.js +1 -0
- package/bin/{shared → modules/workflow-state-registry}/state.js +3 -1
- package/bin/modules/workflow-target-planning/catalog.js +252 -0
- package/bin/modules/workflow-target-planning/index.js +2 -0
- package/bin/modules/workflow-target-planning/workflow-targets.js +130 -0
- package/bin/shared/catalog.js +0 -253
- package/bin/shared/paths.js +1 -12
- package/bin/shared/workflow-targets.js +3 -2
- package/package.json +4 -2
- package/templates/AGENTS.md +3 -3
- package/templates/manifest.json +38 -27
- package/templates/skills/ai-implementation-plan-executor/SKILL.md +74 -70
- package/templates/skills/ai-implementation-planner/SKILL.md +24 -17
- package/templates/skills/architecture/command-pattern/SKILL.md +32 -20
- package/templates/skills/architecture/ddd-hexagonal/SKILL.md +14 -9
- package/templates/skills/deep-module-map-writer/SKILL.md +241 -0
- package/templates/skills/feature-brief-writer/SKILL.md +24 -24
- package/templates/skills/postgresql-expert/SKILL.md +72 -0
- package/templates/skills/product-vision-writer/SKILL.md +2 -2
- package/templates/skills/scrum-master-planner/SKILL.md +2 -2
- package/templates/skills/technical-design-writer/SKILL.md +15 -15
- package/templates/skills/ux-expert/SKILL.md +1 -1
- package/bin/features/sync-project/preview.js +0 -1
- package/templates/skills/product-context-map-writer/SKILL.md +0 -211
- /package/bin/{features/doctor-project/command.js → modules/cli-command-surface/index.js} +0 -0
- /package/bin/{features/init-project → modules/maintainer-release-support/generate-changelog}/command.js +0 -0
- /package/bin/{features/list-skills → modules/maintainer-release-support/release-workflow}/command.js +0 -0
- /package/bin/{features/stop-managing-file → modules/project-adoption}/command.js +0 -0
- /package/bin/{features/sync-project → modules/skill-selection-management/list-skills}/command.js +0 -0
- /package/bin/{features/use-skill → modules/skill-selection-management/stop-managing-file}/command.js +0 -0
- /package/bin/{features/sync-project → modules/sync-review}/action-prompt.js +0 -0
- /package/bin/{features/sync-project → modules/sync-review}/log-preview.js +0 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
export const MANDATORY_SKILLS = [
|
|
2
|
+
{
|
|
3
|
+
templateRelativePath: 'skills/clean-code/SKILL.md',
|
|
4
|
+
targetRelativePathsByAgent: {
|
|
5
|
+
codex: '.agents/skills/clean-code/SKILL.md',
|
|
6
|
+
gemini: '.agents/skills/clean-code/SKILL.md',
|
|
7
|
+
claude: '.agents/skills/clean-code/SKILL.md',
|
|
8
|
+
windsurf: '.agents/skills/clean-code/SKILL.md',
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
templateRelativePath: 'skills/product-vision-writer/SKILL.md',
|
|
13
|
+
targetRelativePathsByAgent: {
|
|
14
|
+
codex: '.agents/skills/product-vision-writer/SKILL.md',
|
|
15
|
+
gemini: '.agents/skills/product-vision-writer/SKILL.md',
|
|
16
|
+
claude: '.agents/skills/product-vision-writer/SKILL.md',
|
|
17
|
+
windsurf: '.agents/skills/product-vision-writer/SKILL.md',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
templateRelativePath: 'skills/deep-module-map-writer/SKILL.md',
|
|
22
|
+
targetRelativePathsByAgent: {
|
|
23
|
+
codex: '.agents/skills/deep-module-map-writer/SKILL.md',
|
|
24
|
+
gemini: '.agents/skills/deep-module-map-writer/SKILL.md',
|
|
25
|
+
claude: '.agents/skills/deep-module-map-writer/SKILL.md',
|
|
26
|
+
windsurf: '.agents/skills/deep-module-map-writer/SKILL.md',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
templateRelativePath: 'skills/feature-brief-writer/SKILL.md',
|
|
31
|
+
targetRelativePathsByAgent: {
|
|
32
|
+
codex: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
33
|
+
gemini: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
34
|
+
claude: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
35
|
+
windsurf: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
templateRelativePath: 'skills/technical-design-writer/SKILL.md',
|
|
40
|
+
targetRelativePathsByAgent: {
|
|
41
|
+
codex: '.agents/skills/technical-design-writer/SKILL.md',
|
|
42
|
+
gemini: '.agents/skills/technical-design-writer/SKILL.md',
|
|
43
|
+
claude: '.agents/skills/technical-design-writer/SKILL.md',
|
|
44
|
+
windsurf: '.agents/skills/technical-design-writer/SKILL.md',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
templateRelativePath: 'skills/scrum-master-planner/SKILL.md',
|
|
49
|
+
targetRelativePathsByAgent: {
|
|
50
|
+
codex: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
51
|
+
gemini: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
52
|
+
claude: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
53
|
+
windsurf: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
templateRelativePath: 'skills/ai-implementation-planner/SKILL.md',
|
|
58
|
+
targetRelativePathsByAgent: {
|
|
59
|
+
codex: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
60
|
+
gemini: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
61
|
+
claude: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
62
|
+
windsurf: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
templateRelativePath: 'skills/ai-implementation-plan-executor/SKILL.md',
|
|
67
|
+
targetRelativePathsByAgent: {
|
|
68
|
+
codex: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
69
|
+
gemini: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
70
|
+
claude: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
71
|
+
windsurf: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
export const SELECTABLE_LANGUAGE_SKILLS = [
|
|
76
|
+
{
|
|
77
|
+
id: 'typescript',
|
|
78
|
+
name: 'TypeScript',
|
|
79
|
+
description: 'Install practical guidance for writing and modifying .ts and .tsx files',
|
|
80
|
+
routingInstruction: 'For any task that changes `.ts` or `.tsx` files, also use `typescript`.',
|
|
81
|
+
templateRelativePath: 'skills/typescript/SKILL.md',
|
|
82
|
+
targetRelativePathsByAgent: {
|
|
83
|
+
codex: '.agents/skills/typescript/SKILL.md',
|
|
84
|
+
gemini: '.agents/skills/typescript/SKILL.md',
|
|
85
|
+
claude: '.agents/skills/typescript/SKILL.md',
|
|
86
|
+
windsurf: '.agents/skills/typescript/SKILL.md',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'golang',
|
|
91
|
+
name: 'Go',
|
|
92
|
+
description: 'Install practical guidance for writing and modifying .go files',
|
|
93
|
+
routingInstruction: 'For any task that changes `.go` files, also use `golang`.',
|
|
94
|
+
templateRelativePath: 'skills/golang/SKILL.md',
|
|
95
|
+
targetRelativePathsByAgent: {
|
|
96
|
+
codex: '.agents/skills/golang/SKILL.md',
|
|
97
|
+
gemini: '.agents/skills/golang/SKILL.md',
|
|
98
|
+
claude: '.agents/skills/golang/SKILL.md',
|
|
99
|
+
windsurf: '.agents/skills/golang/SKILL.md',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
export const SELECTABLE_DATABASE_SKILLS = [
|
|
104
|
+
{
|
|
105
|
+
id: 'postgresql-expert',
|
|
106
|
+
name: 'PostgreSQL Expert',
|
|
107
|
+
description: 'Install practical guidance for PostgreSQL schema design, migrations, constraints, queries, indexing, and database tradeoffs',
|
|
108
|
+
routingInstruction: 'For PostgreSQL schema design, migrations, constraints, queries, indexing, or database tradeoffs, use `postgresql-expert`.',
|
|
109
|
+
templateRelativePath: 'skills/postgresql-expert/SKILL.md',
|
|
110
|
+
targetRelativePathsByAgent: {
|
|
111
|
+
codex: '.agents/skills/postgresql-expert/SKILL.md',
|
|
112
|
+
gemini: '.agents/skills/postgresql-expert/SKILL.md',
|
|
113
|
+
claude: '.agents/skills/postgresql-expert/SKILL.md',
|
|
114
|
+
windsurf: '.agents/skills/postgresql-expert/SKILL.md',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
];
|
|
118
|
+
export const SELECTABLE_FRAMEWORK_SKILLS = [
|
|
119
|
+
{
|
|
120
|
+
id: 'react',
|
|
121
|
+
name: 'React',
|
|
122
|
+
description: 'Install guidance for React components, props, state ownership, and component boundaries',
|
|
123
|
+
routingInstruction: 'For React component changes involving responsibility, props, state ownership, or presentational/data-owning boundaries, use `react`.',
|
|
124
|
+
templateRelativePath: 'skills/react/SKILL.md',
|
|
125
|
+
targetRelativePathsByAgent: {
|
|
126
|
+
codex: '.agents/skills/react/SKILL.md',
|
|
127
|
+
gemini: '.agents/skills/react/SKILL.md',
|
|
128
|
+
claude: '.agents/skills/react/SKILL.md',
|
|
129
|
+
windsurf: '.agents/skills/react/SKILL.md',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 'nextjs',
|
|
134
|
+
name: 'Next.js',
|
|
135
|
+
description: 'Install guidance for Next.js App Router and framework-specific files',
|
|
136
|
+
routingInstruction: 'For Next.js App Router or framework-specific changes—`src/app/**`, pages, layouts, route handlers, loading/error/not-found files, metadata, or Server/Client boundaries—use `nextjs`.',
|
|
137
|
+
templateRelativePath: 'skills/nextjs/SKILL.md',
|
|
138
|
+
targetRelativePathsByAgent: {
|
|
139
|
+
codex: '.agents/skills/nextjs/SKILL.md',
|
|
140
|
+
gemini: '.agents/skills/nextjs/SKILL.md',
|
|
141
|
+
claude: '.agents/skills/nextjs/SKILL.md',
|
|
142
|
+
windsurf: '.agents/skills/nextjs/SKILL.md',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
export const SELECTABLE_ARCHITECTURE_SKILLS = [
|
|
147
|
+
{
|
|
148
|
+
id: 'ddd-hexagonal',
|
|
149
|
+
name: 'DDD + Hexagonal Architecture',
|
|
150
|
+
description: 'Install back-end architecture guidance for DDD, ports/adapters, and inward dependencies',
|
|
151
|
+
routingInstruction: 'For backend features, refactors, bug fixes, persistence, external integrations, application/service boundaries, domain modeling, or architectural tradeoffs, use `ddd-hexagonal`.',
|
|
152
|
+
templateRelativePath: 'skills/architecture/ddd-hexagonal/SKILL.md',
|
|
153
|
+
targetRelativePathsByAgent: {
|
|
154
|
+
codex: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
155
|
+
gemini: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
156
|
+
claude: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
157
|
+
windsurf: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'command-pattern',
|
|
162
|
+
name: 'Command Pattern',
|
|
163
|
+
description: 'Install architecture guidance for structuring executable operations as commands and handlers',
|
|
164
|
+
routingInstruction: 'For work that structures actions, workflows, command handlers, operation dispatch, request processing, or executable tasks, use `command-pattern`.',
|
|
165
|
+
templateRelativePath: 'skills/architecture/command-pattern/SKILL.md',
|
|
166
|
+
targetRelativePathsByAgent: {
|
|
167
|
+
codex: '.agents/skills/command-pattern/SKILL.md',
|
|
168
|
+
gemini: '.agents/skills/command-pattern/SKILL.md',
|
|
169
|
+
claude: '.agents/skills/command-pattern/SKILL.md',
|
|
170
|
+
windsurf: '.agents/skills/command-pattern/SKILL.md',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
];
|
|
174
|
+
export const SELECTABLE_WORKFLOW_SKILLS = [
|
|
175
|
+
{
|
|
176
|
+
id: 'ai-prompt-engineer-master',
|
|
177
|
+
name: 'AI Prompt Engineer Master',
|
|
178
|
+
description: 'Install guidance for creating, rewriting, optimizing, compressing, and evaluating AI prompts',
|
|
179
|
+
routingInstruction: 'For prompt creation, rewriting, optimization, compression, evaluation, or reusable templates for AI models, agents, tools, coding assistants, or product workflows, use `ai-prompt-engineer-master`.',
|
|
180
|
+
templateRelativePath: 'skills/ai-prompt-engineer-master/SKILL.md',
|
|
181
|
+
targetRelativePathsByAgent: {
|
|
182
|
+
codex: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
183
|
+
gemini: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
184
|
+
claude: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
185
|
+
windsurf: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: 'ux-expert',
|
|
190
|
+
name: 'UX Expert',
|
|
191
|
+
description: 'Install senior UX/UI guidance for UI-changing features, responsive layouts, flows, states, accessibility, and binding mockups',
|
|
192
|
+
routingInstruction: 'For UX/UI design after product definition for UI-changing features, use `ux-expert`; downstream design, planning, and implementation must treat `docs/features/<feature-slug>/ux.md` mockups as binding UI goals, not redesign targets.',
|
|
193
|
+
templateRelativePath: 'skills/ux-expert/SKILL.md',
|
|
194
|
+
targetRelativePathsByAgent: {
|
|
195
|
+
codex: '.agents/skills/ux-expert/SKILL.md',
|
|
196
|
+
gemini: '.agents/skills/ux-expert/SKILL.md',
|
|
197
|
+
claude: '.agents/skills/ux-expert/SKILL.md',
|
|
198
|
+
windsurf: '.agents/skills/ux-expert/SKILL.md',
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
];
|
|
202
|
+
export const SUPPORTED_AGENTS = [
|
|
203
|
+
{
|
|
204
|
+
id: 'codex',
|
|
205
|
+
name: 'Codex',
|
|
206
|
+
description: 'Create .codex/config.toml pointing Codex to AGENTS.md',
|
|
207
|
+
targetRelativePath: '.codex/config.toml',
|
|
208
|
+
templateRelativePath: '.codex/config.toml',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: 'gemini',
|
|
212
|
+
name: 'Gemini',
|
|
213
|
+
description: 'Create GEMINI.md that delegates to AGENTS.md',
|
|
214
|
+
targetRelativePath: 'GEMINI.md',
|
|
215
|
+
templateRelativePath: 'GEMINI.md',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: 'claude',
|
|
219
|
+
name: 'Claude',
|
|
220
|
+
description: 'Create CLAUDE.md that delegates to AGENTS.md',
|
|
221
|
+
targetRelativePath: 'CLAUDE.md',
|
|
222
|
+
templateRelativePath: 'CLAUDE.md',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: 'windsurf',
|
|
226
|
+
name: 'Windsurf',
|
|
227
|
+
description: 'Use root AGENTS.md and shared .agents/skills/ discovery',
|
|
228
|
+
},
|
|
229
|
+
];
|
|
230
|
+
export function resolveSelectableSkillById(skillId) {
|
|
231
|
+
const languageSkill = SELECTABLE_LANGUAGE_SKILLS.find((skill) => skill.id === skillId);
|
|
232
|
+
if (languageSkill) {
|
|
233
|
+
return { ok: true, resolved: { kind: 'language', skill: languageSkill } };
|
|
234
|
+
}
|
|
235
|
+
const frameworkSkill = SELECTABLE_FRAMEWORK_SKILLS.find((skill) => skill.id === skillId);
|
|
236
|
+
if (frameworkSkill) {
|
|
237
|
+
return { ok: true, resolved: { kind: 'framework', skill: frameworkSkill } };
|
|
238
|
+
}
|
|
239
|
+
const databaseSkill = SELECTABLE_DATABASE_SKILLS.find((skill) => skill.id === skillId);
|
|
240
|
+
if (databaseSkill) {
|
|
241
|
+
return { ok: true, resolved: { kind: 'database', skill: databaseSkill } };
|
|
242
|
+
}
|
|
243
|
+
const architectureSkill = SELECTABLE_ARCHITECTURE_SKILLS.find((skill) => skill.id === skillId);
|
|
244
|
+
if (architectureSkill) {
|
|
245
|
+
return { ok: true, resolved: { kind: 'architecture', skill: architectureSkill } };
|
|
246
|
+
}
|
|
247
|
+
const workflowSkill = SELECTABLE_WORKFLOW_SKILLS.find((skill) => skill.id === skillId);
|
|
248
|
+
if (workflowSkill) {
|
|
249
|
+
return { ok: true, resolved: { kind: 'workflow', skill: workflowSkill } };
|
|
250
|
+
}
|
|
251
|
+
return { ok: false, message: `Unknown skill \`${skillId}\`. Run \`sibu skills list\` to see available skills.` };
|
|
252
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { MANDATORY_SKILLS, SELECTABLE_ARCHITECTURE_SKILLS, SELECTABLE_DATABASE_SKILLS, SELECTABLE_FRAMEWORK_SKILLS, SELECTABLE_LANGUAGE_SKILLS, SELECTABLE_WORKFLOW_SKILLS, SUPPORTED_AGENTS, resolveSelectableSkillById, } from './catalog.js';
|
|
2
|
+
export { getSelectedAgentsFromState, getSelectedArchitectureSkillFromState, getSelectedDatabaseSkillsFromState, getSelectedFrameworkSkillsFromState, getSelectedLanguageSkillsFromState, getSelectedSkillTargetsForAgents, getSelectedWorkflowSkillsFromState, getWorkflowTargets, renderMissingWorkflowFiles, writeSibuState, } from './workflow-targets.js';
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { SIBU_VERSION } from '../version-advisory/index.js';
|
|
4
|
+
import { MANDATORY_SKILLS, SELECTABLE_ARCHITECTURE_SKILLS, SELECTABLE_DATABASE_SKILLS, SELECTABLE_FRAMEWORK_SKILLS, SELECTABLE_LANGUAGE_SKILLS, SELECTABLE_WORKFLOW_SKILLS, SUPPORTED_AGENTS, } from './index.js';
|
|
5
|
+
import { sha256 } from '../../shared/hash.js';
|
|
6
|
+
import { removeUndefinedFields } from '../../shared/object.js';
|
|
7
|
+
import { readExistingState } from '../workflow-state-registry/index.js';
|
|
8
|
+
import { getTemplateVersion, readTemplate, readTemplateManifest, renderSkillRouting } from '../template-catalog-rendering/index.js';
|
|
9
|
+
export function getSelectedLanguageSkillsFromState(state) {
|
|
10
|
+
return SELECTABLE_LANGUAGE_SKILLS.filter((skill) => state.selectedLanguageSkills?.includes(skill.id));
|
|
11
|
+
}
|
|
12
|
+
export function getSelectedFrameworkSkillsFromState(state) {
|
|
13
|
+
return SELECTABLE_FRAMEWORK_SKILLS.filter((skill) => state.selectedFrameworkSkills?.includes(skill.id));
|
|
14
|
+
}
|
|
15
|
+
export function getSelectedArchitectureSkillFromState(state) {
|
|
16
|
+
return SELECTABLE_ARCHITECTURE_SKILLS.find((skill) => skill.id === state.selectedArchitectureSkill);
|
|
17
|
+
}
|
|
18
|
+
export function getSelectedWorkflowSkillsFromState(state) {
|
|
19
|
+
return SELECTABLE_WORKFLOW_SKILLS.filter((skill) => state.selectedWorkflowSkills?.includes(skill.id));
|
|
20
|
+
}
|
|
21
|
+
export function getSelectedDatabaseSkillsFromState(state) {
|
|
22
|
+
return SELECTABLE_DATABASE_SKILLS.filter((skill) => state.selectedDatabaseSkills?.includes(skill.id));
|
|
23
|
+
}
|
|
24
|
+
export function getSelectedSkillTargetsForAgents(selectedAgents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = [], selectedDatabaseSkills = []) {
|
|
25
|
+
const skillTargets = new Map();
|
|
26
|
+
const selectedSkills = [
|
|
27
|
+
...MANDATORY_SKILLS,
|
|
28
|
+
...selectedLanguageSkills,
|
|
29
|
+
...selectedFrameworkSkills,
|
|
30
|
+
...selectedDatabaseSkills,
|
|
31
|
+
...(selectedArchitectureSkill ? [selectedArchitectureSkill] : []),
|
|
32
|
+
...selectedWorkflowSkills,
|
|
33
|
+
];
|
|
34
|
+
for (const agent of selectedAgents) {
|
|
35
|
+
for (const skill of selectedSkills) {
|
|
36
|
+
const targetRelativePath = skill.targetRelativePathsByAgent[agent.id];
|
|
37
|
+
if (!targetRelativePath) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
skillTargets.set(targetRelativePath, {
|
|
41
|
+
targetRelativePath,
|
|
42
|
+
templateRelativePath: skill.templateRelativePath,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return [...skillTargets.values()];
|
|
47
|
+
}
|
|
48
|
+
export function getWorkflowTargets(rootPath, selectedAgents, selectedLanguageSkills = [], selectedFrameworkSkills = [], selectedArchitectureSkill, selectedWorkflowSkills = [], selectedDatabaseSkills = []) {
|
|
49
|
+
return [
|
|
50
|
+
{
|
|
51
|
+
label: 'AGENTS.md',
|
|
52
|
+
targetPath: path.join(rootPath, 'AGENTS.md'),
|
|
53
|
+
templateRelativePath: 'AGENTS.md',
|
|
54
|
+
requiresProjectOverview: true,
|
|
55
|
+
},
|
|
56
|
+
...selectedAgents.flatMap((agent) => {
|
|
57
|
+
if (!agent.targetRelativePath || !agent.templateRelativePath) {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
label: agent.targetRelativePath,
|
|
63
|
+
targetPath: path.join(rootPath, agent.targetRelativePath),
|
|
64
|
+
templateRelativePath: agent.templateRelativePath,
|
|
65
|
+
requiresProjectOverview: false,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
}),
|
|
69
|
+
...getSelectedSkillTargetsForAgents(selectedAgents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills, selectedDatabaseSkills).map((skillTarget) => ({
|
|
70
|
+
label: skillTarget.targetRelativePath,
|
|
71
|
+
targetPath: path.join(rootPath, skillTarget.targetRelativePath),
|
|
72
|
+
templateRelativePath: skillTarget.templateRelativePath,
|
|
73
|
+
requiresProjectOverview: false,
|
|
74
|
+
})),
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
export function renderMissingWorkflowFiles({ missingTargets, overview, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = [], selectedDatabaseSkills = [], }) {
|
|
78
|
+
return missingTargets.map((target) => {
|
|
79
|
+
let contents = readTemplate(target.templateRelativePath);
|
|
80
|
+
if (target.requiresProjectOverview) {
|
|
81
|
+
if (!overview?.trim()) {
|
|
82
|
+
throw new Error('Project overview is required to create AGENTS.md.');
|
|
83
|
+
}
|
|
84
|
+
contents = contents.replace('{{PROJECT_OVERVIEW}}', overview.trim());
|
|
85
|
+
}
|
|
86
|
+
contents = renderSkillRouting(contents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills, selectedDatabaseSkills);
|
|
87
|
+
return {
|
|
88
|
+
label: target.label,
|
|
89
|
+
targetPath: target.targetPath,
|
|
90
|
+
contents,
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
export function writeSibuState({ rootPath, statePath, selectedAgents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = [], selectedDatabaseSkills = [], targets, }) {
|
|
95
|
+
const previousState = readExistingState(statePath);
|
|
96
|
+
const now = new Date().toISOString();
|
|
97
|
+
const manifest = readTemplateManifest();
|
|
98
|
+
const state = {
|
|
99
|
+
sibuVersion: SIBU_VERSION,
|
|
100
|
+
templateVersion: manifest.templateVersion,
|
|
101
|
+
generatedAt: previousState?.generatedAt ?? now,
|
|
102
|
+
updatedAt: now,
|
|
103
|
+
selectedAgents: selectedAgents.map((agent) => agent.id),
|
|
104
|
+
selectedLanguageSkills: selectedLanguageSkills.map((skill) => skill.id),
|
|
105
|
+
selectedFrameworkSkills: selectedFrameworkSkills.map((skill) => skill.id),
|
|
106
|
+
selectedArchitectureSkill: selectedArchitectureSkill?.id,
|
|
107
|
+
selectedWorkflowSkills: selectedWorkflowSkills.map((skill) => skill.id),
|
|
108
|
+
selectedDatabaseSkills: selectedDatabaseSkills.map((skill) => skill.id),
|
|
109
|
+
managedFiles: Object.fromEntries(targets
|
|
110
|
+
.filter((target) => fs.existsSync(target.targetPath))
|
|
111
|
+
.map((target) => {
|
|
112
|
+
const relativePath = path.relative(rootPath, target.targetPath);
|
|
113
|
+
const previousManagedFile = previousState?.managedFiles[relativePath];
|
|
114
|
+
const nextManagedFile = {
|
|
115
|
+
template: target.templateRelativePath,
|
|
116
|
+
templateVersion: getTemplateVersion(manifest, target.templateRelativePath),
|
|
117
|
+
sha256: sha256(fs.readFileSync(target.targetPath, 'utf8')),
|
|
118
|
+
status: previousManagedFile?.status ?? 'managed',
|
|
119
|
+
lastReviewedTemplateVersion: previousManagedFile?.lastReviewedTemplateVersion,
|
|
120
|
+
reason: previousManagedFile?.reason,
|
|
121
|
+
};
|
|
122
|
+
return [relativePath, removeUndefinedFields(nextManagedFile)];
|
|
123
|
+
})),
|
|
124
|
+
};
|
|
125
|
+
fs.mkdirSync(path.dirname(statePath), { recursive: true });
|
|
126
|
+
fs.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`, 'utf8');
|
|
127
|
+
}
|
|
128
|
+
export function getSelectedAgentsFromState(state) {
|
|
129
|
+
return SUPPORTED_AGENTS.filter((agent) => state.selectedAgents.includes(agent.id));
|
|
130
|
+
}
|
package/bin/shared/catalog.js
CHANGED
|
@@ -1,254 +1 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
export const SIBU_PACKAGE_NAME = '@juancr11/sibu';
|
|
5
|
-
export const SIBU_VERSION = readPackageVersion();
|
|
6
1
|
export const STATE_RELATIVE_PATH = '.sibu/state.json';
|
|
7
|
-
export const NPM_VERSION_LOOKUP_MODE_ENV = 'SIBU_NPM_LOOKUP_MODE';
|
|
8
|
-
export const NPM_VERSION_OVERRIDE_ENV = 'SIBU_NPM_LATEST_VERSION';
|
|
9
|
-
export const SIBU_CACHE_HOME_ENV = 'SIBU_CACHE_HOME';
|
|
10
|
-
export const SUPPORTED_NPM_LOOKUP_MODES = ['live', 'offline'];
|
|
11
|
-
export const MANDATORY_SKILLS = [
|
|
12
|
-
{
|
|
13
|
-
templateRelativePath: 'skills/clean-code/SKILL.md',
|
|
14
|
-
targetRelativePathsByAgent: {
|
|
15
|
-
codex: '.agents/skills/clean-code/SKILL.md',
|
|
16
|
-
gemini: '.agents/skills/clean-code/SKILL.md',
|
|
17
|
-
claude: '.agents/skills/clean-code/SKILL.md',
|
|
18
|
-
windsurf: '.agents/skills/clean-code/SKILL.md',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
templateRelativePath: 'skills/product-vision-writer/SKILL.md',
|
|
23
|
-
targetRelativePathsByAgent: {
|
|
24
|
-
codex: '.agents/skills/product-vision-writer/SKILL.md',
|
|
25
|
-
gemini: '.agents/skills/product-vision-writer/SKILL.md',
|
|
26
|
-
claude: '.agents/skills/product-vision-writer/SKILL.md',
|
|
27
|
-
windsurf: '.agents/skills/product-vision-writer/SKILL.md',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
templateRelativePath: 'skills/product-context-map-writer/SKILL.md',
|
|
32
|
-
targetRelativePathsByAgent: {
|
|
33
|
-
codex: '.agents/skills/product-context-map-writer/SKILL.md',
|
|
34
|
-
gemini: '.agents/skills/product-context-map-writer/SKILL.md',
|
|
35
|
-
claude: '.agents/skills/product-context-map-writer/SKILL.md',
|
|
36
|
-
windsurf: '.agents/skills/product-context-map-writer/SKILL.md',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
templateRelativePath: 'skills/feature-brief-writer/SKILL.md',
|
|
41
|
-
targetRelativePathsByAgent: {
|
|
42
|
-
codex: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
43
|
-
gemini: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
44
|
-
claude: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
45
|
-
windsurf: '.agents/skills/feature-brief-writer/SKILL.md',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
templateRelativePath: 'skills/technical-design-writer/SKILL.md',
|
|
50
|
-
targetRelativePathsByAgent: {
|
|
51
|
-
codex: '.agents/skills/technical-design-writer/SKILL.md',
|
|
52
|
-
gemini: '.agents/skills/technical-design-writer/SKILL.md',
|
|
53
|
-
claude: '.agents/skills/technical-design-writer/SKILL.md',
|
|
54
|
-
windsurf: '.agents/skills/technical-design-writer/SKILL.md',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
templateRelativePath: 'skills/scrum-master-planner/SKILL.md',
|
|
59
|
-
targetRelativePathsByAgent: {
|
|
60
|
-
codex: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
61
|
-
gemini: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
62
|
-
claude: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
63
|
-
windsurf: '.agents/skills/scrum-master-planner/SKILL.md',
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
templateRelativePath: 'skills/ai-implementation-planner/SKILL.md',
|
|
68
|
-
targetRelativePathsByAgent: {
|
|
69
|
-
codex: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
70
|
-
gemini: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
71
|
-
claude: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
72
|
-
windsurf: '.agents/skills/ai-implementation-planner/SKILL.md',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
templateRelativePath: 'skills/ai-implementation-plan-executor/SKILL.md',
|
|
77
|
-
targetRelativePathsByAgent: {
|
|
78
|
-
codex: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
79
|
-
gemini: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
80
|
-
claude: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
81
|
-
windsurf: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
export const SELECTABLE_LANGUAGE_SKILLS = [
|
|
86
|
-
{
|
|
87
|
-
id: 'typescript',
|
|
88
|
-
name: 'TypeScript',
|
|
89
|
-
description: 'Install practical guidance for writing and modifying .ts and .tsx files',
|
|
90
|
-
routingInstruction: 'For any task that changes `.ts` or `.tsx` files, also use `typescript`.',
|
|
91
|
-
templateRelativePath: 'skills/typescript/SKILL.md',
|
|
92
|
-
targetRelativePathsByAgent: {
|
|
93
|
-
codex: '.agents/skills/typescript/SKILL.md',
|
|
94
|
-
gemini: '.agents/skills/typescript/SKILL.md',
|
|
95
|
-
claude: '.agents/skills/typescript/SKILL.md',
|
|
96
|
-
windsurf: '.agents/skills/typescript/SKILL.md',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
id: 'golang',
|
|
101
|
-
name: 'Go',
|
|
102
|
-
description: 'Install practical guidance for writing and modifying .go files',
|
|
103
|
-
routingInstruction: 'For any task that changes `.go` files, also use `golang`.',
|
|
104
|
-
templateRelativePath: 'skills/golang/SKILL.md',
|
|
105
|
-
targetRelativePathsByAgent: {
|
|
106
|
-
codex: '.agents/skills/golang/SKILL.md',
|
|
107
|
-
gemini: '.agents/skills/golang/SKILL.md',
|
|
108
|
-
claude: '.agents/skills/golang/SKILL.md',
|
|
109
|
-
windsurf: '.agents/skills/golang/SKILL.md',
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
];
|
|
113
|
-
export const SELECTABLE_FRAMEWORK_SKILLS = [
|
|
114
|
-
{
|
|
115
|
-
id: 'react',
|
|
116
|
-
name: 'React',
|
|
117
|
-
description: 'Install guidance for React components, props, state ownership, and component boundaries',
|
|
118
|
-
routingInstruction: 'For React component changes involving responsibility, props, state ownership, or presentational/data-owning boundaries, use `react`.',
|
|
119
|
-
templateRelativePath: 'skills/react/SKILL.md',
|
|
120
|
-
targetRelativePathsByAgent: {
|
|
121
|
-
codex: '.agents/skills/react/SKILL.md',
|
|
122
|
-
gemini: '.agents/skills/react/SKILL.md',
|
|
123
|
-
claude: '.agents/skills/react/SKILL.md',
|
|
124
|
-
windsurf: '.agents/skills/react/SKILL.md',
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
id: 'nextjs',
|
|
129
|
-
name: 'Next.js',
|
|
130
|
-
description: 'Install guidance for Next.js App Router and framework-specific files',
|
|
131
|
-
routingInstruction: 'For Next.js App Router or framework-specific changes—`src/app/**`, pages, layouts, route handlers, loading/error/not-found files, metadata, or Server/Client boundaries—use `nextjs`.',
|
|
132
|
-
templateRelativePath: 'skills/nextjs/SKILL.md',
|
|
133
|
-
targetRelativePathsByAgent: {
|
|
134
|
-
codex: '.agents/skills/nextjs/SKILL.md',
|
|
135
|
-
gemini: '.agents/skills/nextjs/SKILL.md',
|
|
136
|
-
claude: '.agents/skills/nextjs/SKILL.md',
|
|
137
|
-
windsurf: '.agents/skills/nextjs/SKILL.md',
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
];
|
|
141
|
-
export const SELECTABLE_ARCHITECTURE_SKILLS = [
|
|
142
|
-
{
|
|
143
|
-
id: 'ddd-hexagonal',
|
|
144
|
-
name: 'DDD + Hexagonal Architecture',
|
|
145
|
-
description: 'Install back-end architecture guidance for DDD, ports/adapters, and inward dependencies',
|
|
146
|
-
routingInstruction: 'For backend features, refactors, bug fixes, persistence, external integrations, application/service boundaries, domain modeling, or architectural tradeoffs, use `ddd-hexagonal`.',
|
|
147
|
-
templateRelativePath: 'skills/architecture/ddd-hexagonal/SKILL.md',
|
|
148
|
-
targetRelativePathsByAgent: {
|
|
149
|
-
codex: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
150
|
-
gemini: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
151
|
-
claude: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
152
|
-
windsurf: '.agents/skills/ddd-hexagonal/SKILL.md',
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
id: 'command-pattern',
|
|
157
|
-
name: 'Command Pattern',
|
|
158
|
-
description: 'Install architecture guidance for structuring executable operations as commands and handlers',
|
|
159
|
-
routingInstruction: 'For work that structures actions, workflows, command handlers, operation dispatch, request processing, or executable tasks, use `command-pattern`.',
|
|
160
|
-
templateRelativePath: 'skills/architecture/command-pattern/SKILL.md',
|
|
161
|
-
targetRelativePathsByAgent: {
|
|
162
|
-
codex: '.agents/skills/command-pattern/SKILL.md',
|
|
163
|
-
gemini: '.agents/skills/command-pattern/SKILL.md',
|
|
164
|
-
claude: '.agents/skills/command-pattern/SKILL.md',
|
|
165
|
-
windsurf: '.agents/skills/command-pattern/SKILL.md',
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
];
|
|
169
|
-
export const SELECTABLE_WORKFLOW_SKILLS = [
|
|
170
|
-
{
|
|
171
|
-
id: 'ai-prompt-engineer-master',
|
|
172
|
-
name: 'AI Prompt Engineer Master',
|
|
173
|
-
description: 'Install guidance for creating, rewriting, optimizing, compressing, and evaluating AI prompts',
|
|
174
|
-
routingInstruction: 'For prompt creation, rewriting, optimization, compression, evaluation, or reusable templates for AI models, agents, tools, coding assistants, or product workflows, use `ai-prompt-engineer-master`.',
|
|
175
|
-
templateRelativePath: 'skills/ai-prompt-engineer-master/SKILL.md',
|
|
176
|
-
targetRelativePathsByAgent: {
|
|
177
|
-
codex: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
178
|
-
gemini: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
179
|
-
claude: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
180
|
-
windsurf: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
id: 'ux-expert',
|
|
185
|
-
name: 'UX Expert',
|
|
186
|
-
description: 'Install senior UX/UI guidance for UI-changing features, responsive layouts, flows, states, accessibility, and binding mockups',
|
|
187
|
-
routingInstruction: 'For UX/UI design after product definition for UI-changing features, use `ux-expert`; downstream design, planning, and implementation must treat `docs/features/<feature-slug>/ux.md` mockups as binding UI goals, not redesign targets.',
|
|
188
|
-
templateRelativePath: 'skills/ux-expert/SKILL.md',
|
|
189
|
-
targetRelativePathsByAgent: {
|
|
190
|
-
codex: '.agents/skills/ux-expert/SKILL.md',
|
|
191
|
-
gemini: '.agents/skills/ux-expert/SKILL.md',
|
|
192
|
-
claude: '.agents/skills/ux-expert/SKILL.md',
|
|
193
|
-
windsurf: '.agents/skills/ux-expert/SKILL.md',
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
];
|
|
197
|
-
export const SUPPORTED_AGENTS = [
|
|
198
|
-
{
|
|
199
|
-
id: 'codex',
|
|
200
|
-
name: 'Codex',
|
|
201
|
-
description: 'Create .codex/config.toml pointing Codex to AGENTS.md',
|
|
202
|
-
targetRelativePath: '.codex/config.toml',
|
|
203
|
-
templateRelativePath: '.codex/config.toml',
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
id: 'gemini',
|
|
207
|
-
name: 'Gemini',
|
|
208
|
-
description: 'Create GEMINI.md that delegates to AGENTS.md',
|
|
209
|
-
targetRelativePath: 'GEMINI.md',
|
|
210
|
-
templateRelativePath: 'GEMINI.md',
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
id: 'claude',
|
|
214
|
-
name: 'Claude',
|
|
215
|
-
description: 'Create CLAUDE.md that delegates to AGENTS.md',
|
|
216
|
-
targetRelativePath: 'CLAUDE.md',
|
|
217
|
-
templateRelativePath: 'CLAUDE.md',
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
id: 'windsurf',
|
|
221
|
-
name: 'Windsurf',
|
|
222
|
-
description: 'Use root AGENTS.md and shared .agents/skills/ discovery',
|
|
223
|
-
},
|
|
224
|
-
];
|
|
225
|
-
export function resolveSelectableSkillById(skillId) {
|
|
226
|
-
const languageSkill = SELECTABLE_LANGUAGE_SKILLS.find((skill) => skill.id === skillId);
|
|
227
|
-
if (languageSkill) {
|
|
228
|
-
return { ok: true, resolved: { kind: 'language', skill: languageSkill } };
|
|
229
|
-
}
|
|
230
|
-
const frameworkSkill = SELECTABLE_FRAMEWORK_SKILLS.find((skill) => skill.id === skillId);
|
|
231
|
-
if (frameworkSkill) {
|
|
232
|
-
return { ok: true, resolved: { kind: 'framework', skill: frameworkSkill } };
|
|
233
|
-
}
|
|
234
|
-
const architectureSkill = SELECTABLE_ARCHITECTURE_SKILLS.find((skill) => skill.id === skillId);
|
|
235
|
-
if (architectureSkill) {
|
|
236
|
-
return { ok: true, resolved: { kind: 'architecture', skill: architectureSkill } };
|
|
237
|
-
}
|
|
238
|
-
const workflowSkill = SELECTABLE_WORKFLOW_SKILLS.find((skill) => skill.id === skillId);
|
|
239
|
-
if (workflowSkill) {
|
|
240
|
-
return { ok: true, resolved: { kind: 'workflow', skill: workflowSkill } };
|
|
241
|
-
}
|
|
242
|
-
return { ok: false, message: `Unknown skill \`${skillId}\`. Run \`sibu skills list\` to see available skills.` };
|
|
243
|
-
}
|
|
244
|
-
function readPackageVersion() {
|
|
245
|
-
const packageJsonPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json');
|
|
246
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
247
|
-
if (!isPackageJsonWithVersion(packageJson)) {
|
|
248
|
-
throw new Error(`Could not read Sibu version from ${packageJsonPath}.`);
|
|
249
|
-
}
|
|
250
|
-
return packageJson.version;
|
|
251
|
-
}
|
|
252
|
-
function isPackageJsonWithVersion(value) {
|
|
253
|
-
return Boolean(value && typeof value === 'object' && typeof value.version === 'string');
|
|
254
|
-
}
|
package/bin/shared/paths.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import os from 'node:os';
|
|
2
1
|
import path from 'node:path';
|
|
3
2
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import {
|
|
3
|
+
import { STATE_RELATIVE_PATH } from './catalog.js';
|
|
5
4
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
5
|
const __dirname = path.dirname(__filename);
|
|
7
6
|
export function getProjectContext() {
|
|
@@ -29,13 +28,3 @@ export function getSideTemplatePath(rootPath, relativePath, templateVersion) {
|
|
|
29
28
|
const safeName = relativePath.replace(/[\\/]/g, '__');
|
|
30
29
|
return path.join(rootPath, '.sibu', 'sync', `${safeName}.template-v${templateVersion}`);
|
|
31
30
|
}
|
|
32
|
-
export function getSibuCacheRoot() {
|
|
33
|
-
const override = process.env[SIBU_CACHE_HOME_ENV]?.trim();
|
|
34
|
-
if (override) {
|
|
35
|
-
return path.resolve(override);
|
|
36
|
-
}
|
|
37
|
-
return path.join(os.homedir(), '.sibu');
|
|
38
|
-
}
|
|
39
|
-
export function getNpmVersionCachePath() {
|
|
40
|
-
return path.join(getSibuCacheRoot(), 'cache', 'npm-version.json');
|
|
41
|
-
}
|