opencode-ship 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,125 +1,174 @@
1
1
  ---
2
- name: setup-matt-pocock-skills
3
- description: Configure this repo for the engineering skills — set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
2
+ name: setup-ship-workflow
3
+ description: First-run setup of opencode-ship. Walks the user through issue tracker, triage labels, domain docs, and AI model roles. Run once after `init` with /setup-ship-workflow.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
- # Setup Matt Pocock's Skills
7
+ # Setup Ship Workflow
8
8
 
9
- Scaffold the per-repo configuration that the engineering skills assume:
9
+ First-run setup for `opencode-ship@1.1`. Run this exactly once after `init` and before any `ship-deliver`. It is prompt-driven, idempotent, and refuses to return until every step is committed or explicitly skipped.
10
10
 
11
- - **Issue tracker** — where issues live (GitHub by default; local markdown is also supported out of the box)
12
- - **Triage labels** — the strings used for the five canonical triage roles
13
- - **Domain docs** — where `CONTEXT.md` and ADRs live, and the consumer rules for reading them
11
+ ## When you trigger
14
12
 
15
- This is a prompt-driven skill, not a deterministic script. Explore, present what you found, confirm with the user, then write.
13
+ - The user runs `/setup-ship-workflow` or types "set up ship" / "continue ship setup".
14
+ - The installer creates `.opencode/ship.setup-pending.json` after `init`; the controller also routes `ship-deliver` here until this skill has cleared the marker.
15
+
16
+ Do **not** trigger on a normal planning or delivery request.
16
17
 
17
18
  ## Process
18
19
 
20
+ Take the sections in order. Lead every question with a recommended default so the user can accept in one word. Skip a section only when exploration already settled it.
21
+
19
22
  ### 1. Explore
20
23
 
21
- Look at the current repo to understand its starting state. Read whatever exists; don't assume:
24
+ ```bash
25
+ git remote -v
26
+ git status --short
27
+ ls -la AGENTS.md CLAUDE.md docs/ .opencode/ 2>/dev/null || true
28
+ cat .opencode/opencode.json 2>/dev/null || true
29
+ cat .opencode/ship.config.json 2>/dev/null || true
30
+ cat .opencode/ship.lock.json 2>/dev/null || true
31
+ opencode providers list 2>/dev/null || true
32
+ ```
22
33
 
23
- - `git remote -v` and `.git/config` — is this a GitHub repo? Which one?
24
- - `AGENTS.md` and `CLAUDE.md` at the repo root — does either exist? Is there already an `## Agent skills` section in either?
25
- - `CONTEXT.md` and `CONTEXT-MAP.md` at the repo root
26
- - `docs/adr/` and any `src/*/docs/adr/` directories
27
- - `docs/agents/` — does this skill's prior output already exist?
28
- - `.scratch/` — sign that a local-markdown issue tracker convention is already in use
29
- - Is the `triage` skill installed? (a `triage` skill folder alongside this one, or `triage` in your available skills.) This decides whether Section B runs at all.
30
- - Monorepo signals — a `pnpm-workspace.yaml`, a `workspaces` field in `package.json`, or a populated `packages/*` with its own `src/`. Present only in a genuinely large multi-package repo; their absence means single-context, which is almost every repo.
34
+ Also check:
31
35
 
32
- ### 2. Present findings and ask
36
+ - is `.opencode/ship.setup-pending.json` present? (it makes this run mandatory)
37
+ - is the `triage` skill installed? (decides whether Section B runs)
38
+ - monorepo signals (`pnpm-workspace.yaml`, `packages/*`)
33
39
 
34
- Summarise what's present and what's missing. Then take the sections in order one section, one answer, then the next.
40
+ ### 2. Section AIssue tracker
35
41
 
