@juancr11/sibu 0.5.3 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/bin/admin/changelog.js +155 -0
  2. package/bin/admin/release.js +217 -0
  3. package/bin/entrypoints/cli/create-program.js +1 -1
  4. package/bin/entrypoints/cli/execute-command.js +6 -6
  5. package/bin/modules/interactive-guidance/index.js +1 -0
  6. package/bin/{shared → modules/interactive-guidance}/prompts.js +1 -1
  7. package/bin/modules/maintainer-release-support/generate-changelog/changelog-format.js +213 -0
  8. package/bin/modules/maintainer-release-support/generate-changelog/changelog-writer.js +91 -0
  9. package/bin/modules/maintainer-release-support/generate-changelog/git-history.js +93 -0
  10. package/bin/modules/maintainer-release-support/generate-changelog/handler.js +167 -0
  11. package/bin/modules/maintainer-release-support/generate-changelog/semver.js +40 -0
  12. package/bin/modules/maintainer-release-support/index.js +2 -0
  13. package/bin/modules/maintainer-release-support/release-workflow/git-release.js +114 -0
  14. package/bin/modules/maintainer-release-support/release-workflow/handler.js +369 -0
  15. package/bin/modules/maintainer-release-support/release-workflow/package-json.js +181 -0
  16. package/bin/modules/maintainer-release-support/release-workflow/release-plan.js +87 -0
  17. package/bin/{features/init-project → modules/project-adoption}/handler.js +3 -3
  18. package/bin/modules/project-adoption/index.js +1 -0
  19. package/bin/modules/skill-selection-management/index.js +3 -0
  20. package/bin/{features → modules/skill-selection-management}/list-skills/handler.js +4 -4
  21. package/bin/{features → modules/skill-selection-management}/stop-managing-file/handler.js +9 -8
  22. package/bin/modules/skill-selection-management/use-skill/command.js +1 -0
  23. package/bin/{features → modules/skill-selection-management}/use-skill/handler.js +7 -6
  24. package/bin/{features/sync-project → modules/sync-review}/apply-action.js +3 -3
  25. package/bin/modules/sync-review/command.js +1 -0
  26. package/bin/{features/sync-project → modules/sync-review}/handler.js +4 -4
  27. package/bin/modules/sync-review/index.js +5 -0
  28. package/bin/{shared → modules/sync-review}/sync-preview.js +4 -4
  29. package/bin/modules/template-catalog-rendering/index.js +1 -0
  30. package/bin/modules/template-catalog-rendering/templates.js +60 -0
  31. package/bin/modules/version-advisory/index.js +1 -0
  32. package/bin/{shared → modules/version-advisory}/npm-version.js +29 -2
  33. package/bin/modules/workflow-health-diagnosis/command.js +1 -0
  34. package/bin/{features/doctor-project → modules/workflow-health-diagnosis}/handler.js +8 -7
  35. package/bin/modules/workflow-health-diagnosis/index.js +1 -0
  36. package/bin/modules/workflow-mutation-readiness/index.js +1 -0
  37. package/bin/{shared → modules/workflow-mutation-readiness}/workflow-mutation-readiness.js +3 -3
  38. package/bin/modules/workflow-state-registry/index.js +1 -0
  39. package/bin/{shared → modules/workflow-state-registry}/state.js +1 -1
  40. package/bin/modules/workflow-target-planning/catalog.js +233 -0
  41. package/bin/modules/workflow-target-planning/index.js +2 -0
  42. package/bin/modules/workflow-target-planning/workflow-targets.js +125 -0
  43. package/bin/shared/catalog.js +0 -244
  44. package/bin/shared/paths.js +1 -12
  45. package/bin/shared/workflow-targets.js +3 -2
  46. package/package.json +5 -3
  47. package/templates/AGENTS.md +4 -1
  48. package/templates/manifest.json +33 -22
  49. package/templates/skills/ai-implementation-plan-executor/SKILL.md +93 -51
  50. package/templates/skills/ai-implementation-planner/SKILL.md +52 -8
  51. package/templates/skills/architecture/command-pattern/SKILL.md +38 -16
  52. package/templates/skills/architecture/ddd-hexagonal/SKILL.md +19 -4
  53. package/templates/skills/deep-module-map-writer/SKILL.md +241 -0
  54. package/templates/skills/feature-brief-writer/SKILL.md +86 -13
  55. package/templates/skills/product-vision-writer/SKILL.md +25 -0
  56. package/templates/skills/scrum-master-planner/SKILL.md +29 -0
  57. package/templates/skills/technical-design-writer/SKILL.md +48 -5
  58. package/templates/skills/ux-expert/SKILL.md +28 -0
  59. package/bin/features/sync-project/preview.js +0 -1
  60. /package/bin/{features/doctor-project/command.js → modules/cli-command-surface/index.js} +0 -0
  61. /package/bin/{features/init-project → modules/maintainer-release-support/generate-changelog}/command.js +0 -0
  62. /package/bin/{features/list-skills → modules/maintainer-release-support/release-workflow}/command.js +0 -0
  63. /package/bin/{features/stop-managing-file → modules/project-adoption}/command.js +0 -0
  64. /package/bin/{features/sync-project → modules/skill-selection-management/list-skills}/command.js +0 -0
  65. /package/bin/{features/use-skill → modules/skill-selection-management/stop-managing-file}/command.js +0 -0
  66. /package/bin/{features/sync-project → modules/sync-review}/action-prompt.js +0 -0
  67. /package/bin/{features/sync-project → modules/sync-review}/log-preview.js +0 -0
