@juancr11/sibu 0.20.0 → 0.21.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.
@@ -89,6 +89,15 @@ export function renderWorkerToolboxRouting({ profile, selectedLanguageSkills, se
89
89
  selectedWorkflowSkills,
90
90
  selectedDatabaseSkills,
91
91
  });
92
+ const selectedArchitectureSection = selectedArchitectureSkill
93
+ ? `### Selected architecture guidance
94
+ - Required: read \`${getSharedSkillTargetPath(selectedArchitectureSkill)}\` before ${profile === 'planner' ? 'writing implementation plan steps' : 'executing or reviewing implementation steps'}.
95
+ - Treat this selected architecture guidance as binding for boundaries, dependency direction, sequencing, and reviewable constraints.
96
+ - If the selected architecture skill path is missing or unavailable, stop and tell the main agent to direct the user to run \`sibu sync\`; do not choose, infer, or substitute architecture guidance.`
97
+ : `### Selected architecture guidance
98
+ - No selected architecture skill was provided to this worker routing profile.
99
+ - Hard-stop architecture-dependent ${profile} work and tell the main agent to direct the user to run \`sibu sync\` to repair workflow configuration.
100
+ - Do not choose, infer, or substitute architecture guidance from repository structure.`;
92
101
  const selectedSkillLines = selectedSkills.map((skill) => `- ${skill.name}: read \`${getSharedSkillTargetPath(skill)}\` when relevant. ${skill.routingInstruction}`);
93
102
  const selectedSkillsSection = selectedSkillLines.length > 0
94
103
  ? selectedSkillLines.join('\n')
