hive-lite 0.1.3 → 0.1.7

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.
package/README.md CHANGED
@@ -74,9 +74,9 @@ node bin/hive.js next --agent codex --json
74
74
  `status` and `next` show actionable split notes by default: active split notes with accepted phase progress, or the newest unstarted split note when no active split exists. Use `status --all` to inspect every runtime split note. `next` may recommend start, finish, map maintenance, split continuation, dirty-worktree cleanup, or git repo setup. It does not run agents, commit, accept risk, or modify files.
75
75
  In JSON output, `splitNoteSummary.primaryRecentSplitNote` identifies the split note that `status`/`next` treat as primary, and `splitNoteSummary.otherActiveSplitNotes` lists older active split notes with accepted progress.
76
76
 
77
- When you pass `next --agent <codex|claude|gemini>` or `next --path <skills-dir>`, `next` also checks whether the recommended Hive Lite operator skill is installed in that target. If it is missing or stale, `next` recommends installing/syncing skills before the handoff.
77
+ When you pass `next --agent <codex|claude|gemini>` or `next --path <skills-dir>`, `next` also checks whether the recommended Hive Lite operator skill is current in that target. If it is missing or stale, `next` recommends `skills sync` before the handoff.
78
78
 
79
- ### Install Agent Skills
79
+ ### Sync Agent Skills
80
80
 
81
81
  Hive Lite ships four operator skills:
82
82
 
@@ -98,22 +98,22 @@ node bin/hive.js skills doctor --json
98
98
 
99
99
  Codex, Claude, and Gemini targets are global user-skill installs. `--agent codex` writes to `~/.codex/skills`, `--agent claude` writes to `~/.claude/skills`, and `--agent gemini` writes to `~/.gemini/skills`. They do not create or update repo-local `.codex/skills`, `.claude/skills`, or `.gemini/skills`. Use `--path <repo-local-skills-dir>` only when you intentionally want a custom repo-local copy that Hive Lite can inspect.
100
100
 
101
- Install missing skills:
101
+ Install or update skills in one step:
102
102
 
103
103
  ```bash
104
- node bin/hive.js skills install --agent codex
105
- node bin/hive.js skills install --agent claude
106
- node bin/hive.js skills install --agent gemini
107
- node bin/hive.js skills install --agent all
104
+ node bin/hive.js skills sync --agent codex
105
+ node bin/hive.js skills sync --agent claude
106
+ node bin/hive.js skills sync --agent gemini
107
+ node bin/hive.js skills sync --agent all
108
108
  ```
109
109
 
110
- `install` creates missing skills but does not overwrite stale local copies unless `--force` is passed.
110
+ `sync` installs missing skills and overwrites stale copies with the bundled version.
111
111
 
112
- Synchronize bundled skills over existing stale copies:
112
+ `install` is still available for conservative installs that should not overwrite stale local copies unless `--force` is passed:
113
113
 
114
114
  ```bash
115
- node bin/hive.js skills sync --agent codex
116
- node bin/hive.js skills sync --agent all
115
+ node bin/hive.js skills install --agent codex
116
+ node bin/hive.js skills install --agent all
117
117
  ```
118
118
 
119
119
  Use `--dry-run` to preview writes. Use `--path <skills-dir>` for a custom target.
@@ -144,7 +144,7 @@ node bin/hive.js find "Update server API for Action Inbox hierarchy" --from-spli
144
144
 
145
145
  When `--from-split` and `--phase` point to a recorded split phase, Hive Lite constrains routing to that phase's primary area. Generated split notes include `--area <primaryAreaId>` so copied commands stay narrowly scoped even if the original intent was broad.
146
146
  If the split note or phase cannot be found, Hive Lite does not treat the copied command as an edit permit. If `--area` disagrees with the recorded phase area, the recorded phase area wins and Hive Lite prints a warning.
147
- When Hive Lite is run from a source checkout with `node /path/to/bin/hive.js`, generated split notes render that Node command first and include `hive-lite` as a package-alias fallback when available.
147
+ When Hive Lite is run from a source checkout, generated split notes may render the caller's current CLI invocation and include `hive-lite` as a package-alias fallback when available.
148
148
 
149
149
  ### Check And Validate A Change
150
150
 
@@ -236,7 +236,7 @@ node bin/hive.js map-dump
236
236
 
237
237
  Hive Lite requires a git repository. If the current directory is not inside a git worktree, `status` and `next` will report `repo_setup_required`, and workflow commands such as `init`, `find`, `check`, `validate`, and `accept` stop. Hive Lite does not initialize git automatically; switch to the correct repo root or manually initialize git and create an initial commit first.
238
238
 
239
- Inside a git repo, `status` reports `hive_init_required` until the repo has been initialized with `hive-lite init`. `next` recommends `$hive-lite-bootstrap`, which is the first-time setup skill that may run init, build the first Project Map, and prepare the setup/map commit before product work starts.
239
+ Inside a git repo, `status` reports `hive_init_required` until required Hive Lite setup files exist. `status` and `next` recommend `$hive-lite-bootstrap`, which is the first-time setup and setup-repair skill that may run init, build the first Project Map, and prepare the setup/map commit before product work starts.
240
240
 
241
241
  Committed by default:
242
242
 
@@ -268,7 +268,7 @@ node bin/hive.js next --json
268
268
  Typical `phaseGuess` values:
269
269
 
270
270
  - `repo_setup_required`: current directory is not inside a git repo
271
- - `hive_init_required`: use `$hive-lite-bootstrap` for first-time setup before product work
271
+ - `hive_init_required`: use `$hive-lite-bootstrap` for first-time setup or setup repair before product work
272
272
  - `preflight`: dirty worktree must be committed, stashed, isolated, or stopped before a new requirement
273
273
  - `finish`: an in-progress or accepted-uncommitted Hive change should be closed with `$hive-lite-finish`
274
274
  - `map`: Project Map needs bootstrap, refresh, or repair via `$hive-lite-map-maintainer`
@@ -45,15 +45,15 @@ It reads:
45
45
  By default, `status --json` and `next --json` filter split notes to reduce exploratory clutter. They show active unfinished split notes that already have accepted phase progress. If no active split exists, they show only the newest unstarted split note. `splitNoteSummary` reports how many split notes were hidden by this default policy. Use `status --all --json` to inspect every runtime split note.
46
46
  `splitNoteSummary.primaryRecentSplitNote` identifies the split note selected as primary from the visible notes. `splitNoteSummary.otherActiveSplitNotes` lists older active-progress split notes so an operator can tell whether additional historical split work exists.
47
47
 
48
- Hive Lite cannot detect the currently running agent CLI. If the caller provides `--agent <codex|claude|gemini|all>` or `--path <skills-dir>`, `next` treats the recommended Hive Lite operator skill as a precondition. When the selected target is missing that skill or has a stale copy, `phaseGuess` becomes `skill_preflight` and `primaryAction.kind` becomes `install_operator_skill`.
48
+ Hive Lite cannot detect the currently running agent CLI. If the caller provides `--agent <codex|claude|gemini|all>` or `--path <skills-dir>`, `next` treats the recommended Hive Lite operator skill as a precondition. When the selected target is missing that skill or has a stale copy, `phaseGuess` becomes `skill_preflight` and `primaryAction.kind` becomes `sync_operator_skill`.
49
49
 
50
50
  ### `phaseGuess`
51
51
 
52
52
  | Value | Meaning | What To Do |
53
53
  | --- | --- | --- |
54
54
  | `repo_setup_required` | Current directory is not inside a git repo. | Stop. Switch to the correct repo root, or manually initialize git and create an initial commit before using Hive Lite. |
55
- | `hive_init_required` | Current git repo does not have required Hive Lite setup files. | Use `$hive-lite-bootstrap` for first-time setup before product work. |
56
- | `skill_preflight` | The selected agent target is missing the operator skill needed for the next Hive Lite step. | Run the recommended `skills install` or `skills sync`, then rerun `next`. |
55
+ | `hive_init_required` | Current git repo does not have required Hive Lite setup files. | Use `$hive-lite-bootstrap` for first-time setup or setup repair before product work. |
56
+ | `skill_preflight` | The selected agent target is missing the operator skill needed for the next Hive Lite step, or has a stale copy. | Run the recommended `skills sync`, then rerun `next`. |
57
57
  | `preflight` | Worktree has unmanaged dirty changes. | Stop before starting new work. Commit, stash, use a separate worktree, or stop. |
58
58
  | `finish` | A Hive change is in progress, or was accepted without commit. | Use `$hive-lite-finish` to check, validate, record evidence, accept, or commit. |
59
59
  | `map` | Project Map is missing, invalid, critical, or needs attention. | Use `$hive-lite-map-maintainer` to bootstrap, refresh, or repair the map. |
@@ -103,7 +103,7 @@ node bin/hive.js status --json
103
103
  | Value | Meaning | What To Do |
104
104
  | --- | --- | --- |
105
105
  | `repo_setup_required` | Not inside a git worktree. | Stop. Do not auto-run `git init`. |
106
- | `hive_init_required` | Inside a git worktree, but required Hive Lite setup files are missing. | Stop ordinary start/finish/map-maintainer skills. Use `$hive-lite-bootstrap` for first-time setup, or run `hive-lite init` manually as the low-level fallback. |
106
+ | `hive_init_required` | Inside a git worktree, but required Hive Lite setup files are missing. | Stop ordinary start/finish/map-maintainer skills. Use `$hive-lite-bootstrap` for first-time setup or setup repair. |
107
107
  | `clean` | Worktree is clean. | It is safe to start `find`. |
108
108
  | `unmanaged_dirty` | Dirty files are not tied to a Hive Change Record. | Stop and ask the human to commit, stash, use a worktree, or stop. |
109
109
  | `in_progress` | Dirty files belong to an unfinished Hive Change Record. | Continue finish flow: `check`, `validate`, manual evidence, or `accept`. |
@@ -146,7 +146,7 @@ node bin/hive.js find "<phase.findIntent>" --from-split split_xxx --phase phase_
146
146
  `--from-split` + `--phase` constrains routing to the selected phase's primary area when the split note is available.
147
147
  If the split note or phase cannot be found, the result is not an edit permit and `phaseDependencyStatus.canStartNormally` is `false`.
148
148
  If `--area` disagrees with the recorded phase area, Hive Lite routes to the recorded phase area and reports a warning.