@@ -0,0 +1,125 @@
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_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 getSelectedSkillTargetsForAgents(selectedAgents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = []) {
22
+ const skillTargets = new Map();
23
+ const selectedSkills = [
24
+ ...MANDATORY_SKILLS,
25
+ ...selectedLanguageSkills,
26
+ ...selectedFrameworkSkills,
27
+ ...(selectedArchitectureSkill ? [selectedArchitectureSkill] : []),
28
+ ...selectedWorkflowSkills,
29
+ ];
30
+ for (const agent of selectedAgents) {
31
+ for (const skill of selectedSkills) {
32
+ const targetRelativePath = skill.targetRelativePathsByAgent[agent.id];
33
+ if (!targetRelativePath) {
34
+ continue;
35
+ }
36
+ skillTargets.set(targetRelativePath, {
37
+ targetRelativePath,
38
+ templateRelativePath: skill.templateRelativePath,
39
+ });
40
+ }
41
+ }
42
+ return [...skillTargets.values()];
43
+ }
44
+ export function getWorkflowTargets(rootPath, selectedAgents, selectedLanguageSkills = [], selectedFrameworkSkills = [], selectedArchitectureSkill, selectedWorkflowSkills = []) {
45
+ return [
46
+ {
47
+ label: 'AGENTS.md',
48
+ targetPath: path.join(rootPath, 'AGENTS.md'),
49
+ templateRelativePath: 'AGENTS.md',
50
+ requiresProjectOverview: true,
51
+ },
52
+ ...selectedAgents.flatMap((agent) => {
53
+ if (!agent.targetRelativePath || !agent.templateRelativePath) {
54
+ return [];
55
+ }
56
+ return [
57
+ {
58
+ label: agent.targetRelativePath,
59
+ targetPath: path.join(rootPath, agent.targetRelativePath),
60
+ templateRelativePath: agent.templateRelativePath,
61
+ requiresProjectOverview: false,
62
+ },
63
+ ];
64
+ }),
65
+ ...getSelectedSkillTargetsForAgents(selectedAgents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills).map((skillTarget) => ({
66
+ label: skillTarget.targetRelativePath,
67
+ targetPath: path.join(rootPath, skillTarget.targetRelativePath),
68
+ templateRelativePath: skillTarget.templateRelativePath,
69
+ requiresProjectOverview: false,
70
+ })),
71
+ ];
72
+ }
73
+ export function renderMissingWorkflowFiles({ missingTargets, overview, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = [], }) {
74
+ return missingTargets.map((target) => {
75
+ let contents = readTemplate(target.templateRelativePath);
76
+ if (target.requiresProjectOverview) {
77
+ if (!overview?.trim()) {
78
+ throw new Error('Project overview is required to create AGENTS.md.');
79
+ }
80
+ contents = contents.replace('{{PROJECT_OVERVIEW}}', overview.trim());
81
+ }
82
+ contents = renderSkillRouting(contents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills);
83
+ return {
84
+ label: target.label,
85
+ targetPath: target.targetPath,
86
+ contents,
87
+ };
88
+ });
89
+ }
90
+ export function writeSibuState({ rootPath, statePath, selectedAgents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = [], targets, }) {
91
+ const previousState = readExistingState(statePath);
92
+ const now = new Date().toISOString();
93
+ const manifest = readTemplateManifest();
94
+ const state = {
95
+ sibuVersion: SIBU_VERSION,
96
+ templateVersion: manifest.templateVersion,
97
+ generatedAt: previousState?.generatedAt ?? now,
98
+ updatedAt: now,
99
+ selectedAgents: selectedAgents.map((agent) => agent.id),
100
+ selectedLanguageSkills: selectedLanguageSkills.map((skill) => skill.id),
101
+ selectedFrameworkSkills: selectedFrameworkSkills.map((skill) => skill.id),
102
+ selectedArchitectureSkill: selectedArchitectureSkill?.id,
103
+ selectedWorkflowSkills: selectedWorkflowSkills.map((skill) => skill.id),
104
+ managedFiles: Object.fromEntries(targets
105
+ .filter((target) => fs.existsSync(target.targetPath))
106
+ .map((target) => {
107
+ const relativePath = path.relative(rootPath, target.targetPath);
108
+ const previousManagedFile = previousState?.managedFiles[relativePath];
109
+ const nextManagedFile = {
110
+ template: target.templateRelativePath,
111
+ templateVersion: getTemplateVersion(manifest, target.templateRelativePath),
112
+ sha256: sha256(fs.readFileSync(target.targetPath, 'utf8')),
113
+ status: previousManagedFile?.status ?? 'managed',
114
+ lastReviewedTemplateVersion: previousManagedFile?.lastReviewedTemplateVersion,
115
+ reason: previousManagedFile?.reason,
116
+ };
117
+ return [relativePath, removeUndefinedFields(nextManagedFile)];
118
+ })),
119
+ };
120
+ fs.mkdirSync(path.dirname(statePath), { recursive: true });
121
+ fs.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`, 'utf8');
122
+ }
123
+ export function getSelectedAgentsFromState(state) {
124
+ return SUPPORTED_AGENTS.filter((agent) => state.selectedAgents.includes(agent.id));
125
+ }
@@ -1,245 +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/feature-brief-writer/SKILL.md',
32
- targetRelativePathsByAgent: {
33
- codex: '.agents/skills/feature-brief-writer/SKILL.md',
34
- gemini: '.agents/skills/feature-brief-writer/SKILL.md',
35
- claude: '.agents/skills/feature-brief-writer/SKILL.md',
36
- windsurf: '.agents/skills/feature-brief-writer/SKILL.md',
37
- },
38
- },
39
- {
40
- templateRelativePath: 'skills/technical-design-writer/SKILL.md',
41
- targetRelativePathsByAgent: {
42
- codex: '.agents/skills/technical-design-writer/SKILL.md',
43
- gemini: '.agents/skills/technical-design-writer/SKILL.md',
44
- claude: '.agents/skills/technical-design-writer/SKILL.md',
45
- windsurf: '.agents/skills/technical-design-writer/SKILL.md',
46
- },
47
- },
48
- {
49
- templateRelativePath: 'skills/scrum-master-planner/SKILL.md',
50
- targetRelativePathsByAgent: {
51
- codex: '.agents/skills/scrum-master-planner/SKILL.md',
52
- gemini: '.agents/skills/scrum-master-planner/SKILL.md',
53
- claude: '.agents/skills/scrum-master-planner/SKILL.md',
54
- windsurf: '.agents/skills/scrum-master-planner/SKILL.md',
55
- },
56
- },
57
- {
58
- templateRelativePath: 'skills/ai-implementation-planner/SKILL.md',
59
- targetRelativePathsByAgent: {
60
- codex: '.agents/skills/ai-implementation-planner/SKILL.md',
61
- gemini: '.agents/skills/ai-implementation-planner/SKILL.md',
62
- claude: '.agents/skills/ai-implementation-planner/SKILL.md',
63
- windsurf: '.agents/skills/ai-implementation-planner/SKILL.md',
64
- },
65
- },
66
- {
67
- templateRelativePath: 'skills/ai-implementation-plan-executor/SKILL.md',
68
- targetRelativePathsByAgent: {
69
- codex: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
70
- gemini: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
71
- claude: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
72
- windsurf: '.agents/skills/ai-implementation-plan-executor/SKILL.md',
73
- },
74
- },
75
- ];
76
- export const SELECTABLE_LANGUAGE_SKILLS = [
77
- {
78
- id: 'typescript',
79
- name: 'TypeScript',
80
- description: 'Install practical guidance for writing and modifying .ts and .tsx files',
81
- routingInstruction: 'For any task that changes `.ts` or `.tsx` files, also use `typescript`.',
82
- templateRelativePath: 'skills/typescript/SKILL.md',
83
- targetRelativePathsByAgent: {
84
- codex: '.agents/skills/typescript/SKILL.md',
85
- gemini: '.agents/skills/typescript/SKILL.md',
86
- claude: '.agents/skills/typescript/SKILL.md',
87
- windsurf: '.agents/skills/typescript/SKILL.md',
88
- },
89
- },
90
- {
91
- id: 'golang',
92
- name: 'Go',
93
- description: 'Install practical guidance for writing and modifying .go files',
94
- routingInstruction: 'For any task that changes `.go` files, also use `golang`.',
95
- templateRelativePath: 'skills/golang/SKILL.md',
96
- targetRelativePathsByAgent: {
97
- codex: '.agents/skills/golang/SKILL.md',
98
- gemini: '.agents/skills/golang/SKILL.md',
99
- claude: '.agents/skills/golang/SKILL.md',
100
- windsurf: '.agents/skills/golang/SKILL.md',
101
- },
102
- },
103
- ];
104
- export const SELECTABLE_FRAMEWORK_SKILLS = [
105
- {
106
- id: 'react',
107
- name: 'React',
108
- description: 'Install guidance for React components, props, state ownership, and component boundaries',
109
- routingInstruction: 'For React component changes involving responsibility, props, state ownership, or presentational/data-owning boundaries, use `react`.',
110
- templateRelativePath: 'skills/react/SKILL.md',
111
- targetRelativePathsByAgent: {
112
- codex: '.agents/skills/react/SKILL.md',
113
- gemini: '.agents/skills/react/SKILL.md',
114
- claude: '.agents/skills/react/SKILL.md',
115
- windsurf: '.agents/skills/react/SKILL.md',
116
- },
117
- },
118
- {
119
- id: 'nextjs',
120
- name: 'Next.js',
121
- description: 'Install guidance for Next.js App Router and framework-specific files',
122
- 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`.',
123
- templateRelativePath: 'skills/nextjs/SKILL.md',
124
- targetRelativePathsByAgent: {
125
- codex: '.agents/skills/nextjs/SKILL.md',
126
- gemini: '.agents/skills/nextjs/SKILL.md',
127
- claude: '.agents/skills/nextjs/SKILL.md',
128
- windsurf: '.agents/skills/nextjs/SKILL.md',
129
- },
130
- },
131
- ];
132
- export const SELECTABLE_ARCHITECTURE_SKILLS = [
133
- {
134
- id: 'ddd-hexagonal',
135
- name: 'DDD + Hexagonal Architecture',
136
- description: 'Install back-end architecture guidance for DDD, ports/adapters, and inward dependencies',
137
- routingInstruction: 'For backend features, refactors, bug fixes, persistence, external integrations, application/service boundaries, domain modeling, or architectural tradeoffs, use `ddd-hexagonal`.',
138
- templateRelativePath: 'skills/architecture/ddd-hexagonal/SKILL.md',
139
- targetRelativePathsByAgent: {
140
- codex: '.agents/skills/ddd-hexagonal/SKILL.md',
141
- gemini: '.agents/skills/ddd-hexagonal/SKILL.md',
142
- claude: '.agents/skills/ddd-hexagonal/SKILL.md',
143
- windsurf: '.agents/skills/ddd-hexagonal/SKILL.md',
144
- },
145
- },
146
- {
147
- id: 'command-pattern',
148
- name: 'Command Pattern',
149
- description: 'Install architecture guidance for structuring executable operations as commands and handlers',
150
- routingInstruction: 'For work that structures actions, workflows, command handlers, operation dispatch, request processing, or executable tasks, use `command-pattern`.',
151
- templateRelativePath: 'skills/architecture/command-pattern/SKILL.md',
152
- targetRelativePathsByAgent: {
153
- codex: '.agents/skills/command-pattern/SKILL.md',
154
- gemini: '.agents/skills/command-pattern/SKILL.md',
155
- claude: '.agents/skills/command-pattern/SKILL.md',
156
- windsurf: '.agents/skills/command-pattern/SKILL.md',
157
- },
158
- },
159
- ];
160
- export const SELECTABLE_WORKFLOW_SKILLS = [
161
- {
162
- id: 'ai-prompt-engineer-master',
163
- name: 'AI Prompt Engineer Master',
164
- description: 'Install guidance for creating, rewriting, optimizing, compressing, and evaluating AI prompts',
165
- 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`.',
166
- templateRelativePath: 'skills/ai-prompt-engineer-master/SKILL.md',
167
- targetRelativePathsByAgent: {
168
- codex: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
169
- gemini: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
170
- claude: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
171
- windsurf: '.agents/skills/ai-prompt-engineer-master/SKILL.md',
172
- },
173
- },
174
- {
175
- id: 'ux-expert',
176
- name: 'UX Expert',
177
- description: 'Install senior UX/UI guidance for UI-changing features, responsive layouts, flows, states, accessibility, and binding mockups',
178
- 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.',
179
- templateRelativePath: 'skills/ux-expert/SKILL.md',
180
- targetRelativePathsByAgent: {
181
- codex: '.agents/skills/ux-expert/SKILL.md',
182
- gemini: '.agents/skills/ux-expert/SKILL.md',
183
- claude: '.agents/skills/ux-expert/SKILL.md',
184
- windsurf: '.agents/skills/ux-expert/SKILL.md',
185
- },
186
- },
187
- ];
188
- export const SUPPORTED_AGENTS = [
189
- {
190
- id: 'codex',
191
- name: 'Codex',
192
- description: 'Create .codex/config.toml pointing Codex to AGENTS.md',
193
- targetRelativePath: '.codex/config.toml',
194
- templateRelativePath: '.codex/config.toml',
195
- },
196
- {
197
- id: 'gemini',
198
- name: 'Gemini',
199
- description: 'Create GEMINI.md that delegates to AGENTS.md',
200
- targetRelativePath: 'GEMINI.md',
201
- templateRelativePath: 'GEMINI.md',
202
- },
203
- {
204
- id: 'claude',
205
- name: 'Claude',
206
- description: 'Create CLAUDE.md that delegates to AGENTS.md',
207
- targetRelativePath: 'CLAUDE.md',
208
- templateRelativePath: 'CLAUDE.md',
209
- },
210
- {
211
- id: 'windsurf',
212
- name: 'Windsurf',
213
- description: 'Use root AGENTS.md and shared .agents/skills/ discovery',
214
- },
215
- ];
216
- export function resolveSelectableSkillById(skillId) {
217
- const languageSkill = SELECTABLE_LANGUAGE_SKILLS.find((skill) => skill.id === skillId);
218
- if (languageSkill) {
219
- return { ok: true, resolved: { kind: 'language', skill: languageSkill } };
220
- }
221
- const frameworkSkill = SELECTABLE_FRAMEWORK_SKILLS.find((skill) => skill.id === skillId);
222
- if (frameworkSkill) {
223
- return { ok: true, resolved: { kind: 'framework', skill: frameworkSkill } };
224
- }
225
- const architectureSkill = SELECTABLE_ARCHITECTURE_SKILLS.find((skill) => skill.id === skillId);
226
- if (architectureSkill) {
227
- return { ok: true, resolved: { kind: 'architecture', skill: architectureSkill } };
228
- }
229
- const workflowSkill = SELECTABLE_WORKFLOW_SKILLS.find((skill) => skill.id === skillId);
230
- if (workflowSkill) {
231
- return { ok: true, resolved: { kind: 'workflow', skill: workflowSkill } };
232
- }
233
- return { ok: false, message: `Unknown skill \`${skillId}\`. Run \`sibu skills list\` to see available skills.` };
234
- }
235
- function readPackageVersion() {
236
- const packageJsonPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'package.json');
237
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
238
- if (!isPackageJsonWithVersion(packageJson)) {
239
- throw new Error(`Could not read Sibu version from ${packageJsonPath}.`);
240
- }
241
- return packageJson.version;
242
- }
243
- function isPackageJsonWithVersion(value) {
244
- return Boolean(value && typeof value === 'object' && typeof value.version === 'string');
245
- }
@@ -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 { SIBU_CACHE_HOME_ENV, STATE_RELATIVE_PATH } from './catalog.js';
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
- }
@@ -1,10 +1,11 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
- import { SIBU_VERSION, MANDATORY_SKILLS, SELECTABLE_ARCHITECTURE_SKILLS, SELECTABLE_FRAMEWORK_SKILLS, SELECTABLE_LANGUAGE_SKILLS, SELECTABLE_WORKFLOW_SKILLS, SUPPORTED_AGENTS, } from './catalog.js';
3
+ import { SIBU_VERSION } from './catalog.js';
4
+ import { MANDATORY_SKILLS, SELECTABLE_ARCHITECTURE_SKILLS, SELECTABLE_FRAMEWORK_SKILLS, SELECTABLE_LANGUAGE_SKILLS, SELECTABLE_WORKFLOW_SKILLS, SUPPORTED_AGENTS, } from '../modules/workflow-target-planning/index.js';
4
5
  import { sha256 } from './hash.js';