@@ -102,6 +111,8 @@ export function renderWorkerToolboxRouting({ profile, selectedLanguageSkills, se
102
111
  - Treat distilled skill constraints from the packet as binding task constraints.
103
112
  - If an optional relevant skill is not installed and you encounter an unmapped language, framework, database, or architecture pattern, do not guess silently; continue only when safe and flag the gap as a ${profile === 'planner' ? 'plan risk' : 'Review Gate risk'}.
104
113
 
114
+ ${selectedArchitectureSection}
115
+
105
116
  ### Optional installed skills relevant to ${profile} work
106
117
  ${profile === 'executor' ? '- Structured Logging: read `.agents/skills/structured-logging/SKILL.md` when the story involves logs, workflows, handlers, jobs, external calls, errors, retries, long-running operations, state changes, or other observability-relevant behavior.\n' : ''}${selectedSkillsSection}`;
107
118
  }
@@ -132,7 +143,6 @@ function collectWorkerRelevantSkills({ selectedLanguageSkills, selectedFramework
132
143
  ...selectedLanguageSkills,
133
144
  ...selectedFrameworkSkills,
134
145
  ...selectedDatabaseSkills,
135
- ...(selectedArchitectureSkill ? [selectedArchitectureSkill] : []),
136
146
  ...implementationRelevantWorkflowSkills,
137
147
  ];
138
148
  }
@@ -61,6 +61,13 @@ export function stopSelectedSkill({ rootPath, state, skillName }) {
61
61
  if (!isSkillSelected(state, resolution.resolved)) {
62
62
  return { status: 'noop', message: `${resolution.resolved.skill.name} is not selected.` };
63
63
  }
64
+ if (resolution.resolved.kind === 'architecture') {
65
+ return {
66
+ status: 'blocked',
67
+ message: `Cannot stop ${resolution.resolved.skill.name} because every healthy Sibu workflow requires one selected architecture skill.`,
68
+ hint: 'Architecture skill replacement is not supported yet; keep the existing architecture skill.',
69
+ };
70
+ }
64
71
  const stoppedPaths = getSkillManagedPaths(rootPath, state, resolution.resolved);
65
72
  if (stoppedPaths.length === 0) {
66
73
  return { status: 'blocked', message: `${resolution.resolved.skill.name} does not have a managed target for the selected agents.` };
@@ -91,7 +91,7 @@ export function getNextSkillSelection(state, skillName) {
91
91
  return {
92
92
  status: 'blocked',
93
93
  message: `Cannot select ${resolution.resolved.skill.name} because another architecture skill is already selected.`,
94
- hint: 'Architecture skill replacement is not supported yet. Keep the existing architecture skill or stop managing it first.',
94
+ hint: 'Every healthy Sibu workflow requires one selected architecture skill. Architecture skill replacement is not supported yet; keep the existing architecture skill.',
95
95
  };
96
96
  }
97
97
  return {
@@ -114,7 +114,14 @@ function addUnsupportedSelectionIssues(state, issues) {
114
114
  issues.push({ severity: 'warning', message: `State references unsupported framework skill: ${selectedFrameworkSkill}.` });
115
115
  }
116
116
  }
117
- if (state.selectedArchitectureSkill && !SELECTABLE_ARCHITECTURE_SKILLS.some((skill) => skill.id === state.selectedArchitectureSkill)) {
117
+ if (!state.selectedArchitectureSkill) {
118
+ issues.push({
119
+ severity: 'error',
120
+ message: 'State is missing a selected architecture skill.',
121
+ hint: 'Run `sibu sync` to choose required architecture guidance for this workflow.',
122
+ });
123
+ }
124
+ else if (!SELECTABLE_ARCHITECTURE_SKILLS.some((skill) => skill.id === state.selectedArchitectureSkill)) {
118
125
  issues.push({ severity: 'warning', message: `State references unsupported architecture skill: ${state.selectedArchitectureSkill}.` });
119
126
  }
120
127
  for (const selectedDatabaseSkill of state.selectedDatabaseSkills ?? []) {
@@ -1 +1 @@
1
- export { askForArchitectureSkill, askForDatabaseSkills, askForFrameworkSkills, askForLanguageSkills, askForMcpServers, askForNotionDocsParentPage, askForMissingFrameworkSkills, askForNewArchitectureSkill, askForNewLanguageSkills, askForProjectOverview, askForSupportedAgents, askForWorkflowSkills, MCP_SERVER_SELECTION_MESSAGE, getPromptableWorkflowSkills, renderIntro, shouldAskForNewLanguageSkills, } from './prompts.js';
1
+ export { askForArchitectureSkill, askForDatabaseSkills, askForFrameworkSkills, askForLanguageSkills, askForMcpServers, askForNotionDocsParentPage, askForMissingFrameworkSkills, askForNewArchitectureSkill, askForNewLanguageSkills, askForProjectOverview, askForSupportedAgents, askForWorkflowSkills, getPromptableWorkflowSkills, getInitArchitectureSkillOptions, getSyncArchitectureSkillOptions, MCP_SERVER_SELECTION_MESSAGE, renderIntro, shouldAskForNewLanguageSkills, } from './prompts.js';
@@ -127,26 +127,33 @@ async function askForFrameworkSkillSelection({ message, cancelMessage, }) {
127
127
  }
128
128
  return SELECTABLE_FRAMEWORK_SKILLS.filter((skill) => selectedFrameworkSkillIds.includes(skill.id));
129
129
  }
130
+ export function getInitArchitectureSkillOptions() {
131
+ return SELECTABLE_ARCHITECTURE_SKILLS.map((skill) => ({
132
+ value: skill.id,
133
+ label: skill.name,
134
+ hint: skill.description,
135
+ }));
136
+ }
137
+ export function getSyncArchitectureSkillOptions() {
138
+ return getInitArchitectureSkillOptions();
139
+ }
130
140
  export async function askForArchitectureSkill() {
131
141
  const selectedArchitectureSkillId = await select({
132
142
  message: 'Select an architecture style for this project.',
133
- options: [
134
- { value: 'none', label: 'None', hint: 'Do not install opinionated architecture guidance.' },
135
- ...SELECTABLE_ARCHITECTURE_SKILLS.map((skill) => ({
136
- value: skill.id,
137
- label: skill.name,
138
- hint: skill.description,
139
- })),
140
- ],
143
+ options: getInitArchitectureSkillOptions(),
141
144
  });
142
145
  if (isCancel(selectedArchitectureSkillId)) {
143
146
  cancel('Initialization cancelled.');
144
147
  process.exit(0);
145
148
  }
146
- if (selectedArchitectureSkillId === 'none') {
147
- return undefined;
149
+ return getSelectableArchitectureSkill(selectedArchitectureSkillId);
150
+ }
151
+ function getSelectableArchitectureSkill(selectedArchitectureSkillId) {
152
+ const selectedArchitectureSkill = SELECTABLE_ARCHITECTURE_SKILLS.find((skill) => skill.id === selectedArchitectureSkillId);
153
+ if (!selectedArchitectureSkill) {
154
+ throw new Error(`Unknown architecture skill selected: ${selectedArchitectureSkillId}`);
148
155
  }
149
- return SELECTABLE_ARCHITECTURE_SKILLS.find((skill) => skill.id === selectedArchitectureSkillId);
156
+ return selectedArchitectureSkill;
150
157
  }
151
158
  export function getPromptableWorkflowSkills(excludedWorkflowSkillIds = []) {
152
159
  const excludedIds = new Set(excludedWorkflowSkillIds);
@@ -232,28 +239,19 @@ export async function askForNewArchitectureSkill(state) {
232
239
  }
233
240
  const selectedArchitectureSkillId = await select({
234
241
  message: 'Select an architecture style for this project.',
235
- options: [
236
- { value: 'none', label: 'None', hint: 'Do not install opinionated architecture guidance.' },
237
- ...SELECTABLE_ARCHITECTURE_SKILLS.map((skill) => ({
238
- value: skill.id,
239
- label: skill.name,
240
- hint: skill.description,
241
- })),
242
- ],
242
+ options: getSyncArchitectureSkillOptions(),
243
243
  });
244
244
  if (isCancel(selectedArchitectureSkillId)) {
245
245
  cancel('Sync cancelled.');
246
246
  process.exit(0);
247
247
  }
248
248
  return {
249
- state: selectedArchitectureSkillId === 'none'
250
- ? state
251
- : {
252
- ...state,
253
- selectedArchitectureSkill: selectedArchitectureSkillId,
254
- updatedAt: new Date().toISOString(),
255
- },
256
- changedState: selectedArchitectureSkillId !== 'none',
249
+ state: {
250
+ ...state,
251
+ selectedArchitectureSkill: selectedArchitectureSkillId,
252
+ updatedAt: new Date().toISOString(),
253
+ },
254
+ changedState: true,
257
255
  };
258
256
  }
259
257
  export async function askForProjectOverview() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juancr11/sibu",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "description": "CLI for setting up a local AI-augmented development workflow.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,5 @@
1
1
  {
2
- "templateVersion": "136",
2
+ "templateVersion": "138",
3
3
  "templates": {
4
4
  "AGENTS.md": {
5
5
  "version": "35",
@@ -90,11 +90,10 @@
90
90
  ]
91
91
  },
92
92
  "skills/technical-design-writer/SKILL.md": {
93
- "version": "21",
93
+ "version": "22",
94
94
  "description": "Mandatory technical design writer skill installed once at the shared .agents/skills workspace path.",
95
95
  "changes": [
96
- "Treats Feature Brief and Deep Module Map as sibling upstream inputs for technical design.",
97
- "Allows newer feature briefs to omit a Deep Module section while still requiring technical design to map the feature to existing Deep Modules."
96
+ "Requires selected architecture guidance before technical design, applies it to implementation boundaries, and directs missing guidance repair to `sibu sync`."
98
97
  ]
99
98
  },
100
99
  "skills/typescript/SKILL.md": {
@@ -119,17 +118,17 @@
119
118
  ]
120
119
  },
121
120
  "skills/architecture/ddd-hexagonal/SKILL.md": {
122
- "version": "8",
121
+ "version": "9",
123
122
  "description": "Selectable back-end architecture skill for DDD and Hexagonal Architecture.",
124
123
  "changes": [
125
- "Adds a framework-agnostic adapter dependency rule requiring delivery entrypoints to call application/orchestration boundaries instead of infrastructure or domain workflow internals."
124
+ "Adds downstream handoff guidance for applying DDD + Hexagonal Architecture during technical design, implementation planning, execution, and review."
126
125
  ]
127
126
  },
128
127
  "skills/architecture/command-pattern/SKILL.md": {
129
- "version": "7",
128
+ "version": "8",
130
129
  "description": "Selectable architecture skill for command-oriented vertical slices using Command Pattern, Hexagonal Architecture, and DDD principles.",
131
130
  "changes": [
132
- "Routes workflow, handler, entrypoint, job, and operational outcome logging concerns to the structured logging skill."
131
+ "Adds downstream handoff guidance for applying command-oriented vertical slices during technical design, implementation planning, execution, and review."
133
132
  ]
134
133
  },
135
134
  "skills/nextjs/SKILL.md": {
@@ -154,31 +153,31 @@
154
153
  ]
155
154
  },
156
155
  "skills/ai-implementation-planner/SKILL.md": {
157
- "version": "17",
156
+ "version": "18",
158
157
  "description": "Mandatory AI implementation planner gatekeeper for routing one User Story into story-local implementation step files.",
159
158
  "changes": [
160
- "Requires the planner to spawn the Sibu implementation planner sub-agent whenever spawning is available and limits inline fallback to host capability blockers."
159
+ "Requires selected architecture guidance before implementation planning and passes architecture constraints into story-local planning context."
161
160
  ]
162
161
  },
163
162
  "skills/ai-implementation-planner-toolbox/SKILL.md": {
164
- "version": "1",
163
+ "version": "2",
165
164
  "description": "Worker-only planner toolbox skill for fresh-context Sibu implementation planner sub-agents.",
166
165
  "changes": [
167
- "Adds a planner toolbox skill with focused worker routing, skill-loading rules, and story-local implementation plan format guidance."
166
+ "Requires planner worker packets to include selected architecture guidance and stops missing guidance work for `sibu sync` repair."
168
167
  ]
169
168
  },
170
169
  "skills/ai-implementation-plan-executor/SKILL.md": {
171
- "version": "25",
170
+ "version": "26",
172
171
  "description": "Mandatory AI implementation plan executor gatekeeper for story execution, review, approval metadata, commit, and feature continuation.",
173
172
  "changes": [
174
- "Updates executor packet guidance to include structured logging when implementation stories touch observability-relevant code."
173
+ "Requires selected architecture guidance before execution and passes architecture constraints into executor review context."
175
174
  ]
176
175
  },
177
176
  "skills/ai-implementation-executor-toolbox/SKILL.md": {
178
- "version": "2",
177
+ "version": "3",
179
178
  "description": "Worker-only executor toolbox skill for fresh-context Sibu implementation executor sub-agents.",
180
179
  "changes": [
181
- "Guides executor workers to load structured logging for observability-relevant implementation stories."
180
+ "Requires executor worker packets to include selected architecture guidance and apply it during implementation and review."
182
181
  ]
183
182
  },
184
183
  "skills/feature-idea-capture/SKILL.md": {
@@ -204,10 +203,10 @@
204
203
  ]
205
204
  },
206
205
  "skills/architecture/layered-architecture/SKILL.md": {
207
- "version": "1",
206
+ "version": "2",
208
207
  "description": "Selectable lightweight architecture skill for pragmatic controllers, services, models, and repositories guidance.",
209
208
  "changes": [
210
- "Adds a Layered Architecture skill for smaller apps that need simple separation of concerns."
209
+ "Adds downstream handoff guidance for applying Layered Architecture during technical design, implementation planning, execution, and review."
211
210
  ]
212
211
  },
213
212
  "skills/export-to-github/SKILL.md": {
@@ -18,6 +18,7 @@ Use only the narrow packet from the main agent. The packet must include:
18
18
  - exactly one User Story path or one story-local `.impl_plan/` folder
19
19
  - required source artifact paths: story, Epic brief, feature brief, technical design, and UX spec when the story, plan, or feature has UI impact
20
20
  - this toolbox skill path
21
+ - selected architecture skill path and distilled architecture constraints
21
22
  - required skill paths, including `clean-code` and `structured-logging` when the story touches observability-relevant code
22
23
  - optional installed skill paths relevant to the story
23
24
  - distilled skill constraints that are binding for this execution task
@@ -26,14 +27,17 @@ Use only the narrow packet from the main agent. The packet must include:
26
27
 
27
28
  If the packet names multiple stories, multiple plans, an Epic without one selected story, or no executable target, stop and ask the main agent for exactly one story or `.impl_plan/` path.
28
29
 
30
+ If selected architecture guidance is missing from the packet or unavailable to read, stop and tell the main agent to direct the user to run `sibu sync`; do not choose, infer, or substitute architecture guidance.
31
+
29
32
  If a required source artifact or required skill path is missing, stop and report the blocker. Do not invent scope from partial context.
30
33
 
31
34
  ## Execution rules
32
35
 
33
- - Read the story, ordered step files, required source artifacts, required skills, and relevant optional installed skills before execution.
36
+ - Read the story, ordered step files, required source artifacts, required skills, the selected architecture skill, and relevant optional installed skills before execution.
34
37
  - If `structured-logging` is provided in the packet, apply it only to observability-relevant code paths and do not duplicate its policy in other skill guidance.
38
+ - Apply selected architecture guidance during implementation and review, including boundaries, dependency direction, sequencing, and architecture-specific risks.
35
39
  - Execute all unapproved step files in filename order.
36
- - Keep changes inside the story scope, step scope, source artifacts, and distilled constraints.
40
+ - Keep changes inside the story scope, step scope, source artifacts, selected architecture constraints, and distilled constraints.
37
41
  - Read repository files narrowly, only as needed for the current step or validation result.
38
42
  - Run focused validation named by the step files or technical design when practical.
39
43
  - If validation fails and the fix is ambiguous, risky, or outside scope, stop and report the blocker.
@@ -20,6 +20,7 @@ When a compatible sub-agent spawn capability is available and permitted by the h
20
20
  - The story, Epic brief, feature brief, and technical design for the selected plan.
21
21
  - `docs/features/<feature-slug>/ux.md` only when the story, any step, or feature has UI impact.
22
22
  - The executor toolbox skill at `.agents/skills/ai-implementation-executor-toolbox/SKILL.md` when sub-agent spawning is available.
23
+ - Selected architecture guidance for the workflow.
23
24
  - Required and relevant installed skill paths for the executor packet, including `clean-code` and `structured-logging` when the story touches observability-relevant code.
24
25
 
25
26
  ### What this skill writes
@@ -34,6 +35,7 @@ When a compatible sub-agent spawn capability is available and permitted by the h
34
35
  - The user does not provide or clearly identify exactly one User Story file or `.impl_plan/` folder.
35
36
  - Any required source artifact is missing, incomplete, or invalid in a way its owning stage should repair.
36
37
  - The story, any step, or feature has UI impact and `ux.md` is missing; direct the user to `ux-expert`.
38
+ - Selected architecture guidance is missing, unavailable, or ambiguous; stop and tell the user to run `sibu sync` to repair workflow configuration before implementation execution. Do not choose, infer, or substitute architecture guidance yourself.
37
39
  - Validation fails and the fix is ambiguous, risky, or would exceed the approved plan.
38
40
  - A step conflicts with the story, Epic, feature brief, technical design, UX spec, or approved Deep Module boundaries.
39
41
 
@@ -45,6 +47,14 @@ When a compatible sub-agent spawn capability is available and permitted by the h
45
47
  - Do not mark any step approved before explicit story-level user approval.
46
48
  - Do not commit story implementation changes before explicit story-level user approval.
47
49
  - Do not let the executor worker write approval metadata or run `git commit`, `git stash`, or `git reset`.
50
+ - Do not choose or infer architecture guidance when it is missing; selected architecture is repo-owned workflow configuration repaired through `sibu sync`.
51
+
52
+
53
+ ## Selected architecture guidance gate
54
+
55
+ Before execution, identify and read the workflow's selected architecture skill. If selected architecture guidance is missing, unavailable, or ambiguous, hard-stop and tell the user to run `sibu sync` to repair Sibu workflow configuration. Do not choose architecture guidance, infer it from repository structure, or continue with generic architecture assumptions.
56
+
57
+ When selected architecture guidance is present, treat it as binding execution and review context. Pass the selected architecture skill path and distilled architecture constraints to the executor worker, and apply them when evaluating step order, implementation boundaries, dependency direction, and review risks.
48
58
 
49
59
  ## Required source context gate
50
60
 
@@ -85,14 +95,15 @@ Build a narrow executor packet for the worker. The packet must include:
85
95
  - story, Epic brief, feature brief, technical design, and UX path when relevant
86
96
  - executor toolbox path: `.agents/skills/ai-implementation-executor-toolbox/SKILL.md`
87
97
  - required skill paths, always including `.agents/skills/clean-code/SKILL.md`, and including `.agents/skills/structured-logging/SKILL.md` when the story involves logs, workflows, handlers, jobs, external calls, errors, retries, long-running operations, state changes, or other observability-relevant behavior
88
- - relevant optional installed skill paths only when applicable, such as TypeScript, React, Next.js, UX Expert, Command Pattern, DDD/Hexagonal, Layered Architecture, PostgreSQL Expert, or AI Prompt Engineer Master
89
- - distilled skill constraints, including story scope, validation expectations, Deep Module boundaries, UX constraints when relevant, and “do not write approval metadata or run git commit/stash/reset”
98
+ - selected architecture skill path as required architecture context
99
+ - relevant optional installed skill paths only when applicable, such as TypeScript, React, Next.js, UX Expert, PostgreSQL Expert, or AI Prompt Engineer Master
100
+ - distilled skill constraints, including story scope, validation expectations, Deep Module boundaries, selected architecture constraints, UX constraints when relevant, and “do not write approval metadata or run git commit/stash/reset”
90
101
  - approval and commit rules: the worker may edit the working tree and run validation, but final approval metadata and commit execution remain with the main agent after explicit user approval
91
102
  - expected output format: changed files, completed steps, validation commands/results, risks, follow-up questions, and approval state
92
103
 
93
104
  Do not include exporter skills such as `export-to-github` or `export-to-notion` in the executor packet. Do not include `structured-logging` for stories limited to trivial pure logic with no observability-relevant behavior.
94
105
 
95
- The worker must use only the packet, the toolbox, listed skill files, source artifacts, and narrow repo inspection required for the story. Do not pass the full main conversation context.
106
+ The worker must use only the packet, the toolbox, listed skill files including the selected architecture skill, source artifacts, and narrow repo inspection required for the story. Do not pass the full main conversation context.
96
107
 
97
108
  ## Fallback matrix
98
109
 
@@ -21,6 +21,7 @@ This planner is normally an internal helper for `ai-implementation-plan-executor
21
21
  - The feature's `technical_design.md`.
22
22
  - `docs/features/<feature-slug>/ux.md` only when the story or feature has UI impact.
23
23
  - The planner toolbox skill at `.agents/skills/ai-implementation-planner-toolbox/SKILL.md` when sub-agent spawning is available.
24
+ - Selected architecture guidance for the workflow.
24
25
  - Required and relevant installed skill paths for the planner packet, including `clean-code`.
25
26
 
26
27
  ### What this skill writes
@@ -33,6 +34,7 @@ This planner is normally an internal helper for `ai-implementation-plan-executor
33
34
  - Any required source artifact is missing, incomplete, or invalid in a way its owning stage should repair.
34
35
  - The story or feature has UI impact and `ux.md` is missing; direct the user to `ux-expert`.
35
36
  - The request belongs to another pipeline stage, such as writing production code, executing an existing implementation plan, creating stories, or performing another pipeline stage.
37
+ - Selected architecture guidance is missing, unavailable, or ambiguous; stop and tell the user to run `sibu sync` to repair workflow configuration before implementation planning. Do not choose, infer, or substitute architecture guidance yourself.
36
38
  - Worker delegation is requested but required worker packet context cannot be assembled.
37
39
 
38
40
  ### What this skill must not do
@@ -42,6 +44,14 @@ This planner is normally an internal helper for `ai-implementation-plan-executor
42
44
  - Do not reread `docs/deep-module-map.md` by default; trust `technical_design.md` for Deep Module implementation boundaries.
43
45
  - Do not infer implementation scope from an Epic brief, feature brief, or technical design without exactly one User Story.
44
46
  - Do not ask for a plan-approval gate before executor handoff unless the user explicitly requested planning-only.
47
+ - Do not choose or infer architecture guidance when it is missing; selected architecture is repo-owned workflow configuration repaired through `sibu sync`.
48
+
49
+
50
+ ## Selected architecture guidance gate
51
+
52
+ Before delegating or planning inline, identify and read the workflow's selected architecture skill. If selected architecture guidance is missing, unavailable, or ambiguous, hard-stop and tell the user to run `sibu sync` to repair Sibu workflow configuration. Do not choose architecture guidance, infer it from repository structure, or continue with generic architecture assumptions.
53
+
54
+ When selected architecture guidance is present, treat it as binding planning context. Apply it to story-local implementation step sequencing, boundaries, dependency direction, and reviewable constraints while still trusting `technical_design.md` for feature-specific Deep Module boundaries.
45
55
 
46
56
  ## Required input
47
57
 
@@ -83,8 +93,9 @@ Build a narrow planner packet for the worker. The packet must include:
83
93
  - Epic brief, feature brief, technical design, and UX path when relevant
84
94
  - planner toolbox path: `.agents/skills/ai-implementation-planner-toolbox/SKILL.md`
85
95
  - required skill paths, always including `.agents/skills/clean-code/SKILL.md`
86
- - relevant optional installed skill paths only when applicable, such as TypeScript, React, Next.js, UX Expert, Command Pattern, DDD/Hexagonal, Layered Architecture, PostgreSQL Expert, or AI Prompt Engineer Master
87
- - distilled skill constraints, such as “create only `.impl_plan/*.md` files,” “do not write production code,” “inspect narrowly,” and any story-specific architecture or UX constraints
96
+ - selected architecture skill path as required architecture context
97
+ - relevant optional installed skill paths only when applicable, such as TypeScript, React, Next.js, UX Expert, PostgreSQL Expert, or AI Prompt Engineer Master
98
+ - distilled skill constraints, such as “create only `.impl_plan/*.md` files,” “do not write production code,” “inspect narrowly,” selected architecture constraints, and any story-specific architecture or UX constraints
88
99
  - expected output format: plan folder, ordered step files created or updated, source artifacts and skills used, and risks/blockers
89
100
 
90
101
  Do not include exporter skills such as `export-to-github` or `export-to-notion` in the planner packet.
@@ -102,7 +113,7 @@ Before writing step files inline, read and apply:
102
113
  - `clean-code` always
103
114
  - relevant installed language skills such as `typescript` for `.ts` or `.tsx` work
104
115
  - relevant installed framework skills such as `react` or `nextjs`
105
- - relevant installed architecture skills such as `command-pattern`, `ddd-hexagonal`, or `layered-architecture`
116
+ - the selected installed architecture skill such as `command-pattern`, `ddd-hexagonal`, or `layered-architecture`; if it is missing, stop and direct repair to `sibu sync`
106
117
  - relevant installed database skills such as `postgresql-expert`
107
118
  - `ux-expert` only when UI/UX implementation planning is in scope and the skill is installed
108
119
  - `ai-prompt-engineer-master` when prompt, agent, or reusable AI instruction templates are in scope
@@ -18,6 +18,7 @@ Use only the narrow packet from the main agent. The packet must include:
18
18
  - exactly one User Story path
19
19
  - required source artifact paths: Epic brief, feature brief, technical design, and UX spec when the story or feature has UI impact
20
20
  - this toolbox skill path
21
+ - selected architecture skill path and distilled architecture constraints
21
22
  - required skill paths, including `clean-code`
22
23
  - optional installed skill paths relevant to the story
23
24
  - distilled skill constraints that are binding for this planning task
@@ -25,14 +26,17 @@ Use only the narrow packet from the main agent. The packet must include:
25
26
 
26
27
  If the packet names multiple stories, an Epic without one story, a feature without one story, or no story, stop and ask the main agent for exactly one User Story path.
27
28
 
29
+ If selected architecture guidance is missing from the packet or unavailable to read, stop and tell the main agent to direct the user to run `sibu sync`; do not choose, infer, or substitute architecture guidance.
30
+
28
31
  If a required source artifact or required skill path is missing, stop and report the blocker. Do not invent scope from partial context.
29
32
 
30
33
  ## Planning rules
31
34
 
32
35
  - Read the story and required source artifacts before writing step files.
33
- - Read required skills and relevant optional installed skills from the packet before writing step files.
36
+ - Read required skills, the selected architecture skill, and relevant optional installed skills from the packet before writing step files.
34
37
  - Inspect repository files narrowly, only enough to make the plan executable.
35
- - Preserve story scope, acceptance criteria, technical design boundaries, and UX constraints when applicable.
38
+ - Preserve story scope, acceptance criteria, technical design boundaries, selected architecture constraints, and UX constraints when applicable.
39
+ - Apply selected architecture guidance to story-local implementation step ordering, boundaries, dependency direction, and reviewable constraints.
36
40
  - Create ordered story-local implementation step files under `<story-slug>.impl_plan/*.md`.
37
41
  - Never write production code, tests, templates, or unrelated documentation.
38
42
  - Never create or change product vision, Deep Module Map, feature brief, technical design, UX, Epic, or User Story artifacts.
@@ -10,6 +10,27 @@ Use this skill to design and implement software features as independent, end-to-
10
10
 
11
11
  ---
12
12
 
13
+
14
+ ## Downstream Sibu workflow handoff
15
+
16
+ Use this selected architecture model as binding guidance for technical design, implementation planning, execution, and review. Downstream artifacts should make the command boundary and execution flow explicit without adding ceremony that does not protect the slice.
17
+
18
+ ### Technical design
19
+
20
+ Design the executable operation first. Name the owning Deep Module and feature slice, then define the Command intent, Result contract, Handler responsibilities, required Ports, driving entrypoints, and driven Adapters. Business rules and orchestration belong in the Handler or domain objects it coordinates; infrastructure behavior belongs behind Ports in adapters; entrypoints only adapt transport input into Commands and translate Results. Dependencies flow entrypoint -> Command -> Handler -> Ports, with adapters implementing Ports from outside the slice.
21
+
22
+ ### Implementation planning
23
+
24
+ Plan each story as one or more end-to-end command slices. For each slice, sequence work as Command and Result shape first, Port contracts second, Handler orchestration and business validation third, Adapter implementations fourth, and entrypoint wiring last. Keep tests aligned to that sequence: handler tests with fake ports before adapter or transport tests.
25
+
26
+ ### Implementation execution
27
+
28
+ Implementation agents should build vertical slices instead of technical-layer batches. Avoid handlers that instantiate databases, clients, or framework objects; entrypoints that call repositories directly; commands with behavior; ports shared too early across unrelated slices; and feature slices importing another slice's internals. Use composition/bootstrap code for wiring concrete adapters into handlers.
29
+
30
+ ### Review and compliance
31
+
32
+ Reviewers should check that every operation has an explicit Command, focused Handler, Result, and required Ports; handlers are transport-agnostic; adapters implement ports without leaking SDK/database shapes inward; entrypoints are thin; and dependencies follow the command flow. A change that requires touching unrelated feature slices or framework code to alter handler business behavior signals a boundary problem.
33
+
13
34
  ## Deep Module Compatibility
14
35
 
15
36
  Deep Modules answer “where does this implementation work belong?” Command Pattern guidance answers “how is that work structured as command-oriented vertical slices inside the selected module?”
@@ -27,6 +27,27 @@ This skill is backend-focused. It does not cover frontend component architecture
27
27
 
28
28
  If a simpler structure preserves clear boundaries, prefer the simpler structure.
29
29
 
30
+
31
+ ## Downstream Sibu workflow handoff
32
+
33
+ Use this selected architecture model as binding guidance for technical design, implementation planning, execution, and review. Keep the guidance concise in downstream artifacts, but make the boundary decisions explicit.
34
+
35
+ ### Technical design
36
+
37
+ Design use-case-first and domain-first. Name the owning Deep Module, then identify the domain concepts, invariants, and application use cases before choosing infrastructure details. Place business rules and invariants in `domain/**`; place orchestration, transaction coordination, input/output contracts, and outgoing ports in `application/**`; place repositories, SDK clients, persistence mappings, and anti-corruption translation in `infra/**`; keep entrypoints as driving adapters. Dependencies must point inward: entrypoint -> application -> domain + ports, and infrastructure -> application/domain contracts.
38
+
39
+ ### Implementation planning
40
+
41
+ Plan slices around one externally meaningful use case at a time. For each slice, sequence the work as domain model/invariants first, application use case and ports second, infrastructure adapters third, and framework or CLI entrypoints last. Call out any cross-module dependency explicitly instead of sharing internals or inventing new modules.
42
+
43
+ ### Implementation execution
44
+
45
+ Implementation agents should keep framework, database, filesystem, SDK, and transport types out of domain and application boundaries unless they are explicit adapter translations. Define application orchestration and ports before infrastructure adapters, then wire entrypoints last. Avoid direct entrypoint-to-database calls, infrastructure imports from the domain, anemic pass-through use cases that hide business rules in adapters, and broad shared services created only for convenience.
46
+
47
+ ### Review and compliance
48
+
49
+ Reviewers should check that use cases and domain concepts were designed before adapters, invariants live in the domain, application orchestration owns the workflow, ports describe required external capabilities, adapters translate at the boundary, entrypoints stay thin, and all dependencies point inward. If a business rule changes because an external DTO, database row, or framework object changed, the hexagonal boundary is leaking.
50
+
30
51
  ## Deep Module compatibility
31
52
 
32
53
  Deep Modules answer “where does this implementation work belong?” DDD + Hexagonal answers “how is that module structured internally?”
@@ -15,6 +15,27 @@ This is Sibu's pragmatic layered architecture guidance. It is not the only valid
15
15
 
16
16
  Keep the layers useful, not ceremonial. If splitting a small function across layers makes the code harder to understand, prefer the simpler code.
17
17
 
18
+
19
+ ## Downstream Sibu workflow handoff
20
+
21
+ Use this selected architecture model as binding guidance for technical design, implementation planning, execution, and review. Keep the design lightweight, but make layer ownership and dependency direction clear.
22
+
23
+ ### Technical design
24
+
25
+ Design the user-facing operation and service responsibility first, then decide which models and repositories the service needs. Business rules and workflow orchestration belong in services, simple invariants and meaningful states belong in models, persistence details belong in repositories, and framework or transport adaptation belongs in controllers. Dependencies should flow controller -> service -> repository and service -> model; repositories may map storage records to models but should not own workflows.
26
+
27
+ ### Implementation planning
28
+
29
+ Plan work by feature behavior, not by sweeping all controllers or all repositories at once. For each slice, sequence the service contract and business behavior first, model changes second, repository interface/implementation third, and controller wiring last. Keep the layer split proportional: use existing project folders when clear and avoid adding layers where a small function stays easier to understand.
30
+
31
+ ### Implementation execution
32
+
33
+ Implementation agents should keep controllers thin, services framework-free, repositories persistence-focused, and models meaningful. Avoid controller-to-repository shortcuts, services that embed SQL/ORM/SDK calls, repositories that return raw storage details to services, models that import controllers or repositories, and miscellaneous service/helper bags that hide unrelated behavior.
34
+
35
+ ### Review and compliance
36
+
37
+ Reviewers should check that controllers only adapt input/output and call services, services coordinate business behavior without framework objects, repositories hide data access and persistence mappings, models express useful concepts or states without over-modeling, and dependency flow follows the approved layer direction. If the layer split makes a small change harder to understand, simplify while preserving controller/service/repository boundaries.
38
+
18
39
  ## Layer responsibilities
19
40
 
20
41
  ### Controllers
@@ -16,7 +16,8 @@ Write the smallest useful technical design doc for an approved feature: enough f
16
16
  - Enough feature and module context to map the feature brief to one or more existing Deep Modules during technical design.
17
17
  - Relevant existing repo files and flows needed to make implementation direction concrete.
18
18
  - `docs/features/<feature-slug>/ux.md` only when the feature has UI impact.
19
- - Relevant implementation guidance skills such as `clean-code`, selected architecture skills, language skills, or framework skills.
19
+ - Selected architecture guidance installed under `.agents/skills/architecture/` or rendered as the selected architecture skill path for this workflow.
20
+ - Relevant implementation guidance skills such as `clean-code`, language skills, or framework skills.
20
21
 
21
22
  ### What this skill writes
22
23
 
@@ -28,6 +29,7 @@ Write the smallest useful technical design doc for an approved feature: enough f
28
29
  - `docs/deep-module-map.md` is missing; direct the user to `deep-module-map-writer`.
29
30
  - The feature brief and Deep Module Map cannot be reconciled to existing Deep Modules after focused clarification, or the selected modules are missing, ambiguous, or inconsistent with the map.
30
31
  - The feature has UI impact and `docs/features/<feature-slug>/ux.md` is missing; direct the user to `ux-expert`.
32
+ - Selected architecture guidance is missing or cannot be identified; stop and tell the user to run `sibu sync` to repair workflow configuration before technical design. Do not choose, infer, or substitute architecture guidance yourself.
31
33
  - The request belongs to another pipeline stage, such as feature definition, UX design, Scrum planning, implementation planning, or implementation execution.
32
34
 
33
35
  ### What this skill must not do
@@ -36,6 +38,7 @@ Write the smallest useful technical design doc for an approved feature: enough f
36
38
  - Do not invent new Deep Modules or move work into modules that cannot be justified from the Feature Brief and Deep Module Map.
37
39
  - Do not redesign binding UX mockups.
38
40
  - Do not duplicate architecture, language, framework, or clean-code skill guidance.
41
+ - Do not choose or infer architecture guidance when it is missing; selected architecture is repo-owned workflow configuration repaired through `sibu sync`.
39
42
  - Do not skip the interview or the final “I am clear; are you good?” check-in before writing. Once the user confirms there is nothing else to cover, write without requiring a recap, artifact approval, or separate summary confirmation.
40
43
 
41
44
  ## Grounding
@@ -47,11 +50,19 @@ Before writing, read:
47
50
  3. the feature brief
48
51
  4. `docs/features/<feature-slug>/ux.md` when the feature has UI impact
49
52
  5. `clean-code`
50
- 6. any selected architecture, language, or framework skills that apply
51
- 7. relevant existing repo files and flows
53
+ 6. the selected architecture skill for this workflow
54
+ 7. any selected language or framework skills that apply
55
+ 8. relevant existing repo files and flows
52
56
 
53
57
  Apply those inputs. Do not summarize them back into the technical design unless a specific implication changes the implementation.
54
58
 
59
+
60
+ ## Selected architecture guidance gate
61
+
62
+ Before interviewing or writing, identify the workflow's selected architecture skill and read its installed guidance. If selected architecture guidance is missing, unavailable, or ambiguous, hard-stop and tell the user to run `sibu sync` to repair Sibu workflow configuration. Do not choose an architecture, infer one from the codebase, or proceed with generic architecture advice.
63
+
64
+ When selected architecture guidance is present, treat it as binding for design order, module/layer boundaries, dependency direction, and concrete implementation boundaries. Apply it through the technical design by naming project-specific boundaries and sequencing decisions; do not paste or restate the architecture skill itself.
65
+
55
66
  ## Required input
56
67
 
57
68
  Require a Markdown feature brief. If the user only has a vague idea, route to `feature-brief-writer` first.
@@ -86,7 +97,7 @@ For UI-related features, `ux.md` is source context, not inspiration. If `ux.md`
86
97
 
87
98
  Translate product intent into implementation direction.
88
99
 
89
- Deep Modules answer “where does this implementation work belong?” Architecture guidance answers “how is that module structured internally?” Translate the existing Deep Modules selected or mapped from the Feature Brief plus Deep Module Map into implementation boundaries appropriate for the selected architecture. Capture those boundaries in the technical design so downstream Scrum planning, implementation planning, and execution can trust the technical design instead of rereading the Deep Module Map by default.
100
+ Deep Modules answer “where does this implementation work belong?” Selected architecture guidance answers “how is that module structured internally?” Translate the existing Deep Modules selected or mapped from the Feature Brief plus Deep Module Map into implementation boundaries appropriate for the selected architecture. Capture those boundaries in the technical design so downstream Scrum planning, implementation planning, and execution can trust the technical design instead of rereading the Deep Module Map by default.
90
101
 
91
102
  When a feature crosses a framework or delivery boundary, include the allowed orchestration/application entrypoint and the forbidden lower-level dependencies. Keep this framework-agnostic: name roles like framework adapter, application/orchestration boundary, domain, port, and infrastructure, then add concrete project paths only where useful.
92
103