36
- Lead each section with the recommended answer so the user can accept it in a word. Give a one-line explainer only when the choice genuinely branches; skip the section entirely when exploration already settled it (Section B when `triage` isn't installed, Section C when there's no monorepo).
42
+ Default: GitHub (the most common case). If `git remote` points at GitLab, propose GitLab. Otherwise offer:
37
43
 
38
- **Section A Issue tracker.**
44
+ - GitHub (uses `gh`)
45
+ - GitLab (uses `glab`)
46
+ - Local markdown (writes under `.scratch/<feature>/`)
47
+ - Other (Jira, Linear, etc.) — describe in one paragraph
39
48
 
40
- > Explainer: The "issue tracker" is where issues live for this repo. Skills like `to-tickets`, `triage`, `to-spec`, and `qa` read from and write to it — they need to know whether to call `gh issue create`, write a markdown file under `.scratch/`, or follow some other workflow you describe. Pick the place you actually track work for this repo.
49
+ Write the choice to `docs/agents/issue-tracker.md`. Use the seed template in `assets/skills/setup-engineering-workflow/issue-tracker-<choice>.md` as the starting point.
41
50
 
42
- Default posture: these skills were designed for GitHub. If a `git remote` points at GitHub, propose that. If a `git remote` points at GitLab (`gitlab.com` or a self-hosted host), propose GitLab. Otherwise (or if the user prefers), offer:
51
+ ### 3. Section B Triage labels
43
52
 
44
- - **GitHub** — issues live in the repo's GitHub Issues (uses the `gh` CLI)
45
- - **GitLab** — issues live in the repo's GitLab Issues (uses the [`glab`](https://gitlab.com/gitlab-org/cli) CLI)
46
- - **Local markdown** — issues live as files under `.scratch/<feature>/` in this repo (good for solo projects or repos without a remote)
47
- - **Other** (Jira, Linear, etc.) — ask the user to describe the workflow in one paragraph; the skill will record it as freeform prose
53
+ Only if the `triage` skill is installed. Ask one question:
48
54
 
49
- Record the choice in `docs/agents/issue-tracker.md`. The GitHub and GitLab templates carry a "PRs as a request surface" flag, defaulted **off** — leave it off and don't raise it; a user who wants external PRs in the triage queue can flip the flag in the file later.
55
+ > Keep the default triage labels? (recommended: yes)
56
+ > Defaults: `needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`.
50
57
 
51
- **Section B Triage label vocabulary.** Skip this section entirely if the `triage` skill isn't installed (exploration told you) — an uninstalled skill needs no labels.
58
+ On **no**, capture the user's overrides so `triage` reuses existing labels instead of creating duplicates.
52
59
 
53
- If it is installed, ask exactly one question:
60
+ Write `docs/agents/triage-labels.md`.
54
61
 
55
- > Do you want to keep the default triage labels? (recommended: **yes**)
62
+ ### 4. Section C Domain docs
56
63
 
57
- The defaults are the five canonical roles, each label string equal to its name: `needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix`. On **yes**, write them as-is. Only if the user says no usually because their tracker already uses other names (e.g. `bug:triage` for `needs-triage`) collect the overrides so `triage` applies existing labels instead of creating duplicates.
64
+ Default: **single-context** — one `CONTEXT.md` + `docs/adr/` at the repo root. Skip the question unless monorepo signals were found.
58
65
 
59
- **Section C — Domain docs.** Default to **single-context** — one `CONTEXT.md` + `docs/adr/` at the repo root. This fits almost every repo; write it without asking.
66
+ Write `docs/agents/domain.md`.
60
67
 
61
- Offer **multi-context** — a root `CONTEXT-MAP.md` pointing to per-context `CONTEXT.md` files only when exploration found monorepo signals. Then confirm which layout they want.
68
+ ### 5. Section DAI model roles
62
69
 
63
- ### 3. Confirm and edit
70
+ Three questions, one at a time. Default to `openai/gpt-5.6-sol` and `minimax/MiniMax-M3`; offer alternative families below.
64
71
 
