@juancr11/sibu 0.13.1 → 0.14.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.
@@ -1,11 +1,11 @@
1
1
  {
2
- "templateVersion": "97",
2
+ "templateVersion": "103",
3
3
  "templates": {
4
4
  "AGENTS.md": {
5
- "version": "29",
5
+ "version": "30",
6
6
  "description": "Project-level agent instructions and Sibu maintenance guidance.",
7
7
  "changes": [
8
- "Can render Layered Architecture routing when that architecture option is selected."
8
+ "Routes rough future idea capture requests to the mandatory feature-idea-capture skill."
9
9
  ]
10
10
  },
11
11
  ".codex/config.toml": {
@@ -65,17 +65,17 @@
65
65
  ]
66
66
  },
67
67
  "skills/feature-brief-writer/SKILL.md": {
68
- "version": "10",
68
+ "version": "13",
69
69
  "description": "Mandatory feature brief writer skill installed once at the shared .agents/skills workspace path.",
70
70
  "changes": [
71
- "Adds optional Notion export guidance after local feature briefs are written while keeping Markdown as the canonical artifact."
71
+ "Keeps feature brief writing focused on local Markdown artifacts and moves Notion export workflow guidance to dedicated exporter skills."
72
72
  ]
73
73
  },
74
74
  "skills/technical-design-writer/SKILL.md": {
75
- "version": "18",
75
+ "version": "19",
76
76
  "description": "Mandatory technical design writer skill installed once at the shared .agents/skills workspace path.",
77
77
  "changes": [
78
- "Strengthens technical design interviews to resolve material implementation questions before drafting and replaces open questions with risks/tradeoffs."
78
+ "Keeps technical design writing focused on local Markdown artifacts and moves Notion export workflow guidance to dedicated exporter skills."
79
79
  ]
80
80
  },
81
81
  "skills/typescript/SKILL.md": {
@@ -121,17 +121,17 @@
121
121
  ]
122
122
  },
123
123
  "skills/react/SKILL.md": {
124
- "version": "2",
124
+ "version": "3",
125
125
  "description": "Selectable React skill for component design, props, state ownership, and presentational boundaries.",
126
126
  "changes": [
127
- "Strengthens React component guidance around Single Responsibility Principle splits, stateless versus stateful boundaries, and one component per file by default."
127
+ "Adds broadly applicable React screen componentization guidance so route and feature entry files stay thin while meaningful UI regions move into focused nearby files."
128
128
  ]
129
129
  },
130
130
  "skills/scrum-master-planner/SKILL.md": {
131
- "version": "11",
131
+ "version": "12",
132
132
  "description": "Mandatory Scrum planner skill for creating pragmatic Epics and User Stories from approved feature and technical design docs.",
133
133
  "changes": [
134
- "Clarifies that User Stories should be deployable increments that can be merged safely on their own, even when gated or incomplete until the parent Epic is done."
134
+ "Keeps Scrum planning focused on local Epic and User Story artifacts and moves GitHub export workflow guidance to dedicated exporter skills."
135
135
  ]
136
136
  },
137
137
  "skills/ai-implementation-planner/SKILL.md": {
@@ -148,6 +148,13 @@
148
148
  "Clarifies that story and Epic planning requests are confirmation for executor implementation."
149
149
  ]
150
150
  },
151
+ "skills/feature-idea-capture/SKILL.md": {
152
+ "version": "1",
153
+ "description": "Mandatory feature idea capture skill for storing rough future ideas in docs/feature-ideas.md only when the skill is used.",
154
+ "changes": [
155
+ "Adds a mandatory feature idea capture skill for quick, raw idea storage without backlog or planning ceremony."
156
+ ]
157
+ },
151
158
  "skills/ai-prompt-engineer-master/SKILL.md": {
152
159
  "version": "2",
153
160
  "description": "Selectable AI prompt engineering skill for prompt creation, optimization, compression, and evaluation.",
@@ -156,10 +163,10 @@
156
163
  ]
157
164
  },