149
- Split-note markdown renders the current Hive Lite CLI invocation first, such as `node /path/to/bin/hive.js ...` when run from a source checkout, and includes `hive-lite ...` as a fallback for environments where the package alias is installed.
149
+ Split-note markdown renders the current Hive Lite CLI invocation first when run from a source checkout, and includes `hive-lite ...` as a fallback for environments where the package alias is installed.
150
150
 
151
151
  ## `skills`
152
152
 
@@ -186,8 +186,8 @@ node bin/hive.js skills doctor --path ~/.codex/skills --json
186
186
  | Status | Meaning | What To Do |
187
187
  | --- | --- | --- |
188
188
  | `current` | Installed copy matches bundled copy. | Nothing needed. |
189
- | `missing` | Skill is not installed at the target path. | Run `skills install`. |
190
- | `stale` | Skill exists but differs from the bundled copy. | Run `skills sync` or `skills install --force` if you want to overwrite. |
189
+ | `missing` | Skill is not installed at the target path. | Run `skills sync`. |
190
+ | `stale` | Skill exists but differs from the bundled copy. | Run `skills sync`. |
191
191
 
192
192
  Install missing skills:
193
193
 
@@ -1,30 +1,31 @@
1
1
  ---
2
2
  name: hive-lite-bootstrap
3
- description: Use this skill when a git repository is adopting Hive Lite for the first time. It checks first-time setup state, may run `hive-lite init`, builds the first Project Map without changing product code, verifies readiness, and prepares a user-approved commit for Hive Lite setup and map files before any product requirement starts.
3
+ description: Use this skill when a git repository is adopting Hive Lite for the first time or has incomplete Hive Lite setup files. It checks setup state, may run `hive-lite init`, builds the first Project Map without changing product code, verifies readiness, and prepares a user-approved commit for Hive Lite setup and map files before any product requirement starts.
4
4
  ---
5
5
 
6
6
  # Hive Lite Bootstrap
7
7
 
8
8
  ## Purpose
9
9
 
10
- Onboard a git repository to Hive Lite for the first time:
10
+ Onboard a git repository to Hive Lite for the first time, or repair incomplete required Hive Lite setup files before product work starts:
11
11
 
12
12
  ```text
13
- check repo -> run hive-lite init when needed -> build first Project Map -> verify -> commit setup/map after approval
13
+ check repo -> run hive-lite init when needed -> build or repair first Project Map -> verify -> commit setup/map after approval
14
14
  ```
15
15
 
16
- This skill is the only Hive Lite operator skill that may run `hive-lite init`. Use it for first-time project setup, not for ordinary coding work.
16
+ This skill is the only Hive Lite operator skill that may run `hive-lite init`. Use it for first-time project setup or incomplete setup repair, not for ordinary coding work or ordinary map health cleanup.
17
17
 
18
18
  ## Boundaries
19
19
 
20
20
  - Do not edit application source, tests, product docs, package files, secrets, CI, or generated artifacts.
21
- - You may run `hive-lite init` only when the target is already a git repo and the worktree was clean before init.
21
+ - You may run `hive-lite init` only when the target is already a git repo and either the worktree was clean before first init, or the only dirty entries are Hive Lite setup/map artifacts involved in setup repair.
22
22
  - You may directly edit only:
23
23
  - `.hive/map/project.yaml`
24
24
  - `.hive/map/areas.yaml`
25
25
  - `.hive/map/rules.yaml`
26
26
  - `.hive/map/validation.yaml`
27
27
  - Preserve setup artifacts created by `hive-lite init`, including `.hive/config.yaml` and Hive Lite `.gitignore` runtime/evidence rules. Do not manually curate or remove them.
28
+ - Do not use this skill to fix ordinary map health findings after required setup files exist. Use `$hive-lite-map-maintainer` for stale paths, scope, roles, validation, aliases, or other Project Map quality cleanup.
28
29
  - Do not start a product requirement, run `hive-lite find`, create a Change Record, accept risk, push, merge, deploy, or run app tests.
29
30
  - Commit only after explicit human approval, or when the user's request already explicitly asked you to commit the Hive Lite bootstrap.
30
31
  - If committing, include only Hive Lite setup/map files and the Hive Lite `.gitignore` change. Never include product-code changes.
@@ -37,7 +38,20 @@ Run Hive Lite from the target repo root. Prefer:
37
38
  hive-lite <args>
