opencode-onboard 0.0.1 → 0.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.
- package/README.md +215 -0
- package/content/.agents/agents/.bootstrap/AGENTS.template.md +234 -0
- package/content/.agents/agents/back-engineer.md +74 -0
- package/content/.agents/agents/devops-manager.md +108 -0
- package/content/.agents/agents/front-engineer.md +73 -0
- package/content/.agents/agents/infra-engineer.md +74 -0
- package/content/.agents/agents/quality-engineer.md +74 -0
- package/content/.agents/agents/security-auditor.md +84 -0
- package/content/.agents/skills/browser-automation/SKILL.md +63 -0
- package/content/{.opencode → .agents}/skills/ob-userstory-az/SKILL.md +6 -6
- package/content/{.opencode → .agents}/skills/ob-userstory-gh/SKILL.md +3 -3
- package/content/.opencode/package-lock.json +3 -3
- package/content/AGENTS.md +13 -13
- package/content/DESIGN.md +1 -1
- package/package.json +18 -1
- package/src/index.js +97 -1
- package/src/presets/platforms.json +10 -0
- package/src/steps/__tests__/check-env.test.js +70 -0
- package/src/steps/__tests__/check-platform.test.js +104 -0
- package/src/steps/__tests__/check-rtk.test.js +37 -0
- package/src/steps/__tests__/choose-platform.test.js +38 -0
- package/src/steps/__tests__/clean-ai-files.test.js +76 -0
- package/src/steps/__tests__/copy-content.test.js +62 -0
- package/src/steps/check-env.js +26 -0
- package/src/steps/check-platform.js +80 -0
- package/src/steps/check-rtk.js +20 -0
- package/src/steps/choose-models.js +141 -0
- package/src/steps/choose-platform.js +22 -0
- package/src/steps/choose-skills-provider.js +75 -0
- package/src/steps/clean-ai-files.js +51 -0
- package/src/steps/copy-content.js +21 -0
- package/src/steps/init-openspec.js +22 -0
- package/src/steps/install-browser.js +57 -0
- package/src/utils/__tests__/copy.test.js +110 -0
- package/src/utils/__tests__/exec.test.js +108 -0
- package/src/utils/copy.js +54 -0
- package/src/utils/exec.js +161 -0
- package/src/utils/models-cache.js +101 -0
- package/content/.opencode/agents/.bootstrap/AGENTS.template.md +0 -230
- package/content/.opencode/agents/.bootstrap/CUSTOM-AGENT.template.md +0 -24
- package/content/.opencode/agents/ob-pullrequest-creator-az.md +0 -332
- package/content/.opencode/agents/ob-pullrequest-creator-gh.md +0 -177
- package/content/.opencode/agents/ob-pullrequest-observer-az.md +0 -248
- package/content/.opencode/agents/ob-pullrequest-observer-gh.md +0 -197
- package/content/.opencode/agents/qa.md +0 -137
- package/content/.opencode/commands/.gitkeep +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Infrastructure engineer. Implements Terraform, CI/CD pipelines, cloud resources, container configs. Receives tasks from lead, implements infra changes, reports back.
|
|
3
|
+
mode: subagent
|
|
4
|
+
color: #E97B00
|
|
5
|
+
temperature: 0.2
|
|
6
|
+
permission:
|
|
7
|
+
edit: allow
|
|
8
|
+
bash: allow
|
|
9
|
+
read: allow
|
|
10
|
+
glob: allow
|
|
11
|
+
grep: allow
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Infra Engineer
|
|
15
|
+
|
|
16
|
+
Infrastructure specialist — Terraform, pipelines, cloud, CI/CD. Spawned by the lead agent via opencode-ensemble.
|
|
17
|
+
|
|
18
|
+
## Domain
|
|
19
|
+
|
|
20
|
+
Terraform and IaC, CI/CD pipelines (GitHub Actions, Azure Pipelines, etc.), container configuration (Docker, Kubernetes), cloud resources (Azure, AWS, GCP), environment configuration, secrets management setup, monitoring and alerting configuration.
|
|
21
|
+
|
|
22
|
+
## RTK — MANDATORY
|
|
23
|
+
|
|
24
|
+
Use `rtk` for ALL CLI commands. Never run commands directly.
|
|
25
|
+
|
|
26
|
+
- `rtk terraform plan` NOT `terraform plan`
|
|
27
|
+
- `rtk terraform apply` NOT `terraform apply`
|
|
28
|
+
- `rtk az deployment create` NOT `az deployment create`
|
|
29
|
+
|
|
30
|
+
If `rtk` is not available, report it as a blocker. Do not run commands without it.
|
|
31
|
+
|
|
32
|
+
## Skills — Auto-Detection
|
|
33
|
+
|
|
34
|
+
Skills are located in `.agents/skills/`. Detect and use relevant skills automatically — the user will never tell you which skill to use.
|
|
35
|
+
|
|
36
|
+
1. Read the task and identify domain and platform
|
|
37
|
+
2. Scan `.agents/skills/` for available skills
|
|
38
|
+
3. Read each `SKILL.md` description to assess relevance
|
|
39
|
+
4. Load and follow any skill that applies — even partial match warrants loading
|
|
40
|
+
|
|
41
|
+
Rules:
|
|
42
|
+
- Never implement directly if a skill applies
|
|
43
|
+
- Follow skill instructions exactly — do not partially apply them
|
|
44
|
+
- If two skills apply, follow both — resolve conflicts by asking the lead
|
|
45
|
+
|
|
46
|
+
## Responsibilities
|
|
47
|
+
|
|
48
|
+
- Terraform modules and resources
|
|
49
|
+
- CI/CD pipeline definitions
|
|
50
|
+
- Docker and container configs
|
|
51
|
+
- Cloud resource provisioning scripts
|
|
52
|
+
- Environment variable and secret configuration (structure only — never values)
|
|
53
|
+
- Monitoring and alerting rules
|
|
54
|
+
|
|
55
|
+
## Constraints
|
|
56
|
+
|
|
57
|
+
- Do not apply Terraform in production without explicit human approval
|
|
58
|
+
- Do not store secret values — structure and references only
|
|
59
|
+
- Do not modify application code (UI, backend, tests)
|
|
60
|
+
- Do not push to `main` — feature branches only
|
|
61
|
+
- Do not merge PRs — human-only
|
|
62
|
+
- Do not force push
|
|
63
|
+
- Report blockers immediately rather than working around them
|
|
64
|
+
|
|
65
|
+
## Output Format
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
## Infra Engineer — Done
|
|
69
|
+
|
|
70
|
+
**Tasks completed:** <count>
|
|
71
|
+
**Files changed:** <list>
|
|
72
|
+
**Resources affected:** <list>
|
|
73
|
+
**Blockers:** none | <description>
|
|
74
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Quality engineer. Writes and runs tests across the full stack. Unit, integration, e2e. Reviews code against acceptance criteria. Receives completed implementation, verifies it, reports findings.
|
|
3
|
+
mode: subagent
|
|
4
|
+
color: accent
|
|
5
|
+
permission:
|
|
6
|
+
edit: allow
|
|
7
|
+
bash: allow
|
|
8
|
+
read: allow
|
|
9
|
+
glob: allow
|
|
10
|
+
grep: allow
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Quality Engineer
|
|
14
|
+
|
|
15
|
+
Testing specialist — unit, integration, and e2e across front and back. Spawned by the lead agent via opencode-ensemble.
|
|
16
|
+
|
|
17
|
+
## Domain
|
|
18
|
+
|
|
19
|
+
Unit tests, integration tests, end-to-end tests, test strategy, coverage analysis, acceptance criteria verification, build verification, linting. Works across frontend and backend — does not specialize in one layer.
|
|
20
|
+
|
|
21
|
+
## RTK — MANDATORY
|
|
22
|
+
|
|
23
|
+
Use `rtk` for ALL CLI commands. Never run commands directly.
|
|
24
|
+
|
|
25
|
+
- `rtk bun test` NOT `bun test`
|
|
26
|
+
- `rtk dotnet test` NOT `dotnet test`
|
|
27
|
+
- `rtk npx playwright test` NOT `npx playwright test`
|
|
28
|
+
- `rtk bun run lint` NOT `bun run lint`
|
|
29
|
+
|
|
30
|
+
If `rtk` is not available, report it as a blocker. Do not run commands without it.
|
|
31
|
+
|
|
32
|
+
## Skills — Auto-Detection
|
|
33
|
+
|
|
34
|
+
Skills are located in `.agents/skills/`. Detect and use relevant skills automatically — the user will never tell you which skill to use.
|
|
35
|
+
|
|
36
|
+
1. Read the task and identify domain and platform
|
|
37
|
+
2. Scan `.agents/skills/` for available skills
|
|
38
|
+
3. Read each `SKILL.md` description to assess relevance
|
|
39
|
+
4. Load and follow any skill that applies — even partial match warrants loading
|
|
40
|
+
|
|
41
|
+
Rules:
|
|
42
|
+
- Never implement directly if a skill applies
|
|
43
|
+
- Follow skill instructions exactly — do not partially apply them
|
|
44
|
+
- If two skills apply, follow both — resolve conflicts by asking the lead
|
|
45
|
+
|
|
46
|
+
## Responsibilities
|
|
47
|
+
|
|
48
|
+
- Write missing unit and integration tests
|
|
49
|
+
- Write or run e2e tests for new flows
|
|
50
|
+
- Verify acceptance criteria from the spec are met
|
|
51
|
+
- Run builds and confirm they pass
|
|
52
|
+
- Run linters and fix trivial issues
|
|
53
|
+
- Report any failing tests or unmet criteria as blockers
|
|
54
|
+
|
|
55
|
+
## Constraints
|
|
56
|
+
|
|
57
|
+
- Do not implement features — testing and verification only
|
|
58
|
+
- Do not push to `main` — feature branches only
|
|
59
|
+
- Do not merge PRs — human-only
|
|
60
|
+
- Do not force push
|
|
61
|
+
- Report all failures — do not silently skip failing tests
|
|
62
|
+
|
|
63
|
+
## Output Format
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
## Quality Engineer — Done
|
|
67
|
+
|
|
68
|
+
**Tests added:** <count> (front: <n>, back: <n>, e2e: <n>)
|
|
69
|
+
**Tests passing:** <count>/<total>
|
|
70
|
+
**Build:** pass | fail
|
|
71
|
+
**Lint:** pass | fail
|
|
72
|
+
**Acceptance criteria:** met | <unmet items>
|
|
73
|
+
**Blockers:** none | <description>
|
|
74
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Security engineer. Audits completed changes for vulnerabilities. OWASP Top 10, secrets exposure, auth gaps, injection risks. Receives completed implementation, audits it, reports findings.
|
|
3
|
+
mode: subagent
|
|
4
|
+
color: error
|
|
5
|
+
permission:
|
|
6
|
+
edit: deny
|
|
7
|
+
bash: allow
|
|
8
|
+
read: allow
|
|
9
|
+
glob: allow
|
|
10
|
+
grep: allow
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Security Auditor
|
|
14
|
+
|
|
15
|
+
Security specialist — finds vulnerabilities across all layers. Spawned by the lead agent via opencode-ensemble after quality-engineer passes.
|
|
16
|
+
|
|
17
|
+
## Domain
|
|
18
|
+
|
|
19
|
+
OWASP Top 10 vulnerabilities, secrets and credential exposure, authentication and authorization gaps, injection risks (SQL, XSS, command), insecure dependencies, misconfigured CORS or headers, data exposure in logs or responses. Works across all layers — UI, backend, infra.
|
|
20
|
+
|
|
21
|
+
## RTK — MANDATORY
|
|
22
|
+
|
|
23
|
+
Use `rtk` for ALL CLI commands. Never run commands directly.
|
|
24
|
+
|
|
25
|
+
- `rtk npm audit` NOT `npm audit`
|
|
26
|
+
- `rtk dotnet list package --vulnerable` NOT `dotnet list package --vulnerable`
|
|
27
|
+
|
|
28
|
+
If `rtk` is not available, report it as a blocker. Do not run commands without it.
|
|
29
|
+
|
|
30
|
+
## Skills — Auto-Detection
|
|
31
|
+
|
|
32
|
+
Skills are located in `.agents/skills/`. Detect and use relevant skills automatically — the user will never tell you which skill to use.
|
|
33
|
+
|
|
34
|
+
1. Read the task and identify domain and platform
|
|
35
|
+
2. Scan `.agents/skills/` for available skills
|
|
36
|
+
3. Read each `SKILL.md` description to assess relevance
|
|
37
|
+
4. Load and follow any skill that applies — even partial match warrants loading
|
|
38
|
+
|
|
39
|
+
Rules:
|
|
40
|
+
- Never implement directly if a skill applies
|
|
41
|
+
- Follow skill instructions exactly — do not partially apply them
|
|
42
|
+
- If two skills apply, follow both — resolve conflicts by asking the lead
|
|
43
|
+
|
|
44
|
+
## Responsibilities
|
|
45
|
+
|
|
46
|
+
- Scan for hardcoded secrets, API keys, passwords, tokens
|
|
47
|
+
- Check `.env` files are gitignored
|
|
48
|
+
- Verify no credentials in logs, URLs, or error responses
|
|
49
|
+
- Check authentication and authorization on sensitive endpoints
|
|
50
|
+
- Verify input validation at system boundaries
|
|
51
|
+
- Check for injection risks in queries and templates
|
|
52
|
+
- Review dependency vulnerabilities
|
|
53
|
+
- Check CORS, headers, and rate limiting
|
|
54
|
+
|
|
55
|
+
## Severity Levels
|
|
56
|
+
|
|
57
|
+
- **Critical** — Must block merge: secret exposure, auth bypass, data loss risk
|
|
58
|
+
- **High** — Should fix before merge: injection risk, missing auth, sensitive data leak
|
|
59
|
+
- **Medium** — Fix soon: missing rate limiting, weak validation, insecure config
|
|
60
|
+
- **Low** — Informational: minor hardening opportunities
|
|
61
|
+
|
|
62
|
+
## Constraints
|
|
63
|
+
|
|
64
|
+
- Audit only — `edit: deny` enforced
|
|
65
|
+
- Do not push to `main`
|
|
66
|
+
- Do not merge PRs — human-only
|
|
67
|
+
- Critical findings must block the PR — report to lead immediately
|
|
68
|
+
|
|
69
|
+
## Output Format
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
## Security Auditor — Done
|
|
73
|
+
|
|
74
|
+
**Status:** pass | blocked
|
|
75
|
+
**Critical:** <count>
|
|
76
|
+
**High:** <count>
|
|
77
|
+
**Medium:** <count>
|
|
78
|
+
**Low:** <count>
|
|
79
|
+
|
|
80
|
+
### Findings
|
|
81
|
+
- [severity] [file:line] <description> — <recommended fix>
|
|
82
|
+
|
|
83
|
+
**Blockers:** none | <critical findings that must be resolved before PR>
|
|
84
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: browser-automation
|
|
3
|
+
description: Reliable, composable browser automation using minimal OpenCode Browser primitives.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: opencode
|
|
6
|
+
metadata:
|
|
7
|
+
audience: agents
|
|
8
|
+
domain: browser
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What I do
|
|
12
|
+
|
|
13
|
+
- Provide a safe, composable workflow for browsing tasks
|
|
14
|
+
- Use `browser_query` list and index selection to click reliably
|
|
15
|
+
- Confirm state changes after each action
|
|
16
|
+
- Support CLI-first debugging with `opencode-browser tool` commands
|
|
17
|
+
|
|
18
|
+
## Best-practice workflow
|
|
19
|
+
|
|
20
|
+
1. Inspect tabs with `browser_get_tabs`
|
|
21
|
+
2. Open new tabs with `browser_open_tab` when needed
|
|
22
|
+
3. Navigate with `browser_navigate` if needed
|
|
23
|
+
4. Wait for UI using `browser_query` with `timeoutMs`
|
|
24
|
+
5. Discover candidates using `browser_query` with `mode=list`
|
|
25
|
+
6. Click, type, or select using `index`
|
|
26
|
+
7. Confirm using `browser_query` or `browser_snapshot`
|
|
27
|
+
|
|
28
|
+
## CLI-first debugging
|
|
29
|
+
|
|
30
|
+
- List all available tools: `npx @different-ai/opencode-browser tools`
|
|
31
|
+
- Run one tool directly: `npx @different-ai/opencode-browser tool browser_status`
|
|
32
|
+
- Pass JSON args: `npx @different-ai/opencode-browser tool browser_query --args '{"mode":"page_text"}'`
|
|
33
|
+
- Run smoke test: `npx @different-ai/opencode-browser self-test`
|
|
34
|
+
- After `update`, reload the unpacked extension in `chrome://extensions`
|
|
35
|
+
|
|
36
|
+
This path is useful for reproducing selector/scroll issues quickly before running a full OpenCode session.
|
|
37
|
+
|
|
38
|
+
## Selecting options
|
|
39
|
+
|
|
40
|
+
- Use `browser_select` for native `<select>` elements
|
|
41
|
+
- Prefer `value` or `label`; use `optionIndex` when needed
|
|
42
|
+
- Example: `browser_select({ selector: "select", value: "plugin" })`
|
|
43
|
+
|
|
44
|
+
## Query modes
|
|
45
|
+
|
|
46
|
+
- `text`: read visible text from a matched element
|
|
47
|
+
- `value`: read input values
|
|
48
|
+
- `list`: list many matches with text/metadata
|
|
49
|
+
- `exists`: check presence and count
|
|
50
|
+
- `page_text`: extract visible page text
|
|
51
|
+
|
|
52
|
+
## Opening tabs
|
|
53
|
+
|
|
54
|
+
- Use `browser_open_tab` to create a new tab, optionally with `url` and `active`
|
|
55
|
+
- Example: `browser_open_tab({ url: "https://example.com", active: false })`
|
|
56
|
+
|
|
57
|
+
## Troubleshooting
|
|
58
|
+
|
|
59
|
+
- If a selector fails, run `browser_query` with `mode=page_text` to confirm the content exists
|
|
60
|
+
- Use `mode=list` on broad selectors (`button`, `a`, `*[role="button"]`, `*[role="listitem"]`) and choose by index
|
|
61
|
+
- For inbox/chat panes, try text selectors first (`text:Subject line`) then verify selection with `browser_query`
|
|
62
|
+
- For scrollable containers, pass both `selector` and `x`/`y` to `browser_scroll` and then verify `scrollTop`
|
|
63
|
+
- Confirm results after each action
|
|
@@ -27,7 +27,7 @@ az login
|
|
|
27
27
|
az devops login --organization https://dev.azure.com/plainconcepts
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
**PAT Token
|
|
30
|
+
**PAT Token**, go to `https://dev.azure.com/plainconcepts/_usersSettings/tokens`
|
|
31
31
|
Create with scopes: **Work Items (Read & Write)** + **Code (Read & Write)**
|
|
32
32
|
|
|
33
33
|
---
|
|
@@ -46,7 +46,7 @@ Create with scopes: **Work Items (Read & Write)** + **Code (Read & Write)**
|
|
|
46
46
|
|
|
47
47
|
3. **Extract Key Fields** from JSON response:
|
|
48
48
|
- `fields.System.Title` → Title
|
|
49
|
-
- `fields.System.Description` → Description (may be HTML
|
|
49
|
+
- `fields.System.Description` → Description (may be HTML, strip tags)
|
|
50
50
|
- `fields.System.WorkItemType` → Type
|
|
51
51
|
- `fields.System.IterationPath` → Sprint
|
|
52
52
|
- `fields.System.State` → State
|
|
@@ -61,7 +61,7 @@ Create with scopes: **Work Items (Read & Write)** + **Code (Read & Write)**
|
|
|
61
61
|
|
|
62
62
|
## Full Azure DevOps CLI Reference
|
|
63
63
|
|
|
64
|
-
Use these for ALL DevOps operations
|
|
64
|
+
Use these for ALL DevOps operations, browser MCP is FORBIDDEN.
|
|
65
65
|
|
|
66
66
|
### Work Items
|
|
67
67
|
```bash
|
|
@@ -91,7 +91,7 @@ rtk az repos pr create \
|
|
|
91
91
|
# Update PR description
|
|
92
92
|
rtk az repos pr update --id <pr-id> --description "<text>"
|
|
93
93
|
|
|
94
|
-
# Link work item to PR (run sequentially
|
|
94
|
+
# Link work item to PR (run sequentially, not parallel)
|
|
95
95
|
rtk az repos pr work-item add --id <pr-id> --work-items <work-item-id>
|
|
96
96
|
```
|
|
97
97
|
|
|
@@ -148,7 +148,7 @@ openspec/changes/{change-name}/images/{screenshot}.png
|
|
|
148
148
|
https://dev.azure.com/plainconcepts/PlainConcepts.CapacityTool/_apis/git/repositories/{repo}/items?path=openspec/changes/{change}/images/{file}.png&versionType=branch&version={branch}&api-version=7.1
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
Do NOT use `_git/` URLs
|
|
151
|
+
Do NOT use `_git/` URLs, they return HTML, not raw binary.
|
|
152
152
|
|
|
153
153
|
### PR comment with screenshot
|
|
154
154
|
```json
|
|
@@ -201,6 +201,6 @@ https://dev.azure.com/{org}/{project}/_git/{repo}/pullrequest/{pr-id}
|
|
|
201
201
|
|
|
202
202
|
## Constraints
|
|
203
203
|
|
|
204
|
-
- This skill only PARSES and PROPOSES
|
|
204
|
+
- This skill only PARSES and PROPOSES, implementation via openspec-apply-change
|
|
205
205
|
- Always use `rtk` for CLI commands
|
|
206
206
|
- Browser MCP tools FORBIDDEN for all DevOps operations
|
|
@@ -16,7 +16,7 @@ metadata:
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
gh auth login
|
|
19
|
-
# Follow prompts
|
|
19
|
+
# Follow prompts, authenticate via browser or token
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Verify:
|
|
@@ -53,7 +53,7 @@ gh auth status
|
|
|
53
53
|
|
|
54
54
|
## Full GitHub CLI Reference
|
|
55
55
|
|
|
56
|
-
Use these for ALL GitHub operations
|
|
56
|
+
Use these for ALL GitHub operations, browser MCP is FORBIDDEN.
|
|
57
57
|
|
|
58
58
|
### Issues
|
|
59
59
|
```bash
|
|
@@ -166,6 +166,6 @@ https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path}
|
|
|
166
166
|
|
|
167
167
|
## Constraints
|
|
168
168
|
|
|
169
|
-
- This skill only PARSES and PROPOSES
|
|
169
|
+
- This skill only PARSES and PROPOSES, implementation via openspec-apply-change
|
|
170
170
|
- Always use `gh` CLI for GitHub operations
|
|
171
171
|
- Browser MCP tools FORBIDDEN for all GitHub operations
|
|
@@ -323,9 +323,9 @@
|
|
|
323
323
|
}
|
|
324
324
|
},
|
|
325
325
|
"node_modules/uuid": {
|
|
326
|
-
"version": "13.0.
|
|
327
|
-
"resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.
|
|
328
|
-
"integrity": "sha512-
|
|
326
|
+
"version": "13.0.1",
|
|
327
|
+
"resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.1.tgz",
|
|
328
|
+
"integrity": "sha512-9ezox2roIft6ExBVTVqibSd5dc5/47Sw/uY6b4SjQUT2TzQ0tltNquWA46y4xPQmdZYqvnio22SgWd41M86+jw==",
|
|
329
329
|
"funding": [
|
|
330
330
|
"https://github.com/sponsors/broofa",
|
|
331
331
|
"https://github.com/sponsors/ctavan"
|
package/content/AGENTS.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# AGENTS.md
|
|
1
|
+
# AGENTS.md, Bootstrap Mode
|
|
2
2
|
|
|
3
3
|
> This project has not been initialized yet.
|
|
4
4
|
> Your ONLY job right now is to run the initialization sequence below.
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
## Trigger
|
|
8
8
|
|
|
9
|
-
When the user says anything resembling initialization
|
|
9
|
+
When the user says anything resembling initialization, "init", "initialize", "setup", "start", "bootstrap", "get started", "prepare", execute all steps below in order. Do not ask for confirmation before starting.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
## Initialization Sequence
|
|
14
14
|
|
|
15
|
-
### Step 1
|
|
15
|
+
### Step 1, Archive project history into OpenSpec
|
|
16
16
|
|
|
17
17
|
Scan the codebase for any existing documentation, changelogs, ADRs, README files, or notable history that describes decisions already made in this project. Create an OpenSpec archive entry that captures this history so agents have context going forward.
|
|
18
18
|
|
|
@@ -33,39 +33,39 @@ openspec archive "project-history"
|
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
|
-
### Step 2
|
|
36
|
+
### Step 2, Generate DESIGN.md
|
|
37
37
|
|
|
38
38
|
Read the current contents of `DESIGN.md`. It contains a prompt/command. Do the following:
|
|
39
39
|
|
|
40
40
|
1. Copy the prompt text from `DESIGN.md` into memory
|
|
41
41
|
2. Wipe `DESIGN.md` completely (write empty file)
|
|
42
|
-
3. Execute the copied prompt against this codebase
|
|
42
|
+
3. Execute the copied prompt against this codebase, analyze the design system, visual tokens, typography, colors, spacing, and UI patterns
|
|
43
43
|
4. Write the result back into `DESIGN.md` following the format described in the prompt
|
|
44
44
|
|
|
45
|
-
The output must be a real, populated `DESIGN.md
|
|
45
|
+
The output must be a real, populated `DESIGN.md`, not the prompt itself.
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
-
### Step 3
|
|
49
|
+
### Step 3, Generate ARCHITECTURE.md
|
|
50
50
|
|
|
51
51
|
Read the current contents of `ARCHITECTURE.md`. It contains a prompt/command. Do the following:
|
|
52
52
|
|
|
53
53
|
1. Copy the prompt text from `ARCHITECTURE.md` into memory
|
|
54
54
|
2. Wipe `ARCHITECTURE.md` completely (write empty file)
|
|
55
|
-
3. Execute the copied prompt against this codebase
|
|
55
|
+
3. Execute the copied prompt against this codebase, analyze the full architecture, structure, components, data flows, integrations, and tech stack
|
|
56
56
|
4. Write the result back into `ARCHITECTURE.md` following the structure described in the prompt
|
|
57
57
|
|
|
58
|
-
The output must be a real, populated `ARCHITECTURE.md` covering all sections the prompt describes
|
|
58
|
+
The output must be a real, populated `ARCHITECTURE.md` covering all sections the prompt describes, not the prompt itself.
|
|
59
59
|
|
|
60
60
|
---
|
|
61
61
|
|
|
62
|
-
### Step 4
|
|
62
|
+
### Step 4, Rewrite this file
|
|
63
63
|
|
|
64
|
-
Replace the entire contents of `AGENTS.md` with the real agent guidance template located at `.
|
|
64
|
+
Replace the entire contents of `AGENTS.md` with the real agent guidance template located at `.agents/agents/.bootstrap/AGENTS.template.md`.
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
-
### Step 5
|
|
68
|
+
### Step 5, Confirm
|
|
69
69
|
|
|
70
70
|
Tell the user:
|
|
71
71
|
|
|
@@ -87,4 +87,4 @@ You're ready to work.
|
|
|
87
87
|
- Do NOT implement any features
|
|
88
88
|
- Do NOT create branches or PRs
|
|
89
89
|
- Do NOT modify any project source files
|
|
90
|
-
- Only read source files for analysis
|
|
90
|
+
- Only read source files for analysis, write only to ARCHITECTURE.md, DESIGN.md, AGENTS.md, and openspec/
|
package/content/DESIGN.md
CHANGED
|
@@ -16,7 +16,7 @@ Requirements:
|
|
|
16
16
|
(colors, typography, spacing, elevation, motion, radii, shadows, etc.)
|
|
17
17
|
- Follow with free-form Markdown that describes the look & feel and
|
|
18
18
|
captures design intent that token values alone cannot convey
|
|
19
|
-
- The file must be entirely self-contained
|
|
19
|
+
- The file must be entirely self-contained, do not reference any
|
|
20
20
|
files, variables, or paths from the codebase
|
|
21
21
|
- All token values must use valid YAML design token format
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-onboard",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Prepare any brownfield codebase for AI agent workflows using OpenCode, OpenSpec, and ensemble orchestration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"opencode",
|
|
@@ -24,5 +24,22 @@
|
|
|
24
24
|
],
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": ">=18"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@inquirer/prompts": "^7.0.0",
|
|
30
|
+
"chalk": "^5.0.0",
|
|
31
|
+
"execa": "^9.6.1",
|
|
32
|
+
"fs-extra": "^11.0.0",
|
|
33
|
+
"ora": "^8.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"vitest": "^4.1.5"
|
|
37
|
+
},
|
|
38
|
+
"vitest": {
|
|
39
|
+
"environment": "node"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"test:watch": "vitest"
|
|
27
44
|
}
|
|
28
45
|
}
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,98 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import chalk from 'chalk'
|
|
3
|
+
import { checkEnv } from './steps/check-env.js'
|
|
4
|
+
import { checkPlatform } from './steps/check-platform.js'
|
|
5
|
+
import { checkRtk } from './steps/check-rtk.js'
|
|
6
|
+
import { chooseModels } from './steps/choose-models.js'
|
|
7
|
+
import { choosePlatform } from './steps/choose-platform.js'
|
|
8
|
+
import { chooseSkillsProvider } from './steps/choose-skills-provider.js'
|
|
9
|
+
import { cleanAiFiles } from './steps/clean-ai-files.js'
|
|
10
|
+
import { copyContentStep } from './steps/copy-content.js'
|
|
11
|
+
import { initOpenspec } from './steps/init-openspec.js'
|
|
12
|
+
import { installBrowser } from './steps/install-browser.js'
|
|
13
|
+
|
|
14
|
+
console.clear()
|
|
15
|
+
console.log()
|
|
16
|
+
const logo = chalk.hex('#fe3d57')
|
|
17
|
+
console.log(logo(' '))
|
|
18
|
+
console.log(logo(' ▒▒▒▒▒▒▒▒▒▒▒▒▒ '))
|
|
19
|
+
console.log(logo(' ▓▒▓ ▓▒▓ '))
|
|
20
|
+
console.log(logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '))
|
|
21
|
+
console.log(logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '))
|
|
22
|
+
console.log(logo(' ▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓ '))
|
|
23
|
+
console.log(logo(' ▓▓▒▒▒░░░▒▒▒▒▒▒▒▒▒▒▒░░░▒▒▒▓▓ '))
|
|
24
|
+
console.log(logo(' ▓▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▓ '))
|
|
25
|
+
console.log(logo(' ▓▒▒▒▒▒▒▒░▒▒▒▒▒▒▒░▒▒▒▒▒▒▒▓ '))
|
|
26
|
+
console.log(logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '))
|
|
27
|
+
console.log(logo(' ▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓ '))
|
|
28
|
+
console.log(logo(' ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ '))
|
|
29
|
+
console.log()
|
|
30
|
+
console.log(chalk.bold(' 🧰 opencode-onboard'))
|
|
31
|
+
console.log(chalk.dim(' Prepare your codebase for AI agents'))
|
|
32
|
+
console.log()
|
|
33
|
+
console.log(' This tool will set up your project with a team of AI agents,')
|
|
34
|
+
console.log(' install skills, select models, and configure OpenCode.')
|
|
35
|
+
console.log()
|
|
36
|
+
console.log(chalk.bold(' Press Enter to begin...'))
|
|
37
|
+
console.log()
|
|
38
|
+
|
|
39
|
+
await new Promise(resolve => {
|
|
40
|
+
process.stdin.resume()
|
|
41
|
+
process.stdin.once('data', () => {
|
|
42
|
+
process.stdin.pause()
|
|
43
|
+
resolve()
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
// 1. Check Node + pnpm
|
|
49
|
+
await checkEnv()
|
|
50
|
+
|
|
51
|
+
// 2. Clean existing AI config files
|
|
52
|
+
await cleanAiFiles()
|
|
53
|
+
|
|
54
|
+
// 3. Choose platform
|
|
55
|
+
const platform = await choosePlatform()
|
|
56
|
+
|
|
57
|
+
// 4. Check platform CLI (az or gh)
|
|
58
|
+
await checkPlatform(platform)
|
|
59
|
+
|
|
60
|
+
// 5. Copy content
|
|
61
|
+
await copyContentStep(platform)
|
|
62
|
+
|
|
63
|
+
// 6. Init OpenSpec
|
|
64
|
+
await initOpenspec()
|
|
65
|
+
|
|
66
|
+
// 7. Install skills
|
|
67
|
+
await chooseSkillsProvider()
|
|
68
|
+
|
|
69
|
+
// 8. Choose models
|
|
70
|
+
await chooseModels()
|
|
71
|
+
|
|
72
|
+
// 9. Check RTK
|
|
73
|
+
await checkRtk()
|
|
74
|
+
|
|
75
|
+
// 10. Install opencode-browser
|
|
76
|
+
await installBrowser()
|
|
77
|
+
|
|
78
|
+
// Done
|
|
79
|
+
console.log()
|
|
80
|
+
console.log(chalk.bold.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
|
|
81
|
+
console.log(chalk.bold.green(' Onboarding complete!'))
|
|
82
|
+
console.log(chalk.bold.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
|
|
83
|
+
console.log()
|
|
84
|
+
console.log(' Next step:')
|
|
85
|
+
console.log(chalk.hex('#fe3d57')(' Open OpenCode in this project and type: ') + chalk.bold('"init"'))
|
|
86
|
+
console.log()
|
|
87
|
+
console.log(' OpenCode will generate ARCHITECTURE.md and DESIGN.md')
|
|
88
|
+
console.log(' from your actual codebase, then activate the agent team.')
|
|
89
|
+
console.log()
|
|
90
|
+
} catch (err) {
|
|
91
|
+
if (err.name === 'ExitPromptError') {
|
|
92
|
+
console.log()
|
|
93
|
+
console.log(chalk.yellow('Cancelled.'))
|
|
94
|
+
} else {
|
|
95
|
+
console.error(chalk.red('\nUnexpected error:'), err.message)
|
|
96
|
+
process.exit(1)
|
|
97
|
+
}
|
|
98
|
+
}
|