158
165
  "skills/ux-expert/SKILL.md": {
159
- "version": "8",
166
+ "version": "9",
160
167
  "description": "Selectable UX expert skill for UI-changing features, responsive design, flows, states, accessibility, and binding mockups.",
161
168
  "changes": [
162
- "Strengthens UX interviews to resolve material experience questions before drafting and replaces open UX questions with risks/tradeoffs."
169
+ "Keeps UX design writing focused on local Markdown artifacts and moves Notion export workflow guidance to dedicated exporter skills."
163
170
  ]
164
171
  },
165
172
  "skills/architecture/layered-architecture/SKILL.md": {
@@ -168,6 +175,20 @@
168
175
  "changes": [
169
176
  "Adds a Layered Architecture skill for smaller apps that need simple separation of concerns."
170
177
  ]
178
+ },
179
+ "skills/export-to-github/SKILL.md": {
180
+ "version": "1",
181
+ "description": "Selectable GitHub export skill for publishing a named feature's Epics and User Stories to GitHub issues and native sub-issues.",
182
+ "changes": [
183
+ "Adds a dedicated GitHub exporter skill paired with GitHub MCP selection."
184
+ ]
185
+ },
186
+ "skills/export-to-notion/SKILL.md": {
187
+ "version": "1",
188
+ "description": "Selectable Notion export skill for publishing a named feature's core documentation files to Notion.",
189
+ "changes": [
190
+ "Adds a dedicated Notion exporter skill paired with Notion MCP selection."
191
+ ]
171
192
  }
172
193
  }
173
194
  }
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: export-to-github
3
+ description: Export a named feature's Epics and User Stories from local Markdown to GitHub issues and native sub-issues using configured GitHub MCP capabilities.
4
+ ---
5
+
6
+ # Export to GitHub
7
+
8
+ Use this skill when the user asks to export a feature's Epics and User Stories to GitHub.
9
+
10
+ ## Required input
11
+
12
+ - A feature name or feature slug.
13
+ - Local planning artifacts under `docs/features/<feature-slug>/epics/`.
14
+ - Configured GitHub MCP capabilities for issue creation, issue ID access, and native sub-issue mutation.
15
+
16
+ If the feature name is ambiguous, inspect `docs/features/` and ask one focused clarification question.
17
+
18
+ ## Workflow
19
+
20
+ 1. Resolve the feature slug from the user's feature name.
21
+ 2. Read the feature's Epic briefs and User Story Markdown files under `docs/features/<feature-slug>/epics/**`.
22
+ 3. Resolve the target repository from the current local repo's GitHub `origin` remote only. Do not ask for or use another repository.
23
+ 4. Verify GitHub MCP can create issues, return issue IDs, and attach native sub-issues.
24
+ 5. Ask one explicit opt-in question before any GitHub mutation.
25
+ 6. If the user accepts, create a fresh issue set every time:
26
+ - one issue per Epic, with no labels
27
+ - one issue per User Story, with no labels
28
+ - each User Story issue attached as a native sub-issue of its parent Epic issue
29
+ 7. Report created issue numbers or URLs.
30
+
31
+ ## Export rules
32
+
33
+ - Keep issue bodies concise and source-grounded.
34
+ - Include the source local doc path and relevant summary, scope, acceptance criteria, or validation notes.
35
+ - Preserve each created User Story issue's GitHub issue `id`; native sub-issue APIs need the child issue ID, not only its issue number.
36
+ - Do not search for duplicates or update existing issues.
37
+ - Do not use labels, milestones, projects, assignees, status tracking, Markdown checklists, or loose links as a substitute for native sub-issues.
38
+ - Do not modify local Markdown files with GitHub URLs.
39
+ - If issue creation, issue ID access, or native sub-issue attachment is unavailable, fail clearly and do not fall back to another structure.
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: export-to-notion
3
+ description: Export a named feature's local feature brief, UX design, and technical design Markdown files to Notion using configured Notion MCP capabilities.
4
+ ---
5
+
6
+ # Export to Notion
7
+
8
+ Use this skill when the user asks to export a feature's core documentation to Notion.
9
+
10
+ ## Required input
11
+
12
+ - A feature name or feature slug.
13
+ - Configured Notion MCP capabilities.
14
+ - `.sibu/state.json` with `mcpServerConfigs.notion.docsParentPage` when available.
15
+
16
+ If the feature name is ambiguous, inspect `docs/features/` and ask one focused clarification question.
17
+
18
+ ## Source files
19
+
20
+ Export only these local Markdown files when present:
21
+
22
+ ```txt
23
+ docs/features/<feature-slug>/feature_brief.md
24
+ docs/features/<feature-slug>/ux.md
25
+ docs/features/<feature-slug>/technical_design.md
26
+ ```
27
+
28
+ Do not export Epics, User Stories, implementation plans, product vision, Deep Module Maps, or arbitrary docs with this skill.
29
+
30
+ ## Notion destination
31
+
32
+ Use this organization under the configured Notion docs parent page:
33
+
34
+ ```txt
35
+ <docsParentPage>
36
+ └── <repo name>
37
+ └── Features
38
+ └── <feature name>
39
+ ├── Feature Brief
40
+ ├── UX Design
41
+ └── Technical Design
42
+ ```
43
+
44
+ ## Workflow
45
+
46
+ 1. Resolve the feature slug from the user's feature name.
47
+ 2. Read `.sibu/state.json` when available and use `mcpServerConfigs.notion.docsParentPage` as the destination parent.
48
+ 3. Confirm which of the allowed source files exist.
49
+ 4. Ask one explicit opt-in question before creating or modifying Notion pages.
50
+ 5. Create or reuse the repo, Features, and feature organization pages under the configured parent.
51
+ 6. Export each existing allowed artifact to its matching Notion page.
52
+ 7. Report export success or failure per artifact.
53
+
54
+ ## Export rules
55
+
56
+ - Local Markdown remains canonical.
57
+ - Do not write Notion URLs back into local Markdown.
58
+ - Do not invent missing source artifacts.
59
+ - Do not export files outside the allowed source list.
60
+ - If Notion MCP capabilities or destination configuration are unavailable, fail clearly and explain what is missing.
@@ -95,6 +95,17 @@ Use a short kebab-case feature slug that matches the feature name. Keep all arti
95
95
 