38
39
  ```
39
40
 
40
- If unavailable, use an explicit path already given by the user or conversation context, such as `node /path/to/hive-lite/bin/hive.js <args>`. Ask for the CLI path if it is not obvious.
41
+ If `hive-lite` is not available, stop and tell the user:
42
+
43
+ ```text
44
+ I can't find the `hive-lite` command.
45
+
46
+ Please install or update Hive Lite CLI:
47
+ npm install -g hive-lite@latest --registry https://registry.npmjs.org
48
+ hive-lite --version
49
+ hive-lite skills sync --agent all
50
+
51
+ Then rerun this skill.
52
+ ```
53
+
54
+ Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
41
55
 
42
56
  ## Workflow
43
57
 
@@ -54,17 +68,21 @@ Stop if the directory is not a git repo. Tell the user to switch to the repo roo
54
68
 
55
69
  Stop if `git status --short` shows pre-existing non-Hive changes. Ask the user to commit, stash, or use another worktree first. Do not run `hive-lite init` into a dirty product worktree.
56
70
 
71
+ If `hive.state = hive_init_required` because required setup files are missing, this is a setup repair condition. Continue only when dirty entries are limited to Hive Lite setup/map artifacts.
72
+
73
+ If `git status --short` shows a deleted tracked `.hive/map/*.yaml` file from an existing committed Project Map, stop and ask whether to restore that file from git before rebuilding anything. Do not silently replace a previously committed map file with a default empty file.
74
+
57
75
  If Hive Lite is already initialized, do not rerun init. Continue only if the user asked to build or repair the first Project Map; otherwise explain that setup already exists and recommend `$hive-lite-map-maintainer` or `$hive-lite-start-prompt`.
58
76
 
59
77
  ### 2. Initialize
60
78
 
61
- If status reports `hive.state = hive_init_required` or `hive.initialized = false`, run:
79
+ If status reports `hive.state = hive_init_required` or `hive.initialized = false`, run this only for first-time setup, partial setup, or user-approved setup repair:
62
80
 
63
81
  ```bash
64
82
  hive-lite init
65
83
  ```
66
84
 
67
- Then continue in the same turn. Do not ask the user to commit yet; first build the initial Project Map.
85
+ Then continue in the same turn. Do not ask the user to commit yet; first build or repair the initial Project Map.
68
86
 
69
87
  ### 3. Build First Map
70
88
 
@@ -133,7 +151,8 @@ Return:
133
151
  Hive Lite bootstrap complete.
134
152
 
135
153
  Setup:
136
- - hive-lite init: <run / already initialized>
154
+ - mode: <first-time / setup repair / already initialized>
155
+ - hive-lite init: <run / already initialized / not run>
137
156
 
138
157
  Project Map:
139
158
  - changed files: <files>
@@ -150,4 +169,3 @@ Commit:
150
169
  Next:
151
170
  - After the setup/map commit exists, start the first requirement with `$hive-lite-start-prompt`.
152
171
  ```
153
-
@@ -27,11 +27,12 @@ Do not assume this skill can invoke `$hive-lite-start-prompt` or `$hive-lite-map
27
27
  - Next phase after split accept: output a `$hive-lite-start-prompt` handoff.
28
28
  - Map repair or refresh needed during finish: output a `$hive-lite-map-maintainer` handoff; do not edit map files here.
29
29
 
30
- If the target handoff skill is unavailable in the active agent CLI, tell the user to install or sync Hive Lite skills for their agent first. Hive Lite cannot detect the running agent by itself; use the user's agent target such as `codex`, `claude`, or `gemini`:
30
+ If a Hive Lite handoff skill is missing or stale, stop and tell the user to update the CLI and sync skills:
31
31
 
32
32
  ```bash
33
- hive-lite skills doctor --agent <codex|claude|gemini>
34
- hive-lite skills install --agent <codex|claude|gemini>
33
+ npm install -g hive-lite@latest --registry https://registry.npmjs.org
34
+ hive-lite --version
35
+ hive-lite skills sync --agent all
35
36
  ```
36
37
 
37
38
  ## Boundaries
@@ -51,9 +52,20 @@ Run Hive Lite from the target repo root. Prefer the package command:
51
52
  hive-lite <args>
52
53
  ```
53
54
 
54
- If `hive-lite` is not available, try an explicit path already given by the user or conversation context, such as `node /path/to/hive-lite/bin/hive.js <args>`. Ask for the CLI path if it is not obvious.
55
+ If `hive-lite` is not available, stop and tell the user:
55
56
 
56
- In command examples below, replace `hive-lite` with the resolved command.
57
+ ```text
58
+ I can't find the `hive-lite` command.
59
+
60
+ Please install or update Hive Lite CLI:
61
+ npm install -g hive-lite@latest --registry https://registry.npmjs.org
62
+ hive-lite --version
63
+ hive-lite skills sync --agent all
64
+
65
+ Then rerun this skill.
66
+ ```
67
+
68
+ Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
57
69
 
58
70
  ## Workflow
59
71
 
@@ -61,7 +73,7 @@ In command examples below, replace `hive-lite` with the resolved command.
61
73
 
62
74
  Run `hive-lite status --json` first. If it reports `hive.state = repo_setup_required`, stop immediately. Do not run check/validate/accept and do not initialize git automatically. Tell the user to switch to the correct git repo root, or manually initialize git and create an initial commit before using Hive Lite.
63
75
 
64
- If it reports `hive.state = hive_init_required`, or `hive.initialized = false`, stop immediately. Do not run `hive-lite init` yourself, and do not run check/validate/accept. Recommend `$hive-lite-bootstrap` for first-time setup. If the user expected an existing Hive Lite change, they may be in the wrong directory.
76
+ If it reports `hive.state = hive_init_required`, or `hive.initialized = false`, stop immediately. Do not run `hive-lite init` yourself, and do not run check/validate/accept. Recommend `$hive-lite-bootstrap` for first-time setup or setup repair. If the user expected an existing Hive Lite change, they may be in the wrong directory or missing setup files.
65
77
 
66
78
  Find one of:
67
79
 
@@ -23,11 +23,12 @@ Do not assume this skill can invoke `$hive-lite-start-prompt` or `$hive-lite-fin
23
23
  - For coding work after map repair: output a `$hive-lite-start-prompt` handoff.
24
24
  - For finishing a code change: do not continue here; use `$hive-lite-finish`.
25
25
 
26
- If the target handoff skill is unavailable in the active agent CLI, tell the user to install or sync Hive Lite skills for their agent first. Hive Lite cannot detect the running agent by itself; use the user's agent target such as `codex`, `claude`, or `gemini`:
26
+ If a Hive Lite handoff skill is missing or stale, stop and tell the user to update the CLI and sync skills:
27
27
 
28
28
  ```bash
29
- hive-lite skills doctor --agent <codex|claude|gemini>
30
- hive-lite skills install --agent <codex|claude|gemini>
29
+ npm install -g hive-lite@latest --registry https://registry.npmjs.org
30
+ hive-lite --version
31
+ hive-lite skills sync --agent all
31
32
  ```
32
33
 
33
34
  ## Authority Boundary
@@ -35,7 +36,7 @@ hive-lite skills install --agent <codex|claude|gemini>
35
36
  Setup precondition:
36
37
 
37
38
  - This skill must not run `hive-lite init`.
38
- - If Hive Lite is not initialized or is partially initialized, stop immediately and recommend `$hive-lite-bootstrap` for first-time setup.
39
+ - If Hive Lite setup is missing or incomplete, stop immediately and recommend `$hive-lite-bootstrap` for first-time setup or setup repair.
39
40
  - Do not create `.hive/map` manually, do not edit `.hive/config.yaml`, and do not edit `.gitignore`.
40
41
 
41
42
  Map-maintenance authority:
@@ -61,9 +62,20 @@ Run Hive Lite from the target repo root. Prefer the package command:
61
62
  hive-lite <args>
62
63
  ```
63
64
 
64
- If `hive-lite` is not available, try an explicit path already given by the user or conversation context, such as `node /path/to/hive-lite/bin/hive.js <args>`. If it is still unclear, ask for the Hive Lite CLI path.
65
+ If `hive-lite` is not available, stop and tell the user:
65
66
 
66
- In examples below, replace `hive-lite` with the resolved command.
67
+ ```text
68
+ I can't find the `hive-lite` command.
69
+
70
+ Please install or update Hive Lite CLI:
71
+ npm install -g hive-lite@latest --registry https://registry.npmjs.org
72
+ hive-lite --version
73
+ hive-lite skills sync --agent all
74
+
75
+ Then rerun this skill.
76
+ ```
77
+
78
+ Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
67
79
 
68
80
  ## Workflow
69
81
 
@@ -80,17 +92,11 @@ If it reports `hive.state = repo_setup_required`, stop immediately. Do not run `
80
92
  If it reports `hive.state = hive_init_required`, or `hive.initialized = false`, stop immediately. Do not run `hive-lite init` yourself. Tell the user:
81
93
 
82
94
  ```text
83
- Hive Lite is not initialized in this repo yet.
95
+ Hive Lite setup is missing or incomplete in this repo.
84
96
 
85
97
  Recommended next step:
86
98
  $hive-lite-bootstrap
87
- 这是已有项目第一次接入 Hive Lite。请完成初始化,建立第一版 Project Map,不要改应用代码。
88
-
89
- If the bootstrap skill is not available, run `hive-lite init` from the repo root, then rerun:
90
- $hive-lite-map-maintainer
91
- 这是已有项目第一次接入 Hive Lite。请建立第一版 Project Map,不要改应用代码。
92
-
93
- Do not commit immediately after init. Build the first Project Map first, then commit Hive Lite setup and map files together before starting the first product requirement.
99
+ 这是已有项目第一次接入 Hive Lite,或 Hive Lite setup 文件缺失。请完成初始化或 setup 修复,建立第一版 Project Map,不要改应用代码。
94
100
  ```
95
101
 
96
102
  For older Hive Lite versions that do not report `hive.initialized`, check for required setup files before continuing:
@@ -128,7 +134,7 @@ Before any mode-specific work, check whether the target repo has the required Hi
128
134
  .hive/map/validation.yaml
129
135
  ```
130
136
 
131
- If any required map file is missing, stop immediately and recommend `$hive-lite-bootstrap`. Do not create missing map files manually.
137
+ If any required map file is missing, stop immediately and recommend `$hive-lite-bootstrap` as a setup repair handoff. Do not create missing map files manually. If the repo already had a committed Project Map, tell the user that restoring the missing file from git is safer than silently rebuilding it from defaults.
132
138
 
133
139
  ### 3. Verify Current Map
134
140
 
@@ -56,7 +56,7 @@ Use when a real requirement hits a map gap during start:
56
56
 
57
57
  - `find.mode` is `needs_map` or `discovery_context`.
58
58
  - `find` selected a generic/broad area.
59
- - warnings include `NO_CONFIDENT_AREA`, `MISSING_DIRECT_WRITABLE_SCOPE`, `MISSING_ENTRYPOINT`, or `MISSING_VALIDATION`.
59
+ - warnings include `NO_CONFIDENT_AREA`, `MISSING_DIRECT_WRITABLE_SCOPE`, `MISSING_DIRECT_NEW_FILE_SCOPE`, `DIRECT_ONLY_REFERENCE_PEERS`, `BROAD_FALLBACK_ONLY`, `TARGET_ENTITY_MISMATCH`, `MISSING_ARTIFACT_FAMILY_SCOPE`, `MISSING_REQUIRED_HOOK_SCOPE`, `MISSING_ENTRYPOINT`, or `MISSING_VALIDATION`.
60
60
  - `map health --area <selected>` shows critical findings.
61
61
 
62
62
  Goal:
@@ -55,6 +55,10 @@ Rules:
55
55
 
56
56
  - `readable` may be broad.
57
57
  - `writable_direct` should be exact existing files, usually 2-8 files.
58
+ - Prefer `writable_existing` for exact update targets and `writable_create_patterns` for new file permissions when the repo has repeated artifact families.
59
+ - For intents that create new peer files, use very small direct patterns that match only the expected family, such as `src/providers/*Provider.ts`; do not fall back to an entire source tree.
60
+ - Existing peer files that are only copy/reference examples should stay readable/reference context, not selected Direct Writable for a new peer target.
61
+ - Put peer examples under `readable_reference` and describe repeated families under `artifact_families` when possible.
58
62
  - Broad patterns such as `apps/*/src/**`, `packages/**`, `server/**`, and `**` must not be in `writable_direct`.
59
63
  - Every conditional/fallback item needs `reason` and `requires_review: true`.
60
64
 
@@ -24,18 +24,19 @@ Do not assume this skill can invoke another skill automatically. Handoffs are te
24
24
  - To map maintenance: output a `$hive-lite-map-maintainer` prompt and stop.
25
25
  - To finish work after coding: include `$hive-lite-finish` in the final instructions, but do not run finish actions here.
26
26
 
27
- If the target handoff skill is unavailable in the active agent CLI, tell the user to install or sync Hive Lite skills for their agent first. Hive Lite cannot detect the running agent by itself; use the user's agent target such as `codex`, `claude`, or `gemini`:
27
+ If a Hive Lite handoff skill is missing or stale, stop and tell the user to update the CLI and sync skills:
28
28
 
29
29
  ```bash
30
- hive-lite skills doctor --agent <codex|claude|gemini>
31
- hive-lite skills install --agent <codex|claude|gemini>
30
+ npm install -g hive-lite@latest --registry https://registry.npmjs.org
31
+ hive-lite --version
32
+ hive-lite skills sync --agent all
32
33
  ```
33
34
 
34
35
  ## Boundaries
35
36
 
36
37
  - Do not directly edit application source, tests, docs, `.gitignore`, generated artifacts, `.hive/context`, `.hive/changes`, or `.hive/deltas`.
37
38
  - Only edit these Project Map files when map repair is needed: `.hive/map/project.yaml`, `.hive/map/areas.yaml`, `.hive/map/rules.yaml`, `.hive/map/validation.yaml`.
38
- - Do not run `hive-lite init`. If Hive Lite is not initialized or is partially initialized, stop and recommend `$hive-lite-bootstrap` before using this skill.
39
+ - Do not run `hive-lite init`. If Hive Lite setup is missing or incomplete, stop and recommend `$hive-lite-bootstrap` before using this skill.
39
40
  - Do not run `hive check`, `hive validate`, `hive accept`, commits, formatters, or app tests for the new requirement. Those belong after the coding agent changes code.
40
41
  - During preflight, you may help finish or isolate pre-existing work only after explicit user confirmation.
41
42
  - Never discard changes with destructive commands such as `git reset --hard`, `git checkout --`, or forced branch switches.
@@ -49,9 +50,20 @@ Run Hive Lite from the target repo root. Prefer the package command:
49
50
  hive-lite <args>
50
51
  ```
51
52
 
52
- If `hive-lite` is not available, try an explicit path already given by the user or conversation context, such as `node /path/to/hive-lite/bin/hive.js <args>`. Do not spend a long time searching the target repo; ask for the Hive Lite CLI path if it is not obvious.
53
+ If `hive-lite` is not available, stop and tell the user:
53
54
 
54
- In command examples below, replace `hive-lite` with the resolved command.
55
+ ```text
56
+ I can't find the `hive-lite` command.
57
+
58
+ Please install or update Hive Lite CLI:
59
+ npm install -g hive-lite@latest --registry https://registry.npmjs.org
60
+ hive-lite --version
61
+ hive-lite skills sync --agent all
62
+
63
+ Then rerun this skill.
64
+ ```
65
+
66
+ Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
55
67
 
56
68
  ## Workflow
57
69
 
@@ -78,11 +90,11 @@ If status reports `hive.state = repo_setup_required`, stop immediately. Do not r
78
90
  If status reports `hive.state = hive_init_required`, or `hive.initialized = false`, stop immediately. Do not run `hive-lite init` yourself. Tell the user:
79
91
 
80
92
  ```text
81
- Hive Lite is not initialized in this repo yet.
93
+ Hive Lite setup is missing or incomplete in this repo.
82
94
 
83
95
  Recommended next step:
84
96
  $hive-lite-bootstrap
85
- 这是已有项目第一次接入 Hive Lite。请完成初始化,建立第一版 Project Map,不要改应用代码。
97
+ 这是已有项目第一次接入 Hive Lite,或 Hive Lite setup 文件缺失。请完成初始化或 setup 修复,建立第一版 Project Map,不要改应用代码。
86
98
 
87
99
  Do not start the product requirement yet. After bootstrap builds the first map, commit the Hive Lite setup and map files together, then rerun this start skill with the original requirement.
88
100
  ```
@@ -99,9 +111,9 @@ For older Hive Lite versions that do not report `hive.initialized`, check whethe
99
111
 
100
112
  If any are missing, stop with the same message. Do not run init automatically and do not create missing map files manually.
101
113
 
102
- If the command is unavailable in an older Hive Lite, fall back to `git status --porcelain`.
114
+ If `hive-lite status --json` is unavailable, stop and tell the user to update Hive Lite CLI and sync skills. Do not fall back to git-only status for normal pilot use.
103
115
 
104
- Continue only when `canStartNewRequirement` is true or fallback git status is clean. If not clean, read [preflight.md](references/preflight.md), present options, and stop immediately unless the user had already explicitly chosen an option before this step.
116
+ Continue only when `canStartNewRequirement` is true. If not clean, read [preflight.md](references/preflight.md), present options, and stop immediately unless the user had already explicitly chosen an option before this step.
105
117
 
106
118
  After any preflight action, rerun `hive-lite status --json`; continue only when the target worktree is clean.
107
119
 
@@ -168,8 +180,9 @@ Accept the packet only when all are true:
168
180
  - `mode` is `edit_context`.
169
181
  - `area.id` is present.
170
182
  - `writableScope` contains at least one narrow direct file.
183
+ - `writePlan.blockingWarnings` is empty when present.
171
184
  - `validationPlan` is not empty.
172
- - `warnings` has no map-gap warning such as `NO_CONFIDENT_AREA`, `MISSING_DIRECT_WRITABLE_SCOPE`, `MISSING_ENTRYPOINT`, or `MISSING_VALIDATION`.
185
+ - `warnings` has no map-gap warning such as `NO_CONFIDENT_AREA`, `MISSING_DIRECT_WRITABLE_SCOPE`, `MISSING_DIRECT_NEW_FILE_SCOPE`, `DIRECT_ONLY_REFERENCE_PEERS`, `BROAD_FALLBACK_ONLY`, `TARGET_ENTITY_MISMATCH`, `MISSING_ENTRYPOINT`, or `MISSING_VALIDATION`.
173
186
  - `hive-lite map health --area <areaId> --json` reports no critical findings.
174
187
 
175
188
  Review-gated conditional or broad fallback scope is allowed. Include it in the final prompt as a boundary, not as a failure.
@@ -188,7 +201,12 @@ Repair principles:
188
201
 
189
202
  - Prefer focused product/work area ids such as `dashboard.action_inbox`, not one-part ids such as `dashboard`.
190
203
  - Preserve unrelated areas exactly unless a change is needed for the reported map gap.
191
- - Use `scope.writable_direct` for exact files the coding agent may edit.
204
+ - Use `scope.writable_direct` for exact files the coding agent may edit, or very small direct patterns when the intent needs new peer files such as a provider, proxy, adapter, connector, or plugin.
205
+ - Prefer `scope.writable_existing` for exact update targets and `scope.writable_create_patterns` for narrow create permissions when the map needs operation-specific write capabilities.
206
+ - Put copy sources and peer examples under `scope.readable_reference` when they should guide implementation but not be edited.
207
+ - Use `artifact_families` to declare required create artifacts and hook files for repeated artifact families such as providers, adapters, connectors, endpoints, DTOs, tests, or migrations.
208
+ - Treat Direct Writable as the selected intent-specific write target list, not the area's full writable maximum.
209
+ - Keep peer examples, entrypoints, and similar existing files as reference context unless the current intent specifically requires editing them.
192
210
  - Put conditional files under `scope.writable_conditional` with `reason` and `requires_review: true`.
193
211
  - Put broad patterns only under `scope.writable_broad_fallback` with `reason` and `requires_review: true`.
194
212
  - Never put broad patterns such as `apps/*/src/**`, `packages/**`, `server/**`, or `**` in `writable_direct`.
@@ -258,6 +276,9 @@ Use this context packet as your source of truth. Edit only Direct Writable files
258
276
  Direct Writable:
259
277
  - <file>
260
278
 
279
+ Reference Files:
280
+ - <file and reason, only when useful; do not edit unless it is also Direct Writable>
281
+
261
282
  Review-Gated:
262
283
  - <conditional/broad item and reason>
263
284
 
@@ -11,11 +11,11 @@ If `hive-lite status --json` reports `hive.state = hive_init_required` or `hive.
11
11
  Say:
12
12
 
13
13
  ```text
14
- Hive Lite is not initialized in this repo yet.
14
+ Hive Lite setup is missing or incomplete in this repo.
15
15
 
16
16
  Recommended next step:
17
17
  $hive-lite-bootstrap
18
- 这是已有项目第一次接入 Hive Lite。请完成初始化,建立第一版 Project Map,不要改应用代码。
18
+ 这是已有项目第一次接入 Hive Lite,或 Hive Lite setup 文件缺失。请完成初始化或 setup 修复,建立第一版 Project Map,不要改应用代码。
19
19
 
20
20
  After bootstrap builds the first map, commit the Hive Lite setup and map files together before starting the product requirement.
21
21
  ```
@@ -107,7 +107,7 @@ hive-lite accept <chg_id> --commit -m "<message>"
107
107
  ## Safety Rules
108
108
 
109
109
  - Do not continue to `find` while status is not clean.
110
- - Do not run `hive-lite init` from this start skill; first-time setup belongs to `$hive-lite-bootstrap`.
110
+ - Do not run `hive-lite init` from this start skill; first-time setup and setup repair belong to `$hive-lite-bootstrap`.
111
111
  - Do not initialize git automatically.
112
112
  - Do not assume "new branch" cleans the worktree; dirty files usually follow branch switches.
113
113
  - Prefer commit, stash, or separate git worktree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hive-lite",
3
- "version": "0.1.3",
3
+ "version": "0.1.7",
4
4
  "description": "Local Project Map + Change Control for coding agents.",
5
5
  "keywords": [
6
6
  "codex",
@@ -37,4 +37,4 @@
37
37
  "engines": {
38
38
  "node": ">=16"
39
39
  }
40
- }
40
+ }
package/src/cli.js CHANGED
@@ -103,7 +103,7 @@ function requireHiveInitialized(cwd, commandName) {
103
103
  const missing = status.hive.missingSetupFiles && status.hive.missingSetupFiles.length > 0
104
104
  ? ` Missing: ${status.hive.missingSetupFiles.join(', ')}.`
105
105
  : '';
106
- throw new Error(`${commandName} requires Hive Lite initialization. Use $hive-lite-bootstrap first, or run hive-lite init from the repo root as the low-level fallback.${missing}`);
106
+ throw new Error(`${commandName} requires Hive Lite initialization. Use $hive-lite-bootstrap first.${missing}`);
107
107
  }
108
108
  }
109
109
 
@@ -230,6 +230,22 @@ function printContext(result) {
230
230
  console.log(` risk: ${item.risk}`);
231
231
  }
232
232
  }
233
+ if (packet.writePlan && packet.writePlan.hypotheses && packet.writePlan.hypotheses.length > 0) {
234
+ console.log('');
235
+ console.log('Write Plan:');
236
+ for (const item of packet.writePlan.hypotheses) {
237
+ console.log(` - ${item.action} ${item.artifactFamily}: ${item.operation}${item.targetIdentity ? ` for ${item.targetIdentity}` : ''}`);
238
+ }
239
+ if (packet.writePlan.blockingWarnings && packet.writePlan.blockingWarnings.length > 0) {
240
+ console.log(' blocking:');
241
+ for (const item of packet.writePlan.blockingWarnings) console.log(` - ${item.code}: ${item.message}`);
242
+ }
243
+ }
244
+ if (packet.writePlan && packet.writePlan.referenceFiles && packet.writePlan.referenceFiles.length > 0) {
245
+ console.log('');
246
+ console.log('Reference Files:');
247
+ for (const file of packet.writePlan.referenceFiles) console.log(` - ${file.path}\n reason: ${file.reason}`);
248
+ }
233
249
  console.log('');
234
250
  console.log('Relevant Files:');
235
251
  if (packet.relevantFiles.length === 0) console.log(' - (none found)');
@@ -242,6 +258,14 @@ function printContext(result) {
242
258
  console.log('');
243
259
  console.log(`Scope Quality: ${packet.scope.quality}`);
244
260
  console.log('');
261
+ console.log('Writable Existing Scope:');
262
+ if (!packet.scope.writableExisting || packet.scope.writableExisting.length === 0) console.log(' - (none configured)');
263
+ for (const item of packet.scope.writableExisting || []) console.log(` - ${patternDisplay(item)}`);
264
+ console.log('');
265
+ console.log('Writable Create Patterns:');
266
+ if (!packet.scope.writableCreatePatterns || packet.scope.writableCreatePatterns.length === 0) console.log(' - (none configured)');
267
+ for (const item of packet.scope.writableCreatePatterns || []) console.log(` - ${patternDisplay(item)}`);
268
+ console.log('');
245
269
  console.log('Conditional Writable Scope:');
246
270
  if (packet.scope.writableConditional.length === 0) console.log(' - (none configured)');
247
271
  for (const item of packet.scope.writableConditional) console.log(` - ${patternDisplay(item)}`);
@@ -363,6 +387,24 @@ function printCheck(root, result) {
363
387
  console.log(' broad fallback:');
364
388
  for (const item of change.scope.writableBroadFallback) console.log(` - ${patternDisplay(item)}`);
365
389
  }
390
+ if (change.writePlanStatus) {
391
+ console.log('');
392
+ console.log('Write Plan:');
393
+ console.log(` ${change.writePlanStatus.status}`);
394
+ if (change.writePlanStatus.contextMode) console.log(` context mode: ${change.writePlanStatus.contextMode}`);
395
+ if (change.writePlanStatus.selectedWritableDirect && change.writePlanStatus.selectedWritableDirect.length > 0) {
396
+ console.log(' selected direct:');
397
+ for (const item of change.writePlanStatus.selectedWritableDirect) console.log(` - ${item}`);
398
+ }
399
+ if (change.writePlanStatus.referenceOnlyTouched && change.writePlanStatus.referenceOnlyTouched.length > 0) {
400
+ console.log(' reference-only touched:');
401
+ for (const item of change.writePlanStatus.referenceOnlyTouched) console.log(` - ${item.path}: ${item.reason || item.reference}`);
402
+ }
403
+ if (change.writePlanStatus.blockingReasons && change.writePlanStatus.blockingReasons.length > 0) {
404
+ console.log(' blockers:');
405
+ for (const reason of change.writePlanStatus.blockingReasons) console.log(` - ${reason}`);
406
+ }
407
+ }
366
408
  console.log('');
367
409
  console.log('Validation:');
368
410
  console.log(` ${change.validation.status}`);