65
- Show the user a draft of:
72
+ | Role | Default | Suggestion |
73
+ |---|---|---|
74
+ | planner | `openai/gpt-5.6-sol` | strong model for plan writing |
75
+ | builder | `minimax/MiniMax-M3` | cheap/fast model for code |
76
+ | finalReviewer | `openai/gpt-5.6-sol` | strong model for final Standards + Spec review |
66
77
 
67
- - The `## Agent skills` block to add to whichever of `CLAUDE.md` / `AGENTS.md` is being edited (see step 4 for selection rules)
68
- - The contents of `docs/agents/issue-tracker.md`, `docs/agents/domain.md`, and `docs/agents/triage-labels.md` (the last only when `triage` is installed)
78
+ Alternatives to mention if the user has no OpenAI/MiniMax:
69
79
 
70
- Let them edit before writing.
80
+ - Anthropic: `anthropic/claude-opus-4.1`, `anthropic/claude-sonnet-4.5`
81
+ - Google: `google/gemini-2.5-pro`, `google/gemini-2.5-flash`
82
+ - Or any `<provider>/<model>` string the user has credentials for
71
83
 
72
- ### 4. Write
84
+ After the user answers, **update `.opencode/ship.config.json`** so workflow looks like:
73
85
 
74
- **Pick the file to edit:**
86
+ ```json
87
+ {
88
+ "schemaVersion": 2,
89
+ "profile": "engineering",
90
+ "project": { ... },
91
+ "delivery": { ... },
92
+ "workflow": {
93
+ "models": {
94
+ "planner": "<answer>",
95
+ "builder": "<answer>",
96
+ "finalReviewer": "<answer>"
97
+ },
98
+ "approval": { "mirrorToIssue": true, "maxFailedRounds": 3 }
99
+ }
100
+ }
101
+ ```
75
102
 
76
- - If `CLAUDE.md` exists, edit it.
77
- - Else if `AGENTS.md` exists, edit it.
78
- - If neither exists, ask the user which one to create — don't pick for them.
103
+ Then run `opencode-ship update` to write the change with full transactional coverage.
79
104
 
80
- Never create `AGENTS.md` when `CLAUDE.md` already exists (or vice versa) always edit the one that's already there.
105
+ ### 6. Section EProvider auth probe
81
106
 
82
- If an `## Agent skills` block already exists in the chosen file, update its contents in-place rather than appending a duplicate. Don't overwrite user edits to the surrounding sections.
107
+ ```bash
108
+ opencode providers list
109
+ ```
83
110
 
84
- The block:
111
+ If the planner/builder/finalReviewer names are missing credentials, surface a warning and tell the user how to log in:
85
112
 
86
- ```markdown
87
- ## Agent skills
113
+ ```bash
114
+ opencode providers login openai
115
+ opencode providers login minimax
116
+ ```
117
+
118
+ Do not invent credentials. Do not retry.
88
119
 
89
- ### Issue tracker
120
+ ### 7. Section F — Permissions sanity
90
121
 
91
- [one-line summary of where issues are tracked]. See `docs/agents/issue-tracker.md`.
122
+ Run `opencode-ship doctor`. If any pointer is missing, prompt the user to run:
92
123
 
93
- ### Triage labels
124
+ ```bash
125
+ opencode-ship update --force-root-config
126
+ ```
127
+
128
+ Do not auto-rewrite root configs without consent.
129
+
130
+ ### 8. Section G — AGENTS.md / CLAUDE.md
131
+
132
+ Pick the file to edit:
133
+
134
+ - If `CLAUDE.md` exists, edit it.
135
+ - Else if `AGENTS.md` exists, edit it.
136
+ - If neither, ask the user to pick one — never create both.
94
137
 
95
- [one-line summary of the label vocabulary]. See `docs/agents/triage-labels.md`.
138
+ If an `## Ship workflow` block exists, update in place. Otherwise append:
96
139
 
