hive-lite 0.1.2 → 0.1.6

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
@@ -78,8 +78,9 @@ When you pass `next --agent <codex|claude|gemini>` or `next --path <skills-dir>`
78
78
 
79
79
  ### Install Agent Skills
80
80
 
81
- Hive Lite ships three operator skills:
81
+ Hive Lite ships four operator skills:
82
82
 
83
+ - `hive-lite-bootstrap`
83
84
  - `hive-lite-start-prompt`
84
85
  - `hive-lite-finish`
85
86
  - `hive-lite-map-maintainer`
@@ -143,7 +144,7 @@ node bin/hive.js find "Update server API for Action Inbox hierarchy" --from-spli
143
144
 
144
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.
145
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.
146
- 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.
147
148
 
148
149
  ### Check And Validate A Change
149
150
 
@@ -235,7 +236,7 @@ node bin/hive.js map-dump
235
236
 
236
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.
237
238
 
238
- Inside a git repo, `status` and `next` report `hive_init_required` until the repo has been initialized with `hive-lite init`. Hive Lite skills should stop in this state and ask the human/operator to run init explicitly before start, finish, or map-maintenance workflows continue.
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.
239
240
 
240
241
  Committed by default:
241
242
 
@@ -267,7 +268,7 @@ node bin/hive.js next --json
267
268
  Typical `phaseGuess` values:
268
269
 
269
270
  - `repo_setup_required`: current directory is not inside a git repo
270
- - `hive_init_required`: run `hive-lite init` explicitly before using Hive Lite skills
271
+ - `hive_init_required`: use `$hive-lite-bootstrap` for first-time setup or setup repair before product work
271
272
  - `preflight`: dirty worktree must be committed, stashed, isolated, or stopped before a new requirement
272
273
  - `finish`: an in-progress or accepted-uncommitted Hive change should be closed with `$hive-lite-finish`
273
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. | Stop skill workflows. Run `hive-lite init` explicitly from the repo root, commit or preserve setup files, then rerun `next`. |
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 all skills. Run `hive-lite init` explicitly from the repo root. |
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
 