96
96
  Do not write the brief to technical design, UX, user story, implementation plan, or backlog files unless the user explicitly asks for a separate artifact after the feature brief exists.
97
97
 
98
+ ## Raw idea sources
99
+
100
+ If the user asks for a feature brief from an idea in `docs/feature-ideas.md`, read the relevant idea and treat it as raw/vague input only.
101
+
102
+ - Do not skip the normal interview flow because the idea exists in a file.
103
+ - Use the idea as a seed for the first discovery question, not as complete feature intent.
104
+ - Keep asking one focused question at a time until the usual required context is resolved: problem, target user/scenario, business goal, MVP boundary, out-of-scope boundary, success signals, constraints, and Deep Module fit.
105
+ - Preserve the hard-start requirements for `docs/product-vision.md` and `docs/deep-module-map.md`.
106
+ - After the local `docs/features/<feature-slug>/feature_brief.md` file is successfully written, remove the promoted idea from `docs/feature-ideas.md` while preserving the rest of the file.
107
+ - Do not delete the idea before the feature brief file exists, and do not remove unrelated ideas or headings.
108
+
98
109
  ## Interview posture
99
110
 
100
111
  Be deliberately interrogative before drafting. The feature brief should reflect the user's intent, not the assistant's assumptions.
@@ -283,31 +294,6 @@ When shaping a feature brief, prefer:
283
294
  7. measurable success signals
284
295
  8. non-technical acceptance criteria
285
296
 
