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,84 +1,92 @@
1
- Generic skill, common project-level guidance loaded by all agents. Provides baseline rules; specialized skills add specific concerns.
2
-
3
- ## When loaded
4
-
5
- Load this skill first in any session. All other skills add to it, never replace it.
6
-
7
- ## Context
8
-
9
- - Load DESIGN.md first for design principles and guidelines.
10
- - Load ARCHITECTURE.md for system architecture and component interactions.
11
-
12
- ## Source Roots
13
-
14
- <!-- OB-SOURCE-ROOTS-START -->
15
- Source roots are generated during onboarding from the user's source-scope selection.
16
- Read and analyze code ONLY from those generated roots.
17
-
18
- If multiple roots are generated, each root is an independent git repository. Branch, commit, push, and PR operations must be handled per repository.
19
- <!-- OB-SOURCE-ROOTS-END -->
20
-
21
- ## Git Guardrails
22
-
23
- - NEVER commit or push to main
24
- - NEVER force push
25
- - NEVER merge PRs (human-only)
26
- - Feature branches only: `feature/*` or `bugfix/*`
27
-
28
- ## Secrets Guardrails
29
-
30
- - NEVER read or output .env files
31
- - NEVER log credentials, API keys, tokens
32
- - NEVER commit secrets to git
33
-
34
- ## Code Quality
35
-
36
- - Run tests before marking done
37
- - Run lint/build before pushing
38
- - Keep changes small and focused
39
- - Ask for clarification if unclear
40
-
41
- ## Ensemble Task Board Rules
42
-
43
- When working as a spawned agent in an ensemble team, these rules are mandatory:
44
-
45
- **Claim-first execution:**
46
- - Your FIRST tool call after loading skills MUST be `team_claim task_id:<id>`. The dashboard must show your active task immediately.
47
- - Do NOT spend more than 2 tool calls reading/planning before writing code. Claim first, then explore only what's needed for that specific task.
48
-
49
- **One task at a time:**
50
- - Claim implement build/verify commit `team_tasks_complete` claim next.
51
- - NEVER hold multiple claimed tasks simultaneously.
52
- - NEVER batch completions. Mark done immediately after each commit.
53
-
54
- **Dependency check before claiming:**
55
- - Before calling `team_claim task_id:<id>`, call `team_tasks_list` and verify every dependency of that task has status `done`.
56
- - If any dependency is not `done`, do NOT claim that task. Scan the board for another assigned task whose dependencies ARE all done and claim that one instead.
57
- - If no assigned task is unblocked, report blocked to lead and STOP. Do NOT poll, sleep, or loop waiting for a dependency.
58
-
59
- **Commit cadence:**
60
- - After each task passes build: `git add -A && git commit -m "feat: <short description>"`
61
- - ONE task = ONE commit. No multi-task commits.
62
-
63
- **Communication discipline:**
64
- - NEVER message lead with "I'm reading" or "I'm planning". Only message when BATCH DONE or BLOCKED.
65
- - When BATCH DONE: report number of tasks completed + commit count. Lead may assign more tasks, stay active until lead confirms no more.
66
- - When BLOCKED: report which task, what's blocking, what you tried.
67
- - NEVER ask lead for permission to proceed, skip, or reorder tasks. Task sequencing and dependency resolution are YOUR responsibility. Only message lead when BATCH DONE or genuinely BLOCKED (no unblocked tasks remain).
68
- - When lead sends new task IDs via team_message, treat them as new assignments and continue working.
69
-
70
- **Stall prevention:**
71
- - If a build fails, fix it immediately (max 3 attempts). Then report blocker.
72
- - If you don't understand a task, message lead asking for clarification. Do NOT guess.
73
- - If a file you need doesn't exist yet (dependency on another agent), report as blocked, don't create stubs.
74
- - NEVER use sleep loops or polling to wait for a dependency. Waiting is always a blocker: report it and stop.
75
-
76
- ## Token Optimization Rules
77
-
78
- <!-- OB-RTK-START -->
79
- RTK rules are generated here when RTK is selected during onboarding.
80
- <!-- OB-RTK-END -->
81
-
82
- <!-- OB-CAVEMAN-START -->
83
- Caveman rules are generated here when Caveman is selected during onboarding.
84
- <!-- OB-CAVEMAN-END -->
1
+ ---
2
+ name: ob-global
3
+ description: Generic skill, common project-level guidance loaded by all agents. Provides baseline rules; specialized skills add specific concerns. Load this skill first in any session.
4
+ license: MIT
5
+ ---
6
+
7
+ ## When loaded
8
+
9
+ Load this skill first in any session. All other skills add to it, never replace it.
10
+
11
+ ## Context
12
+
13
+ - Load DESIGN.md first for design principles and guidelines.
14
+ - Load ARCHITECTURE.md for system architecture and component interactions.
15
+
16
+ ## Source Roots
17
+
18
+ <!-- OB-SOURCE-ROOTS-START -->
19
+ Source roots are generated during onboarding from the user's source-scope selection.
20
+ Read and analyze code ONLY from those generated roots.
21
+
22
+ If multiple roots are generated, each root is an independent git repository. Branch, commit, push, and PR operations must be handled per repository.
23
+ <!-- OB-SOURCE-ROOTS-END -->
24
+
25
+ ## Git Guardrails
26
+
27
+ - NEVER commit or push to main
28
+ - NEVER force push
29
+ - NEVER merge PRs (human-only)
30
+ - Feature branches only: `feature/*` or `bugfix/*`
31
+
32
+ ## Secrets Guardrails
33
+
34
+ - NEVER read or output .env files
35
+ - NEVER log credentials, API keys, tokens
36
+ - NEVER commit secrets to git
37
+
38
+ ## Code Quality
39
+
40
+ - Run tests before marking done
41
+ - Run lint/build before pushing
42
+ - Keep changes small and focused
43
+ - Ask for clarification if unclear
44
+
45
+ ## Ensemble Task Board Rules
46
+
47
+ When working as a spawned agent in an ensemble team, these rules are mandatory:
48
+
49
+ **Claim-first execution:**
50
+ - Your FIRST tool call after loading skills MUST be `team_claim task_id:<id>`. The dashboard must show your active task immediately.
51
+ - Do NOT spend more than 2 tool calls reading/planning before writing code. Claim first, then explore only what's needed for that specific task.
52
+
53
+ **One task at a time:**
54
+ - Claim implement → build/verify → commit → `team_tasks_complete` → claim next.
55
+ - NEVER hold multiple claimed tasks simultaneously.
56
+ - NEVER batch completions. Mark done immediately after each commit.
57
+
58
+ **Dependency check before claiming:**
59
+ - Before calling `team_claim task_id:<id>`, call `team_tasks_list` and verify every dependency of that task has status `done`.
60
+ - If any dependency is not `done`, do NOT claim that task. Scan the board for another assigned task whose dependencies ARE all done and claim that one instead.
61
+ - If no assigned task is unblocked, report blocked to lead and STOP. Do NOT poll, sleep, or loop waiting for a dependency.
62
+
63
+ **Commit cadence:**
64
+ - After each task passes build: `git add -A && git commit -m "feat: <short description>"`
65
+ - ONE task = ONE commit. No multi-task commits.
66
+
67
+ **Communication discipline:**
68
+ - NEVER message lead with "I'm reading" or "I'm planning". Only message when BATCH DONE or BLOCKED.
69
+ - When BATCH DONE: report number of tasks completed + commit count. Lead may assign more tasks, stay active until lead confirms no more.
70
+ - When BLOCKED: report which task, what's blocking, what you tried.
71
+ - NEVER ask lead for permission to proceed, skip, or reorder tasks. Task sequencing and dependency resolution are YOUR responsibility. Only message lead when BATCH DONE or genuinely BLOCKED (no unblocked tasks remain).
72
+ - When lead sends new task IDs via team_message, treat them as new assignments and continue working.
73
+
74
+ **Stall prevention:**
75
+ - If a build fails, fix it immediately (max 3 attempts). Then report blocker.
76
+ - If you don't understand a task, message lead asking for clarification. Do NOT guess.
77
+ - If a file you need doesn't exist yet (dependency on another agent), report as blocked, don't create stubs.
78
+ - NEVER use sleep loops or polling to wait for a dependency. Waiting is always a blocker: report it and stop.
79
+
80
+ ## Token Optimization Rules
81
+
82
+ <!-- OB-RTK-START -->
83
+ RTK rules are generated here when RTK is selected during onboarding.
84
+ <!-- OB-RTK-END -->
85
+
86
+ <!-- OB-CAVEMAN-START -->
87
+ Caveman rules are generated here when Caveman is selected during onboarding.
88
+ <!-- OB-CAVEMAN-END -->
89
+
90
+ <!-- OB-CODEGRAPH-START -->
91
+ Codegraph rules are generated here when codegraph is selected during onboarding.
92
+ <!-- OB-CODEGRAPH-END -->
@@ -1,160 +1,168 @@
1
- ---
2
- name: ob-pullrequest-az
3
- description: Create Azure DevOps 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 az CLI, az devops extension, openspec CLI, and opencode-browser for screenshots.
6
- metadata:
7
- author: copilots
8
- version: "1.0"
9
- ---
10
-
11
- **Browser MCP tools are FORBIDDEN for all Azure DevOps operations.**
12
- Browser tools are ONLY permitted for screenshots of the LOCAL running app on `localhost` URLs.
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
- az repos pr create \
50
- --repository {repo} \
51
- --source-branch feature/{id}-{slug} \
52
- --target-branch main \
53
- --title "feat(#{id}): {title}" \
54
- --description "{description}"
55
- ```
56
-
57
- ### Step 5: Link work item (MANDATORY, run sequentially, not in parallel)
58
-
59
- ```bash
60
- az repos pr work-item add --id {pr-id} --work-items {workitem-id}
61
- ```
62
-
63
- ### Step 6: Post screenshot comment
64
-
65
- Build raw URL for each image:
66
- ```
67
- https://dev.azure.com/{org}/{project}/_apis/git/repositories/{repo}/items?path=openspec/changes/{change}/images/{file}.png&versionType=branch&version={branch}&api-version=7.1
68
- ```
69
-
70
- Post via:
71
- ```bash
72
- az devops invoke \
73
- --area git --resource pullRequestThreads \
74
- --route-parameters project={project} repositoryId={repo} pullRequestId={pr-id} \
75
- --http-method POST --api-version 7.1 --in-file body.json
76
- ```
77
-
78
- `body.json`:
79
- ```json
80
- {
81
- "comments": [{
82
- "parentCommentId": 0,
83
- "content": "## Screenshots\n\n![{feature}]({raw-url})",
84
- "commentType": 1
85
- }],
86
- "status": "active"
87
- }
88
- ```
89
-
90
- ---
91
-
92
- ## Mode B: Read PR Feedback (feedback mode)
93
-
94
- Triggered when user says "I've added comments to the PR" or "check PR feedback".
95
-
96
- ### Step 1: Find PRs
97
-
98
- If PR link provided, extract ID from URL. Otherwise:
99
- ```bash
100
- az repos pr list --repository {repo} --status active --top 1
101
- ```
102
-
103
- ### Step 2: Read comment threads
104
-
105
- ```bash
106
- az devops invoke \
107
- --area git --resource pullRequestThreads \
108
- --route-parameters project={project} repositoryId={repo} pullRequestId={id} \
109
- --http-method GET --api-version 7.1
110
- ```
111
-
112
- ### Step 3: Categorize feedback
113
-
114
- | Category | Description | Action |
115
- |----------|-------------|--------|
116
- | `code-change` | Reviewer requests code modification | Return to lead to spawn specialists |
117
- | `spec-update` | Affects proposal, design, or tasks | Update openspec artifacts |
118
- | `question` | Reviewer asks a question | Reply with answer |
119
- | `resolved` | Thread already resolved | Skip |
120
-
121
- ### Step 4: Update openspec (if spec-update)
122
-
123
- ```bash
124
- git branch --show-current
125
- # feature/193208-roles-crud change: us-193208-roles-crud
126
- ```
127
-
128
- Update: `openspec/changes/{change}/proposal.md`, `design.md`, or `tasks.md` as appropriate.
129
-
130
- ### Step 5: Reply to each thread
131
-
132
- ```bash
133
- az devops invoke \
134
- --area git --resource pullRequestThreadComments \
135
- --route-parameters project={project} repositoryId={repo} pullRequestId={id} threadId={tid} \
136
- --http-method POST --api-version 7.1 --in-file reply.json
137
- ```
138
-
139
- `reply.json`:
140
- ```json
141
- {
142
- "comments": [{
143
- "parentCommentId": 1,
144
- "content": "Acknowledged, applying this change now.",
145
- "commentType": 1
146
- }]
147
- }
148
- ```
149
-
150
- ---
151
-
152
- ## Guardrails
153
-
154
- - ✅ Commit and push to feature branches only
155
- - ✅ Create and comment on PRs via az CLI
156
- - ✅ Screenshots of localhost only via browser_screenshot
157
- - ❌ Commit or push to `main`, FORBIDDEN
158
- - ❌ Force push, FORBIDDEN
159
- - ❌ Merge or approve PRs, human-only
160
- - ❌ Navigate browser to dev.azure.com, FORBIDDEN
1
+ ---
2
+ name: ob-pullrequest-az
3
+ description: Create Azure DevOps 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 az CLI, az devops extension, openspec CLI, and opencode-browser for screenshots.
6
+ metadata:
7
+ author: copilots
8
+ version: "1.0"
9
+ ---
10
+
11
+ **Browser MCP tools are FORBIDDEN for all Azure DevOps operations.**
12
+ Browser tools are ONLY permitted for screenshots of the LOCAL running app on `localhost` URLs.
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
+ az repos pr create \
50
+ --repository {repo} \
51
+ --source-branch feature/{id}-{slug} \
52
+ --target-branch main \
53
+ --title "feat(#{id}): {title}" \
54
+ --description "{description}"
55
+ ```
56
+
57
+ ### Step 5: Link work item (MANDATORY, run sequentially, not in parallel)
58
+
59
+ ```bash
60
+ az repos pr work-item add --id {pr-id} --work-items {workitem-id}
61
+ ```
62
+
63
+ ### Step 6: Post screenshot comment
64
+
65
+ Build raw URL for each image:
66
+
67
+ ```
68
+ https://dev.azure.com/{org}/{project}/_apis/git/repositories/{repo}/items?path=openspec/changes/{change}/images/{file}.png&versionType=branch&version={branch}&api-version=7.1
69
+ ```
70
+
71
+ Post via:
72
+
73
+ ```bash
74
+ az devops invoke \
75
+ --area git --resource pullRequestThreads \
76
+ --route-parameters project={project} repositoryId={repo} pullRequestId={pr-id} \
77
+ --http-method POST --api-version 7.1 --in-file body.json
78
+ ```
79
+
80
+ `body.json`:
81
+
82
+ ```json
83
+ {
84
+ "comments": [
85
+ {
86
+ "parentCommentId": 0,
87
+ "content": "## Screenshots\n\n![{feature}]({raw-url})",
88
+ "commentType": 1
89
+ }
90
+ ],
91
+ "status": "active"
92
+ }
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Mode B: Read PR Feedback (feedback mode)
98
+
99
+ Triggered when user says "I've added comments to the PR" or "check PR feedback".
100
+
101
+ ### Step 1: Find PRs
102
+
103
+ If PR link provided, extract ID from URL. Otherwise:
104
+
105
+ ```bash
106
+ az repos pr list --repository {repo} --status active --top 1
107
+ ```
108
+
109
+ ### Step 2: Read comment threads
110
+
111
+ ```bash
112
+ az devops invoke \
113
+ --area git --resource pullRequestThreads \
114
+ --route-parameters project={project} repositoryId={repo} pullRequestId={id} \
115
+ --http-method GET --api-version 7.1
116
+ ```
117
+
118
+ ### Step 3: Categorize feedback
119
+
120
+ | Category | Description | Action |
121
+ | ------------- | ----------------------------------- | ----------------------------------- |
122
+ | `code-change` | Reviewer requests code modification | Return to lead to spawn specialists |
123
+ | `spec-update` | Affects proposal, design, or tasks | Update openspec artifacts |
124
+ | `question` | Reviewer asks a question | Reply with answer |
125
+ | `resolved` | Thread already resolved | Skip |
126
+
127
+ ### Step 4: Update openspec (if spec-update)
128
+
129
+ ```bash
130
+ git branch --show-current
131
+ # feature/193208-roles-crud → change: us-193208-roles-crud
132
+ ```
133
+
134
+ Update: `openspec/changes/{change}/proposal.md`, `design.md`, or `tasks.md` as appropriate.
135
+
136
+ ### Step 5: Reply to each thread
137
+
138
+ ```bash
139
+ az devops invoke \
140
+ --area git --resource pullRequestThreadComments \
141
+ --route-parameters project={project} repositoryId={repo} pullRequestId={id} threadId={tid} \
142
+ --http-method POST --api-version 7.1 --in-file reply.json
143
+ ```
144
+
145
+ `reply.json`:
146
+
147
+ ```json
148
+ {
149
+ "comments": [
150
+ {
151
+ "parentCommentId": 1,
152
+ "content": "Acknowledged, applying this change now.",
153
+ "commentType": 1
154
+ }
155
+ ]
156
+ }
157
+ ```
158
+ ---
159
+
160
+ ## Guardrails
161
+
162
+ - ✅ Commit and push to feature branches only
163
+ - ✅ Create and comment on PRs via az CLI
164
+ - ✅ Screenshots of localhost only via browser_screenshot
165
+ - ❌ Commit or push to `main`, FORBIDDEN
166
+ - ❌ Force push, FORBIDDEN
167
+ - ❌ Merge or approve PRs, human-only
168
+ - ❌ Navigate browser to dev.azure.com, FORBIDDEN