@@ -158,6 +158,7 @@ Hive Lite does not detect which agent CLI is installed or currently running. `sk
158
158
 
159
159
  Bundled skills:
160
160
 
161
+ - `hive-lite-bootstrap`
161
162
  - `hive-lite-start-prompt`
162
163
  - `hive-lite-finish`
163
164
  - `hive-lite-map-maintainer`
@@ -185,8 +186,8 @@ node bin/hive.js skills doctor --path ~/.codex/skills --json
185
186
  | Status | Meaning | What To Do |
186
187
  | --- | --- | --- |
187
188
  | `current` | Installed copy matches bundled copy. | Nothing needed. |
188
- | `missing` | Skill is not installed at the target path. | Run `skills install`. |
189
- | `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`. |
190
191
 
191
192
  Install missing skills:
192
193
 
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: hive-lite-bootstrap
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
+ ---
5
+
6
+ # Hive Lite Bootstrap
7
+
8
+ ## Purpose
9
+
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
+
12
+ ```text
13
+ check repo -> run hive-lite init when needed -> build or repair first Project Map -> verify -> commit setup/map after approval
14
+ ```
15
+
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
+
18
+ ## Boundaries
19
+
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 either the worktree was clean before first init, or the only dirty entries are Hive Lite setup/map artifacts involved in setup repair.
22
+ - You may directly edit only:
23
+ - `.hive/map/project.yaml`
24
+ - `.hive/map/areas.yaml`
25
+ - `.hive/map/rules.yaml`
26
+ - `.hive/map/validation.yaml`
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.
29
+ - Do not start a product requirement, run `hive-lite find`, create a Change Record, accept risk, push, merge, deploy, or run app tests.
30
+ - Commit only after explicit human approval, or when the user's request already explicitly asked you to commit the Hive Lite bootstrap.
31
+ - If committing, include only Hive Lite setup/map files and the Hive Lite `.gitignore` change. Never include product-code changes.
32
+
33
+ ## Find The CLI
34
+
35
+ Run Hive Lite from the target repo root. Prefer:
36
+
37
+ ```bash
38
+ hive-lite <args>
39
+ ```
40
+
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.
55
+
56
+ ## Workflow
57
+
58
+ ### 1. Preflight
59
+
60
+ Run:
61
+
62
+ ```bash
63
+ hive-lite status --json
64
+ git status --short
65
+ ```
66
+
67
+ Stop if the directory is not a git repo. Tell the user to switch to the repo root, or initialize git and create an initial commit before using Hive Lite.
68
+
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.
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
+
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`.
76
+
77
+ ### 2. Initialize
78
+
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:
80
+
81
+ ```bash
82
+ hive-lite init
83
+ ```
84
+
85
+ Then continue in the same turn. Do not ask the user to commit yet; first build or repair the initial Project Map.
86
+
87
+ ### 3. Build First Map
88
+
89
+ Run:
90
+
91
+ ```bash
92
+ hive-lite map verify --json
93
+ hive-lite map prompt --focus "highest value product and workflow areas" --max-areas 8
94
+ ```
95
+
96
+ Inspect the repo with deterministic commands such as:
97
+
98
+ ```bash
99
+ rg --files
100
+ rg "<routing term>"
101
+ ```
102
+
103
+ Edit only `.hive/map/*.yaml`. Build 3-8 high-value, narrow areas that make near-term product requests routable. Do not try to map the whole project.
104
+
105
+ ### 4. Verify
106
+
107
+ Run:
108
+
109
+ ```bash
110
+ hive-lite map verify --json
111
+ hive-lite map health --json
112
+ ```
113
+
114
+ If areas were created, spot-check important areas with:
115
+
116
+ ```bash
117
+ hive-lite map health --area <area_id> --json
118
+ ```
119
+
120
+ Success means:
121
+
122
+ - map verify is ok
123
+ - the first useful areas have no critical health findings
124
+ - the map is not empty
125
+ - no product files were changed
126
+
127
+ ### 5. Commit Boundary
128
+
129
+ Before any product requirement starts, the Hive Lite setup and initial Project Map should have a git commit boundary.
130
+
131
+ If the user already explicitly asked to commit, and `git status --short` contains only Hive Lite setup/map files plus the Hive Lite `.gitignore` update, run:
132
+
133
+ ```bash
134
+ git add .hive/config.yaml .hive/map/project.yaml .hive/map/areas.yaml .hive/map/rules.yaml .hive/map/validation.yaml .gitignore
135
+ git commit -m "Initialize Hive Lite Project Map"
136
+ ```
137
+
138
+ If the user did not explicitly approve committing, stop and ask for approval. Provide the exact command above and say that the user can reply with:
139
+
140
+ ```text
141
+ 可以提交。commit message 用:Initialize Hive Lite Project Map
142
+ ```
143
+
144
+ Do not start `$hive-lite-start-prompt` until the setup/map files are committed or otherwise isolated.
145
+
146
+ ## Return Summary
147
+
148
+ Return:
149
+
150
+ ```text
151
+ Hive Lite bootstrap complete.
152
+
153
+ Setup:
154
+ - mode: <first-time / setup repair / already initialized>
155
+ - hive-lite init: <run / already initialized / not run>
156
+
157
+ Project Map:
158
+ - changed files: <files>
159
+ - areas created or updated: <area ids>
160
+
161
+ Verification:
162
+ - hive-lite map verify --json: <ok/fail>
163
+ - hive-lite map health --json: <status and finding counts>
164
+
165
+ Commit:
166
+ - <committed / waiting for approval>
167
+ - command or commit sha if applicable
168
+
169
+ Next:
170
+ - After the setup/map commit exists, start the first requirement with `$hive-lite-start-prompt`.
171
+ ```
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "Hive Lite Bootstrap"
3
+ short_description: "Initialize Hive Lite for a repo"
4
+ default_prompt: "Use $hive-lite-bootstrap when this repository is adopting Hive Lite for the first time. Initialize Hive Lite, build the first Project Map, and prepare the setup/map commit before product work starts."
5
+
6
+ policy:
7
+ allow_implicit_invocation: true
@@ -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. Tell the user to run `hive-lite init` from the repo root first. If they 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
 
