habithive-code 0.2.4 → 0.3.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.
@@ -0,0 +1,278 @@
1
+ name: intent-driven
2
+ version: 1
3
+ description: Intent-driven OpenSpec workflow - proposal -> Gherkin-style specs -> design -> adr -> tasks
4
+ context:
5
+ artifacts:
6
+ - id: proposal
7
+ generates: proposal.md
8
+ description: Initial proposal document outlining the change
9
+ template: proposal.md
10
+ instruction: >
11
+ Create the proposal document that establishes WHY this change is needed.
12
+
13
+
14
+ Sections:
15
+
16
+ - **Why**: 1-2 sentences on the problem or opportunity. What problem does
17
+ this solve? Why now?
18
+
19
+ - **What Changes**: Bullet list of changes. Be specific about new
20
+ capabilities, modifications, or removals. Mark breaking changes with
21
+ **BREAKING**.
22
+
23
+ - **Capabilities**: Identify which behaviour specs will be created or modified:
24
+ - **New Capabilities**: List capabilities being introduced. Each becomes a new `specs/<name>/spec.md`. Use kebab-case names (e.g., `user-auth`, `data-export`).
25
+ - **Modified Capabilities**: List existing capabilities whose behaviour is changing. Only include if spec-level behaviour changes, not just implementation details. Each needs an OpenSpec Markdown delta file at `specs/<name>/spec.md`. Check `openspec/specs/` for existing spec names. Leave empty if no behaviour changes.
26
+ - **Impact**: Affected code, APIs, dependencies, or systems.
27
+
28
+
29
+ IMPORTANT: The Capabilities section is critical. It creates the contract
30
+ between proposal and specs phases. Research existing specs before filling
31
+ this in. Each capability listed here will need a corresponding spec file.
32
+
33
+
34
+ Durable architectural decisions worth carrying across changes are
35
+ distilled into ADR files at <repo>/adr/ by a later step after design.
36
+
37
+
38
+ Keep it concise (1-2 pages). Focus on the "why" not the "how" -
39
+ implementation details belong in design.md.
40
+
41
+
42
+ This is the foundation - specs, design, adr, and tasks all build on this.
43
+ requires: []
44
+ - id: specs
45
+ generates: specs/**/*.md
46
+ description: OpenSpec Markdown specs with Gherkin-style behaviour scenarios
47
+ template: spec.md
48
+ instruction: >
49
+ Create OpenSpec Markdown spec files that define WHAT the system should do.
50
+ The Markdown structure is the OpenSpec merge wrapper; the requirement and
51
+ scenario content inside that wrapper should be written in Gherkin style.
52
+
53
+
54
+ Create one spec file per capability listed in the proposal's Capabilities
55
+ section.
56
+
57
+ - New capabilities: use the exact kebab-case name from the proposal
58
+ (specs/<capability>/spec.md).
59
+
60
+ - Modified capabilities: use the existing spec folder name from
61
+ openspec/specs/<capability>/ when creating the delta spec at
62
+ specs/<capability>/spec.md.
63
+
64
+
65
+ Delta operations (use ## headers exactly so OpenSpec archive can merge):
66
+
67
+ - **ADDED Requirements**: New behaviour capabilities.
68
+
69
+ - **MODIFIED Requirements**: Changed behaviour - MUST include the full
70
+ updated requirement content, not a partial diff.
71
+
72
+ - **REMOVED Requirements**: Deprecated behaviours - MUST include
73
+ **Reason** and **Migration**.
74
+
75
+ - **RENAMED Requirements**: Name changes only - use FROM:/TO: format.
76
+
77
+
78
+ OpenSpec wrapper requirements:
79
+
80
+ - Each requirement MUST use `### Requirement: <name>`.
81
+
82
+ - Each scenario MUST use `#### Scenario: <name>`. This exact four-hash
83
+ heading is required for OpenSpec validation and archive.
84
+
85
+ - Every requirement MUST have at least one scenario.
86
+
87
+
88
+ Gherkin-style content requirements:
89
+
90
+ - Treat each requirement as the feature or business rule being specified.
91
+ You may include `Feature:` or `Rule:` prose in the requirement body when
92
+ it clarifies the behaviour.
93
+
94
+ - Each scenario MUST describe behaviour with `GIVEN`, `WHEN`, and `THEN`
95
+ steps. Use `AND` or `BUT` for follow-on steps.
96
+
97
+ - Write observable outcomes in `THEN` steps. Avoid implementation details
98
+ such as database table names, private methods, or UI selectors unless
99
+ they are part of the domain contract.
100
+
101
+ - Do not create `.feature` files for this artifact. External Gherkin
102
+ linting is outside this schema; `spec.md` is required for OpenSpec merge.
103
+
104
+
105
+ MODIFIED requirements workflow:
106
+
107
+ 1. Locate the existing requirement in openspec/specs/<capability>/spec.md.
108
+
109
+ 2. Copy the ENTIRE requirement block (from `### Requirement:` through all
110
+ scenarios).
111
+
112
+ 3. Paste under `## MODIFIED Requirements` and edit it so the copied block
113
+ represents the full desired behaviour after the change.
114
+
115
+ 4. Ensure header text matches exactly (whitespace-insensitive).
116
+
117
+
118
+ Common pitfall: Using MODIFIED with partial content loses detail at
119
+ archive time. If adding new concerns without changing existing behaviour,
120
+ use ADDED instead.
121
+ requires:
122
+ - proposal
123
+ - id: design
124
+ generates: design.md
125
+ description: Technical design document with implementation details
126
+ template: design.md
127
+ instruction: >
128
+ Create the design document that explains HOW to implement the change.
129
+
130
+
131
+ When to include design.md (create only if any apply):
132
+
133
+ - Cross-cutting change (multiple services/modules) or new architectural
134
+ pattern
135
+
136
+ - New external dependency or significant data model changes
137
+
138
+ - Security, performance, or migration complexity
139
+
140
+ - Ambiguity that benefits from technical decisions before coding
141
+
142
+
143
+ Prior decisions (read existing ADRs first):
144
+
145
+ Before writing, list every file in <repo>/adr/. Build the supersession
146
+ graph from each ADR's Supersedes field - an ADR is no longer in force if
147
+ a later ADR's Supersedes points at it. Only the currently-in-force ADRs
148
+ (accepted, not superseded) constrain this design. Older superseded ADRs
149
+ are historical context only and MUST NOT be treated as live commitments.
150
+ New design choices MUST be coherent with the in-force set. If a current
151
+ ADR needs to be revisited, do not propose modifying it; flag it under
152
+ Open Questions and let the adr step record a new superseding ADR.
153
+
154
+
155
+ Sections:
156
+
157
+ - **Context**: Background, current state, constraints, stakeholders
158
+
159
+ - **Goals / Non-Goals**: What this design achieves and explicitly excludes
160
+
161
+ - **Decisions**: Key technical choices with rationale (why X over Y?).
162
+ Include alternatives considered for each decision.
163
+
164
+ - **Risks / Trade-offs**: Known limitations, things that could go wrong.
165
+ Format: [Risk] -> Mitigation
166
+
167
+ - **Migration Plan**: Steps to deploy, rollback strategy (if applicable)
168
+
169
+ - **Open Questions**: Outstanding decisions or unknowns to resolve.
170
+ Include any in-force ADRs that this design suggests revisiting; the adr
171
+ step will record the supersession.
172
+
173
+
174
+ Focus on architecture and approach, not line-by-line implementation.
175
+
176
+ Reference the proposal for motivation and specs for requirements.
177
+
178
+
179
+ Good design docs explain the "why" behind technical decisions.
180
+ requires:
181
+ - proposal
182
+ - id: adr
183
+ generates: "../../../adr/*.md"
184
+ description: Architecture Decision Records distilled from design for future reference
185
+ template: adr.md
186
+ instruction: >
187
+ Distill significant decisions from design.md into Architecture Decision
188
+ Records that live in <repo>/adr/ and persist across changes. The path
189
+ <repo>/adr/ means the target repository's top-level adr/ folder beside
190
+ openspec/, not any folder inside openspec/. ADR files MUST be written
191
+ outside openspec/ and MUST NOT be written under
192
+ openspec/changes/<change>/.
193
+
194
+
195
+ IRON RULE - ADRs are immutable once accepted. You MUST NOT edit a prior
196
+ ADR file under any circumstance, not its Status, not its body, not its
197
+ date. To change a previously accepted decision, record a NEW ADR whose
198
+ Status is "accepted, supersedes ADR-NNNN" and whose `Supersedes:` field
199
+ names the prior one. Design consumers derive what is currently in force
200
+ by walking Supersedes links across the folder. The prior ADR's contents
201
+ stay frozen as a historical record.
202
+
203
+
204
+ Process:
205
+
206
+ 1. Read every existing ADR in <repo>/adr/. Build the supersession graph
207
+ from each ADR's Supersedes field. Note the highest sequence number in
208
+ use.
209
+
210
+ 2. Re-read design.md. Identify decisions that meet ALL of these:
211
+
212
+ - Establish a long-term architectural commitment (pattern, technology,
213
+ boundary, contract) - not a tactical implementation detail.
214
+
215
+ - Will affect future changes beyond this one.
216
+
217
+ - Either aren't already captured by a currently-in-force ADR, OR
218
+ intentionally diverge from one. If diverging, the new ADR supersedes the
219
+ prior.
220
+
221
+ 3. For each qualifying decision, create a NEW file at
222
+ <repo>/adr/NNNN-kebab-title.md, where NNNN is a 4-digit sequence one
223
+ greater than the highest existing. Use the template (MADR-short). If
224
+ this decision replaces a prior in-force ADR, set Status to
225
+ "accepted, supersedes ADR-NNNN", populate the `Supersedes:` field, and
226
+ explain in Context why the prior decision is being revisited. Do NOT
227
+ touch the prior ADR's file.
228
+
229
+ 4. If nothing meets the bar, do not invent ADRs. The step still completes
230
+ as long as <repo>/adr/ already contains at least one ADR file.
231
+
232
+
233
+ Filename convention: NNNN-kebab-title.md (e.g.,
234
+ 0042-use-postgres-for-catalog.md). Sequence is monotonic across the
235
+ whole repo and never reused.
236
+ requires:
237
+ - design
238
+ - id: tasks
239
+ generates: tasks.md
240
+ description: Implementation checklist with trackable tasks
241
+ template: tasks.md
242
+ instruction: >
243
+ Create the task list that breaks down the implementation work.
244
+
245
+
246
+ **IMPORTANT: Follow the template below exactly.** The apply phase parses
247
+ checkbox format to track progress. Tasks not using `- [ ]` won't be
248
+ tracked.
249
+
250
+
251
+ Guidelines:
252
+
253
+ - Group related tasks under ## numbered headings.
254
+
255
+ - Each task MUST be a checkbox: `- [ ] X.Y Task description`.
256
+
257
+ - Tasks should be small enough to complete in one session.
258
+
259
+ - Order tasks by dependency (what must be done first?).
260
+
261
+ - If implementation changes behaviour specs, include a task to run
262
+ `openspec validate <change> --type change --strict` before archive.
263
+
264
+
265
+ Reference specs for what to build, design for how to build it, and
266
+ <repo>/adr/ for durable architectural commitments to honor.
267
+
268
+ Each task should be verifiable - you know when it's done.
269
+ requires:
270
+ - specs
271
+ - adr
272
+ apply:
273
+ requires:
274
+ - tasks
275
+ tracks: tasks.md
276
+ instruction: |
277
+ Read context files, work through pending tasks, mark complete as you go.
278
+ Pause if you hit blockers or need clarification.
@@ -0,0 +1,23 @@
1
+ # ADR-NNNN: <!-- short title, representative of the decision -->
2
+
3
+ - **Status**: accepted <!-- or: accepted, supersedes ADR-NNNN -->
4
+ - **Date**: <!-- YYYY-MM-DD -->
5
+ - **Supersedes**: <!-- ADR-NNNN, only if this decision replaces a prior in-force ADR; otherwise leave blank -->
6
+
7
+ ## Context and Problem Statement
8
+
9
+ <!-- What issue motivates this decision? A few sentences is enough. If superseding a prior ADR, explain here why it's being revisited. -->
10
+
11
+ ## Considered Options
12
+
13
+ <!-- The realistic options that were weighed -->
14
+ - <!-- option 1 -->
15
+ - <!-- option 2 -->
16
+
17
+ ## Decision Outcome
18
+
19
+ <!-- Chosen option, and why -->
20
+
21
+ ## Consequences
22
+
23
+ <!-- What becomes easier or harder as a result of this decision -->
@@ -0,0 +1,19 @@
1
+ ## Context
2
+
3
+ <!-- Background and current state -->
4
+
5
+ ## Goals / Non-Goals
6
+
7
+ **Goals:**
8
+ <!-- What this design aims to achieve -->
9
+
10
+ **Non-Goals:**
11
+ <!-- What is explicitly out of scope -->
12
+
13
+ ## Decisions
14
+
15
+ <!-- Key design decisions and rationale -->
16
+
17
+ ## Risks / Trade-offs
18
+
19
+ <!-- Known risks and trade-offs -->
@@ -0,0 +1,23 @@
1
+ ## Why
2
+
3
+ <!-- Explain the motivation for this change. What problem does this solve? Why now? -->
4
+
5
+ ## What Changes
6
+
7
+ <!-- Describe what will change. Be specific about new capabilities, modifications, or removals. -->
8
+
9
+ ## Capabilities
10
+
11
+ ### New Capabilities
12
+ <!-- Capabilities being introduced. Replace <name> with kebab-case identifier (e.g., user-auth, data-export, api-rate-limiting). Each creates specs/<name>/spec.md -->
13
+ - `<name>`: <brief description of what this capability covers>
14
+
15
+ ### Modified Capabilities
16
+ <!-- Existing capabilities whose REQUIREMENTS are changing (not just implementation).
17
+ Only list here if spec-level behavior changes. Each needs a delta spec file.
18
+ Use existing spec names from openspec/specs/. Leave empty if no requirement changes. -->
19
+ - `<existing-name>`: <what requirement is changing>
20
+
21
+ ## Impact
22
+
23
+ <!-- Affected code, APIs, dependencies, systems -->
@@ -0,0 +1,10 @@
1
+ ## ADDED Requirements
2
+
3
+ ### Requirement: <!-- requirement name -->
4
+ <!-- requirement text; may include Feature: or Rule: prose that clarifies the behaviour -->
5
+
6
+ #### Scenario: <!-- scenario name -->
7
+ - **GIVEN** <!-- starting context -->
8
+ - **WHEN** <!-- action or event -->
9
+ - **THEN** <!-- observable outcome -->
10
+ - **AND** <!-- optional follow-on step -->
@@ -0,0 +1,9 @@
1
+ ## 1. <!-- Task Group Name -->
2
+
3
+ - [ ] 1.1 <!-- Task description -->
4
+ - [ ] 1.2 <!-- Task description -->
5
+
6
+ ## 2. <!-- Task Group Name -->
7
+
8
+ - [ ] 2.1 <!-- Task description -->
9
+ - [ ] 2.2 <!-- Task description -->
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "habithive-code",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "A control layer for opencode: one-command install, live simple/complex mode switching, and a model tree for oh-my-opencode agents.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "habithive": "bin/habithive.mjs"
7
+ "habithive": "bin/habithive.mjs",
8
+ "hive": "bin/habithive.mjs"
8
9
  },
9
10
  "main": "src/plugin.js",
10
11
  "exports": {
@@ -15,15 +16,18 @@
15
16
  "src",
16
17
  "bin",
17
18
  "skills",
19
+ "openspec-schemas",
20
+ "docs",
18
21
  "README.md",
22
+ "CHANGELOG.md",
19
23
  "LICENSE",
20
24
  "THIRD-PARTY-NOTICES.md"
21
25
  ],
22
26
  "engines": {
23
- "node": ">=18"
27
+ "node": ">=20.19.0"
24
28
  },
25
29
  "scripts": {
26
- "test": "node test/core.test.mjs"
30
+ "test": "node test/core.test.mjs && node test/jsonc.test.mjs && node test/config.test.mjs && node test/versions.test.mjs && node test/update.test.mjs && node test/omniroute.test.mjs && node test/openspec.test.mjs && node test/spec.test.mjs && node test/package.test.mjs"
27
31
  },
28
32
  "keywords": [
29
33
  "opencode",