@juancr11/sibu 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +198 -0
  2. package/bin/entrypoints/cli/command.js +1 -0
  3. package/bin/entrypoints/cli/create-program.js +33 -0
  4. package/bin/entrypoints/cli/execute-command.js +28 -0
  5. package/bin/entrypoints/cli/main.js +5 -0
  6. package/bin/features/doctor-project/command.js +1 -0
  7. package/bin/features/doctor-project/handler.js +194 -0
  8. package/bin/features/init-project/command.js +1 -0
  9. package/bin/features/init-project/handler.js +63 -0
  10. package/bin/features/list-skills/command.js +1 -0
  11. package/bin/features/list-skills/handler.js +55 -0
  12. package/bin/features/stop-managing-file/command.js +1 -0
  13. package/bin/features/stop-managing-file/handler.js +213 -0
  14. package/bin/features/sync-project/action-prompt.js +65 -0
  15. package/bin/features/sync-project/apply-action.js +81 -0
  16. package/bin/features/sync-project/command.js +1 -0
  17. package/bin/features/sync-project/handler.js +77 -0
  18. package/bin/features/sync-project/log-preview.js +62 -0
  19. package/bin/features/sync-project/preview.js +1 -0
  20. package/bin/features/use-skill/command.js +1 -0
  21. package/bin/features/use-skill/handler.js +197 -0
  22. package/bin/shared/catalog.js +199 -0
  23. package/bin/shared/hash.js +11 -0
  24. package/bin/shared/npm-version.js +178 -0
  25. package/bin/shared/object.js +3 -0
  26. package/bin/shared/paths.js +41 -0
  27. package/bin/shared/prompts.js +205 -0
  28. package/bin/shared/state.js +76 -0
  29. package/bin/shared/sync-preview.js +166 -0
  30. package/bin/shared/templates.js +60 -0
  31. package/bin/shared/types.js +1 -0
  32. package/bin/shared/workflow-mutation-readiness.js +30 -0
  33. package/bin/shared/workflow-targets.js +119 -0
  34. package/bin/sibu.js +6 -0
  35. package/package.json +68 -0
  36. package/templates/.codex/config.toml +1 -0
  37. package/templates/AGENTS.md +60 -0
  38. package/templates/CLAUDE.md +5 -0
  39. package/templates/GEMINI.md +5 -0
  40. package/templates/manifest.json +129 -0
  41. package/templates/skills/ai-implementation-plan-executor/SKILL.md +138 -0
  42. package/templates/skills/ai-implementation-planner/SKILL.md +213 -0
  43. package/templates/skills/architecture/command-pattern/SKILL.md +77 -0
  44. package/templates/skills/architecture/ddd-hexagonal/SKILL.md +212 -0
  45. package/templates/skills/clean-code/SKILL.md +109 -0
  46. package/templates/skills/feature-brief-writer/SKILL.md +219 -0
  47. package/templates/skills/golang/SKILL.md +82 -0
  48. package/templates/skills/nextjs/SKILL.md +94 -0
  49. package/templates/skills/product-vision-writer/SKILL.md +128 -0
  50. package/templates/skills/react/SKILL.md +75 -0
  51. package/templates/skills/scrum-master-planner/SKILL.md +191 -0
  52. package/templates/skills/technical-design-writer/SKILL.md +109 -0
  53. package/templates/skills/typescript/SKILL.md +111 -0
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: command-pattern
3
+ description: Use this skill to design and implement software features as independent, end-to-end Vertical Slices using the Command Pattern, Hexagonal Architecture, and DDD principles.
4
+ ---
5
+
6
+ # Skill: Command-Oriented Vertical Slice Architect
7
+
8
+ ## Description
9
+ Use this skill to design and implement software features as independent, end-to-end Vertical Slices. This approach combines the Command Pattern with Hexagonal Architecture and DDD principles. It ensures that business logic is decoupled from transport layers (CLI, API) and infrastructure (Databases, Third-party SDKs).
10
+
11
+ ---
12
+
13
+ ## 1. The Component Contract
14
+ Every feature is defined by four distinct roles. This separation ensures that the "Core" logic remains pure and testable.
15
+
16
+ | Component | Responsibility | Constraints |
17
+ | :--- | :--- | :--- |
18
+ | **Command** | Represents Intent | A flat, immutable data structure. No logic, no dependencies. |
19
+ | **Handler** | Represents Execution | The orchestrator. Receives one Command, coordinates with Ports, and returns a Result. |
20
+ | **Port** | Represents Requirement | An interface defined inside the feature folder describing what the handler needs (e.g., SaveUserPort). |
21
+ | **Adapter** | Represents Implementation | The low-level code (SQL, HTTP Client) that satisfies a Port. |
22
+
23
+ ---
24
+
25
+ ## 2. Directory Structure (The "Vertical Slice" Blueprint)
26
+ Organize by Capability (what the system does) rather than Technical Layer (what the code is). This minimizes "shotgun surgery" and increases cohesion.
27
+
28
+ ```text
29
+ /src
30
+ ├── /entrypoints # Driving Adapters (The "Edges")
31
+ │ └── /cli # Parses flags/args -> creates Command -> calls Handler
32
+ ├── /features # THE HEXAGON (Domain & Application Logic)
33
+ │ └── /feature-name # e.g., "archive-project"
34
+ │ ├── command # The Input DTO
35
+ │ ├── handler # The Orchestration logic
36
+ │ ├── ports # Interfaces required by the handler
37
+ │ └── result # The Output DTO/Contract
38
+ ├── /shared # Universal logic only
39
+ │ ├── /domain # Global Entities (e.g., "User", "Project")
40
+ │ └── /errors # Global error definitions
41
+ └── /infrastructure # Driven Adapters (Implementation Details)
42
+ ├── /persistence # DB implementations of feature Ports
43
+ └── /clients # External API implementations of feature Ports
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 3. Operational Rules for Implementation
49
+
50
+ ### Rule 1: Feature Isolation
51
+ A feature folder must never import from another feature folder. If two features need the same logic, that logic must be promoted to the /shared directory.
52
+
53
+ ### Rule 2: Dependency Inversion
54
+ The Handler must never instantiate a database, a file system, or a network client. It must receive its dependencies (via Ports) through its constructor or initialization.
55
+
56
+ ### Rule 3: Transport Agnosticism
57
+ The Handler must be "blind" to the entrypoint. It should not know if it is being triggered by a CLI terminal, a Cron job, or a REST API. It returns domain results, never transport-specific codes (e.g., no HTTP 404s or CLI exit codes).
58
+
59
+ ### Rule 4: Thin Entrypoints
60
+ Entrypoints (CLI/API) are responsible for Syntactic Validation (is the input the right type?). Handlers are responsible for Semantic Validation (does this operation make sense in the current state of the system?).
61
+
62
+ ---
63
+
64
+ ## 4. Implementation Workflow
65
+ 1. Define the Command: Identify the minimum data needed to represent the user's intent.
66
+ 2. Define the Ports: Identify what external systems the handler needs to talk to. Define these as interfaces in the feature folder.
67
+ 3. Implement the Handler: Write the coordination logic. Fetch entities, apply business rules, and use Ports to persist changes.
68
+ 4. Wire the Adapter: Implement the concrete infrastructure code in the /infrastructure layer.
69
+ 5. Connect the Entrypoint: In the CLI layer, map raw input to the Command and trigger the Handler.
70
+
71
+ ---
72
+
73
+ ## 5. Constraint Checklist for Agent Reviews
74
+ - [ ] Zero Leakage: Does the Handler contain CLI-specific code (like fmt.Printf or flags)?
75
+ - [ ] Interface-Driven: Does the Handler depend on a concrete Database class or an Interface (Port)?
76
+ - [ ] Folder Integrity: Does the feature folder contain the Command, Handler, and Ports?
77
+ - [ ] Dependency Direction: Does the infrastructure layer depend on the feature ports, and not the other way around?
@@ -0,0 +1,212 @@
1
+ ---
2
+ name: ddd-hexagonal
3
+ description: Use this skill for back-end architecture decisions in projects that selected DDD and Hexagonal Architecture.
4
+ ---
5
+
6
+ # ddd-hexagonal
7
+
8
+ Use this skill for back-end architecture decisions in projects that selected DDD and Hexagonal Architecture.
9
+
10
+ Use it when deciding where code belongs, how to structure a feature, whether a port is needed, or how to keep business logic separated from infrastructure.
11
+
12
+ This skill is backend-focused. It does not cover frontend component architecture, React patterns, or UX concerns.
13
+
14
+ ## Use this skill for
15
+
16
+ - backend feature design
17
+ - domain/application/infra placement
18
+ - use case design
19
+ - port and adapter decisions
20
+ - repository and external service boundaries
21
+ - server-side refactors that affect architecture
22
+ - reviewing whether backend code respects DDD + Hexagonal Architecture
23
+
24
+ ## Main rule
25
+
26
+ > **Keep the domain pure, let the application orchestrate, let adapters translate, and keep dependencies pointing inward.**
27
+
28
+ If a simpler structure preserves clear boundaries, prefer the simpler structure.
29
+
30
+ ## The layers
31
+
32
+ ### Domain
33
+ The domain contains business concepts, rules, and invariants.
34
+
35
+ Domain should contain:
36
+ - business concepts
37
+ - domain rules
38
+ - invariants
39
+ - domain language
40
+
41
+ Domain should not contain:
42
+ - framework code
43
+ - database concerns
44
+ - SDK clients
45
+ - filesystem code
46
+ - transport-specific request/response shapes
47
+
48
+ ### Application
49
+ The application layer coordinates use cases.
50
+
51
+ Application should contain:
52
+ - use cases
53
+ - application orchestration
54
+ - outgoing ports when external capabilities are needed
55
+ - incoming ports when they add clarity
56
+
57
+ Application should not contain:
58
+ - infrastructure implementations
59
+ - low-level SDK or DB details
60
+ - framework entrypoint logic
61
+
62
+ ### Infrastructure
63
+ Infrastructure contains technical details and adapter implementations.
64
+
65
+ Infrastructure should contain:
66
+ - repository implementations
67
+ - external API clients
68
+ - SDK integrations
69
+ - filesystem/storage integrations
70
+ - queue or messaging integrations
71
+
72
+ Infrastructure should not own business rules.
73
+
74
+ ## Dependency rule
75
+
76
+ > **Dependencies point inward. Implementations point outward.**
77
+
78
+ This means:
79
+ - driving code depends on the application boundary
80
+ - the application depends on domain concepts and outgoing ports
81
+ - infrastructure depends on application/domain contracts to implement them
82
+ - the domain depends on nothing outside itself
83
+
84
+ If business logic needs a DB client, SDK response, HTTP object, or framework context directly, the boundary is probably wrong.
85
+
86
+ ## Domain modeling: entity, value object, or neither
87
+
88
+ Do not force DDD labels onto every concept. Use them only when they buy clarity, express real business meaning, or protect invariants.
89
+
90
+ ### Use an entity when identity matters
91
+ Model something as an entity when:
92
+ - it has continuity over time
93
+ - it can change while remaining the same conceptual thing
94
+ - the business cares which specific instance it is
95
+ - identity matters more than raw field equality
96
+
97
+ Examples often include users, playlists, subscriptions, or other concepts with lifecycle and identity.
98
+
99
+ ### Use a value object when value and invariants matter
100
+ Model something as a value object when:
101
+ - identity does not matter
102
+ - equality is based on value
103
+ - the concept has validation or invariants worth protecting
104
+ - wrapping a primitive or object makes the domain clearer
105
+
106
+ Examples often include email addresses, money, ranges, normalized names, or other validated domain values.
107
+
108
+ ### Use neither when the concept is simple and gains little from extra modeling
109
+ Do not create an entity or value object when:
110
+ - the data is simple and obvious
111
+ - there are no meaningful invariants to protect
112
+ - identity is not important
113
+ - a plain type, plain object, or application-level DTO is enough
114
+ - introducing a domain type would add ceremony without improving understanding
115
+
116
+ ### Rule
117
+ > **Prefer the lightest model that preserves meaning and invariants.**
118
+
119
+ ## Practical project mapping
120
+
121
+ Use this default mapping when the project does not already have a clearer convention:
122
+
123
+ - `<feature-or-domain>/domain/**` → domain concepts and rules
124
+ - `<feature-or-domain>/application/**` → use cases and application orchestration
125
+ - `<feature-or-domain>/infra/**` → technical implementations and external integrations
126
+ - entrypoints such as routes, jobs, or handlers → thin driving adapters that call application behavior
127
+
128
+ ## Ports and adapters
129
+
130
+ ### Use ports where they buy clarity
131
+ Introduce a port when the application needs a capability but should not depend on its implementation.
132
+
133
+ Good reasons:
134
+ - isolation
135
+ - testability
136
+ - clearer boundaries
137
+
138
+ Bad reasons:
139
+ - habit
140
+ - ceremony
141
+ - abstraction for its own sake
142
+
143
+ ### Adapters translate
144
+ Adapters translate between the application model and external systems.
145
+
146
+ Typical driven adapters:
147
+ - repository implementations
148
+ - external API clients
149
+ - storage clients
150
+ - SDK wrappers
151
+
152
+ Adapters should hide technical details rather than leak them inward.
153
+
154
+ ## Use cases
155
+
156
+ A use case should represent one meaningful backend capability.
157
+
158
+ A use case should:
159
+ - orchestrate domain logic and required ports explicitly
160
+ - stay readable and focused
161
+ - express one meaningful application action
162
+
163
+ A use case should not:
164
+ - become a dumping ground for unrelated helpers
165
+ - hide infrastructure details inline
166
+ - absorb framework behavior that belongs in adapters
167
+
168
+ ## Simplicity rule
169
+
170
+ - Use the fewest layers that preserve clear boundaries.
171
+ - Do not add ports, services, or abstractions unless they clearly improve clarity or isolation.
172
+ - Do not split concepts just to look architecturally sophisticated.
173
+ - Architecture should reduce confusion, not create it.
174
+
175
+ ## Boundary tests
176
+
177
+ When deciding where code belongs, ask:
178
+
179
+ 1. Is this business logic or technical plumbing?
180
+ 2. Does this concept exist in the business, or only because of a framework, API, or DB?
181
+ 3. Would this code still make sense if we changed the underlying technology?
182
+ 4. Is this orchestrating behavior, or implementing a technical detail?
183
+ 5. Is this abstraction buying clarity, or only adding indirection?
184
+
185
+ ## Common mistakes
186
+
187
+ ### 1. Putting business logic in entrypoint code
188
+ Route handlers, jobs, or other entrypoints should trigger application behavior, not contain meaningful business rules.
189
+
190
+ ### 2. Letting use cases depend directly on SDKs, DB clients, or framework objects
191
+ This collapses the application boundary.
192
+
193
+ ### 3. Treating every helper as a domain concept
194
+ This makes the domain noisy and artificial.
195
+
196
+ ### 4. Over-abstracting with too many ports and interfaces
197
+ This creates ceremony instead of clarity.
198
+
199
+ ### 5. Letting technical data shapes define the internal model
200
+ This allows infrastructure concerns to leak inward.
201
+
202
+ ### 6. Creating layers without real responsibility
203
+ This grows file structure without improving understanding.
204
+
205
+ ## Practical default
206
+
207
+ When unsure, prefer:
208
+ 1. clear boundaries
209
+ 2. simple code
210
+ 3. explicit orchestration
211
+ 4. minimal necessary abstraction
212
+ 5. business concepts over technical leakage
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: clean-code
3
+ description: Use this skill when writing or modifying code and you need general code-quality guidance.
4
+ ---
5
+
6
+ # clean-code
7
+
8
+ Use this skill when writing or modifying code and you need general code-quality guidance.
9
+
10
+ Apply these principles by default unless a more specific repo rule or task requirement overrides them.
11
+
12
+ ## Use this skill for
13
+
14
+ - writing new code
15
+ - editing existing code
16
+ - reviewing implementation quality
17
+ - simplifying code during an in-scope change
18
+
19
+ ## Core principles
20
+
21
+ ### 1. Prefer clarity over cleverness
22
+ - Write code that is easy to read on the first pass.
23
+ - Avoid surprising control flow, hidden side effects, and dense expressions.
24
+ - If a simpler form exists, prefer it.
25
+
26
+ ### 2. Use clear, descriptive names
27
+ - Names should reveal intent.
28
+ - Prefer names that explain what something represents or does.
29
+ - Avoid unnecessary abbreviations unless they are obvious in context.
30
+
31
+ #### Prefer
32
+ ```ts
33
+ const authenticatedUserId = session.user.id;
34
+ const recommendedTracks = buildRecommendedTracks(seedTracks);
35
+ ```
36
+
37
+ #### Avoid
38
+ ```ts
39
+ const uid = session.user.id;
40
+ const recs = buildRecommendedTracks(seedTracks);
41
+ ```
42
+
43
+ ### 3. Keep functions focused
44
+ - A function should do one thing well.
45
+ - If a function is doing multiple conceptually different jobs, split it.
46
+ - Keep nested logic shallow when possible.
47
+
48
+ ### 4. Keep control flow simple
49
+ - Prefer straightforward conditionals over clever compact forms.
50
+ - Avoid inline assignments in conditionals.
51
+ - Prefer early returns or clear branching when they improve readability.
52
+
53
+ #### Prefer
54
+ ```ts
55
+ const playlist = await playlistRepository.findById(playlistId);
56
+
57
+ if (!playlist) {
58
+ throw new Error("Playlist not found");
59
+ }
60
+ ```
61
+
62
+ #### Avoid
63
+ ```ts
64
+ if (!(playlist = await playlistRepository.findById(playlistId))) {
65
+ throw new Error("Playlist not found");
66
+ }
67
+ ```
68
+
69
+ ### 5. Keep the right level of abstraction
70
+ - A function or module should not mix high-level policy with low-level details without a good reason.
71
+ - Keep related concepts together.
72
+ - Separate orchestration from implementation detail when that separation improves understanding.
73
+
74
+ ### 6. Prefer the simplest solution that works
75
+ - Prefer the simplest solution that satisfies the real requirement.
76
+ - Do not add abstraction, indirection, or configurability unless it clearly pays for itself.
77
+ - If a simple solution is sufficient, stop there.
78
+
79
+ ### 7. Avoid duplication with judgment
80
+ - Remove meaningful duplication when it reduces maintenance cost.
81
+ - Do not introduce premature abstractions just to eliminate a small amount of repetition.
82
+ - Prefer a little duplication over the wrong abstraction.
83
+
84
+ ### 8. Comments should add value
85
+ - Prefer code that explains itself.
86
+ - Use comments when they provide context, intent, or rationale that the code alone cannot express.
87
+ - Do not add comments that merely restate the code.
88
+
89
+ ### 9. Make error paths understandable
90
+ - Error handling should be explicit and readable.
91
+ - Add useful context when surfacing errors.
92
+ - Do not hide failure paths in clever expressions.
93
+
94
+ ### 10. Keep changes tidy
95
+ - During a requested change, it is good to remove clearly unused code or obvious local clutter when it is safe and in scope.
96
+ - Leave the touched area cleaner than you found it, without drifting into unrelated refactors.
97
+
98
+ ### 11. Prefer consistency
99
+ - Match the surrounding style when it is already reasonable.
100
+ - Use existing project conventions unless there is a strong reason not to.
101
+
102
+ ## Decision rule
103
+
104
+ When unsure, prefer:
105
+ 1. readability
106
+ 2. simplicity
107
+ 3. explicitness
108
+ 4. small focused units
109
+ 5. consistency with the surrounding code
@@ -0,0 +1,219 @@
1
+ ---
2
+ name: feature-brief-writer
3
+ description: Use this skill to define business-level feature briefs that stay loyal to docs/product-vision.md before UX, technical design, or implementation work.
4
+ ---
5
+
6
+ # Feature Brief Writer
7
+
8
+ ## Purpose
9
+
10
+ Create concise feature briefs that explain what a feature is, why it matters, who it serves, and how it follows the product vision required by this skill.
11
+
12
+ Every feature shaped with this skill must stay loyal to `docs/product-vision.md`: it should support the product's purpose, fit its intended audience, respect its boundaries, and move in the same direction as its success signals.
13
+
14
+ This skill owns the product/business shape of a feature. It does not own UI interaction design, technical architecture, implementation plans, data models, APIs, or task breakdowns.
15
+
16
+ ## Required source of truth
17
+
18
+ Before doing any feature-brief work, read:
19
+
20
+ ```txt
21
+ docs/product-vision.md
22
+ ```
23
+
24
+ Use the product vision as the source of truth for the product's purpose, audience, positioning, principles, voice, boundaries, trust expectations, and success signals.
25
+
26
+ Do not duplicate or rewrite the product vision inside the feature brief. Apply it to the specific feature being defined.
27
+
28
+ ## Hard start rule
29
+
30
+ Do not start a feature brief if `docs/product-vision.md` is missing.
31
+
32
+ If the product vision is missing:
33
+
34
+ 1. Stop.
35
+ 2. Tell the user that a feature brief requires `docs/product-vision.md`.
36
+ 3. Instruct the user to create the product vision first with the `product-vision-writer` skill.
37
+ 4. Do not draft, infer, or save a feature brief until the product vision exists.
38
+
39
+ ## Use this skill for
40
+
41
+ - defining a new feature at the business/product level
42
+ - turning a rough feature idea into a scoped feature brief
43
+ - clarifying user value, product fit, and business rationale
44
+ - deciding MVP vs later scope at a product level
45
+ - identifying non-technical risks, assumptions, dependencies, and tradeoffs
46
+ - defining business-level acceptance criteria
47
+ - checking whether a feature fits the product vision
48
+
49
+ ## Output location
50
+
51
+ When asked to create a file, write the feature brief to:
52
+
53
+ ```txt
54
+ docs/features/<feature-slug>/feature_brief.md
55
+ ```
56
+
57
+ Use a short kebab-case feature slug that matches the feature name. Keep all artifacts for the same feature together under `docs/features/<feature-slug>/`.
58
+
59
+ 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.
60
+
61
+ ## Workflow
62
+
63
+ ### 1. Read the product vision
64
+
65
+ Read `docs/product-vision.md` first and identify:
66
+
67
+ - the product's core promise
68
+ - target users and scenarios
69
+ - product positioning
70
+ - product principles
71
+ - boundaries and anti-goals
72
+ - trust, quality, or voice expectations
73
+ - success signals
74
+
75
+ Use these as constraints for the feature brief.
76
+
77
+ ### 2. Clarify vague feature intent before drafting
78
+
79
+ Do not draft a feature brief from a vague request.
80
+
81
+ A request is too vague when the user gives only a broad area, product milestone, theme, or label such as "define the MVP," "write the onboarding feature," "make a sync feature," or "I want analytics" without enough detail to know what the user actually means.
82
+
83
+ When feature intent is vague:
84
+
85
+ 1. Stop before drafting.
86
+ 2. Explain briefly that the feature direction needs clarification before a responsible brief can be written.
87
+ 3. Ask one focused discovery question.
88
+ 4. Wait for the user's answer.
89
+ 5. Continue asking one question at a time until there is enough context to write a useful, product-vision-aligned brief.
90
+
91
+ Do not ask the user to answer a large questionnaire all at once. Keep the interview conversational and focused.
92
+
93
+ ### 3. Gather the minimum required feature context
94
+
95
+ Ask only for missing information that materially affects the brief. Prefer the fewest questions needed to produce a useful document, but ask as many one-at-a-time questions as needed when the feature is underdefined.
96
+
97
+ Clarify:
98
+
99
+ - what feature or capability the user wants
100
+ - what the user means by broad labels such as MVP, onboarding, sync, analytics, or automation
101
+ - what user or business problem it addresses
102
+ - who the feature is for
103
+ - when and why the target user would use it
104
+ - what outcome should improve
105
+ - what must be included in the first version
106
+ - what should stay out of scope
107
+ - known constraints, risks, or open decisions
108
+
109
+ Only move to drafting once the feature intent, target user or scenario, desired outcome, and rough MVP boundary are clear enough to avoid inventing the product direction.
110
+
111
+ ### 4. Write a business-level brief
112
+
113
+ Write in Markdown. Keep the brief clear, decision-oriented, and non-technical.
114
+
115
+ Recommended structure:
116
+
117
+ ```md
118
+ # <Feature Name> Feature Brief
119
+
120
+ ## Summary
121
+ <One-paragraph description of the feature and why it matters.>
122
+
123
+ ## Product Vision Fit
124
+ <How this feature supports the product vision, principles, audience, or positioning.>
125
+
126
+ ## User / Customer Problem
127
+ <The user need, pain, desire, or opportunity this feature addresses.>
128
+
129
+ ## Business Goal
130
+ <The product or business outcome this feature should improve.>
131
+
132
+ ## Target User / Scenario
133
+ <Who this is for and when they would use it.>
134
+
135
+ ## Proposed Experience
136
+ <Business-level user experience, not implementation details.>
137
+
138
+ ## MVP Scope
139
+ - <What belongs in the first useful version.>
140
+
141
+ ## Out of Scope
142
+ - <What is intentionally excluded for now.>
143
+
144
+ ## Success Signals
145
+ - <Observable user, product, or business signals that indicate the feature is working.>
146
+
147
+ ## Business-Level Acceptance Criteria
148
+ - <Testable product behavior or outcome, stated without technical implementation details.>
149
+
150
+ ## Risks / Tradeoffs
151
+ - <Important product, user, trust, operational, or positioning risks.>
152
+
153
+ ## Open Questions
154
+ - <Decisions that still need user/product input.>
155
+ ```
156
+
157
+ Adapt the structure to the feature. Add, rename, merge, or omit sections when useful, but keep the result business-level and product-vision-aligned.
158
+
159
+ ### 5. Keep technical detail out
160
+
161
+ Do not include:
162
+
163
+ - architecture diagrams
164
+ - implementation plans
165
+ - database schemas
166
+ - API contracts
167
+ - library choices
168
+ - engineering task lists
169
+ - UI wireframes or detailed interaction specs
170
+
171
+ If technical or UX decisions come up, capture them as brief product-level constraints or open questions.
172
+
173
+ ### 6. Save the document
174
+
175
+ Create the feature directory if needed and save the document at:
176
+
177
+ ```txt
178
+ docs/features/<feature-slug>/feature_brief.md
179
+ ```
180
+
181
+ If the file already exists, read it first. Treat the request as a revision when the user asks to revise, clarify, or update the feature brief. Ask before overwriting an existing brief when the user appears to be asking for a separate new feature.
182
+
183
+ ## Writing style
184
+
185
+ Aim for writing that is:
186
+
187
+ - loyal to the required product vision
188
+ - specific to the user's feature
189
+ - grounded in the product vision
190
+ - concise
191
+ - opinionated enough to guide later decisions
192
+ - understandable by non-engineering stakeholders
193
+
194
+ Avoid:
195
+
196
+ - generic startup language
197
+ - technical implementation detail
198
+ - vague benefits without user or business grounding
199
+ - feature lists without rationale
200
+ - drafting from vague feature labels without discovery
201
+ - inventing certainty where the product vision or user input is unresolved
202
+
203
+ ## Decision rule
204
+
205
+ When shaping a feature brief, prefer:
206
+
207
+ 1. alignment with `docs/product-vision.md`
208
+ 2. clear user value
209
+ 3. clear business or product outcome
210
+ 4. simple MVP scope
211
+ 5. honest boundaries and tradeoffs
212
+ 6. measurable success signals
213
+ 7. non-technical acceptance criteria
214
+
215
+ ## Final response behavior
216
+
217
+ After writing the file, briefly report the path that was created or updated. Include the full feature brief in the response only if the user asks to review it inline.
218
+
219
+ If file writes are unavailable, provide the Markdown content and state that it is intended for `docs/features/<feature-slug>/feature_brief.md`.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: golang
3
+ description: Use this skill when writing or modifying Go files and you need practical Go guidance grounded in Effective Go and standard Go conventions.
4
+ ---
5
+
6
+ # golang
7
+
8
+ Use this skill when writing or modifying `.go` files and you need practical Go guidance.
9
+
10
+ Apply this skill together with `clean-code`. Keep this skill focused on Go-specific decisions, not generic code-quality advice.
11
+
12
+ ## Use this skill for
13
+
14
+ - writing new Go code
15
+ - editing existing Go packages
16
+ - shaping package APIs
17
+ - choosing between structs, interfaces, methods, and functions
18
+ - writing idiomatic Go error handling, concurrency, and tests
19
+
20
+ ## Core principles
21
+
22
+ ### 1. Follow Go's default shape
23
+ - Let `gofmt` and standard Go conventions decide most formatting.
24
+ - Prefer short, clear names that match common Go usage.
25
+ - Use lowercase package names with no underscores when possible.
26
+ - Favor the standard library before adding dependencies.
27
+
28
+ ### 2. Keep packages small and APIs narrower than implementations
29
+ - Organize code around packages with clear responsibilities.
30
+ - Keep exported surface area small.
31
+ - Export only what callers truly need.
32
+
33
+ ### 3. Prefer concrete types and useful zero values
34
+ - Design structs so the zero value is useful when practical.
35
+ - Prefer plain structs and functions over unnecessary constructors or class-like patterns.
36
+ - Avoid pointers unless mutation, sharing, interface contracts, or copy cost justify them.
37
+ - Return concrete types unless callers truly benefit from an interface.
38
+
39
+ ### 4. Keep interfaces small and define them where they are used
40
+ - Prefer tiny behavior-focused interfaces, often with one or two methods.
41
+ - Usually define interfaces in the consuming package, not the implementing package.
42
+ - Do not introduce interfaces just for future flexibility or mocking.
43
+ - Accept interfaces when you need abstraction; return concrete types when you can.
44
+
45
+ ### 5. Handle errors explicitly
46
+ - Return `error` for expected failure paths.
47
+ - Add context with wrapping, such as `fmt.Errorf("read config: %w", err)`.
48
+ - Use sentinel errors or typed errors only when callers need branching behavior.
49
+ - Do not use `panic` for normal control flow.
50
+
51
+ ### 6. Choose methods and receivers deliberately
52
+ - Use value receivers for small immutable-like values.
53
+ - Use pointer receivers when methods mutate state, the type is large, or receiver consistency matters.
54
+ - Keep receiver style consistent for a given type.
55
+ - Prefer functions over methods when behavior does not depend on receiver state.
56
+
57
+ ### 7. Keep control flow straightforward
58
+ - Prefer early returns for error handling.
59
+ - Use `switch` when it reads better than long `if` chains.
60
+ - Use `for` and `range` directly instead of trying to simulate other loop styles.
61
+ - Keep `defer` close to the resource acquisition it cleans up.
62
+
63
+ ### 8. Use concurrency only when it clarifies or improves the design
64
+ - Do not add goroutines or channels unless they solve a real coordination or latency problem.
65
+ - Use `context.Context` for cancellation, deadlines, and request-scoped work.
66
+ - Be explicit about goroutine lifetime and shutdown paths.
67
+ - Prefer simple ownership and communication over shared mutable state.
68
+
69
+ ### 9. Write table-driven tests when they improve coverage and readability
70
+ - Prefer small, focused tests in the same package unless external-package tests add value.
71
+ - Use table-driven tests for repeated input/output cases.
72
+ - Keep test cases named so failures explain themselves.
73
+ - Test exported behavior and important package contracts, not private implementation trivia.
74
+
75
+ ## Decision rule
76
+
77
+ When unsure, prefer:
78
+ 1. standard library and Go conventions
79
+ 2. smaller package APIs
80
+ 3. concrete types over premature interfaces
81
+ 4. explicit error handling
82
+ 5. simple sequential code before concurrency