@@ -275,6 +287,20 @@ Accepted and committed.
275
287
  - Split next phase: <handoff prompt or none>
276
288
  ```
277
289
 
290
+ If `Map Delta Candidate` is not `none`, do not apply it from this skill. Explain that the accepted change suggests a possible Project Map improvement and output this handoff:
291
+
292
+ ```text
293
+ $hive-lite-map-maintainer
294
+ 请 review 这个 Map Delta Candidate:
295
+ <delta_id>
296
+
297
+ 只判断是否 apply 或 reject 这个 map delta。
298
+ 不要改应用代码。
299
+ 不要开始新需求。
300
+ ```
301
+
302
+ Tell the user that map delta review can happen before or after the next requirement, but reviewing it before similar future requests may improve routing.
303
+
278
304
  If no commit was created because the user explicitly asked not to commit, warn that a new Hive Lite requirement should not start until the worktree is clean.
279
305
 
280
306
  ## Response Style
@@ -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 tell the user to run `hive-lite init` from the target repo root, then rerun this skill.
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,14 +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.
84
-
85
- Please run this once from the repo root:
86
- hive-lite init
95
+ Hive Lite setup is missing or incomplete in this repo.
87
96
 
88
- Then commit or otherwise preserve the setup files, and rerun:
89
- $hive-lite-map-maintainer
90
- 这是已有项目第一次接入 Hive Lite。请建立第一版 Project Map,不要改应用代码。
97
+ Recommended next step:
98
+ $hive-lite-bootstrap
99
+ 这是已有项目第一次接入 Hive Lite,或 Hive Lite setup 文件缺失。请完成初始化或 setup 修复,建立第一版 Project Map,不要改应用代码。
91
100
  ```
92
101
 
93
102
  For older Hive Lite versions that do not report `hive.initialized`, check for required setup files before continuing:
@@ -125,7 +134,7 @@ Before any mode-specific work, check whether the target repo has the required Hi
125
134
  .hive/map/validation.yaml
126
135
  ```
127
136
 
128
- If any required map file is missing, stop immediately and tell the user to run `hive-lite init` from the repo root. 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.
129
138
 
130
139
  ### 3. Verify Current Map
131
140
 
@@ -8,8 +8,8 @@ Use when an existing project is adopting Hive Lite for the first time.
8
8
 
9
9
  Precondition:
10
10
 
11
- - `hive-lite init` has already been run explicitly by the user/operator.
12
- - If Hive Lite setup files are missing, stop and tell the user to run `hive-lite init`; do not run it from this skill.
11
+ - Hive Lite setup already exists, normally because `$hive-lite-bootstrap` ran first.
12
+ - If Hive Lite setup files are missing, stop and recommend `$hive-lite-bootstrap`; do not run `hive-lite init` from this skill.
13
13
 
14
14
  Goal:
15
15
 
@@ -101,7 +101,7 @@ Only apply a delta when the user explicitly asks or confirms. Reject stale or lo
101
101
 
102
102
  ## recovery
103
103
 
104
- Use when initialized map files are invalid YAML or structurally broken. If required Hive Lite setup or map files are missing, stop and tell the user to run `hive-lite init` from the repo root.
104
+ Use when initialized map files are invalid YAML or structurally broken. If required Hive Lite setup or map files are missing, stop and recommend `$hive-lite-bootstrap`.
105
105
 
106
106
  Goal:
107
107
 
@@ -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 tell the user to run `hive-lite init` from the repo root 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,14 +90,13 @@ 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
- Please run this once from the repo root:
84
- hive-lite init
95
+ Recommended next step:
96
+ $hive-lite-bootstrap
97
+ 这是已有项目第一次接入 Hive Lite,或 Hive Lite setup 文件缺失。请完成初始化或 setup 修复,建立第一版 Project Map,不要改应用代码。
85
98
 
86
- After the setup files are committed or otherwise preserved, rerun:
87
- $hive-lite-map-maintainer
88
- 这是已有项目第一次接入 Hive Lite。请建立第一版 Project Map,不要改应用代码。
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.
89
100
  ```