97
- ### Domain docs
140
+ ```markdown
141
+ ## Ship workflow
98
142
 
99
- [one-line summary of layout "single-context" or "multi-context"]. See `docs/agents/domain.md`.
143
+ This repo uses opencode-ship. Read `.opencode/ship.config.json` for the active model roles and approval policy. Issues live in [tracker]. See `docs/agents/issue-tracker.md`. Triage labels are documented in `docs/agents/triage-labels.md`.
144
+
145
+ For a single-issue delivery, the user invokes `/setup-ship-workflow` once, then `ship-deliver <issue-number>` (or types "Ship issue N"). The controller dispatches the planner, builder, and reviewers; no further user action is required until Ready.
100
146
  ```
101
147
 
102
- Include the `### Triage labels` sub-block, and write `docs/agents/triage-labels.md`, only when `triage` is installed and Section B ran. When it isn't, both are omitted.
148
+ Include the `### Triage labels` sub-block only when the `triage` skill is installed.
103
149
 
104
- Then write the docs files using the seed templates in this skill folder as a starting point:
150
+ ### 9. Done
105
151
 
106
- - [issue-tracker-github.md](./issue-tracker-github.md) — GitHub issue tracker
107
- - [issue-tracker-gitlab.md](./issue-tracker-gitlab.md) GitLab issue tracker
108
- - [issue-tracker-local.md](./issue-tracker-local.md) local-markdown issue tracker
109
- - [triage-labels.md](./triage-labels.md) — label mapping (only if `triage` is installed)
110
- - [domain.md](./domain.md) — domain doc consumer rules + layout
152
+ - Delete `.opencode/ship.setup-pending.json`.
153
+ - Print the next-step block below.
154
+ - Tell the user they can edit `docs/agents/*.md` directly; re-running this skill is only necessary to switch trackers or re-configure models.
111
155
 
112
- For "other" issue trackers, write `docs/agents/issue-tracker.md` from scratch using the user's description.
156
+ ## Next steps (always print)
113
157
 
