@vibest/cli 0.0.0 → 0.0.1-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "preToolUse": [
5
+ {
6
+ "command": "sh ./hooks/vibest.sh guard",
7
+ "failClosed": true
8
+ }
9
+ ],
10
+ "beforeSubmitPrompt": [
11
+ {
12
+ "command": "sh ./hooks/vibest.sh prompt"
13
+ }
14
+ ],
15
+ "afterAgentResponse": [
16
+ {
17
+ "command": "sh ./hooks/vibest.sh stop"
18
+ }
19
+ ],
20
+ "stop": [
21
+ {
22
+ "command": "sh ./hooks/vibest.sh stop"
23
+ }
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,19 @@
1
+ #!/bin/sh
2
+ # @vibest/cursor 0.0.1-beta.11: `vibest integration guard` before a tool call, `vibest integration prompt` when the user submits, `vibest integration stop` at a turn end.
3
+ case "${1:-}" in
4
+ guard)
5
+ # preToolUse runs fail-closed, where no answer refuses: outside vibest, allow (it grants no approval).
6
+ if [ -z "${VIBEST_AGENT:-}" ]; then cat >/dev/null; echo '{"permission":"allow"}'; exit 0; fi
7
+ vibest integration guard --harness cursor || { echo "vibest integration guard failed; the tool call is refused." >&2; exit 2; }
8
+ ;;
9
+ prompt)
10
+ # beforeSubmitPrompt can block the prompt. A missed report must not: the turn still runs.
11
+ if [ -z "${VIBEST_AGENT:-}" ] || [ -z "${VIBEST_SESSION_ID:-}" ]; then cat >/dev/null; exit 0; fi
12
+ vibest integration prompt --harness cursor >/dev/null 2>&1 || true
13
+ ;;
14
+ stop)
15
+ if [ -z "${VIBEST_AGENT:-}" ] || [ -z "${VIBEST_SESSION_ID:-}" ]; then cat >/dev/null; exit 0; fi
16
+ vibest integration stop --harness cursor >/dev/null 2>&1 || true
17
+ ;;
18
+ esac
19
+ exit 0
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: delegate
3
+ description: Hand work to subagents with `vibest run` and keep talking with the user while they work. Only vibest's main Agent (the coordinator) starts agents; a subagent must not use this skill. Use for any request to change, fix, build, investigate, research, test or verify code ("fix this bug", "add X", "look into why Y", "do these three things", "have an agent check it"), and whenever a task splits into independent parts that can run at the same time.
4
+ ---
5
+
6
+ # Delegate
7
+
8
+ You direct subagents. You stay with the user. Each result arrives in your inbox by itself. Do not poll, sleep, or loop on `vibest result`.
9
+
10
+ ## Dispatch
11
+
12
+ Split independent pieces. Research and review run in parallel. One writing subagent per set of files. A few shell reads (`git diff`, `rg`) you do yourself.
13
+
14
+ ```
15
+ vibest run <harness> --access write -- '<self-contained task>'
16
+ ```
17
+
18
+ Its id is <id>.
19
+
20
+ ```
21
+ vibest run <harness> --access read --archive-on-completion -- '<task>'
22
+ ```
23
+
24
+ `--archive-on-completion` is only for a session you will not message again after it completes. It archives once the session reports completed and that result has reached you. The branch is kept. Do not `vibest send` it after that. A `needs_input` or `failed` result has not archived it: send the answer to the id it printed; the flag still archives the completed result that follows. A reviewer that gets later rounds is the pipeline skill and must stay open, without this flag.
25
+
26
+ - `<harness>` is `pi`, `claude` or `cursor` (`auto` only when a spawn plugin chooses).
27
+ - `--access write` (the default) starts a new worktree. `--access read` stays in the project directory, read-only, with no new worktree.
28
+ - Several `vibest run` commands in one message start in parallel.
29
+ - A subagent cannot see this conversation. Say what to achieve, where (paths, lines), what done means, and how to verify it. For code: run the tests and typecheck, commit, and report the branch and hash.
30
+ - Long material: `vibest project write scratch <name>.md --if-version new -- '<text>'`. The absolute path is `scratchPath` from `vibest project info`, plus the file name. If write says the file already exists, `vibest project read scratch <name>.md`, then write again with the version it prints, or pick a new file name.
31
+ - If the user approved a specific action, quote their exact words.
32
+
33
+ ## After you start
34
+
35
+ Tell the user in one or two lines what is running, then end your turn. Never guess a result. Answer other questions meanwhile. A result arrives as `<agent-result>`; a progress note or question as `<agent-message>`.
36
+
37
+ ## Check the result
38
+
39
+ An `<agent-result>` is a claim. For a session started with `--access write`, before you report success read `git -C <worktree> diff main...HEAD` and run the proving check in that worktree. A session started with `--access read` has no worktree; the result's worktree path is the project directory. Judge the report text. Do not treat `git diff main...HEAD` there as the subagent's work.
40
+
41
+ - `status: needs_input` → `vibest send <id> -- '<the answer>'`, or ask the user. If it is waiting for the user's approval of an action, do not send the approval back: start a fresh agent with the approved action, quoting the user's words.
42
+ - `status: failed`, or your check fails → `vibest send <id> -- '<the failure and what to fix>'`. It keeps its context. If a second correction fails, start a new `vibest run` or tell the user.
43
+
44
+ Then say what changed, the evidence, and the branch. `<id>` is the id the run printed, for either kind of run.
45
+
46
+ ## Track
47
+
48
+ `vibest ls` lists sessions that have not exited: task (cut to 500 characters), live status, and latest result. `vibest ls --all` includes exited sessions. `vibest result <id>` is the full latest result, with the task uncut. Use these after a restart, after compaction, or when you are unsure. Do not trust memory.
49
+
50
+ ## Follow up
51
+
52
+ - More work on the same change → `vibest send <id> -- '<message>'`. It waits until the session is idle and does not interrupt the turn.
53
+ - Wrong direction while it is working → `vibest interrupt <id>`, then `vibest send <id> -- '<the corrected task>'`. The session stays. That turn produces no result.
54
+ - A new set of eyes, or a wrong approach → a new `vibest run`.
55
+
56
+ ## Finish
57
+
58
+ - Archive a research agent with `vibest archive <id>` once its findings are saved, or start that session with `--archive-on-completion` when you will not message it again. Same for a review or verification you will not continue.
59
+ - Keep an agent that changed code until the user asks to remove it. Archiving keeps the branch, and the worktree whenever it holds unsaved work. `vibest archive --keep-worktree <id>` only when the user wants the directory kept.
60
+ - A `## Remember` section: `vibest project write memory <name>.md --if-version new -- '<lesson>'`. If write says the file already exists, `vibest project read memory <name>.md`, then write again with the version it prints, or pick a new file name.
61
+
62
+ ## The user steps into a pane
63
+
64
+ The user may type into a subagent's pane. If no round is open, that starts one. The only thing you later receive is that agent's `<agent-result>`, which may not quote the user. Do not treat it as a copy of what they typed. A step-in during an open round is not recorded. Do not act on a step-in, and do not message the subagent about it, unless the user asks.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: pipeline
3
+ description: Plan, implement, review, then open a pull request, with the user approving the plan first. Only vibest's main Agent (the coordinator) starts agents; a subagent must not use this skill. Use when the user wants a plan or design before code, a review before merging, or a pull request at the end ("plan it first, then build it", "write a design, then implement", "implement it and have someone review it", "先出方案再写,写完找人 review 后提 PR", "do it as a pipeline", "/pipeline").
4
+ ---
5
+
6
+ # Pipeline
7
+
8
+ Plan (read) → the user agrees → implement (write) → review until the reviewer approves → pull request. Follow delegate: do not poll; each result arrives by itself; check it yourself. The user stays in the loop and may step into any pane. What they say overrides the next step.
9
+
10
+ ## 1. Plan
11
+
12
+ ```
13
+ vibest run <harness> --access read -- 'Write an implementation plan for: <goal, paths, constraints>. Read the code. Report the approach, the files to change, the steps, how to verify, and open questions. Do not modify files.'
14
+ ```
15
+
16
+ Its id is <planner id>. Tell the user the plan is being written and end your turn. `--access read` keeps the planner in the project directory, read-only, with no worktree. Do not pass `--archive-on-completion`: the user has not agreed yet, and a completed result would archive the session before they can answer.
17
+
18
+ ## 2. Agree
19
+
20
+ Show the plan in full, including open questions. Do not implement until the user agrees. If they change it, `vibest send <planner id> -- '<their changes>'` while the planner is open, or edit the plan text yourself before you save it. When the text is agreed, `vibest archive <planner id>`. The agreed text is the plan.
21
+
22
+ ## 3. Implement
23
+
24
+ ```
25
+ vibest project write scratch pipeline-<topic>-plan.md --if-version new -- '<the agreed plan, verbatim>'
26
+ vibest run <harness> --access write -- 'Implement the plan at <absolute scratch path> exactly. Run the tests and typecheck, commit on a branch, push, and report the branch and hash. Do not open a pull request.'
27
+ ```
28
+
29
+ Its id is <implementer id>. The absolute path is `scratchPath` from `vibest project info`, plus the file name. If write says the file already exists, `vibest project read scratch pipeline-<topic>-plan.md`, then write again with the version it prints, or pick a new file name. Do not pass `--archive-on-completion`: this session stays for review and the pull request. When it reports, check the diff and the tests yourself before review. That diff is for this write session, which has a worktree.
30
+
31
+ ## 4. Review
32
+
33
+ `--peer` shares the implementer's worktree: a pane split off the implementer's pane. Archiving the reviewer never removes that worktree.
34
+ Do not pass `--access read` on this session. That flag is the project directory and does not share a worktree, so the server refuses the pair.
35
+ Read-only here is the prompt you pass, plus the peer git rule the session already has: no commit, and nothing that moves HEAD, a branch, or the index. The session is not started with `VIBEST_ACCESS=read`, so the harness is not in its read-only tool mode.
36
+
37
+ ```
38
+ vibest run <harness> --peer <implementer id> -- 'Review the change on this branch against the plan at <absolute scratch path>. Run git diff main...HEAD. Do not modify files, commit, or move HEAD. Look for bugs, missing tests, and departures from the plan; run the tests. Start with "verdict: approve" or "verdict: changes requested", then each comment with file and line.'
39
+ ```
40
+
41
+ Its id is <reviewer id>. Do not pass `--archive-on-completion`: later rounds go to this reviewer with `vibest send`.
42
+
43
+ ## 5. Until approval
44
+
45
+ - `changes requested` → `vibest send <implementer id> -- '<the comments, verbatim. Fix them, run the tests, commit, push, and report the hash.>'` When it reports, `vibest send <reviewer id> -- 'The implementer pushed <hash>. Review again. Same report format.'`
46
+ - `approve` → open the pull request.
47
+ - After 3 rounds without approval, or a judgment call, stop and show the open comments. The user decides: another round, accept, or change the plan.
48
+
49
+ One line to the user per round: the number, the verdict, what is being fixed.
50
+
51
+ ## 6. Pull request
52
+
53
+ ```
54
+ vibest send <implementer id> -- 'The review approved the change. Open a pull request against main with gh pr create. Title: <title>. Body: the plan, the change, and how it was verified. Report the URL.'
55
+ ```
56
+
57
+ Give the user the URL. Then `vibest archive <reviewer id>`. Keep the implementer until the user is done; follow-ups are `vibest send <implementer id> -- '<message>'`.