90
101
 
91
102
  For older Hive Lite versions that do not report `hive.initialized`, check whether these files exist before continuing:
@@ -100,9 +111,9 @@ For older Hive Lite versions that do not report `hive.initialized`, check whethe
100
111
 
101
112
  If any are missing, stop with the same message. Do not run init automatically and do not create missing map files manually.
102
113
 
103
- 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.
104
115
 
105
- 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.
106
117
 
107
118
  After any preflight action, rerun `hive-lite status --json`; continue only when the target worktree is clean.
108
119
 
@@ -11,14 +11,13 @@ 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
- Please run this once from the repo root:
17
- hive-lite init
16
+ Recommended next step:
17
+ $hive-lite-bootstrap
18
+ 这是已有项目第一次接入 Hive Lite,或 Hive Lite setup 文件缺失。请完成初始化或 setup 修复,建立第一版 Project Map,不要改应用代码。
18
19
 
19
- After the setup files are committed or otherwise preserved, rerun:
20
- $hive-lite-map-maintainer
21
- 这是已有项目第一次接入 Hive Lite。请建立第一版 Project Map,不要改应用代码。
20
+ After bootstrap builds the first map, commit the Hive Lite setup and map files together before starting the product requirement.
22
21
  ```
23
22
 
24
23
  Do not continue to find/map repair/start prompt until Hive Lite setup exists.
@@ -108,7 +107,7 @@ hive-lite accept <chg_id> --commit -m "<message>"
108
107
  ## Safety Rules
109
108
 
110
109
  - Do not continue to `find` while status is not clean.
111
- - Do not run `hive-lite init` from a skill.
110
+ - Do not run `hive-lite init` from this start skill; first-time setup and setup repair belong to `$hive-lite-bootstrap`.
112
111
  - Do not initialize git automatically.
113
112
  - Do not assume "new branch" cleans the worktree; dirty files usually follow branch switches.
114
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.2",
3
+ "version": "0.1.6",
4
4
  "description": "Local Project Map + Change Control for coding agents.",
5
5
  "keywords": [
6
6
  "codex",
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. Run hive-lite init from the repo root first.${missing}`);
106
+ throw new Error(`${commandName} requires Hive Lite initialization. Use $hive-lite-bootstrap first.${missing}`);
107
107
  }
108
108
  }
109
109
 
package/src/lib/health.js CHANGED
@@ -69,7 +69,7 @@ function readYamlHealth(root, name, fallback, findings) {
69
69
  field: '',
70
70
  message: `.hive/map/${name} is missing.`,
71
71
  impact: 'Hive Lite cannot evaluate Project Map health.',
72
- fix: 'Run hive-lite init or restore the missing map file.',
72
+ fix: 'Use $hive-lite-bootstrap for first-time or partial setup. If this repo already had a committed Project Map, restore the missing map file from git instead of rebuilding it silently.',
73
73
  });
74
74
  return { doc: fallback, valid: false };
75
75
  }
package/src/lib/next.js CHANGED
@@ -94,6 +94,13 @@ function startPrompt() {
94
94
  ].join('\n');
95
95
  }
96
96
 
