hive-lite 0.1.9 → 0.2.1
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 +3 -1
- package/docs/cli-semantics.md +53 -1
- package/docs/skills/hive-lite-bootstrap/SKILL.md +28 -0
- package/docs/skills/hive-lite-discovery/SKILL.md +149 -0
- package/docs/skills/hive-lite-discovery/agents/openai.yaml +4 -0
- package/docs/skills/hive-lite-finish/SKILL.md +62 -5
- package/docs/skills/hive-lite-map-maintainer/SKILL.md +28 -0
- package/docs/skills/hive-lite-map-maintainer/references/lifecycle.md +1 -1
- package/docs/skills/hive-lite-map-maintainer/references/repair-rules.md +7 -0
- package/docs/skills/hive-lite-start-prompt/SKILL.md +176 -52
- package/docs/skills/hive-lite-start-prompt/references/preflight.md +70 -20
- package/package.json +3 -3
- package/src/cli.js +147 -3
- package/src/lib/change.js +93 -0
- package/src/lib/context.js +304 -31
- package/src/lib/git.js +1 -0
- package/src/lib/health.js +208 -0
- package/src/lib/intent.js +619 -0
- package/src/lib/map.js +57 -0
- package/src/lib/operator.js +1156 -0
- package/src/lib/skills.js +1 -0
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ validate -> accept -> optional Map Delta Candidate
|
|
|
24
24
|
|
|
25
25
|
For detailed CLI output meanings and "what to do next" tables, see [docs/cli-semantics.md](docs/cli-semantics.md).
|
|
26
26
|
For a non-technical pilot-user workflow guide in Chinese, see [docs/user-pilot-guide.zh.md](docs/user-pilot-guide.zh.md).
|
|
27
|
+
For using `$hive-lite-discovery` to turn vague ideas into Start Intent Handoffs, see [docs/hive-lite-discovery-usage.zh.md](docs/hive-lite-discovery-usage.zh.md).
|
|
27
28
|
|
|
28
29
|
Examples below use `node bin/hive.js` from this repository. When installed as a package, use `hive-lite` instead.
|
|
29
30
|
|
|
@@ -78,9 +79,10 @@ When you pass `next --agent <codex|claude|gemini>` or `next --path <skills-dir>`
|
|
|
78
79
|
|
|
79
80
|
### Sync Agent Skills
|
|
80
81
|
|
|
81
|
-
Hive Lite ships
|
|
82
|
+
Hive Lite ships five bundled skills for discovery and operator workflows:
|
|
82
83
|
|
|
83
84
|
- `hive-lite-bootstrap`
|
|
85
|
+
- `hive-lite-discovery`
|
|
84
86
|
- `hive-lite-start-prompt`
|
|
85
87
|
- `hive-lite-finish`
|
|
86
88
|
- `hive-lite-map-maintainer`
|
package/docs/cli-semantics.md
CHANGED
|
@@ -133,10 +133,34 @@ node bin/hive.js find "Dashboard Action Inbox content should align left" --json
|
|
|
133
133
|
- `mode`: whether the packet is editable, discovery-only, map-needing, or too broad
|
|
134
134
|
- `area.id`: selected Project Map area
|
|
135
135
|
- `writableScope`: direct writable files
|
|
136
|
+
- `writePlan.selectedWritableCertificates`: structured proof for each selected direct write
|
|
136
137
|
- `reviewGated`: conditional or broad fallback scope that requires review
|
|
137
138
|
- `splitNote`: split artifact path when mode is `needs_decomposition`
|
|
138
139
|
- `candidatePhaseSeeds`: phase seeds for large intents
|
|
139
140
|
|
|
141
|
+
### Write Plan Safety
|
|
142
|
+
|
|
143
|
+
`find` builds a write plan before it emits `edit_context`.
|
|
144
|
+
|
|
145
|
+
Hard principles:
|
|
146
|
+
|
|
147
|
+
- Relevant does not mean writable.
|
|
148
|
+
- Entrypoint does not mean writable.
|
|
149
|
+
- Peer example does not mean writable.
|
|
150
|
+
- Broad fallback does not mean writable.
|
|
151
|
+
- Create intent requires create capability.
|
|
152
|
+
- Hook requirement requires hook capability.
|
|
153
|
+
- Direct Writable is selected per intent, not copied from the whole area.
|
|
154
|
+
- Unknown new files are blocked by default during `check`.
|
|
155
|
+
|
|
156
|
+
Areas can declare `identity_aliases` so user-facing names, model names, or vendor nicknames resolve to the same peer identity during write-plan selection. This is useful for intents such as "image2" or "ChatGPT" that should map to OpenAI/OpenAI-like provider files without making old peer examples writable.
|
|
157
|
+
|
|
158
|
+
Areas can also declare `peer_file_templates` for read-only candidate paths. Templates help explain what a new peer may need, but they do not grant write permission; create intents still need `writable_create_patterns` or an exact certified create path.
|
|
159
|
+
|
|
160
|
+
`selectedWritableDirect` remains a compatibility path list. New Context Packets also include `writePlan.selectedWritableCertificates`, where each certificate records the path or pattern, operation, artifact, target identity, and map entry that certified the write. `check` uses these certificates when present, and falls back to legacy selected direct scope for older Context Packets.
|
|
161
|
+
|
|
162
|
+
Warning codes that indicate map gaps or write-plan uncertainty include `MISSING_DIRECT_NEW_FILE_SCOPE`, `DIRECT_ONLY_REFERENCE_PEERS`, `BROAD_FALLBACK_ONLY`, `TARGET_ENTITY_MISMATCH`, `MISSING_ARTIFACT_FAMILY_SCOPE`, `MISSING_REQUIRED_HOOK_SCOPE`, `AMBIGUOUS_TARGET_IDENTITY`, `REFERENCE_DIRECT_ROLE_CONFLICT`, `DIRECT_SCOPE_OPERATION_UNSPECIFIED`, `UNKNOWN_NEW_FILE`, and `LOW_CONFIDENCE_INTENT_WRITE_PLAN`.
|
|
163
|
+
|
|
140
164
|
When continuing a split phase, pass the recorded split and phase ids plus the phase primary area:
|
|
141
165
|
|
|
142
166
|
```bash
|
|
@@ -148,9 +172,35 @@ If the split note or phase cannot be found, the result is not an edit permit and
|
|
|
148
172
|
If `--area` disagrees with the recorded phase area, Hive Lite routes to the recorded phase area and reports a warning.
|
|
149
173
|
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
174
|
|
|
175
|
+
## `intent`
|
|
176
|
+
|
|
177
|
+
`intent` stores and checks Start Intent Handoff artifacts produced by `$hive-lite-discovery`.
|
|
178
|
+
It is a deterministic artifact command, not a discovery chat surface and not an execution permit.
|
|
179
|
+
|
|
180
|
+
Commands:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
node bin/hive.js intent save --from <start-intent.md> --json
|
|
184
|
+
node bin/hive.js intent save --stdin --json
|
|
185
|
+
node bin/hive.js intent validate <intent_id_or_path> --json
|
|
186
|
+
node bin/hive.js intent show <intent_id_or_path> --json
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Saved handoffs are written under:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
.hive/state/intents/<intent_id>/start-intent.md
|
|
193
|
+
.hive/state/intents/<intent_id>/start-intent.json
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The validator requires `type: hive-lite.start-intent`, `version: 1`, `status: ready_for_hive`, a safe `intent_id`, and the minimal Markdown sections `Original Idea`, `Agreed Direction`, and `User-Confirmed Decisions`. `Blocking Questions` is optional, but if present for a ready handoff it must be `None`.
|
|
197
|
+
It rejects execution-only content such as `Direct Writable`, final file scope, implementation plans, validation plans, files-to-modify sections, and direct instructions that an agent should edit specific files.
|
|
198
|
+
`show --json` includes a derived `findIntent` for `$hive-lite-start-prompt`; it is target-oriented and derived from `Agreed Direction`.
|
|
199
|
+
The human-readable `intent save` output recommends starting the operator runner with `hive-lite operator run --intent <intent_id>` and also prints the equivalent saved handoff path form.
|
|
200
|
+
|
|
151
201
|
## `skills`
|
|
152
202
|
|
|
153
|
-
`skills` installs and checks
|
|
203
|
+
`skills` installs and checks bundled Hive Lite skills that teach agent CLIs how to drive discovery and operator workflows.
|
|
154
204
|
|
|
155
205
|
Hive Lite does not detect which agent CLI is installed or currently running. `skills doctor` only checks the selected skills directories: all known target paths by default, explicit target paths with `--agent`, or a custom directory with `--path`.
|
|
156
206
|
|
|
@@ -159,6 +209,7 @@ Hive Lite does not detect which agent CLI is installed or currently running. `sk
|
|
|
159
209
|
Bundled skills:
|
|
160
210
|
|
|
161
211
|
- `hive-lite-bootstrap`
|
|
212
|
+
- `hive-lite-discovery`
|
|
162
213
|
- `hive-lite-start-prompt`
|
|
163
214
|
- `hive-lite-finish`
|
|
164
215
|
- `hive-lite-map-maintainer`
|
|
@@ -344,6 +395,7 @@ JSON output includes `status`, `mapDir`, `problems`, `errors`, and `warnings`. `
|
|
|
344
395
|
## `map health`
|
|
345
396
|
|
|
346
397
|
`map health` checks whether the Project Map can support safe `find` and useful `check` evidence policy.
|
|
398
|
+
It includes lightweight static lint for write capability coverage, such as reference files that also match update-capable writable scope, artifact families missing create patterns or hook coverage, create patterns without operation/artifact/intent metadata, and peer templates/examples without create capability.
|
|
347
399
|
|
|
348
400
|
```bash
|
|
349
401
|
node bin/hive.js map health
|
|
@@ -30,6 +30,17 @@ This skill is the only Hive Lite operator skill that may run `hive-lite init`. U
|
|
|
30
30
|
- Commit only after explicit human approval, or when the user's request already explicitly asked you to commit the Hive Lite bootstrap.
|
|
31
31
|
- If committing, include only Hive Lite setup/map files and the Hive Lite `.gitignore` change. Never include product-code changes.
|
|
32
32
|
|
|
33
|
+
## Completion Contract
|
|
34
|
+
|
|
35
|
+
End with exactly one clear outcome:
|
|
36
|
+
|
|
37
|
+
- `bootstrap_complete`: Hive Lite setup exists, the first Project Map is verified, changed setup/map files are summarized, and the commit boundary is either created or explicitly waiting for approval.
|
|
38
|
+
- `already_initialized`: setup already exists and ordinary work should continue through `$hive-lite-start-prompt` or `$hive-lite-map-maintainer`.
|
|
39
|
+
- `needs_user_decision`: pre-existing dirty work, deleted committed map files, or commit approval requires a human choice.
|
|
40
|
+
- `blocked`: the repo is not a git repository, the CLI is unavailable, or setup cannot be repaired safely.
|
|
41
|
+
|
|
42
|
+
Do not start a product requirement from this skill.
|
|
43
|
+
|
|
33
44
|
## Find The CLI
|
|
34
45
|
|
|
35
46
|
Run Hive Lite from the target repo root. Prefer:
|
|
@@ -53,6 +64,23 @@ Then rerun this skill.
|
|
|
53
64
|
|
|
54
65
|
Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
|
|
55
66
|
|
|
67
|
+
## Language Style
|
|
68
|
+
|
|
69
|
+
Use Chinese for human-facing process guidance, warnings, and next-step instructions. Keep technical identifiers and structured Hive Lite labels in English, including file paths, commands, setup state names, validation profile ids, `Project Map`, `Change`, and `Commit`.
|
|
70
|
+
|
|
71
|
+
## Context Gathering
|
|
72
|
+
|
|
73
|
+
Gather only enough facts to create or repair the initial Hive Lite setup.
|
|
74
|
+
|
|
75
|
+
Stop searching once these are known:
|
|
76
|
+
|
|
77
|
+
- repo and worktree preflight state;
|
|
78
|
+
- whether `hive-lite init` is needed and safe;
|
|
79
|
+
- high-value initial areas, existing scripts, and key entrypoints needed for the first usable Project Map;
|
|
80
|
+
- `map verify` and `map health` status after the map is built.
|
|
81
|
+
|
|
82
|
+
Do not map the whole repository. Build 3-8 narrow areas that make near-term product requests routable.
|
|
83
|
+
|
|
56
84
|
## Workflow
|
|
57
85
|
|
|
58
86
|
### 1. Preflight
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hive-lite-discovery
|
|
3
|
+
description: Use this skill when a user wants to discuss and clarify a product/code requirement before coding. It behaves like a no-code requirements conversation, may inspect the repository read-only to compare the idea with the current project, asks follow-up questions when the requirement is unclear, saves a short Start Intent Handoff with `hive-lite intent save`, and stops before code execution, Project Map repair, or operator-run automation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hive Lite Discovery
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Turn a requirements conversation into a durable Start Intent Handoff that is ready for Hive Lite to search.
|
|
11
|
+
|
|
12
|
+
Discovery makes an idea ready for Hive Lite. Start makes that intent ready for code.
|
|
13
|
+
|
|
14
|
+
The mental model is simple: the user is saying, "do not write code yet; discuss this requirement with me." If the requirement is unclear, ask natural follow-up questions. If repo context would help, inspect it read-only. When the direction is clear enough, save the agreed result for the next skill.
|
|
15
|
+
|
|
16
|
+
## Boundaries
|
|
17
|
+
|
|
18
|
+
- This skill is pre-Hive and pre-operator.
|
|
19
|
+
- Do not edit application code, tests, docs, `.hive/map/*.yaml`, `.gitignore`, generated artifacts, or runtime evidence.
|
|
20
|
+
- Do not run `hive-lite find`, `check`, `validate`, `accept`, `operator run`, or coding-agent execution.
|
|
21
|
+
- Do not produce `Direct Writable`, final file scope, an implementation plan, a validation plan, files to modify, or instructions that an agent should edit specific files.
|
|
22
|
+
- Do not turn vague ideas into coding permission. The handoff is search-ready, not execution-ready.
|
|
23
|
+
- Keep the handoff plain and short. Do not add sections merely to sound complete.
|
|
24
|
+
- Optional non-goals, acceptance signals, unknowns, or hints are for unusual cases only; omit them by default.
|
|
25
|
+
|
|
26
|
+
## Completion Contract
|
|
27
|
+
|
|
28
|
+
End with exactly one clear outcome:
|
|
29
|
+
|
|
30
|
+
- `ready_for_hive`: a valid Start Intent Handoff is saved, `intent_id` and artifact paths are reported, and the next terminal `hive-lite operator run --intent ...` command is shown.
|
|
31
|
+
- `needs_user_decision`: one to three product questions are asked because the direction is not clear enough; no `ready_for_hive` handoff is saved.
|
|
32
|
+
- `blocked`: CLI, repo, or artifact validation prevents saving; report the exact blocker and next action.
|
|
33
|
+
|
|
34
|
+
Do not produce a coding prompt, implementation plan, or file-edit permission as a discovery outcome.
|
|
35
|
+
|
|
36
|
+
## Context Gathering
|
|
37
|
+
|
|
38
|
+
Gather only enough facts to make the idea ready for Hive Lite search.
|
|
39
|
+
|
|
40
|
+
Stop searching once these are known:
|
|
41
|
+
|
|
42
|
+
- the user-approved product direction;
|
|
43
|
+
- confirmed product decisions versus open blocking questions;
|
|
44
|
+
- whether the request is best understood as a bug, new capability, behavior change, or replacement of existing behavior;
|
|
45
|
+
- only the minimal repo vocabulary or existing capability hints needed to phrase the direction in project terms;
|
|
46
|
+
- whether the handoff can be saved as `status: ready_for_hive`.
|
|
47
|
+
|
|
48
|
+
Do not inspect the repo to choose final files, architecture, validation commands, or Direct Writable scope. Those belong to `$hive-lite-start-prompt` and the Context Packet.
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
1. Understand the user's starting idea and preserve it as provenance.
|
|
53
|
+
2. Inspect the repo read-only only when project vocabulary, current behavior, or the difference between the idea and the current project needs clarification. Prefer `rg` and `rg --files`; do not write files during exploration.
|
|
54
|
+
3. Ask follow-up questions only when the answer affects the product direction. If product decisions remain unresolved, do not save a `ready_for_hive` handoff.
|
|
55
|
+
4. Separate confirmed decisions from ideas that were merely discussed.
|
|
56
|
+
5. Draft a short Start Intent Handoff using the required structure below.
|
|
57
|
+
6. Save it with one of:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
hive-lite intent save --from <draft-start-intent.md> --json
|
|
61
|
+
hive-lite intent save --stdin --json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
7. If the CLI reports errors, revise the draft only when the error is about this draft's content. Treat execution-only content errors as real scope violations, not formatting nits.
|
|
65
|
+
- If the CLI reports `MISSING_SECTION` for optional legacy sections such as `Non-Goals`, `Acceptance Signals`, `Unknowns For Hive Lite To Resolve`, `Pre-Hive Observations / Hints`, or `Blocking Questions`, the installed CLI is stale relative to this skill. Do not add those sections just to satisfy the old CLI. Stop and tell the user to update or reinstall Hive Lite CLI, then rerun discovery.
|
|
66
|
+
8. Return the `intent_id`, `start-intent.md` path, and the next terminal command for `hive-lite operator run --intent`.
|
|
67
|
+
|
|
68
|
+
## Required Handoff
|
|
69
|
+
|
|
70
|
+
Use Markdown with YAML frontmatter:
|
|
71
|
+
|
|
72
|
+
```md
|
|
73
|
+
---
|
|
74
|
+
type: hive-lite.start-intent
|
|
75
|
+
version: 1
|
|
76
|
+
status: ready_for_hive
|
|
77
|
+
source: hive-lite-discovery
|
|
78
|
+
intent_id: int_20260515_short_topic
|
|
79
|
+
created_at: 2026-05-15T00:00:00+08:00
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
# Start Intent Handoff: <short title>
|
|
83
|
+
|
|
84
|
+
## Original Idea
|
|
85
|
+
|
|
86
|
+
<Preserve the user's starting point. This is provenance, not the final requirement.>
|
|
87
|
+
|
|
88
|
+
## Agreed Direction
|
|
89
|
+
|
|
90
|
+
<The user-approved product or behavior direction. Avoid exact implementation files or architecture.>
|
|
91
|
+
|
|
92
|
+
## User-Confirmed Decisions
|
|
93
|
+
|
|
94
|
+
- <Decision actually confirmed by the user.>
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The sections above are enough for most handoffs. Add optional sections only when they remove real ambiguity:
|
|
99
|
+
|
|
100
|
+
- `## Blocking Questions`: use only when the handoff is not ready; for `ready_for_hive`, omit it or set it to `None`.
|
|
101
|
+
- `## Non-Goals`: use only for a user-confirmed scope boundary that would otherwise be easy to misunderstand.
|
|
102
|
+
- `## Pre-Hive Observations / Hints`: use only for non-authoritative repo observations that materially help wording.
|
|
103
|
+
- Avoid `## Acceptance Signals` and `## Unknowns For Hive Lite To Resolve` by default. They easily become noisy pseudo-specs.
|
|
104
|
+
|
|
105
|
+
## Target-Only Routing Text
|
|
106
|
+
|
|
107
|
+
`Agreed Direction` is used to derive the Hive Lite `findIntent`. Keep it target-only.
|
|
108
|
+
|
|
109
|
+
- Put only the capability or behavior that should be searched next.
|
|
110
|
+
- Do not name reference, existing, non-regression, or "do not replace" capabilities in `Agreed Direction`.
|
|
111
|
+
- If the user mentions an existing capability only as context, keep that in `Original Idea`.
|
|
112
|
+
- If an additive/non-replacement boundary is important, phrase it generically in `User-Confirmed Decisions`, such as `This is additive, not a replacement of existing LLM proxy capability`, without naming unrelated providers.
|
|
113
|
+
- Before saving, mentally check whether `Agreed Direction` could match multiple providers, products, modules, or target identities. If yes, rewrite it around the intended target only.
|
|
114
|
+
|
|
115
|
+
## Validation Rules
|
|
116
|
+
|
|
117
|
+
- A `ready_for_hive` handoff must have no unresolved product questions. If `Blocking Questions` exists, it must be `None`.
|
|
118
|
+
- Do not invent non-goals, acceptance criteria, codebase unknowns, or hints just to fill a template.
|
|
119
|
+
- Put possible file paths only in `Pre-Hive Observations / Hints`, and phrase them as non-authoritative hints.
|
|
120
|
+
- If the user asks for implementation planning, explain that `$hive-lite-start-prompt` and the Context Packet define execution boundaries after discovery.
|
|
121
|
+
- If the requirement is already clear, save a short handoff without extra questions. Do not skip to `$hive-lite-start-prompt` unless the user explicitly asks to bypass discovery.
|
|
122
|
+
|
|
123
|
+
## Final Output
|
|
124
|
+
|
|
125
|
+
When the intent is saved, use this shape:
|
|
126
|
+
|
|
127
|
+
~~~text
|
|
128
|
+
Start Intent Handoff saved.
|
|
129
|
+
|
|
130
|
+
Intent: <intent_id>
|
|
131
|
+
Path: .hive/state/intents/<intent_id>/start-intent.md
|
|
132
|
+
JSON: .hive/state/intents/<intent_id>/start-intent.json
|
|
133
|
+
|
|
134
|
+
Next recommended step: run this in a real terminal from the target repo root, not in the agent chat:
|
|
135
|
+
```bash
|
|
136
|
+
cd <target repo root>
|
|
137
|
+
hive-lite operator run --intent <intent_id>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Equivalent path form:
|
|
141
|
+
```bash
|
|
142
|
+
cd <target repo root>
|
|
143
|
+
hive-lite operator run --intent .hive/state/intents/<intent_id>/start-intent.md
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The discovery skill stops here. It does not run the operator command, start coding, or invoke another skill automatically.
|
|
147
|
+
~~~
|
|
148
|
+
|
|
149
|
+
Do not run the next skill or operator command yourself from this discovery skill.
|
|
@@ -22,7 +22,9 @@ Hive Lite is the factual evidence layer. This skill is the operator layer. The h
|
|
|
22
22
|
|
|
23
23
|
## Skill Handoffs
|
|
24
24
|
|
|
25
|
-
Do not assume this skill can invoke `$hive-lite-start-prompt` or `$hive-lite-map-maintainer` automatically. If another skill is needed, output an explicit prompt for the user to
|
|
25
|
+
Do not assume this skill can invoke `$hive-lite-start-prompt` or `$hive-lite-map-maintainer` automatically. If another skill is needed, output an explicit prompt for the user to paste as a new skill invocation message and stop.
|
|
26
|
+
|
|
27
|
+
Skill handoffs are not terminal commands. Do not run raw `hive-lite find/check/validate` commands as a substitute for a `$hive-lite-start-prompt`, `$hive-lite-finish`, or `$hive-lite-map-maintainer` handoff. If the human says "help me run the next skill" or similar, remind them to paste the provided `$...` block as a new message so the correct skill is loaded.
|
|
26
28
|
|
|
27
29
|
- Next phase after split accept: output a `$hive-lite-start-prompt` handoff.
|
|
28
30
|
- Map repair or refresh needed during finish: output a `$hive-lite-map-maintainer` handoff; do not edit map files here.
|
|
@@ -35,6 +37,18 @@ hive-lite --version
|
|
|
35
37
|
hive-lite skills sync --agent all
|
|
36
38
|
```
|
|
37
39
|
|
|
40
|
+
## Operator Runner Mode
|
|
41
|
+
|
|
42
|
+
If the invocation includes `Step result path`, `Artifacts directory`, and `Step-result schema_version`, you are running under `hive-lite operator run`.
|
|
43
|
+
|
|
44
|
+
- Treat natural-language output as human/debug text only; the runner reads `step-result.json`.
|
|
45
|
+
- Write any repair, handoff, manual-review, or accept-summary artifact under the provided `Artifacts directory`, then write `step-result.json` to the exact `Step result path`.
|
|
46
|
+
- Use `needs_human_action` with `manual_review_required` or `review_reason_required` when human evidence or review judgment is required.
|
|
47
|
+
- Use `accept_ready` with `accept` only when Hive Lite evidence is acceptable and the remaining decision is human accept/commit confirmation.
|
|
48
|
+
- Use `risk_acceptance_required` only when explicit human risk acceptance and a reason are required.
|
|
49
|
+
- Use `blocked` with `revise_required` for scope violations, failed required validation, or repair-needed outcomes.
|
|
50
|
+
- After writing the structured result, stop. Do not wait for human input inside the operator-agent session.
|
|
51
|
+
|
|
38
52
|
## Boundaries
|
|
39
53
|
|
|
40
54
|
- Do not edit application code.
|
|
@@ -44,6 +58,18 @@ hive-lite skills sync --agent all
|
|
|
44
58
|
- Do not ignore scope violations or failed required validation.
|
|
45
59
|
- Agent summaries are not evidence. Evidence must come from Hive Lite diff/scope, validation logs, manual validation notes, review reasons, or accept records.
|
|
46
60
|
|
|
61
|
+
## Completion Contract
|
|
62
|
+
|
|
63
|
+
End with exactly one clear outcome:
|
|
64
|
+
|
|
65
|
+
- `accepted` or `done`: the change was accepted through Hive Lite and the commit decision was completed or explicitly deferred.
|
|
66
|
+
- `needs_human_action`: the human must perform manual verification, provide a review reason, or choose a risk path before the skill can proceed.
|
|
67
|
+
- `accept_ready`: evidence is acceptable and the human/runner must decide whether to accept and commit.
|
|
68
|
+
- `blocked`: scope, validation, map, or evidence problems prevent accept; provide the bounded repair prompt or map-maintainer handoff.
|
|
69
|
+
- `failed`: only for an unexpected tool/runtime failure that prevents a normal blocked result.
|
|
70
|
+
|
|
71
|
+
Do not present a change as finished unless Hive Lite check/validation/evidence state supports that conclusion.
|
|
72
|
+
|
|
47
73
|
## Find The CLI
|
|
48
74
|
|
|
49
75
|
Run Hive Lite from the target repo root. Prefer the package command:
|
|
@@ -67,6 +93,19 @@ Then rerun this skill.
|
|
|
67
93
|
|
|
68
94
|
Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
|
|
69
95
|
|
|
96
|
+
## Context Gathering
|
|
97
|
+
|
|
98
|
+
Gather only enough facts to decide the finish outcome.
|
|
99
|
+
|
|
100
|
+
Stop searching once these are known:
|
|
101
|
+
|
|
102
|
+
- target `ctx_id` or `chg_id`;
|
|
103
|
+
- latest `hive-lite check --json` scope, validation, risk, and `evidencePolicy.verdict`;
|
|
104
|
+
- validation command safety from [safety.md](references/safety.md), when validation is needed;
|
|
105
|
+
- exact human evidence, review reason, or risk reason when the flow requires one.
|
|
106
|
+
|
|
107
|
+
After any validation, manual evidence, review reason, or risk action, rerun `hive-lite check <chg_id> --json` before deciding the next outcome.
|
|
108
|
+
|
|
70
109
|
## Workflow
|
|
71
110
|
|
|
72
111
|
### 1. Identify The Change
|
|
@@ -138,10 +177,10 @@ After running validation or recording manual evidence, run `hive-lite check <chg
|
|
|
138
177
|
|
|
139
178
|
If `accept` later returns `postAcceptHint.kind = split_remaining_phases`, explain ready and waiting phases to the human and recommend `postAcceptHint.suggestedNextPhase` when present.
|
|
140
179
|
|
|
141
|
-
Do not assume this skill can invoke `$hive-lite-start-prompt` automatically. Instead, output a clear handoff prompt and stop:
|
|
180
|
+
Do not assume this skill can invoke `$hive-lite-start-prompt` automatically. Instead, output a clear handoff prompt for the human to paste as a new message and stop:
|
|
142
181
|
|
|
143
182
|
```text
|
|
144
|
-
To continue the next phase,
|
|
183
|
+
To continue the next phase, paste this as a new message:
|
|
145
184
|
|
|
146
185
|
$hive-lite-start-prompt
|
|
147
186
|
Continue split <split_id> with phase <phase_id>.
|
|
@@ -149,7 +188,7 @@ Use this find intent:
|
|
|
149
188
|
"<findIntent>"
|
|
150
189
|
```
|
|
151
190
|
|
|
152
|
-
If the user
|
|
191
|
+
If the user asks you to continue the next phase in the same session, do not run the phase-specific `hive-lite find ...` command as a shortcut. Tell them to paste the `$hive-lite-start-prompt` block above as a new message so the start skill is definitely active.
|
|
153
192
|
|
|
154
193
|
### 4. Automatic Validation
|
|
155
194
|
|
|
@@ -287,7 +326,7 @@ Accepted and committed.
|
|
|
287
326
|
- Split next phase: <handoff prompt or none>
|
|
288
327
|
```
|
|
289
328
|
|
|
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:
|
|
329
|
+
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 for the human to paste as a new message:
|
|
291
330
|
|
|
292
331
|
```text
|
|
293
332
|
$hive-lite-map-maintainer
|
|
@@ -307,4 +346,22 @@ If no commit was created because the user explicitly asked not to commit, warn t
|
|
|
307
346
|
|
|
308
347
|
Do not dump raw JSON unless the user asks. Translate Hive Lite facts into plain language, then show exact commands only when asking for confirmation or reporting what ran.
|
|
309
348
|
|
|
349
|
+
Use Chinese for human-facing process guidance, warnings, and instructions. Keep technical identifiers and structured Hive Lite labels in English. Do not translate labels such as `Change`, `Commit`, `Evidence`, `Validation`, `Review mode`, `Map Delta Candidate`, or `Worktree`; do not translate commands, file paths, context/change ids, validation profile ids, verdict names, risk levels, commit hashes, branch names, package names, or code symbols.
|
|
350
|
+
|
|
351
|
+
For accepted-change summaries, keep the structured summary lines in English and localize only human reminders or operational notes. For example:
|
|
352
|
+
|
|
353
|
+
```text
|
|
354
|
+
Accepted and committed.
|
|
355
|
+
|
|
356
|
+
- Change: chg_xxx
|
|
357
|
+
- Commit: <sha> (<message>)
|
|
358
|
+
- Evidence: .hive/changes/chg_xxx/evidence.json
|
|
359
|
+
- Validation: mvn -q -DskipTests compile passed
|
|
360
|
+
- Review mode: accepted with your review reason
|
|
361
|
+
- Map Delta Candidate: none
|
|
362
|
+
- Worktree: clean
|
|
363
|
+
|
|
364
|
+
没有执行 push 或 deploy。
|
|
365
|
+
```
|
|
366
|
+
|
|
310
367
|
When you must stop for human input, stop cleanly with choices. Do not continue in the same response unless the user had already explicitly chosen an option.
|
|
@@ -54,6 +54,17 @@ Map-maintenance authority:
|
|
|
54
54
|
- Durable map changes require human awareness. Summarize map edits and tell the user to run/approve commit separately.
|
|
55
55
|
- Apply Map Delta Candidates only when the user explicitly asked for or confirmed that action. Otherwise list/summarize them and stop.
|
|
56
56
|
|
|
57
|
+
## Completion Contract
|
|
58
|
+
|
|
59
|
+
End with exactly one clear outcome:
|
|
60
|
+
|
|
61
|
+
- `map_maintained`: `.hive/map/*.yaml` changes are summarized, `map verify` and relevant health/find checks are reported, and the next skill prompt or commit boundary is explicit.
|
|
62
|
+
- `needs_user_decision`: a Map Delta Candidate, missing map restore, uncertain broad repair, or commit decision requires human confirmation.
|
|
63
|
+
- `handoff_required`: setup repair, start-prompt rerun, or finish flow belongs to another skill; provide the exact handoff prompt and stop.
|
|
64
|
+
- `blocked`: required map files, YAML validity, or repo state prevents safe maintenance; report the exact blocker and next action.
|
|
65
|
+
|
|
66
|
+
Do not include a coding agent prompt or product-code implementation instructions.
|
|
67
|
+
|
|
57
68
|
## Find The CLI
|
|
58
69
|
|
|
59
70
|
Run Hive Lite from the target repo root. Prefer the package command:
|
|
@@ -77,6 +88,23 @@ Then rerun this skill.
|
|
|
77
88
|
|
|
78
89
|
Keep user-facing recovery guidance to the install/update block above unless the user explicitly says they are developing Hive Lite itself.
|
|
79
90
|
|
|
91
|
+
## Language Style
|
|
92
|
+
|
|
93
|
+
Use Chinese for human-facing process guidance, warnings, and next-step instructions. Keep technical identifiers and structured Hive Lite labels in English, including area ids, file paths, commands, validation profile ids, `Context Packet`, `Direct Writable`, `Review-Gated`, `Map Delta Candidate`, `Change`, and `Commit`.
|
|
94
|
+
|
|
95
|
+
## Context Gathering
|
|
96
|
+
|
|
97
|
+
Gather only enough facts to repair or refresh the Project Map safely.
|
|
98
|
+
|
|
99
|
+
Stop searching once these are known:
|
|
100
|
+
|
|
101
|
+
- maintenance mode from [lifecycle.md](references/lifecycle.md);
|
|
102
|
+
- current map validity and affected area health;
|
|
103
|
+
- exact existing paths, scripts, entrypoints, validation profiles, and risk/manual-verification hints needed for the map change;
|
|
104
|
+
- whether an intent-triggered repair now produces `edit_context` without critical map-gap warnings.
|
|
105
|
+
|
|
106
|
+
Prefer `rg --files`, `rg`, `hive-lite map health`, `hive-lite map prompt`, and focused `hive-lite find` reruns over broad architecture exploration. Mark uncertainty with TODO notes instead of continuing to search indefinitely.
|
|
107
|
+
|
|
80
108
|
## Workflow
|
|
81
109
|
|
|
82
110
|
### 0. Git Precondition
|
|
@@ -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_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`.
|
|
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`, `AMBIGUOUS_TARGET_IDENTITY`, `REFERENCE_DIRECT_ROLE_CONFLICT`, `DIRECT_SCOPE_OPERATION_UNSPECIFIED`, `UNKNOWN_NEW_FILE`, `LOW_CONFIDENCE_INTENT_WRITE_PLAN`, `MISSING_ENTRYPOINT`, or `MISSING_VALIDATION`.
|
|
60
60
|
- `map health --area <selected>` shows critical findings.
|
|
61
61
|
|
|
62
62
|
Goal:
|
|
@@ -54,11 +54,18 @@ scope:
|
|
|
54
54
|
Rules:
|
|
55
55
|
|
|
56
56
|
- `readable` may be broad.
|
|
57
|
+
- Relevant does not mean writable.
|
|
58
|
+
- Entrypoint does not mean writable.
|
|
59
|
+
- Peer example does not mean writable.
|
|
60
|
+
- Broad fallback does not mean writable.
|
|
61
|
+
- Direct Writable is selected per intent, not copied from the whole area.
|
|
57
62
|
- `writable_direct` should be exact existing files, usually 2-8 files.
|
|
58
63
|
- Prefer `writable_existing` for exact update targets and `writable_create_patterns` for new file permissions when the repo has repeated artifact families.
|
|
59
64
|
- 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
65
|
- Existing peer files that are only copy/reference examples should stay readable/reference context, not selected Direct Writable for a new peer target.
|
|
61
66
|
- Put peer examples under `readable_reference` and describe repeated families under `artifact_families` when possible.
|
|
67
|
+
- Use `identity_aliases` when user-facing names, model names, or vendor nicknames should resolve to one canonical peer identity.
|
|
68
|
+
- Use `peer_file_templates` only as read-only candidate path hints; create permissions still require `writable_create_patterns`.
|
|
62
69
|
- Broad patterns such as `apps/*/src/**`, `packages/**`, `server/**`, and `**` must not be in `writable_direct`.
|
|
63
70
|
- Every conditional/fallback item needs `reason` and `requires_review: true`.
|
|
64
71
|
|