@juancr11/sibu 0.18.0 → 0.20.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.
@@ -7,6 +7,14 @@ export const MANDATORY_SKILLS = [
7
7
  claude: '.agents/skills/clean-code/SKILL.md',
8
8
  },
9
9
  },
10
+ {
11
+ templateRelativePath: 'skills/structured-logging/SKILL.md',
12
+ targetRelativePathsByAgent: {
13
+ codex: '.agents/skills/structured-logging/SKILL.md',
14
+ gemini: '.agents/skills/structured-logging/SKILL.md',
15
+ claude: '.agents/skills/structured-logging/SKILL.md',
16
+ },
17
+ },
10
18
  {
11
19
  templateRelativePath: 'skills/product-vision-writer/SKILL.md',
12
20
  targetRelativePathsByAgent: {
@@ -103,7 +103,7 @@ export function renderWorkerToolboxRouting({ profile, selectedLanguageSkills, se
103
103
  - 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
104
 
105
105
  ### Optional installed skills relevant to ${profile} work
106
- ${selectedSkillsSection}`;
106
+ ${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
107
  }
108
108
  export function renderWorkerToolboxRoutingPlaceholders(contents, selectedLanguageSkills, selectedFrameworkSkills, selectedArchitectureSkill, selectedWorkflowSkills = [], selectedDatabaseSkills = []) {
109
109
  const placeholderProfiles = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juancr11/sibu",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "CLI for setting up a local AI-augmented development workflow.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,6 +48,7 @@ Keep responses concise by default, but spend the context needed for correctness,
48
48
  For planned product/feature work, use this pipeline: product vision -> business domain model -> capabilities map -> deep module map / feature brief -> technical design -> optional UX -> epics/stories -> AI executor. Business Domain Model work sits after Product Vision and before the Capabilities Map. Deep Module Map and Feature Brief work are sibling downstream artifacts from Product Vision, Business Domain Model, and Capabilities Map. Technical Design remains downstream of both Feature Brief and Deep Module Map, with Scrum planning and AI executor flows after Technical Design. Narrow code fixes and small local changes do not require the full pipeline unless product scope, module ownership, or architecture direction is unclear.
49
49
 
50
50
  - For any code-writing task, use `clean-code`.
51
+ - For code-writing tasks that introduce or modify logging, workflows, handlers, jobs, external calls, errors, retries, long-running operations, state changes, or other observability-relevant behavior, also use `structured-logging`.
51
52
  - 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`.
52
53
  - For requests to create, revise, or clarify a Business Domain Model, `docs/business-domain-model.md`, business/domain vocabulary, ubiquitous language, domain concepts, relationships, rules, lifecycles, workflows, domain events, boundaries, or hard parts, use `business-domain-model-writer`.
53
54
  - 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`.
@@ -1,13 +1,11 @@
1
1
  {
2
- "templateVersion": "133",
2
+ "templateVersion": "136",
3
3
  "templates": {
4
4
  "AGENTS.md": {
5
- "version": "34",
5
+ "version": "35",
6
6
  "description": "Project-level agent instructions and Sibu maintenance guidance.",
7
7
  "changes": [
8
- "Adds judgment and honesty guidance for direct, non-condescending collaboration.",
9
- "Clarifies that agents should state uncertainty, ask focused questions, or verify instead of inventing certainty.",
10
- "Defines when agents should challenge users for clear factual, safety, quality, instruction, product, or context-reliability reasons."
8
+ "Routes observability-relevant code-writing tasks to the structured logging skill."
11
9
  ]
12
10
  },
13
11
  ".codex/config.toml": {
@@ -46,10 +44,10 @@
46
44
  ]
47
45
  },
48
46
  "skills/clean-code/SKILL.md": {
49
- "version": "5",
47
+ "version": "6",
50
48
  "description": "Mandatory clean-code skill installed once at the shared .agents/skills workspace path.",
51
49
  "changes": [
52
- "Adds guidance to validate required function inputs before doing work instead of silently continuing with partial defaults."
50
+ "Adds concise observability guidance that delegates detailed logging policy to structured-logging."
53
51
  ]
54
52
  },
55
53
  "skills/product-vision-writer/SKILL.md": {
@@ -100,17 +98,17 @@
100
98
  ]
101
99
  },
102
100
  "skills/typescript/SKILL.md": {
103
- "version": "1",
101
+ "version": "2",
104
102
  "description": "Selectable TypeScript skill installed when TypeScript language support is selected.",
105
103
  "changes": [
106
- "Adds an optional TypeScript skill for projects that use .ts or .tsx files."
104
+ "Routes observability-relevant TypeScript changes to the structured logging skill."
107
105
  ]
108
106
  },
109
107
  "skills/golang/SKILL.md": {
110
- "version": "1",
108
+ "version": "2",
111
109
  "description": "Selectable Go skill installed when Go language support is selected.",
112
110
  "changes": [
113
- "Adds an optional Go skill with concise, Effective Go\u2013style guidance for .go files, package APIs, interfaces, errors, receivers, concurrency, and tests."
111
+ "Routes observability-relevant Go changes to the structured logging skill."
114
112
  ]
115
113
  },
116
114
  "skills/postgresql-expert/SKILL.md": {
@@ -128,10 +126,10 @@
128
126
  ]
129
127
  },
130
128
  "skills/architecture/command-pattern/SKILL.md": {
131
- "version": "6",
129
+ "version": "7",
132
130
  "description": "Selectable architecture skill for command-oriented vertical slices using Command Pattern, Hexagonal Architecture, and DDD principles.",
133
131
  "changes": [
134
- "Adds a framework-agnostic entrypoint dependency rule requiring delivery adapters to create commands and call handlers or dispatchers instead of infrastructure, SDKs, repositories, or domain workflow internals."
132
+ "Routes workflow, handler, entrypoint, job, and operational outcome logging concerns to the structured logging skill."
135
133
  ]
136
134
  },
137
135
  "skills/nextjs/SKILL.md": {
@@ -142,10 +140,10 @@
142
140
  ]
143
141
  },
144
142
  "skills/react/SKILL.md": {
145
- "version": "3",
143
+ "version": "4",
146
144
  "description": "Selectable React skill for component design, props, state ownership, and presentational boundaries.",
147
145
  "changes": [
148
- "Adds broadly applicable React screen componentization guidance so route and feature entry files stay thin while meaningful UI regions move into focused nearby files."
146
+ "Strengthens React guidance to require one component per nearby file by default, disallow same-file helper subcomponents, and add a before-finish component-boundary self-check."
149
147
  ]
150
148
  },
151
149
  "skills/scrum-master-planner/SKILL.md": {
@@ -170,17 +168,17 @@
170
168
  ]
171
169
  },
172
170
  "skills/ai-implementation-plan-executor/SKILL.md": {
173
- "version": "24",
171
+ "version": "25",
174
172
  "description": "Mandatory AI implementation plan executor gatekeeper for story execution, review, approval metadata, commit, and feature continuation.",
175
173
  "changes": [
176
- "Requires the executor to spawn the Sibu implementation executor sub-agent whenever spawning is available and limits inline fallback to host capability blockers."
174
+ "Updates executor packet guidance to include structured logging when implementation stories touch observability-relevant code."
177
175
  ]
178
176
  },
179
177
  "skills/ai-implementation-executor-toolbox/SKILL.md": {
180
- "version": "1",
178
+ "version": "2",
181
179
  "description": "Worker-only executor toolbox skill for fresh-context Sibu implementation executor sub-agents.",
182
180
  "changes": [
183
- "Adds an executor toolbox skill with focused worker routing, ordered step execution, validation, Interactive Review Gate, and git-safety rules."
181
+ "Guides executor workers to load structured logging for observability-relevant implementation stories."
184
182
  ]
185
183
  },
186
184
  "skills/feature-idea-capture/SKILL.md": {
@@ -330,6 +328,15 @@
330
328
  "changes": [
331
329
  "Adds a managed Gemini SessionStart hook that checks the latest Sibu version and runs sibu doctor automatically."
332
330
  ]
331
+ },
332
+ "skills/structured-logging/SKILL.md": {
333
+ "version": "1",
334
+ "description": "Mandatory structured logging skill for safe, useful, storytelling logs in code-writing workflows.",
335
+ "changes": [
336
+ "Adds required structured logging guidance for code-writing workflows.",
337
+ "Defines safe, structured, storytelling log expectations while avoiding noisy logs in trivial code.",
338
+ "Guides agents to follow project logging conventions and use concise local logging helpers when useful."
339
+ ]
333
340
  }
334
341
  }
335
342
  }
@@ -18,7 +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
- - required skill paths, including `clean-code`
21
+ - required skill paths, including `clean-code` and `structured-logging` when the story touches observability-relevant code
22
22
  - optional installed skill paths relevant to the story
23
23
  - distilled skill constraints that are binding for this execution task
24
24
  - approval and commit rules from the main executor workflow
@@ -31,6 +31,7 @@ If a required source artifact or required skill path is missing, stop and report
31
31
  ## Execution rules
32
32
 
33
33
  - Read the story, ordered step files, required source artifacts, required skills, and relevant optional installed skills before execution.
34
+ - 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.
34
35
  - Execute all unapproved step files in filename order.
35
36
  - Keep changes inside the story scope, step scope, source artifacts, and distilled constraints.
36
37
  - Read repository files narrowly, only as needed for the current step or validation result.
@@ -20,7 +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
- - Required and relevant installed skill paths for the executor packet, including `clean-code`.
23
+ - Required and relevant installed skill paths for the executor packet, including `clean-code` and `structured-logging` when the story touches observability-relevant code.
24
24
 
25
25
  ### What this skill writes
26
26
 
@@ -84,13 +84,13 @@ Build a narrow executor packet for the worker. The packet must include:
84
84
  - exactly one User Story path or story-local `.impl_plan/` folder
85
85
  - story, Epic brief, feature brief, technical design, and UX path when relevant
86
86
  - executor toolbox path: `.agents/skills/ai-implementation-executor-toolbox/SKILL.md`
87
- - required skill paths, always including `.agents/skills/clean-code/SKILL.md`
87
+ - 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
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
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”
90
90
  - 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
91
  - expected output format: changed files, completed steps, validation commands/results, risks, follow-up questions, and approval state
92
92
 
93
- Do not include exporter skills such as `export-to-github` or `export-to-notion` in the executor packet.
93
+ 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
94
 
95
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.
96
96
 
@@ -112,6 +112,9 @@ entrypoint / framework adapter -> domain workflow internals that bypass the Hand
112
112
 
113
113
  If dependency wiring needs infrastructure implementations, prefer a composition/bootstrap module or small factory that constructs the Handler. Keep request handling, command creation, and result translation separate from infrastructure behavior.
114
114
 
115
+ ### Rule 6: Operational Behavior Uses Structured Logging
116
+ When workflows, command handlers, entrypoints, jobs, external calls, retries, state changes, or operational outcomes need logging, also use `structured-logging`. Keep this architecture guidance focused on boundaries and delegate logging policy to that skill.
117
+
115
118
  ---
116
119
 
117
120
  ## 4. Implementation Workflow
@@ -100,6 +100,10 @@ if (!(playlist = await playlistRepository.findById(playlistId))) {
100
100
  - Match the surrounding style when it is already reasonable.
101
101
  - Use existing project conventions unless there is a strong reason not to.
102
102
 
103
+ ### 12. Keep operational behavior observable
104
+ - When code changes affect logs, workflows, handlers, jobs, external calls, errors, retries, long-running operations, state changes, or important outcomes, keep logging useful, concise, and safe.
105
+ - Use `structured-logging` for detailed logging guidance instead of duplicating that policy here.
106
+
103
107
  ## Decision rule
104
108
 
105
109
  When unsure, prefer:
@@ -72,6 +72,9 @@ Apply this skill together with `clean-code`. Keep this skill focused on Go-speci
72
72
  - Keep test cases named so failures explain themselves.
73
73
  - Test exported behavior and important package contracts, not private implementation trivia.
74
74
 
75
+ ### 10. Use structured logging for operational behavior
76
+ - When Go changes affect logs, workflows, handlers, jobs, external calls, errors, retries, state changes, or important outcomes, also use `structured-logging`.
77
+
75
78
  ## Decision rule
76
79
 
77
80
  When unsure, prefer:
@@ -61,19 +61,21 @@ This skill covers React componentization, component responsibility, state owners
61
61
  ### 7. Prefer composition over configuration-heavy components
62
62
  - Compose smaller components instead of building one component with many modes and flags.
63
63
  - If a component needs many boolean props, consider whether it is doing too much.
64
- - Use `children` or named subcomponents when composition makes the API clearer.
64
+ - Use `children` or named child component APIs when composition makes the API clearer, but keep each component implementation in its own nearby file.
65
65
 
66
66
  ### 8. Make component boundaries visible
67
67
  - Name components by what they represent in the UI or product.
68
68
  - Keep server-interacting, stateful, and presentational responsibilities easy to identify from the component shape.
69
69
  - Avoid mixing data fetching, mutation, layout, formatting, and low-level UI rendering in one component.
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.
71
- - If a helper component is only temporary, promote it to its own file as soon as it represents a meaningful UI responsibility.
70
+ - Each React component belongs in its own nearby file by default.
71
+ - Do not define helper subcomponents in a parent component file, even when they are small, file-local, currently unreused, named only for readability, or part of a compound component API.
72
+ - Same-file helpers are acceptable only when they are not React components, do not return JSX, and do not represent a UI responsibility. Constants, type aliases, and pure non-JSX helpers such as `formatStatusLabel()` may stay when they support the component without becoming UI.
73
+ - A function that returns JSX, represents a named UI region, renders a repeated unit, or owns UI state/interaction is a component. Move it to its own nearby file before finishing.
72
74
 
73
75
  ### 9. Build screens as composition roots, not component dumping grounds
74
76
  - 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
77
  - 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.
78
+ - If a UI region has its own state, interaction, repeated rendering, overlay, menu, empty/error/loading state, or domain formatting concern, extract it to a focused nearby file.
77
79
  - 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
80
  - 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
81
 
@@ -103,6 +105,59 @@ feature-format.ts
103
105
  feature-types.ts
104
106
  ```
105
107
 
108
+ Prefer separated component files:
109
+
110
+ ```tsx
111
+ // feature-shell.tsx
112
+ export function FeatureShell() {
113
+ return <FeatureList />;
114
+ }
115
+
116
+ // feature-list.tsx
117
+ export function FeatureList() {
118
+ return <FeatureListItem />;
119
+ }
120
+
121
+ // feature-list-item.tsx
122
+ export function FeatureListItem() {
123
+ return <li>Item</li>;
124
+ }
125
+ ```
126
+
127
+ Avoid multiple component implementations in one parent file:
128
+
129
+ ```tsx
130
+ export function FeatureShell() {
131
+ return <FeatureList />;
132
+ }
133
+
134
+ function FeatureList() {
135
+ return <FeatureListItem />;
136
+ }
137
+
138
+ function FeatureListItem() {
139
+ return <li>Item</li>;
140
+ }
141
+ ```
142
+
143
+ Allowed same-file helpers are non-components:
144
+
145
+ ```tsx
146
+ const statusLabels = { active: "Active" };
147
+
148
+ function formatStatusLabel(status: string) {
149
+ return statusLabels[status] ?? "Unknown";
150
+ }
151
+ ```
152
+
153
+ Avoid same-file JSX helpers:
154
+
155
+ ```tsx
156
+ function StatusBadge({ status }: { status: string }) {
157
+ return <span>{formatStatusLabel(status)}</span>;
158
+ }
159
+ ```
160
+
106
161
  ## Decision rule
107
162
 
108
163
  When unsure, prefer:
@@ -110,7 +165,7 @@ When unsure, prefer:
110
165
  2. route-level or feature-level containers that own only the interaction state they coordinate
111
166
  3. one clear responsibility per component
112
167
  4. more focused components instead of fewer overloaded components
113
- 5. one meaningful component per file by default
168
+ 5. one React component per nearby file by default
114
169
  6. nearby component files before shared abstractions
115
170
  7. stateless presentational components that render from props
116
171
  8. stateful components only where local interaction state is genuinely owned
@@ -121,10 +176,12 @@ When unsure, prefer:
121
176
 
122
177
  ## Componentization self-review
123
178
 
124
- Before finishing a React change, ask:
179
+ Before finishing a React change, inspect every changed React file and ask:
125
180
 
126
181
  - Can I understand the screen structure from the top-level file without reading repeated item, action surface, overlay, state, or formatting internals?
127
182
  - Are meaningful UI regions and repeated units in named components?
128
183
  - Does each file have one obvious reason to change?
184
+ - Does any changed file define more than one React component implementation, including small, file-local, currently unreused, named helper, or compound subcomponents?
185
+ - If multiple component implementations remain, did I split them into nearby files before finishing or explicitly explain why the remaining same-file helper is not a React component, does not return JSX, and does not represent UI responsibility?
129
186
  - Are server/client boundaries still as small as practical?
130
187
  - Did I avoid creating shared abstractions before there is real reuse?
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: structured-logging
3
+ description: Use when writing or modifying code that affects logging or meaningful operational behavior, so logs stay structured, safe, useful, and concise.
4
+ ---
5
+
6
+ # Structured Logging
7
+
8
+ Use this skill when writing or modifying code that emits logs or changes meaningful operational behavior: workflows, command handlers, jobs, external calls, retries, errors, long-running operations, state changes, important outcomes, or other observability-relevant paths.
9
+
10
+ Do not add logs to trivial pure logic, noisy implementation details, or paths where a log would not help someone diagnose what happened.
11
+
12
+ ## Logging approach
13
+
14
+ - Follow the repository's existing logging conventions first.
15
+ - If the project has no clear convention, choose a widely accepted logger for the current language, framework, and runtime.
16
+ - Do not introduce a new logging dependency when the repository already has a reasonable logging approach.
17
+ - Prefer a small first-party project-local helper or wrapper around the chosen logger when it keeps log calls concise and centralizes names, levels, formatting, or shared fields.
18
+
19
+ ## Structured logs
20
+
21
+ - Use structured, machine-readable logs for meaningful events; prefer JSON when the logger/runtime supports it.
22
+ - Use clear event names and consistent field names.
23
+ - Make logs tell an operational story: what started, what decision was made, what external interaction happened, what outcome occurred, and what failed or was retried.
24
+ - Include useful safe metadata when available, such as operation or workflow name, request or correlation id, safe entity ids, counts, timings, state transitions, outcomes, and safe error context.
25
+ - Keep individual log calls small; move repeated fields or formatting into a local helper instead of spreading boilerplate through business logic.
26
+
27
+ ## Safety
28
+
29
+ Never log secrets, credentials, tokens, API keys, session cookies, raw personal data, full prompts or model responses, or large user payloads. If context is useful but sensitive, log a safe identifier, count, type, or redacted summary instead.
@@ -101,6 +101,9 @@ type LoadState = {
101
101
  - Do not try to force every runtime guarantee into the type system.
102
102
  - Balance safety with readability and development speed.
103
103
 
104
+ ### 10. Use structured logging for operational behavior
105
+ - When TypeScript changes affect logs, workflows, handlers, jobs, external calls, errors, retries, state changes, or important outcomes, also use `structured-logging`.
106
+
104
107
  ## Decision rule
105
108
 
106
109
  When unsure, prefer: