opencode-onboard 0.4.3 → 0.4.5

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.
Files changed (36) hide show
  1. package/README.md +41 -40
  2. package/content/.agents/agents/devops-manager.md +123 -123
  3. package/content/.agents/skills/ob-default/SKILL.md +25 -21
  4. package/content/.agents/skills/ob-generic-guardrails/SKILL.md +36 -32
  5. package/content/.agents/skills/ob-global/SKILL.md +92 -84
  6. package/content/.agents/skills/ob-pullrequest-az/SKILL.md +168 -160
  7. package/content/.agents/skills/ob-pullrequest-gh/SKILL.md +140 -136
  8. package/content/.opencode/commands/create-engineer.md +109 -0
  9. package/content/.opencode/plugins/session-log.js +523 -519
  10. package/content/AGENTS.md +32 -21
  11. package/package.json +1 -1
  12. package/src/commands/wizard.js +124 -113
  13. package/src/presets/browser.json +22 -18
  14. package/src/presets/optimization.json +27 -22
  15. package/src/steps/browser/browser.test.js +115 -81
  16. package/src/steps/browser/index.js +62 -54
  17. package/src/steps/clean/index.js +108 -107
  18. package/src/steps/metadata/index.js +63 -62
  19. package/src/steps/models/format.js +61 -60
  20. package/src/steps/models/write.test.js +117 -117
  21. package/src/steps/openspec/ensemble.test.js +79 -79
  22. package/src/steps/openspec/index.js +121 -32
  23. package/src/steps/openspec/index.test.js +63 -0
  24. package/src/steps/optimization/caveman.js +34 -29
  25. package/src/steps/optimization/codegraph.js +103 -0
  26. package/src/steps/optimization/codegraph.test.js +104 -0
  27. package/src/steps/optimization/global.js +88 -64
  28. package/src/steps/optimization/global.test.js +99 -0
  29. package/src/steps/optimization/index.js +109 -101
  30. package/src/steps/optimization/optimization.test.js +101 -93
  31. package/src/steps/optimization/quota.js +84 -84
  32. package/src/steps/source/source.test.js +124 -124
  33. package/src/utils/__tests__/copy.test.js +117 -117
  34. package/src/utils/exec-spinner.js +47 -47
  35. package/src/utils/exec.js +134 -131
  36. package/src/utils/terminal.js +6 -0