5
6
  import { removeUndefinedFields } from './object.js';
6
7
  import { readExistingState } from './state.js';
7
- import { getTemplateVersion, readTemplate, readTemplateManifest, renderSkillRouting } from './templates.js';
8
+ import { getTemplateVersion, readTemplate, readTemplateManifest, renderSkillRouting } from '../modules/template-catalog-rendering/index.js';
8
9
  export function getSelectedLanguageSkillsFromState(state) {
9
10
  return SELECTABLE_LANGUAGE_SKILLS.filter((skill) => state.selectedLanguageSkills?.includes(skill.id));
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juancr11/sibu",
3
- "version": "0.5.3",
3
+ "version": "0.7.0",
4
4
  "description": "CLI for setting up a local AI-augmented development workflow.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,8 +16,10 @@
16
16
  "files": [
17
17
  "bin/sibu.js",
18
18
  "bin/entrypoints/",
19
- "bin/features/",
19
+ "bin/admin/",
20
+ "bin/modules/",
20
21
  "bin/shared/",
22
+ "!bin/shared/state.js",
21
23
  "!bin/**/*.test.js",
22
24
  "!bin/echo.js",
23
25
  "templates/",
@@ -32,7 +34,7 @@
32
34
  "dev:unlink": "pnpm unlink --global sibu",
33
35
  "prepack": "pnpm run build",
34
36
  "smoke:init": "node ./bin/sibu.js init",
35
- "test": "pnpm build && node --test bin/shared/catalog.test.js bin/shared/npm-version.test.js bin/shared/prompts.test.js bin/shared/workflow-targets.test.js bin/shared/workflow-mutation-readiness.test.js bin/admin/generate-changelog/handler.test.js bin/admin/release.test.js bin/admin/release-workflow/handler.test.js bin/admin/release-workflow/package-json.test.js bin/features/doctor-project/handler.test.js bin/features/use-skill/handler.test.js bin/features/stop-managing-file/handler.test.js",
37
+ "test": "pnpm build && node ./scripts/run-tests.mjs",
36
38
  "validate:packed-runtime": "node ./scripts/validate-packed-cli-runtime.mjs",
37
39
  "validate:doctor-version-advisory": "pnpm build && node ./scripts/validate-doctor-version-advisory.mjs",
38
40
  "validate:post-update-doctor-drift": "pnpm build && node ./scripts/validate-post-update-doctor-drift.mjs",
@@ -36,9 +36,12 @@ Keep responses concise by default, but spend the context needed for correctness,
36
36
 
37
37
  ## Skill routing
38
38
 
39
+ For planned product/feature work, use this pipeline: product vision -> deep module map -> feature brief -> technical design -> optional UX -> epics/stories -> AI implementation plan -> AI executor. Narrow code fixes and small local changes do not require the full pipeline unless product scope, module ownership, or architecture direction is unclear.
40
+
39
41
  - For any code-writing task, use `clean-code`.
40
42
  - For requests to create, revise, or clarify a product vision, product strategy narrative, product north star, positioning, product principles, product voice, target user definition, product boundaries, or success signals, use `product-vision-writer`.
41
- - For requests to create, revise, or clarify a business-level feature brief, feature definition, feature scope, MVP feature boundaries, business acceptance criteria, or product-level feature rationale, use `feature-brief-writer`.
43
+ - For requests to create, revise, or clarify a Deep Module Map, deep, complexity-hiding implementation modules, module boundaries, suggested implementation modules, or `docs/deep-module-map.md`, use `deep-module-map-writer`.
44
+ - For requests to create, revise, or clarify a business-level feature brief after Deep Module Map work, feature definition, feature scope, MVP feature boundaries, business acceptance criteria, or product-level feature rationale, use `feature-brief-writer`.
42
45
  - For requests to create, revise, or clarify a technical design, implementation-oriented design doc, architecture approach, technical tradeoffs, technical risks, or implementation plan for an approved feature, use `technical-design-writer`.
43
46
  - For requests to create Epics, User Stories, Scrum planning artifacts, backlog slices, or delivery plans from an approved feature brief and technical design, use `scrum-master-planner`.
44
47
  - For requests to turn a specific User Story into an implementation checklist, coding plan, step-by-step execution plan, or baby-step plan, use `ai-implementation-planner`.
@@ -1,11 +1,11 @@
1
1
  {
2
- "templateVersion": "55",
2
+ "templateVersion": "69",
3
3
  "templates": {
4
4
  "AGENTS.md": {
5
- "version": "22",
5
+ "version": "25",
6
6
  "description": "Project-level agent instructions and Sibu maintenance guidance.",
7
7
  "changes": [
8
- "Adds concise context-budget discipline so agents prefer narrow reads, summarize large outputs, and preserve quality over token savings."
8
+ "Clarifies Deep Module routing as complexity-hiding implementation module planning."
9
9
  ]
10
10
  },
11
11
  ".codex/config.toml": {
@@ -38,24 +38,32 @@
38
38
  ]
39
39
  },
40
40
  "skills/product-vision-writer/SKILL.md": {
41
- "version": "5",
41
+ "version": "7",
42
42
  "description": "Mandatory product vision writer skill installed once at the shared .agents/skills workspace path.",
43
43
  "changes": [
44
- "Strengthens final response rules so saved product visions report only the path unless inline review is explicitly requested."
44
+ "Updates downstream artifact wording to use Deep Module Map."
45
+ ]
46
+ },
47
+ "skills/deep-module-map-writer/SKILL.md": {
48
+ "version": "2",
49
+ "description": "Mandatory Deep Module Map writer skill installed once at the shared .agents/skills workspace path.",
50
+ "changes": [
51
+ "Clarifies that Deep Modules are primarily technical design boundaries that hide substantial implementation complexity behind simple interfaces.",
52
+ "Strengthens the interview flow so agents ask focused one-at-a-time questions until module interfaces, hidden complexity, and boundaries are defensible."
45
53
  ]
46
54
  },
47
55
  "skills/feature-brief-writer/SKILL.md": {
48
- "version": "4",
56
+ "version": "8",
49
57
  "description": "Mandatory feature brief writer skill installed once at the shared .agents/skills workspace path.",
50
58
  "changes": [
51
- "Strengthens final response rules so saved feature briefs report only the path unless inline review is explicitly requested."
59
+ "Updates feature brief guidance to require Deep Modules from docs/deep-module-map.md."
52
60
  ]
53
61
  },
54
62
  "skills/technical-design-writer/SKILL.md": {
55
- "version": "12",
63
+ "version": "15",
56
64
  "description": "Mandatory technical design writer skill installed once at the shared .agents/skills workspace path.",
57
65
  "changes": [
58
- "Strengthens final response rules so saved technical designs report only the path and never include excerpts unless inline review is explicitly requested."
66
+ "Updates technical design guidance to translate selected Deep Modules into implementation boundaries."
59
67
  ]
60
68
  },
61
69
  "skills/typescript/SKILL.md": {
@@ -73,17 +81,17 @@
73
81
  ]
74
82
  },
75
83
  "skills/architecture/ddd-hexagonal/SKILL.md": {
76
- "version": "1",
84
+ "version": "4",
77
85
  "description": "Selectable back-end architecture skill for DDD and Hexagonal Architecture.",
78
86
  "changes": [
79
- "Adds an optional DDD + Hexagonal Architecture skill for projects that want opinionated back-end architecture guidance."
87
+ "Clarifies that Deep Modules hide implementation complexity behind small interfaces and are not product categories by themselves."
80
88
  ]
81
89
  },
82
90
  "skills/architecture/command-pattern/SKILL.md": {
83
- "version": "2",
91
+ "version": "5",
84
92
  "description": "Selectable architecture skill for command-oriented vertical slices using Command Pattern, Hexagonal Architecture, and DDD principles.",
85
93
  "changes": [
86
- "Reframes Command Pattern guidance around command-oriented vertical slices, feature-local ports, thin entrypoints, and infrastructure adapters."
94
+ "Clarifies that Deep Modules hide implementation complexity behind small interfaces and are not product categories by themselves."
87
95
  ]
88
96
  },
89
97
  "skills/nextjs/SKILL.md": {
@@ -101,24 +109,27 @@
101
109
  ]
102
110
  },
103
111
  "skills/scrum-master-planner/SKILL.md": {
104
- "version": "5",
112
+ "version": "7",
105
113
  "description": "Mandatory Scrum planner skill for creating pragmatic Epics and User Stories from approved feature and technical design docs.",
106
114
  "changes": [
107
- "Strengthens final response rules so generated Epics and Stories are summarized by paths and counts, not pasted inline unless explicitly requested."
115
+ "Updates Scrum planning guidance to preserve Deep Module implementation boundaries from technical designs."
108
116
  ]
109
117
  },
110
118
  "skills/ai-implementation-planner/SKILL.md": {
111
- "version": "7",
119
+ "version": "11",
112
120
  "description": "Mandatory AI implementation planner skill for turning one approved User Story into small, story-local implementation step files.",
113
121
  "changes": [
114
- "Strengthens final response rules so generated implementation step files are listed by path, not pasted inline unless explicitly requested."
122
+ "Adds a plan review gate so newly created implementation plans wait for user approval before execution.",
123
+ "Clarifies that next-story planning handoffs from the executor must stop after planning and wait for approval."
115
124
  ]
116
125
  },
117
126
  "skills/ai-implementation-plan-executor/SKILL.md": {
118
- "version": "12",
119
- "description": "Mandatory AI implementation plan executor skill for implementing existing story implementation plans one reviewed step at a time.",
127
+ "version": "16",
128
+ "description": "Mandatory AI implementation plan executor skill for implementing full story plans before story-level review and commit.",
120
129
  "changes": [
121
- "Clarifies focused approved-step commits and validation-only step reporting."
130
+ "Changes execution from per-step approval to full-story execution followed by one story-level review gate.",
131
+ "Marks all completed steps approved and commits once after the completed story is approved.",
132
+ "Continues Epics automatically by implementing the next planned story or planning the next unplanned story and waiting for plan approval."
122
133
  ]
123
134
  },
124
135
  "skills/ai-prompt-engineer-master/SKILL.md": {
@@ -129,10 +140,10 @@
129
140
  ]
130
141
  },
131
142
  "skills/ux-expert/SKILL.md": {
132
- "version": "4",
143
+ "version": "6",
133
144
  "description": "Selectable UX expert skill for UI-changing features, responsive design, flows, states, accessibility, and binding mockups.",
134
145
  "changes": [
135
- "Strengthens final response rules so saved UX specs report only the path and never include mockups or excerpts unless inline review is explicitly requested."
146
+ "Updates boundary wording to use Deep Module Maps."
136
147
  ]
137
148
  }
138
149
  }