286
- ## Optional Notion export after local write
287
-
288
- After the local Markdown file is written successfully, optionally offer Notion export. Local Markdown remains the canonical pipeline artifact and Notion is only a convenience export destination.
289
-
290
- 1. Do not check Notion export before the local file exists.
291
- 2. After writing the local file, read `.sibu/state.json` if available.
292
- 3. Offer export only when all are true:
293
- - `selectedMcpServers` includes `notion`
294
- - `mcpServerConfigs.notion.docsParentPage` is present
295
- - Notion MCP tools are available in the current agent session
296
- 4. If export is unavailable, do nothing else and finish with the normal local path response.
297
- 5. If export is available, ask for explicit opt-in before creating or modifying any Notion page.
298
- 6. If the user declines, do nothing else.
299
- 7. If the user accepts, create or reuse Notion organization pages under the configured parent page:
300
-
301
- ```txt
302
- <docsParentPage>
303
- └── <repo name>
304
- └── Features
305
- └── <feature name>
306
- └── Feature Brief
307
- ```
308
-
309
- Create a new document page for the just-written artifact content. Do not write Notion URLs back into local Markdown. Report Notion export success or a clear Notion export failure, while preserving the local file as the completed artifact either way.
310
-
311
297
  ## Final response behavior
312
298
 
313
299
  After writing the file, final-answer with only the path created or updated. Do not paste the feature brief body, excerpt, outline, or section summaries.
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: feature-idea-capture
3
+ description: Use when the user wants to capture, save, jot down, or add a rough future feature, product, workflow, or improvement idea without turning it into a backlog item, feature brief, or implementation task.
4
+ ---
5
+
6
+ # Feature Idea Capture
7
+
8
+ Capture rough future ideas quickly in `docs/feature-ideas.md`.
9
+
10
+ ## Behavior
11
+
12
+ - Write the idea down directly. Do not interview the user before capture.
13
+ - Keep the idea intentionally raw: a short heading and a few bullets are enough.
14
+ - If `docs/feature-ideas.md` does not exist, create it on first use.
15
+ - Append new ideas; do not classify, prioritize, groom, or turn them into backlog work.
16
+ - Do not create feature briefs, epics, stories, implementation plans, or code from captured ideas unless the user separately asks for that later.
17
+ - Do not migrate, rename, inspect, or reconcile pre-existing alternate idea files.
18
+
19
+ ## File shape
20
+
21
+ Use this lightweight shape:
22
+
23
+ ```md
24
+ # Feature Ideas
25
+
26
+ ## <Idea title>
27
+
28
+ - <Short note>
29
+ - <Short note>
30
+ ```
31
+
32
+ If the file already exists, preserve its current content and append the new idea using the same simple style.
@@ -13,6 +13,8 @@ This skill covers React componentization, component responsibility, state owners
13
13
 
14
14
  - creating or editing React components
15
15
  - splitting large components
16
+ - constructing or refactoring page-level UI from smaller route-local components
17
+ - deciding when a page file should delegate sections, repeated items, panels, overlays, menus, states, and formatting helpers to focused files
16
18
  - deciding where state should live
17
19
  - separating presentational components from server-interacting or data-owning components
18
20
  - reviewing component responsibility and prop design
@@ -68,15 +70,61 @@ This skill covers React componentization, component responsibility, state owners
68
70
  - Each component should live in its own file by default; do not define multiple components in the same file just because they are currently small.
69
71
  - If a helper component is only temporary, promote it to its own file as soon as it represents a meaningful UI responsibility.
70
72
 