97
+ function bootstrapPrompt() {
98
+ return [
99
+ '$hive-lite-bootstrap',
100
+ '这是已有项目第一次接入 Hive Lite。请完成初始化,建立第一版 Project Map,不要改应用代码。完成后在开始第一个需求前准备 Hive Lite setup/map 提交。',
101
+ ].join('\n');
102
+ }
103
+
97
104
  function finishPrompt(changeId) {
98
105
  return [
99
106
  '$hive-lite-finish',
@@ -137,6 +144,7 @@ function chooseSplit(status) {
137
144
 
138
145
  function requiredSkillForAction(actionItem) {
139
146
  if (!actionItem) return null;
147
+ if (actionItem.kind === 'run_bootstrap_skill') return 'hive-lite-bootstrap';
140
148
  if (actionItem.kind === 'run_start_skill' || actionItem.kind === 'continue_split') return 'hive-lite-start-prompt';
141
149
  if (actionItem.kind === 'run_finish_skill' || actionItem.kind === 'commit_accepted_change') return 'hive-lite-finish';
142
150
  if (actionItem.kind === 'run_map_maintainer') return 'hive-lite-map-maintainer';
@@ -154,21 +162,21 @@ function applySkillPreflight(root, options, current) {
154
162
  ...current,
155
163
  phaseGuess: 'skill_preflight',
156
164
  primaryAction: action({
157
- kind: 'install_operator_skill',
158
- label: `Install ${preflight.requiredSkill}`,
159
- command: preflight.installCommand,
160
- explanation: 'The recommended next operator step requires this Hive Lite skill in the selected agent target.',
165
+ kind: 'sync_operator_skill',
166
+ label: `Sync ${preflight.requiredSkill}`,
167
+ command: preflight.syncCommand,
168
+ explanation: 'The recommended next operator step requires a current Hive Lite skill in the selected agent target.',
161
169
  }),
162
170
  secondaryActions: [
163
171
  action({
164
172
  ...blockedAction,
165
173
  enabled: false,
166
- disabledReason: `Install ${preflight.requiredSkill} first for the selected agent target.`,
174
+ disabledReason: `Sync ${preflight.requiredSkill} first for the selected agent target.`,
167
175
  }),
168
176
  ...current.secondaryActions,
169
177
  ],
170
- summaryForHuman: `需要先安装 ${preflight.requiredSkill},然后再继续 Hive Lite operator flow。`,
171
- summaryForAgent: `The selected agent target is missing ${preflight.requiredSkill}. Run skills install before using the handoff skill.`,
178
+ summaryForHuman: `需要先同步 ${preflight.requiredSkill},然后再继续 Hive Lite operator flow。`,
179
+ summaryForAgent: `The selected agent target is missing or has a stale ${preflight.requiredSkill}. Run skills sync before using the handoff skill.`,
172
180
  operatorSkillPreflight: preflight,
173
181
  };
174
182
  }
@@ -227,13 +235,13 @@ function evaluateNextAction(cwd, options = {}) {
227
235
  } else if (workspace.hive.state === 'hive_init_required') {
228
236
  phaseGuess = 'hive_init_required';
229
237
  primaryAction = action({
230
- kind: 'run_hive_init',
231
- label: 'Run hive-lite init',
232
- command: 'hive-lite init',
233
- explanation: 'This git repository has not been initialized for Hive Lite. Run init explicitly before using Hive Lite skills.',
238
+ kind: 'run_bootstrap_skill',
239
+ label: 'Use hive-lite-bootstrap',
240
+ prompt: bootstrapPrompt(),
241
+ explanation: 'This git repository is missing required Hive Lite setup files. Use the bootstrap skill to initialize or repair setup, build the first Project Map when needed, and prepare the setup/map commit before product work starts.',
234
242
  });
235
- summaryForHuman = '当前项目还没有初始化 Hive Lite。请先在项目根目录运行 hive-lite init,然后提交 setup/map 文件,再用 hive-lite-map-maintainer 建立 Project Map。';
236
- summaryForAgent = 'Hive Lite is not initialized. Stop all skill workflows and tell the human to run hive-lite init first.';
243
+ summaryForHuman = '当前项目缺少 Hive Lite setup 文件。建议使用 hive-lite-bootstrap 完成首次接入或 setup 修复,并在开始第一个需求前准备 setup/map 提交。';
244
+ summaryForAgent = 'Hive Lite setup is missing or incomplete. Stop ordinary start/finish/map-maintainer workflows and hand off to hive-lite-bootstrap.';
237
245
  } else if (!workspace.canStartNewRequirement) {
238
246
  if (workspace.hive.state === 'in_progress') {
239
247
  phaseGuess = 'finish';
package/src/lib/skills.js CHANGED
@@ -4,6 +4,7 @@ const os = require('os');
4
4
  const path = require('path');
5
5
 
6
6
  const SKILL_NAMES = [
7
+ 'hive-lite-bootstrap',
7
8
  'hive-lite-start-prompt',
8
9
  'hive-lite-finish',
9
10
  'hive-lite-map-maintainer',
@@ -214,11 +215,11 @@ function targetSelection(options = {}, command = 'doctor') {
214
215
  };
215
216
  }
216
217
 
217
- function installCommandForOptions(options = {}) {
218
- if (options.path && options.path !== true) return `hive-lite skills install --path ${options.path}`;
219
- if (options.agent && options.agent !== true) return `hive-lite skills install --agent ${options.agent}`;
220
- if (options.all) return 'hive-lite skills install --agent all';
221
- return 'hive-lite skills install --agent <codex|claude|gemini>';
218
+ function syncCommandForOptions(options = {}) {
219
+ if (options.path && options.path !== true) return `hive-lite skills sync --path ${options.path}`;
220
+ if (options.agent && options.agent !== true) return `hive-lite skills sync --agent ${options.agent}`;
221
+ if (options.all) return 'hive-lite skills sync --agent all';
222
+ return 'hive-lite skills sync --agent all';
222
223
  }
223
224
 
224
225
  function skillPreflight(cwd, skillName, options = {}) {
@@ -245,7 +246,7 @@ function skillPreflight(cwd, skillName, options = {}) {
245
246
  requiredSkill: skillName,
246
247
  targetSelection: targetSelection(options, 'doctor'),
247
248
  ready: targets.length > 0 && targets.every((target) => target.status === 'current'),
248
- installCommand: installCommandForOptions(options),
249
+ syncCommand: syncCommandForOptions(options),
249
250
  targets,
250
251
  };
251
252
  }
package/src/lib/status.js CHANGED
@@ -226,8 +226,8 @@ function actionsFor(state, latestId, diffMatches) {
226
226
  }
227
227
  if (state === 'hive_init_required') {
228
228
  return [
229
- action('run_hive_init', 'Run Hive Lite init', 'hive-lite init', 'Initialize Hive Lite setup files before using Hive Lite skills.'),
230
- action('stop', 'Stop', null, 'Do not run start, finish, or map-maintainer skills until Hive Lite has been initialized.'),
229
+ action('run_bootstrap_skill', 'Use hive-lite-bootstrap', '$hive-lite-bootstrap', 'Use the first-time setup or setup repair skill before ordinary start, finish, or map-maintainer workflows.'),
230
+ action('stop', 'Stop', null, 'Do not run start, finish, or map-maintainer skills until Hive Lite setup is complete.'),
231
231
  ];
232
232
  }
233
233
  if (state === 'clean') {
@@ -314,7 +314,7 @@ function evaluateWorkspaceStatus(cwd, options = {}) {
314
314
 
315
315
  if (!initialized) {
316
316
  state = 'hive_init_required';
317
- reason = 'Hive Lite is not initialized in this git repository. Run hive-lite init before using Hive Lite skills.';
317
+ reason = 'Hive Lite setup is missing or incomplete in this git repository. Use $hive-lite-bootstrap for first-time setup or setup repair.';
318
318
  } else if (dirty && latest.change) {
319
319
  if (accepted(latest.change) && !committed(latest.change) && diffMatches) {
320
320
  state = 'accepted_uncommitted';