114
- ### 5. Done
158
+ ```text
159
+ Setup complete.
115
160
 
116
- Tell the user the setup is complete and which engineering skills will now read from these files. Mention they can edit `docs/agents/*.md` directly later — re-running this skill is only necessary if they want to switch issue trackers or restart from scratch.
161
+ Next:
162
+ 1. Restart OpenCode in this repo (if you haven't already).
163
+ 2. Try: Ship issue 1 (or any issue number)
164
+ 3. The controller will: plan -> ask approve -> implement -> review -> ready -> wait for "merge it"
165
+ ```
117
166
 
118
- ## Ship integration
167
+ ## Hard rules
119
168
 
120
- This skill is part of the engineering profile shipped by
121
- `opencode-ship@1.0`. The strong planner child session is
122
- configured with `openai/gpt-5.6-sol` and the durable workflow
123
- state lives under `<git-common-dir>/opencode-ship/`. All
124
- GitHub mutations go through Ship's typed tools; never use
125
- `gh api` or raw shell.
169
+ - One question per turn. Never batch.
170
+ - Re-run safe: skip sections already settled by existing config or docs.
171
+ - Never edit the same `docs/agents/*.md` twice in one run.
172
+ - Never silently overwrite a user-owned value in `ship.config.json`; always show the diff first.
173
+ - Never tell the user to "merge it" automatically. The merge step is the only autonomy break.
174
+ - Never hide step failures. If a write fails, surface the error and stop.
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: skill-discovery
3
+ description: Discover and conditionally install skills from the open agent skills ecosystem before non-trivial work. Use when the parent agent is starting a new task and wants to ensure the most relevant public skills (React, testing, deployment, etc.) are available to the cheap builder.
4
+ ---
5
+
6
+ # skill-discovery
7
+
8
+ Discover skills from the open agent skills ecosystem (`npx skills`) that match the current task objective, then install the trusted ones locally. The hard rule is that this skill is **suggest-first, install-conditionally**: trusted sources may auto-install; everything else must be approved by the user.
9
+
10
+ ## When you trigger
11
+
12
+ - The parent agent (typically `ship-deliver` or `ship-task-builder`) is about to dispatch a new task.
13
+ - The task objective references a domain where a public skill likely exists (web frameworks, testing, deployment, design, etc.).
14
+ - The user has not yet opted out of skill discovery for this session.
15
+
16
+ Do **not** trigger on:
17
+
18
+ - Trivial edits, doc rewrites, single-line fixes
19
+ - Tasks that are already covered by a vendored skill from the engineering catalog
20
+
21
+ ## Procedure
22
+
23
+ ### 1. Extract a discovery query
24
+
25
+ From the current task brief (interfaces, files, technology stack), build one short query string (2–5 words). Example: `react testing`, `docker deploy`, `postgres migrations`, `tailwind components`.
26
+
27
+ ### 2. Search the skills ecosystem
28
+
29
+ ```bash
30
+ npx skills find "<query>"
31
+ ```
32
+
33
+ The CLI returns candidates with source repo, install count, and skill name. Parse the output, do not transcribe it.
34
+
35
+ ### 3. Score and filter
36
+
37
+ The install allowlist and quality threshold live in `ship.config.json` under `skillDiscovery`:
38
+
39
+ ```json
40
+ {
41
+ "skillDiscovery": {
42
+ "trustedOwners": [
43
+ "vercel-labs",
44
+ "anthropics",
45
+ "obra",
46
+ "mattpocock",
47
+ "ComposioHQ"
48
+ ],
49
+ "minInstalls": 1000,
50
+ "blocklist": ["known-bad-owner/example"]
51
+ }
52
+ }
53
+ ```
54
+
55
+ **Auto-install** is allowed only if all of the following are true:
56
+
57
+ - source owner is in `trustedOwners`
58
+ - install count >= `minInstalls` (default 1000)
59
+ - skill name does not conflict with a managed `opencode-ship` skill
60
+ - the user has not previously blocked this skill in this repo
61
+
62
+ Otherwise:
63
+
64
+ - If the source is untrusted but the skill looks relevant, present 1–3 candidates to the user and wait for a yes/no.
65
+ - If no candidates match, continue without installation.
66
+
67
+ ### 4. Install project-locally
68
+
69
+ Auto-approved candidates install to `.opencode/skills/<skill>/SKILL.md` (project-local). The typed tool `ship_skill_install` records every install in the run ledger so `doctor` and `uninstall` can audit it.
70
+
71
+ Manual install if the user prefers global:
72
+
73
+ ```bash
74
+ npx skills add <owner/repo@skill> -g -y
75
+ ```
76
+
77
+ Prefer project-local unless the user explicitly asks for global.
78
+
79
+ ### 5. Report
80
+
81
+ After discovery, emit a one-line summary in the run:
82
+
83
+ ```text
84
+ Skill discovery: <n> candidates, <m> installed (<owner/skill list>).
85
+ ```
86
+
87
+ If 0 installed, say `Skill discovery: 0 installed, continuing with catalog skills only.`
88
+
89
+ ## Hard rules
90
+
91
+ - Never run `npx skills add` for an untrusted source without explicit user approval.
92
+ - Never install a skill that shadows a managed opencode-ship skill (name collision).
93
+ - Never run discovery when offline or when the registry is unreachable. Warn and continue.
94
+ - Never install more than 5 skills in one discovery pass.
95
+ - Never persist discovery results to `ship.config.json`. The discovery is per-task, not per-repo.
96
+
97
+ ## Permissions
98
+
99
+ This skill expects the following bash allowances on the host (configured in `ship-controller` frontmatter):
100
+
101
+ - `npx skills find *`
102
+ - `npx skills add *`
103
+ - `ls .opencode/skills`
104
+ - `cat .opencode/skills/*/SKILL.md`