73
+ ### 9. Build screens as composition roots, not component dumping grounds
74
+ - Treat page-level components, route-level containers, and major feature components as composition roots: they should assemble focused child components, not define every section, repeated item, overlay, menu, state, helper, and interaction inline.
75
+ - A top-level screen component may own data loading, high-level layout, route states, and wiring, but should delegate meaningful UI regions to named components.
76
+ - If a UI region has its own state, interaction, repeated rendering, overlay, menu, empty/error/loading state, or domain formatting concern, strongly prefer extracting it to a focused nearby file.
77
+ - Keep route entry files especially thin: they should fetch or prepare data, handle route-level states, and compose the screen. Avoid placing substantial presentational or interactive subcomponents directly inside them.
78
+ - Route-local or feature-local components are good defaults for UI that belongs to one screen or feature. Shared components should be extracted only when reuse is real, not speculative.
79
+
80
+ ## File splitting triggers
81
+
82
+ When editing a React page, route container, or major component, extract a separate component or helper file when any of these are true:
83
+
84
+ - The file defines more than one meaningful UI responsibility, such as a container plus repeated item plus action surface plus state view.
85
+ - A nested component has a product/UI name a user, designer, or teammate would recognize.
86
+ - A UI region owns local state, submission or mutation behavior, pending/optimistic feedback, validation, confirmation, or recovery behavior.
87
+ - A component renders a repeated unit, such as a row, card, list item, tile, timeline entry, tab panel, or menu group.
88
+ - A component represents an empty state, error state, no-results state, loading state, permission state, or other named screen state.
89
+ - A helper formats domain-visible values, such as money, dates, percentages, names, quantities, labels, or statuses, and is used by more than one component.
90
+ - The parent component becomes hard to scan in one pass or requires scrolling through implementation details to understand the screen structure.
91
+
92
+ Prefer nearby files first, using names from the product or UI. For example:
93
+
94
+ ```txt
95
+ page.tsx
96
+ feature-shell.tsx
97
+ feature-summary.tsx
98
+ feature-list.tsx
99
+ feature-item.tsx
100
+ feature-actions.tsx
101
+ feature-state.tsx
102
+ feature-format.ts
103
+ feature-types.ts
104
+ ```
105
+
71
106
  ## Decision rule
72
107
 
73
108
  When unsure, prefer:
74
- 1. one clear responsibility per component
75
- 2. more focused components instead of fewer overloaded components
76
- 3. one component per file by default
77
- 4. stateless presentational components that render from props
78
- 5. stateful components only where local interaction state is genuinely owned
79
- 6. data/server interaction in obvious owner components
80
- 7. local state unless coordination requires lifting it
81
- 8. composition over flag-heavy component APIs
82
- 9. no duplicated derived state
109
+ 1. route entry files as thin composition roots
110
+ 2. route-level or feature-level containers that own only the interaction state they coordinate
111
+ 3. one clear responsibility per component
112
+ 4. more focused components instead of fewer overloaded components
113
+ 5. one meaningful component per file by default
114
+ 6. nearby component files before shared abstractions
115
+ 7. stateless presentational components that render from props
116
+ 8. stateful components only where local interaction state is genuinely owned
117
+ 9. data/server interaction in obvious owner components
118
+ 10. local state unless coordination requires lifting it
119
+ 11. composition over flag-heavy component APIs
120
+ 12. no duplicated derived state
121
+
122
+ ## Componentization self-review
123
+
124
+ Before finishing a React change, ask:
125
+
126
+ - Can I understand the screen structure from the top-level file without reading repeated item, action surface, overlay, state, or formatting internals?
127
+ - Are meaningful UI regions and repeated units in named components?
128
+ - Does each file have one obvious reason to change?
129
+ - Are server/client boundaries still as small as practical?
130
+ - Did I avoid creating shared abstractions before there is real reuse?
@@ -213,37 +213,6 @@ Before finishing, verify:
213
213
  - no Story adds scope that is absent from the feature brief or technical design
214
214
  - acceptance criteria are testable enough for a reviewer
215
215
 