@@ -1,136 +1,140 @@
1
- ---
2
- name: ob-pullrequest-gh
3
- description: Create GitHub PRs with screenshots, or read and triage PR review feedback. Use when shipping a feature branch or when user says "I've added comments to the PR".
4
- license: MIT
5
- compatibility: Requires gh CLI, openspec CLI, and opencode-browser for screenshots.
6
- metadata:
7
- author: copilots
8
- version: "1.0"
9
- ---
10
-
11
- **ALL GitHub data MUST come from `gh` CLI. NEVER use webfetch, HTTP requests, or browser MCP tools for GitHub operations, even if gh CLI fails. If `gh` is unavailable, report as a blocker.**
12
- Always pass `--repo {owner}/{repo}` explicitly, never rely on git context to resolve the repo.
13
-
14
- ---
15
-
16
- ## Mode A: Create PR (ship mode)
17
-
18
- Triggered when devops-manager is in ship mode after implementation is complete.
19
-
20
- ### Step 1: Verify feature branch
21
-
22
- ```bash
23
- git branch --show-current
24
- ```
25
-
26
- Branch must be `feature/{id}-{slug}`. NEVER push to `main`.
27
-
28
- ### Step 2: Capture screenshots (if UI changes exist)
29
-
30
- ```bash
31
- browser_navigate url="http://localhost:{port}/{route}"
32
- browser_wait ms=2000
33
- browser_screenshot
34
- ```
35
-
36
- Save to: `openspec/changes/{change-name}/images/{feature}.png`
37
-
38
- ### Step 3: Commit and push
39
-
40
- ```bash
41
- git add .
42
- git commit -m "feat(#{id}): {description}"
43
- git push origin feature/{slug}
44
- ```
45
-
46
- ### Step 4: Create PR
47
-
48
- ```bash
49
- gh pr create \
50
- --base main \
51
- --head feature/{slug} \
52
- --title "feat: {title}" \
53
- --body "{description}"
54
- ```
55
-
56
- ### Step 5: Post screenshot comment
57
-
58
- Resolve commit SHA (the commit that includes screenshots):
59
- ```bash
60
- git rev-parse HEAD
61
- ```
62
-
63
- Build blob URL for each image (preferred, stable in PR discussion):
64
- ```
65
- https://github.com/{owner}/{repo}/blob/{sha}/openspec/changes/{change}/images/{file}.png
66
- ```
67
-
68
- Post comment:
69
- ```bash
70
- gh pr comment {pr-number} --repo {owner}/{repo} --body $'## Screenshots\n\n![{feature}]({blob-url})'
71
- ```
72
-
73
- ---
74
-
75
- ## Mode B: Read PR Feedback (feedback mode)
76
-
77
- Triggered when user says "I've added comments to the PR" or "check PR feedback".
78
-
79
- ### Step 1: Find PRs
80
-
81
- If PR link provided, extract number from URL. Otherwise:
82
- ```bash
83
- gh pr list --repo {owner}/{repo} --state open --limit 1
84
- ```
85
-
86
- ### Step 2: Read comment threads
87
-
88
- ```bash
89
- gh pr view {pr-number} --repo {owner}/{repo} --comments
90
- # Or structured output:
91
- gh api repos/{owner}/{repo}/pulls/{pr-number}/comments
92
- gh api repos/{owner}/{repo}/pulls/{pr-number}/reviews
93
- ```
94
-
95
- ### Step 3: Categorize feedback
96
-
97
- | Category | Description | Action |
98
- |----------|-------------|--------|
99
- | `code-change` | Reviewer requests code modification | Return to lead to spawn specialists |
100
- | `spec-update` | Affects proposal, design, or tasks | Update openspec artifacts |
101
- | `question` | Reviewer asks a question | Reply with answer |
102
- | `resolved` | Thread already resolved | Skip |
103
-
104
- ### Step 4: Update openspec (if spec-update)
105
-
106
- ```bash
107
- git branch --show-current
108
- # feature/add-user-auth → change: add-user-auth
109
- ```
110
-
111
- Update: `openspec/changes/{change}/proposal.md`, `design.md`, or `tasks.md` as appropriate.
112
-
113
- ### Step 5: Reply to each comment thread
114
-
115
- ```bash
116
- # Reply to a review comment
117
- gh api repos/{owner}/{repo}/pulls/{pr-number}/comments/{comment-id}/replies \
118
- --method POST \
119
- --field body="Acknowledged, applying this change now."
120
-
121
- # Or post a general PR comment
122
- gh pr comment {pr-number} --body "Updated design.md to reflect feedback."
123
- ```
124
-
125
- ---
126
-
127
- ## Guardrails
128
-
129
- - ✅ Commit and push to feature branches only
130
- - ✅ Create and comment on PRs via gh CLI with explicit `--repo {owner}/{repo}`
131
- - ✅ Screenshots of localhost only via browser_screenshot
132
- - ❌ Commit or push to `main`, FORBIDDEN
133
- - Force push, FORBIDDEN
134
- - Merge or approve PRs, human-only
135
- - Navigate browser to github.com, FORBIDDEN
136
- - ❌ webfetch or HTTP requests to GitHub URLs, FORBIDDEN
1
+ ---
2
+ name: ob-pullrequest-gh
3
+ description: Create GitHub PRs with screenshots, or read and triage PR review feedback. Use when shipping a feature branch or when user says "I've added comments to the PR".
4
+ license: MIT
5
+ compatibility: Requires gh CLI, openspec CLI, and opencode-browser for screenshots.
6
+ metadata:
7
+ author: copilots
8
+ version: "1.0"
9
+ ---
10
+
11
+ **ALL GitHub data MUST come from `gh` CLI. NEVER use webfetch, HTTP requests, or browser MCP tools for GitHub operations, even if gh CLI fails. If `gh` is unavailable, report as a blocker.**
12
+ Always pass `--repo {owner}/{repo}` explicitly, never rely on git context to resolve the repo.
13
+
14
+ ---
15
+
16
+ ## Mode A: Create PR (ship mode)
17
+
18
+ Triggered when devops-manager is in ship mode after implementation is complete.
19
+
20
+ ### Step 1: Verify feature branch
21
+
22
+ ```bash
23
+ git branch --show-current
24
+ ```
25
+
26
+ Branch must be `feature/{id}-{slug}`. NEVER push to `main`.
27
+
28
+ ### Step 2: Capture screenshots (if UI changes exist)
29
+
30
+ ```bash
31
+ browser_navigate url="http://localhost:{port}/{route}"
32
+ browser_wait ms=2000
33
+ browser_screenshot
34
+ ```
35
+
36
+ Save to: `openspec/changes/{change-name}/images/{feature}.png`
37
+
38
+ ### Step 3: Commit and push
39
+
40
+ ```bash
41
+ git add .
42
+ git commit -m "feat(#{id}): {description}"
43
+ git push origin feature/{id}-{slug}
44
+ ```
45
+
46
+ ### Step 4: Create PR
47
+
48
+ ```bash
49
+ gh pr create \
50
+ --base main \
51
+ --head feature/{id}-{slug} \
52
+ --title "feat(#{id}): {title}" \
53
+ --body "{description}"
54
+ ```
55
+
56
+ ### Step 5: Post screenshot comment
57
+
58
+ Resolve commit SHA (the commit that includes screenshots):
59
+
60
+ ```bash
61
+ git rev-parse HEAD
62
+ ```
63
+
64
+ Build blob URL for each image (preferred, stable in PR discussion):
65
+
66
+ ```
67
+ https://github.com/{owner}/{repo}/blob/{sha}/openspec/changes/{change}/images/{file}.png
68
+ ```
69
+
70
+ Post comment:
71
+
72
+ ```bash
73
+ gh pr comment {pr-number} --repo {owner}/{repo} --body $'## Screenshots\n\n![{feature}]({blob-url})'
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Mode B: Read PR Feedback (feedback mode)
79
+
80
+ Triggered when user says "I've added comments to the PR" or "check PR feedback".
81
+
82
+ ### Step 1: Find PRs
83
+
84
+ If PR link provided, extract number from URL. Otherwise:
85
+
86
+ ```bash
87
+ gh pr list --repo {owner}/{repo} --state open --limit 1
88
+ ```
89
+
90
+ ### Step 2: Read comment threads
91
+
92
+ ```bash
93
+ gh pr view {pr-number} --repo {owner}/{repo} --comments
94
+ # Or structured output:
95
+ gh api repos/{owner}/{repo}/pulls/{pr-number}/comments
96
+ gh api repos/{owner}/{repo}/pulls/{pr-number}/reviews
97
+ ```
98
+
99
+ ### Step 3: Categorize feedback
100
+
101
+ | Category | Description | Action |
102
+ | ------------- | ----------------------------------- | ----------------------------------- |
103
+ | `code-change` | Reviewer requests code modification | Return to lead to spawn specialists |
104
+ | `spec-update` | Affects proposal, design, or tasks | Update openspec artifacts |
105
+ | `question` | Reviewer asks a question | Reply with answer |
106
+ | `resolved` | Thread already resolved | Skip |
107
+
108
+ ### Step 4: Update openspec (if spec-update)
109
+
110
+ ```bash
111
+ git branch --show-current
112
+ # feature/add-user-auth → change: add-user-auth
113
+ ```
114
+
115
+ Update: `openspec/changes/{change}/proposal.md`, `design.md`, or `tasks.md` as appropriate.
116
+
117
+ ### Step 5: Reply to each comment thread
118
+
119
+ ```bash
120
+ # Reply to a review comment
121
+ gh api repos/{owner}/{repo}/pulls/{pr-number}/comments/{comment-id}/replies \
122
+ --method POST \
123
+ --field body="Acknowledged, applying this change now."
124
+
125
+ # Or post a general PR comment
126
+ gh pr comment {pr-number} --body "Updated design.md to reflect feedback."
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Guardrails
132
+
133
+ - Commit and push to feature branches only
134
+ - Create and comment on PRs via gh CLI with explicit `--repo {owner}/{repo}`
135
+ - Screenshots of localhost only via browser_screenshot
136
+ - ❌ Commit or push to `main`, FORBIDDEN
137
+ - ❌ Force push, FORBIDDEN
138
+ - ❌ Merge or approve PRs, human-only
139
+ - ❌ Navigate browser to github.com, FORBIDDEN
140
+ - ❌ webfetch or HTTP requests to GitHub URLs, FORBIDDEN
@@ -0,0 +1,109 @@
1
+ ---
2
+ description: Create a custom engineer agent from a description, with skills from skills.sh
3
+ ---
4
+
5
+ Create a new custom engineer agent based on the `basic-engineer.md` template.
6
+
7
+ **Usage**: `/create-engineer <name> "<description>"`
8
+
9
+ Example: `/create-engineer frontend-engineer "A frontend engineer specialized in React, Next.js, and CSS"`
10
+
11
+ **Steps**
12
+
13
+ 1. **Parse input**
14
+
15
+ Extract `<name>` and `<description>` from the arguments after `/create-engineer`.
16
+ - Name should be kebab-case (e.g., `frontend-engineer`)
17
+ - Description is the quoted string explaining the agent's specialty
18
+ - If no input provided, use the AskUserQuestion tool to ask for both.
19
+
20
+ 2. **Search for relevant skills from skills.sh**
21
+
22
+ Based on the description and the project context (read ARCHITECTURE.md, DESIGN.md), search for relevant skills:
23
+
24
+ ```bash
25
+ npx skills search "<relevant keywords from description>"
26
+ ```
27
+
28
+ If the search doesn't work or returns nothing, browse https://www.skills.sh/ for relevant skills based on the agent's specialty.
29
+
30
+ Select 2-5 skills that are most relevant to the agent's role. Prefer official/popular skills.
31
+
32
+ 3. **Install selected skills**
33
+
34
+ For each selected skill:
35
+ ```bash
36
+ npx skills add <owner/repo>
37
+ ```
38
+
39
+ This installs the skill files into the project.
40
+
41
+ 4. **Create the agent file**
42
+
43
+ Create `.agents/agents/<name>.md` with this structure:
44
+
45
+ ```markdown
46
+ ---
47
+ description: <description>
48
+ mode: subagent
49
+ color: <pick a unique hex color>
50
+ temperature: 0.2
51
+ permission:
52
+ edit: allow
53
+ bash: allow
54
+ read: allow
55
+ glob: allow
56
+ grep: allow
57
+ ---
58
+
59
+ ## Abilities
60
+ - Guardrails: @ob-generic-guardrails
61
+ - Development: <@installed-skill-1>, <@installed-skill-2>, ...
62
+ - Testing: <@installed-skill-for-testing>, ...
63
+ - Infrastructure: <@installed-skill-for-devops-cicd>, ...
64
+
65
+ ## Workflow
66
+
67
+ When spawned by the lead:
68
+ 1. Call `team_tasks_list` and verify your assigned task IDs and status before starting.
69
+ 2. For each assigned task: before calling `team_claim task_id:<id>`, check `team_tasks_list` to confirm every dependency of that task has status `done`. If any dependency is not done, skip to the next assigned task that IS unblocked. Only claim tasks whose dependencies are fully complete.
70
+ 3. Load `@ob-global` first, then load mandatory ability `Guardrails`.
71
+ 4. Load additional abilities from the `## Abilities` section as needed for the claimed task domain (for example: development, testing, infrastructure). Each ability can include one or more skills; load all relevant skills listed under each selected ability.
72
+ 5. Send a short `team_message` to lead confirming claimed task ID and loaded skills.
73
+ 6. Implement the task following all loaded skill rules.
74
+ 7. Call `team_tasks_complete task_id:<id>` after finishing that task.
75
+ 8. Repeat until all currently assigned tasks are completed or blocked.
76
+ 9. Message lead with results via `team_message`. Lead may assign more tasks, do NOT stop working or shut down until lead confirms no more tasks for you.
77
+ 10. If lead sends new task IDs via `team_message`, treat them as new assignments and go back to step 2.
78
+ ```
79
+
80
+ Place the installed skills under the most relevant ability category:
81
+ - **Development** — language frameworks, UI libraries, application code skills
82
+ - **Testing** — test frameworks, linting, type checking, validation skills
83
+ - **Infrastructure** — DevOps, CI/CD, cloud, deployment, containerization skills
84
+
85
+ Distribute skills across ALL categories that apply. Only include categories that have at least one real skill assigned (besides Guardrails which is always present).
86
+
87
+ 5. **Update AGENTS.md**
88
+
89
+ Add the new agent to the agents table in AGENTS.md:
90
+ ```
91
+ | `<name>` | .agents/agents/<name>.md | <short role description> |
92
+ ```
93
+
94
+ 6. **Show summary**
95
+
96
+ Report:
97
+ - Agent file created at `.agents/agents/custom-engineer-<name>.md`
98
+ - Skills installed (list each with source)
99
+ - How to use: "This agent will be spawned by the lead during `/opsx-apply` for tasks matching its specialty."
100
+
101
+ **Guidelines**
102
+ - Always keep `@ob-generic-guardrails` in the Guardrails ability
103
+ - NEVER use `@ob-default` in any ability category - all abilities must reference real installed skills
104
+ - **Development** = language/framework/UI skills. **Testing** = test/lint/typecheck skills. **Infrastructure** = DevOps, CI/CD, cloud, deployment skills. Never put UI/CSS skills under Infrastructure.
105
+ - Distribute installed skills across the appropriate categories — not just Development
106
+ - Only include ability categories that have at least one real skill assigned
107
+ - Pick a color that doesn't conflict with existing agents (basic-engineer uses #68A063)
108
+ - Skills should match both the agent description AND the project's tech stack
109
+ - If `npx skills` CLI is not available, manually reference skills by their `owner/repo` name in the abilities section and tell the user to install them