216
- ### 6. Mandatory GitHub export gate
217
-
218
- After all local Epic and User Story files are written, you must run the GitHub export gate before the final response. This gate is mandatory whenever Scrum planning creates or updates local Epic or User Story files.
219
-
220
- Do not skip the gate because the user did not mention GitHub. Do not assume GitHub MCP is unavailable. Explicitly check whether GitHub MCP tools are available for issue creation, issue ID access, and native sub-issue mutation.
221
-
222
- If any required GitHub MCP capability is unavailable, do not offer GitHub export. In the final response, include a single concise note that GitHub export was skipped because the required GitHub MCP capabilities were unavailable.
223
-
224
- If the required GitHub MCP capabilities are available:
225
-
226
- 1. Resolve the target repository from the current local repo's GitHub `origin` remote only. Do not ask for or use another repository.
227
- 2. Ask one explicit opt-in question before any GitHub mutation: "GitHub MCP is available. Create GitHub Issues for these Epics and User Stories in the current repo?"
228
- 3. If the user declines, perform no GitHub mutation.
229
- 4. If the user accepts, create a fresh issue set every time. Do not search for duplicates or update existing issues.
230
- 5. Create one issue per Epic with no labels.
231
- 6. Create one issue per User Story with no labels.
232
- 7. Attach each User Story issue as a native GitHub sub-issue of its parent Epic issue.
233
- 8. Report created issue numbers or URLs.
234
-
235
- Keep issue bodies concise and source-grounded. Include the source local doc path and relevant summary, scope, acceptance criteria, or validation notes. Do not modify local Markdown files with GitHub URLs.
236
-
237
- Native sub-issues are required for this export. Preserve each created User Story issue's GitHub issue `id` because native sub-issue APIs need the child issue ID, not only its issue number. If issue creation, issue ID access, or native sub-issue attachment fails or is unavailable, fail clearly and do not fall back to labels, Markdown checklists, loose links, GitHub Projects, milestones, assignees, or status tracking.
238
-
239
- Passing the gate means exactly one of these outcomes occurred:
240
-
241
- - GitHub MCP was unavailable or incomplete, and the final response says export was skipped for that reason.
242
- - GitHub MCP was available, the user declined export, and no GitHub mutation occurred.
243
- - GitHub MCP was available, the user accepted export, and the created issue numbers or URLs are reported.
244
-
245
- Never finish a Scrum planning run without one of these three GitHub export outcomes.
246
-
247
216
  ## Final response behavior
248
217
 
249
218
  After writing files, final-answer with only:
@@ -251,6 +220,5 @@ After writing files, final-answer with only:
251
220
  - the Epic directories created or updated
252
221
  - the number of Epics and User Stories
253
222
  - any source-scope items intentionally left unresolved or captured as risks
254
- - the GitHub export gate outcome
255
223
 
256
224
  Do not paste artifact bodies, excerpts, outlines, story text, acceptance criteria, or section summaries. Only include generated artifacts when the user explicitly asks for inline review in the current request.
@@ -173,31 +173,6 @@ Use this structure as a starting point. Delete sections that do not add value.
173
173
 
174
174
  A good technical design is short, specific, and useful. It should not try to be the product brief, architecture skill, clean-code skill, implementation plan, or ticket backlog.
175
175
 
176
- ## Optional Notion export after local write
177
-
178
- After the local Markdown file is written successfully, optionally offer Notion export. Local Markdown remains the canonical pipeline artifact and Notion is only a convenience export destination.
179
-
180
- 1. Do not check Notion export before the local file exists.
181
- 2. After writing the local file, read `.sibu/state.json` if available.
182
- 3. Offer export only when all are true:
183
- - `selectedMcpServers` includes `notion`
184
- - `mcpServerConfigs.notion.docsParentPage` is present
185
- - Notion MCP tools are available in the current agent session
186
- 4. If export is unavailable, do nothing else and finish with the normal local path response.
187
- 5. If export is available, ask for explicit opt-in before creating or modifying any Notion page.
188
- 6. If the user declines, do nothing else.
189
- 7. If the user accepts, create or reuse Notion organization pages under the configured parent page:
190
-
191
- ```txt
192
- <docsParentPage>
193
- └── <repo name>
194
- └── Features
195
- └── <feature name>
196
- └── Technical Design
197
- ```
198
-
199
- Create a new document page for the just-written artifact content. Do not write Notion URLs back into local Markdown. Report Notion export success or a clear Notion export failure, while preserving the local file as the completed artifact either way.
200
-
201
176
  ## Final response behavior
202
177
 
203
178
  After writing the file, final-answer with only the path created or updated. Do not paste the technical design body, excerpt, outline, or section summaries.
@@ -133,31 +133,6 @@ Use only helpful sections from this shape:
133
133
 
134
134
  The Binding Mockups section is authoritative for downstream work unless this UX spec is revised.
135
135
 
136
- ## Optional Notion export after local write
137
-
138
- After the local Markdown file is written successfully, optionally offer Notion export. Local Markdown remains the canonical pipeline artifact and Notion is only a convenience export destination.
139
-
140
- 1. Do not check Notion export before the local file exists.
141
- 2. After writing the local file, read `.sibu/state.json` if available.
142
- 3. Offer export only when all are true:
143
- - `selectedMcpServers` includes `notion`
144
- - `mcpServerConfigs.notion.docsParentPage` is present
145
- - Notion MCP tools are available in the current agent session
146
- 4. If export is unavailable, do nothing else and finish with the normal local path response.
147
- 5. If export is available, ask for explicit opt-in before creating or modifying any Notion page.
148
- 6. If the user declines, do nothing else.
149
- 7. If the user accepts, create or reuse Notion organization pages under the configured parent page:
150
-
151
- ```txt
152
- <docsParentPage>
153
- └── <repo name>
154
- └── Features
155
- └── <feature name>
156
- └── UX Design
157
- ```
158
-
159
- Create a new document page for the just-written artifact content. Do not write Notion URLs back into local Markdown. Report Notion export success or a clear Notion export failure, while preserving the local file as the completed artifact either way.
160
-
161
136
  ## Final response behavior
162
137
 
163
138
  After writing the file, final-answer with only the path created or updated. Do not paste the UX spec body, excerpt, outline, mockups, or section summaries.
@@ -1,60 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { getTemplatesPath } from './paths.js';
4
- export function readTemplate(relativePath) {
5
- return fs.readFileSync(path.join(getTemplatesPath(), relativePath), 'utf8');
6
- }
7
- export function readTemplateManifest() {
8
- const manifest = JSON.parse(fs.readFileSync(path.join(getTemplatesPath(), 'manifest.json'), 'utf8'));
9
- if (!isTemplateManifest(manifest)) {
10
- throw new Error('templates/manifest.json is not a valid template manifest.');
11
- }
12
- return manifest;
13
- }
14
- export function getTemplateVersion(manifest, templateRelativePath) {
15
- const template = manifest.templates[templateRelativePath];
16
- if (!template) {
17
- throw new Error(`Template ${templateRelativePath} is missing from templates/manifest.json.`);
18
- }
19
- return template.version;
20
- }
21
- export function renderTemplateForSync({ templateRelativePath, currentPath, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = [], }) {
22
- let contents = readTemplate(templateRelativePath);
23
- if (contents.includes('{{PROJECT_OVERVIEW}}')) {
24
- contents = contents.replace('{{PROJECT_OVERVIEW}}', extractProjectOverview(currentPath) ?? 'Describe this project.');
25
- }
26
- return renderSkillRouting(contents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills);
27
- }
28
- export function renderSkillRouting(contents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = []) {
29
- if (!contents.includes('{{OPTIONAL_SKILL_ROUTING}}')) {
30
- return contents;
31
- }
32
- const optionalRouting = [...selectedLanguageSkills, ...selectedFrameworkSkills, ...(selectedArchitectureSkill ? [selectedArchitectureSkill] : []), ...selectedWorkflowSkills]
33
- .map((skill) => `- ${skill.routingInstruction}`)
34
- .join('\n');
35
- return contents.replace('{{OPTIONAL_SKILL_ROUTING}}', optionalRouting);
36
- }
37
- export function extractProjectOverview(filePath) {
38
- if (!fs.existsSync(filePath)) {
39
- return undefined;
40
- }
41
- const contents = fs.readFileSync(filePath, 'utf8');
42
- const match = contents.match(/## Project overview\s+([\s\S]*?)(?=\n## |$)/);
43
- const overview = match?.[1]?.trim();
44
- return overview || undefined;
45
- }
46
- function isTemplateManifest(value) {
47
- if (!value || typeof value !== 'object') {
48
- return false;
49
- }
50
- const manifest = value;
51
- return (typeof manifest.templateVersion === 'string' &&
52
- !!manifest.templates &&
53
- typeof manifest.templates === 'object' &&
54
- Object.values(manifest.templates).every((template) => !!template &&
55
- typeof template === 'object' &&
56
- typeof template.version === 'string' &&
57
- typeof template.description === 'string' &&
58
- Array.isArray(template.changes) &&
59
- template.changes.every((change) => typeof change === 'string')));
60
- }