@plainconceptsplatform/agent-harness 2.3.0 → 2.4.1

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 (155) hide show
  1. package/README.md +23 -12
  2. package/{src → cli}/commands/join.js +3 -4
  3. package/{src → cli}/commands/migrate.js +1 -1
  4. package/{src → cli}/commands/wizard.js +1 -1
  5. package/{src → cli}/index.js +1 -1
  6. package/{src → cli}/presets/agents-content.json +4 -4
  7. package/cli/presets/browser.json +10 -0
  8. package/{src → cli}/presets/clean.json +21 -21
  9. package/{src → cli}/presets/optimization.json +37 -37
  10. package/{src → cli}/presets/platforms.json +76 -76
  11. package/{src → cli}/presets/quota.json +16 -16
  12. package/{src → cli}/presets/source.json +23 -23
  13. package/cli/steps/browser/index.js +48 -0
  14. package/{src → cli}/steps/clean/index.js +120 -120
  15. package/{src → cli}/steps/copy/agents.js +119 -119
  16. package/{src → cli}/steps/copy/commands.js +95 -95
  17. package/{src → cli}/steps/copy/fullstack-engineer.js +89 -88
  18. package/{src → cli}/steps/copy/index.js +1 -1
  19. package/{src → cli}/steps/copy/opencode-json.js +196 -161
  20. package/{src → cli}/steps/copy/skills.js +2 -2
  21. package/{src → cli}/steps/models/format.js +88 -88
  22. package/{src → cli}/steps/models/index.js +64 -64
  23. package/{src → cli}/steps/openspec/index.js +136 -136
  24. package/{src → cli}/steps/optimization/codegraph.js +127 -127
  25. package/{src → cli}/steps/optimization/detect.js +66 -66
  26. package/{src → cli}/steps/optimization/humanizer.js +17 -17
  27. package/{src → cli}/steps/optimization/index.js +163 -163
  28. package/{src → cli}/steps/optimization/memory.js +88 -88
  29. package/{src → cli}/steps/optimization/patch-guardrails.js +109 -109
  30. package/{src → cli}/steps/optimization/quota.js +119 -119
  31. package/{src → cli}/steps/optimization/simple-english.js +17 -17
  32. package/{src → cli}/steps/optimization/skills-lock.js +30 -30
  33. package/{src → cli}/steps/platform/index.js +109 -109
  34. package/{src → cli}/steps/source/index.js +123 -123
  35. package/{src → cli}/utils/agent-color.js +111 -83
  36. package/{src → cli}/utils/exec-spinner.js +47 -47
  37. package/{src → cli}/utils/exec.js +134 -134
  38. package/{src → cli}/utils/models-pricing.js +42 -42
  39. package/{src → cli}/utils/paths.js +1 -1
  40. package/{src → cli}/utils/process.js +3 -3
  41. package/{src → cli}/utils/terminal.js +6 -6
  42. package/harness/.agents/skills/browser-automation/SKILL.md +72 -0
  43. package/{src/content → harness}/.agents/skills/pc-make-engineer/SKILL.md +219 -219
  44. package/{src/content → harness}/.agents/skills/pc-make-engineer/template.md +80 -80
  45. package/{src/content → harness}/.agents/skills/pc-plan-apply/simple-mode.md +1 -1
  46. package/{src/content → harness}/.agents/skills/pc-plan-archive/SKILL.md +3 -0
  47. package/{src/content → harness}/.agents/skills/pc-plan-explore/SKILL.md +3 -0
  48. package/{src/content → harness}/.agents/skills/pc-plan-goal/SKILL.md +11 -20
  49. package/{src/content → harness}/.agents/skills/pc-plan-goal/branching.md +1 -1
  50. package/{src/content → harness}/.agents/skills/pc-plan-goal/output.md +5 -8
  51. package/{src/content → harness}/.agents/skills/pc-plan-story/SKILL.md +3 -0
  52. package/{src/content → harness}/.agents/skills/pc-userstory-browser/SKILL.md +136 -132
  53. package/{src/content → harness}/.opencode/package.json +9 -10
  54. package/{src/content → harness}/.opencode/plugins/pc-subagent-tiers.js +368 -337
  55. package/{src/content → harness}/ARCHITECTURE.md +16 -16
  56. package/{src/content → harness}/DESIGN.md +16 -16
  57. package/{src/content → harness}/opencode.jsonc +47 -41
  58. package/{src/content → harness}/openspec/config.yaml +20 -20
  59. package/{src/content → harness}/skills-lock.json +17 -17
  60. package/package.json +7 -7
  61. package/src/content/.agents/skills/browser-automation/SKILL.md +0 -66
  62. package/src/presets/browser.json +0 -22
  63. package/src/steps/browser/index.js +0 -91
  64. /package/{src → cli}/commands/shared.js +0 -0
  65. /package/{src → cli}/commands/single.js +0 -0
  66. /package/{src → cli}/commands/update.js +0 -0
  67. /package/{src → cli}/fragments/archive/az.md +0 -0
  68. /package/{src → cli}/fragments/archive/gh.md +0 -0
  69. /package/{src → cli}/fragments/archive/gl.md +0 -0
  70. /package/{src → cli}/fragments/archive/none.md +0 -0
  71. /package/{src → cli}/fragments/guardrails/codegraph.md +0 -0
  72. /package/{src → cli}/fragments/guardrails/humanizer.md +0 -0
  73. /package/{src → cli}/fragments/guardrails/memory.md +0 -0
  74. /package/{src → cli}/fragments/guardrails/rtk.md +0 -0
  75. /package/{src → cli}/fragments/guardrails/simple-english.md +0 -0
  76. /package/{src → cli}/fragments/ops-backlog/az.md +0 -0
  77. /package/{src → cli}/fragments/ops-backlog/gh.md +0 -0
  78. /package/{src → cli}/fragments/ops-backlog/jira.md +0 -0
  79. /package/{src → cli}/fragments/ops-evidence/az.md +0 -0
  80. /package/{src → cli}/fragments/ops-evidence/gh.md +0 -0
  81. /package/{src → cli}/fragments/ops-evidence/jira.md +0 -0
  82. /package/{src → cli}/fragments/ops-review/az.md +0 -0
  83. /package/{src → cli}/fragments/ops-review/gh.md +0 -0
  84. /package/{src → cli}/fragments/ops-review/gl.md +0 -0
  85. /package/{src → cli}/fragments/ops-ship/az.md +0 -0
  86. /package/{src → cli}/fragments/ops-ship/gh.md +0 -0
  87. /package/{src → cli}/fragments/ops-ship/gl.md +0 -0
  88. /package/{src → cli}/presets/models.json +0 -0
  89. /package/{src → cli}/presets/openspec.json +0 -0
  90. /package/{src → cli}/steps/metadata/index.js +0 -0
  91. /package/{src → cli}/steps/models/write.js +0 -0
  92. /package/{src → cli}/utils/copy.js +0 -0
  93. /package/{src → cli}/utils/legacy-check.js +0 -0
  94. /package/{src → cli}/utils/models-cache.js +0 -0
  95. /package/{src → cli}/utils/update-manifest.js +0 -0
  96. /package/{src/content → harness}/.agents/skills/pc-guardrails-generic/SKILL.md +0 -0
  97. /package/{src/content → harness}/.agents/skills/pc-guardrails-project/SKILL.md +0 -0
  98. /package/{src/content → harness}/.agents/skills/pc-make-architecture/SKILL.md +0 -0
  99. /package/{src/content → harness}/.agents/skills/pc-make-architecture/structure-template.md +0 -0
  100. /package/{src/content → harness}/.agents/skills/pc-make-design/SKILL.md +0 -0
  101. /package/{src/content → harness}/.agents/skills/pc-make-engineer/signal-mapping.md +0 -0
  102. /package/{src/content → harness}/.agents/skills/pc-make-evidence-scaffold/SKILL.md +0 -0
  103. /package/{src/content → harness}/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +0 -0
  104. /package/{src/content → harness}/.agents/skills/pc-make-guardrails/SKILL.md +0 -0
  105. /package/{src/content → harness}/.agents/skills/pc-make-guardrails/category-reference.md +0 -0
  106. /package/{src/content → harness}/.agents/skills/pc-make-merge-risk-assess/SKILL.md +0 -0
  107. /package/{src/content → harness}/.agents/skills/pc-make-merge-risk-assess/category-reference.md +0 -0
  108. /package/{src/content → harness}/.agents/skills/pc-make-user-model/SKILL.md +0 -0
  109. /package/{src/content → harness}/.agents/skills/pc-ops-evidence/SKILL.md +0 -0
  110. /package/{src/content → harness}/.agents/skills/pc-ops-ship/SKILL.md +0 -0
  111. /package/{src/content → harness}/.agents/skills/pc-plan-apply/SKILL.md +0 -0
  112. /package/{src/content → harness}/.agents/skills/pc-plan-goal/failure-policy.md +0 -0
  113. /package/{src/content → harness}/.agents/skills/pc-plan-goal/output-mode.md +0 -0
  114. /package/{src/content → harness}/.agents/skills/pc-plan-propose/SKILL.md +0 -0
  115. /package/{src/content → harness}/.agents/skills/pc-plan-propose/task-annotation.md +0 -0
  116. /package/{src/content → harness}/.agents/skills/pc-plan-quick/SKILL.md +0 -0
  117. /package/{src/content → harness}/.agents/skills/pc-repo-audit/SKILL.md +0 -0
  118. /package/{src/content → harness}/.agents/skills/pc-repo-help/SKILL.md +0 -0
  119. /package/{src/content → harness}/.agents/skills/pc-repo-initialize/SKILL.md +0 -0
  120. /package/{src/content → harness}/.agents/skills/pc-repo-onboard/SKILL.md +0 -0
  121. /package/{src/content → harness}/.agents/skills/pc-repo-verify/SKILL.md +0 -0
  122. /package/{src/content → harness}/.agents/skills/pc-userstory-az/SKILL.md +0 -0
  123. /package/{src/content → harness}/.agents/skills/pc-userstory-gh/SKILL.md +0 -0
  124. /package/{src/content → harness}/.agents/skills/pc-userstory-jira/SKILL.md +0 -0
  125. /package/{src/content → harness}/.opencode/_gitignore +0 -0
  126. /package/{src/content → harness}/.opencode/commands/init.md +0 -0
  127. /package/{src/content → harness}/.opencode/commands/make-architecture.md +0 -0
  128. /package/{src/content → harness}/.opencode/commands/make-design.md +0 -0
  129. /package/{src/content → harness}/.opencode/commands/make-engineer.md +0 -0
  130. /package/{src/content → harness}/.opencode/commands/make-evidence-scaffold.md +0 -0
  131. /package/{src/content → harness}/.opencode/commands/make-guardrails.md +0 -0
  132. /package/{src/content → harness}/.opencode/commands/make-user-model.md +0 -0
  133. /package/{src/content → harness}/.opencode/commands/ops-backlog.md +0 -0
  134. /package/{src/content → harness}/.opencode/commands/ops-evidence.md +0 -0
  135. /package/{src/content → harness}/.opencode/commands/ops-review.md +0 -0
  136. /package/{src/content → harness}/.opencode/commands/ops-ship.md +0 -0
  137. /package/{src/content → harness}/.opencode/commands/plan-apply.md +0 -0
  138. /package/{src/content → harness}/.opencode/commands/plan-archive.md +0 -0
  139. /package/{src/content → harness}/.opencode/commands/plan-explore.md +0 -0
  140. /package/{src/content → harness}/.opencode/commands/plan-goal.md +0 -0
  141. /package/{src/content → harness}/.opencode/commands/plan-propose.md +0 -0
  142. /package/{src/content → harness}/.opencode/commands/plan-quick.md +0 -0
  143. /package/{src/content → harness}/.opencode/commands/plan-story.md +0 -0
  144. /package/{src/content → harness}/.opencode/commands/repo-audit.md +0 -0
  145. /package/{src/content → harness}/.opencode/commands/repo-help.md +0 -0
  146. /package/{src/content → harness}/.opencode/commands/repo-initialize.md +0 -0
  147. /package/{src/content → harness}/.opencode/commands/repo-onboard.md +0 -0
  148. /package/{src/content → harness}/.opencode/commands/repo-verify.md +0 -0
  149. /package/{src/content → harness}/.opencode/plugins/pc-subagent-monitor.js +0 -0
  150. /package/{src/content → harness}/.opencode/plugins/pc-system-reminders.js +0 -0
  151. /package/{src/content → harness}/.opencode/tui/pc-subagents.tsx +0 -0
  152. /package/{src/content → harness}/.opencode/tui.json +0 -0
  153. /package/{src/content → harness}/AGENTS.md +0 -0
  154. /package/{src/content → harness}/openspec/changes/archive/.gitkeep +0 -0
  155. /package/{src/content → harness}/openspec/specs/.gitkeep +0 -0
@@ -1,6 +1,6 @@
1
- export const MARKERS = {
2
- EMPTY: " ",
3
- OK_PREFIX: "✓ ",
4
- WARN_PREFIX: "⚠ ",
5
- ERROR_PREFIX: "✗ ",
6
- };
1
+ export const MARKERS = {
2
+ EMPTY: " ",
3
+ OK_PREFIX: "✓ ",
4
+ WARN_PREFIX: "⚠ ",
5
+ ERROR_PREFIX: "✗ ",
6
+ };
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: browser-automation
3
+ description: Reliable, composable browser automation using agent-browser. Use when capturing screenshots of a locally running app, clicking UI elements, reading page content, or automating browser interactions on localhost.
4
+ license: MIT
5
+ compatibility: Requires agent-browser CLI installed (Rust binary) and running.
6
+ metadata:
7
+ author: copilots
8
+ version: "2.0"
9
+ ---
10
+
11
+ This skill operates on `localhost` URLs only. Screenshots, clicks, typing, scrolling, and reads on locally running apps are in scope. External services (github.com, dev.azure.com, npmjs.com, etc.) are out of scope for browser tools.
12
+
13
+ The only exception: when the user selects "Others (Browser)" as their backlog platform during onboarding, the `pc-userstory` skill may navigate to work item URLs the user explicitly provides. That is the sole case where external navigation is permitted, and only to URLs the user explicitly gives you.
14
+
15
+ ## Best-practice workflow
16
+
17
+ 1. Open the page: `agent-browser open <url>` (launches its own Chrome; reuses the running daemon)
18
+ 2. Take a snapshot: `agent-browser snapshot` to get the accessibility tree with `@ref` handles
19
+ 3. Interact by ref: `agent-browser click @e2`, `agent-browser fill @e3 "text"`
20
+ 4. Wait when needed: `agent-browser wait --load networkidle` or `agent-browser wait <selector>`
21
+ 5. Confirm the result with a fresh `snapshot`, `get text`, or `screenshot`
22
+
23
+ Refs like `@e2` come from the last snapshot and go stale after page changes: retake the snapshot after navigation or dynamic updates before reusing them. When a click fails because another element covers the target (consent banner, modal), dismiss or interact with the covering element, then take a fresh snapshot before retrying.
24
+
25
+ ## Tool access
26
+
27
+ - MCP tools (inside OpenCode): `agent_browser_open`, `agent_browser_snapshot`, `agent_browser_click`, `agent_browser_fill`, `agent_browser_type`, `agent_browser_wait_for_selector`, `agent_browser_screenshot`, `agent_browser_eval`, `agent_browser_close` — configured in `opencode.jsonc` with `--tools core`
28
+ - CLI (any agent, any host): every command below works identically via bash
29
+ - Diagnose the install: `agent-browser doctor`
30
+
31
+ ## Selecting elements
32
+
33
+ - Prefer refs from `snapshot` (`@e1`, `@e2`, ...) over CSS selectors
34
+ - CSS selectors also work: `agent-browser click "#submit"`, `agent-browser fill "#email" "text"`
35
+ - Semantic locators: `agent-browser find role button click --name "Submit"`, `find text "Sign In" click`, `find label "Email" fill "value"`, `find testid <id> click`
36
+ - Native selects: `agent-browser select <sel> <value>`
37
+
38
+ ## Reading state
39
+
40
+ - `agent-browser get text <sel>` — text content of an element
41
+ - `agent-browser get value <sel>` — input value
42
+ - `agent-browser snapshot` — structured accessibility tree (preferred for parsing)
43
+ - `agent-browser screenshot [path]` — `--full` for full page, `--annotate` for numbered labels
44
+ - `agent-browser read` — agent-readable markdown of the active tab (no Chrome launch for URL reads)
45
+
46
+ ## Tabs and sessions
47
+
48
+ - `agent-browser tab` lists tabs with stable `t1`, `t2` ids; `tab new --label <name>` and `tab <label>` switch
49
+ - `agent-browser close` closes the browser; `close --all` closes every session
50
+
51
+ ## CLI-first debugging
52
+
53
+ - `agent-browser doctor` — diagnose install, Chrome, and daemon state
54
+ - `agent-browser console` — view console messages; `agent-browser errors` — uncaught exceptions
55
+ - `agent-browser eval "<js>"` — run JavaScript in the page
56
+ - `agent-browser network requests --filter api` — inspect tracked requests
57
+
58
+ ## Troubleshooting
59
+
60
+ - Stale ref: take a fresh `snapshot` after any navigation or DOM change
61
+ - Covered click: the error names the covering element; dismiss it, re-snapshot, retry
62
+ - Selector fails: confirm the content exists with `agent-browser get text` or a snapshot before retrying
63
+ - Daemon or Chrome issues: run `agent-browser doctor`
64
+
65
+ ## Scope
66
+
67
+ - Screenshots of locally running app on `localhost` URLs: in scope
68
+ - Click, type, scroll, read on `localhost` pages: in scope
69
+ - Navigate to work item URLs the user explicitly provides (when backlog platform is "Others (Browser)"): in scope
70
+ - Navigate to external services for non-work-item purposes: out of scope
71
+ - DevOps or GitHub CLI operations via browser tools: out of scope
72
+ - Reading or modifying production systems via browser tools: out of scope
@@ -1,219 +1,219 @@
1
- ---
2
- name: pc-make-engineer
3
- description: Create a custom engineer agent via persona-driven interactive design. Invoked by the /make-engineer command.
4
- license: MIT
5
- ---
6
-
7
- Create one file only: `.opencode/agents/{persona}-engineer.md`. The `pc-subagent-tiers` plugin creates tier variants (`.build.md`, `.fast.md`, `.plan.md`) at startup, so you never write those. It also generates `build.md` and `plan.md`, the only two primary agents: never create or edit those either.
8
-
9
- Fidelity to the [template](template.md) is the whole job. The file contains frontmatter plus one identity paragraph plus the `## Abilities` section. No other `##` headings. No expertise notes, architecture details, conventions, file maps, or workflow steps. Those belong in skills. Always set `mode: subagent`. Engineers are reached through `task()`, never picked by a human, so a primary engineer would only clutter the agent picker. Never write `model:` and never write `color:`. The `pc-subagent-tiers` plugin derives a colour from the agent name at startup, which is why the same persona looks the same in every project; `primary` and `warning` belong to the build and plan agents. Only reference skills installed in the project's `.agents/skills/` directory.
10
-
11
- Skills first: you must complete Step 4 (present the form, discover skills for every detected signal and architecture, let the user confirm the set, then install 5-10 skills) before writing any file.
12
-
13
- ## Step 1: Ask persona (always, closed choice)
14
-
15
- Ask the user this question using the `question` tool:
16
-
17
- > **"What type of engineer are you creating?"**
18
- >
19
- > - Frontend: UI components, pages, mobile, styling, browser
20
- > - Layout Designer: Design systems, CSS architecture, Storybook, a11y
21
- > - Backend: APIs, databases, auth, services
22
- > - Data: Data pipelines, ETL, analytics, ML models, data quality
23
- > - DevOps: CI/CD, infra, Docker, deploy
24
- > - Security: Auth, secrets, vulnerability scanning, hardening
25
- > - Mobile: React Native, Flutter, native iOS/Android
26
- > - API / Integration: REST/GraphQL APIs, webhooks, third-party integrations
27
- > - QA: Test automation, E2E, regression, performance testing
28
-
29
- The chosen persona determines everything: what to detect, what questions to ask, what skills to suggest.
30
-
31
- If the user passes the persona as an argument (e.g. `/make-engineer frontend`) or selects "Type your own answer", accept any single-word persona name and skip to Step 2.
32
-
33
- ## Step 2: Detect signals from source roots
34
-
35
- Check `source-roots.json` first. Read `.opencode/source-roots.json`. If it doesn't exist or has empty roots, ask the user which directories to scan using the `question` tool with the project's top-level directories as options.
36
-
37
- Also read `ARCHITECTURE.md` and `DESIGN.md` for context on the tech stack.
38
-
39
- Scan for persona-relevant signals only. Look in manifest files (`package.json`, `tsconfig.json`, `*.csproj`, `pyproject.toml`, `requirements.txt`, `go.mod`, `Cargo.toml`, etc.) and project structure:
40
-
41
- - Language: primary language(s) and version(s)
42
- - Framework: web, backend, or mobile framework
43
- - Data layer: ORM, database client, cache client
44
- - Testing: test framework, test config files, test directories
45
- - Styling: CSS framework, CSS-in-JS, design tokens
46
- - Architecture: FSD, monolith, microservices, feature dirs
47
- - i18n: internationalization libs
48
- - CI/CD: workflow definition files
49
- - Cloud / IaC: cloud provider config, infrastructure-as-code files
50
- - Monitoring: observability/monitoring config or deps
51
- - Linting: linter, formatter, and their config files
52
- - Dependency Injection: DI/IoC containers, hook frameworks
53
-
54
- Report what was detected as a signal inventory. This list drives Step 4 deterministically:
55
-
56
- ```
57
- Signal inventory:
58
- <signal-type>: <signal-value> (<source>)
59
- <signal-type>: <signal-value> (<source>)
60
- ...
61
- ```
62
-
63
- ## Step 3: Persona-specific form (recommend and confirm)
64
-
65
- Present a short form using the `question` tool. Each question is a closed choice or yes-no. Every option that matches a detected signal from Step 2 must be marked (Recommended) and pre-selected. The user just confirms or overrides.
66
-
67
- Ask 2-5 questions total:
68
-
69
- 1. Architecture / patterns (always ask for `frontend`, `backend`, `layout`, `api` personas; optional otherwise). Use `multiple: true`. Pre-select the architecture detected in Step 2 and mark it (Recommended); offer common alternatives so the user can opt in even when the codebase does not signal one yet. Options map to the known sources in the [signal mapping](signal-mapping.md) reference:
70
- - Feature-Sliced Design (FSD)
71
- - Design patterns: singleton, observer, factory, hooks, HOC, compound, render-props, provider
72
- - Rendering patterns: SSR, RSC, streaming, static, islands, progressive hydration
73
- - Performance patterns: bundle splitting, tree-shaking, dynamic import, route-based
74
- - Microservices
75
- - Monolith / layered
76
- 2. Up to 4 more questions, only where Step 2 detected multiple options or where the user's choice genuinely matters (e.g. which test runner, which styling approach, which cloud). Skip anything with a single detected option and just use it silently.
77
-
78
- Rules:
79
- - Options matching a detected signal are (Recommended) and pre-selected.
80
- - Never ask about things where only one option was detected.
81
- - Keep the whole form to 5 questions max.
82
- - The user's selections here (plus Step 2 signals) become the recommended skill set that Step 4 resolves, confirms, and installs.
83
-
84
- ## Step 4: Skill discovery, confirmation, and install
85
-
86
- Complete this step fully before writing anything in Step 5. The agent file is worthless without real skills. The flow is: discover candidates, confirm with the user, install the confirmed set, verify.
87
-
88
- ### 4a. Pre-check already-installed skills
89
-
90
- Before searching, build a map of what's already available:
91
-
92
- 1. List every directory in `.agents/skills/`
93
- 2. Read `skills-lock.json` for npx-installed skills
94
- 3. For each detected signal from Step 2, check if an already-installed skill covers it
95
- 4. Mark covered signals as already-satisfied
96
-
97
- Report:
98
-
99
- ```
100
- Already installed:
101
- <skill-name> covers <signal>
102
- ...
103
- Signals still needing skills:
104
- - <signal-type>: <signal-value>
105
- ...
106
- ```
107
-
108
- ### 4b. Ensure `find-skills` is available
109
-
110
- Check if `.agents/skills/find-skills/SKILL.md` exists. If not, install it:
111
-
112
- ```bash
113
- npx skills add -y vercel-labs/skills@find-skills
114
- ```
115
-
116
- If it can't be installed, stop and tell the user: "find-skills is required for skill discovery. Install it manually with `npx skills add -y vercel-labs/skills@find-skills` and re-run."
117
-
118
- ### 4c. Search and resolve
119
-
120
- For each uncovered signal, run `npx skills find` with the query and resolve architecture/patterns via the known direct sources. Follow the [signal mapping](signal-mapping.md) reference for the full table of queries, known direct sources, quality filter, recommended set assembly, and post-install verification.
121
-
122
- ### 4d. Confirm the skill set (the form)
123
-
124
- Present the recommended set to the user as a multi-select form using the `question` tool with `multiple: true`, and pre-select every recommended skill. This is the confirmation gate.
125
-
126
- - Group the options by category: Architecture, Development, Testing, Infrastructure.
127
- - For each skill show: name, one-line description, source (`owner/repo`), and install count (or "curated source" for known direct source entries).
128
- - Every recommended skill is checked by default; the user unchecks anything unwanted.
129
- - Include a short note that they can request additional skills by name.
130
- - Nothing installs until the user submits this form.
131
-
132
- The submitted selection is the confirmed set. Install only the confirmed set in the next step.
133
-
134
- ### 4e. Install the confirmed set
135
-
136
- Install each confirmed skill (project-local). Always pass `-y` to skip the skills CLI's own prompt. Use the syntax that matches the source:
137
-
138
- ```bash
139
- # skills.sh index entries (from npx skills find):
140
- npx skills add -y <owner/repo@skill-name>
141
-
142
- # known direct sources (Step 4c):
143
- npx skills add -y feature-sliced/skills
144
- npx skills add -y PatternsDev/skills --skill <skill-name>
145
- ```
146
-
147
- Project-local only. Do not use the `-g` flag.
148
-
149
- Then run the [post-install verification](signal-mapping.md) procedure for each installed skill.
150
-
151
- ## Step 5: Fill the template
152
-
153
- Before creating the file, check if `.opencode/agents/{persona}-engineer.md` already exists. If it does, call the `question` tool:
154
-
155
- ```json
156
- {
157
- "questions": [
158
- {
159
- "header": "Overwrite engineer",
160
- "question": "An engineer named \"{persona}-engineer\" already exists. Overwrite or cancel?",
161
- "options": [
162
- { "label": "Overwrite", "description": "Proceed, preserving the existing color frontmatter value unless a new one is chosen." },
163
- { "label": "Cancel", "description": "Stop. Do not modify the existing file." }
164
- ]
165
- }
166
- ]
167
- }
168
- ```
169
-
170
- - If `Overwrite`: proceed, but preserve the existing `color:` frontmatter value unless the user chose a new one.
171
- - If `Cancel`: stop.
172
-
173
- Fill the [template](template.md). All the research from Steps 2-4 (signal detection, project analysis, tech stack knowledge) was for selecting the right skills. The agent file itself is just the template. Do not write project knowledge, architecture notes, coding conventions, file maps, testing patterns, or workflow instructions into the file. Those belong in skills and guardrails.
174
-
175
- Follow the [template](template.md) reference for the full structure, description quality bar, identity paragraph rules, category rules, and structural validation checklist.
176
-
177
- ## Step 6: Validate the file
178
-
179
- After writing the agent file, run both checks from the [template](template.md) reference:
180
-
181
- 1. Structural validation: verify frontmatter, no `model:` field, `## Abilities` is the only `##` heading, one identity paragraph, abilities categorized, one file only.
182
- 2. Skill reference validation: verify every `@skill-name` in `## Abilities` exists in `.agents/skills/` and in `skills-lock.json`.
183
-
184
- If either check fails, fix the file and re-validate.
185
-
186
- ## Step 7: Update fullstack-engineer.md abilities
187
-
188
- `fullstack-engineer.md` is `mode: subagent`, but it is also the body that `pc-subagent-tiers` copies into `build.md` and `plan.md` on every startup. So every skill listed here reaches both primary agents, which is why it accumulates all of them: it plans and delegates rather than doing parallel implementation itself.
189
-
190
- After creating the persona engineer and validating its references, additively merge new skills into fullstack:
191
-
192
- 1. Read `.agents/skills/` directory to list all installed skills.
193
- 2. Read `skills-lock.json` for npx-installed skills.
194
- 3. Read the current `fullstack-engineer.md`.
195
- 4. Parse its existing `## Abilities` section to find which skills are already listed.
196
- 5. Append-only: add only skills that are not already in the file (dedup by skill name).
197
- 6. Preserve the frontmatter (mode, color, permissions, model if stamped), the identity paragraph, and all existing ability lines.
198
- 7. Remove any old startup directive line. The `pc-system-reminders` plugin loads abilities for every session.
199
- 8. Write the file back.
200
-
201
- Merge new skills into existing categories. If a new skill belongs to "Development" and that line already exists, append to it. If a new category is needed, add it. Do not overwrite the Abilities section.
202
-
203
- ## Step 8: Update AGENTS.md
204
-
205
- Add the new agent to the agents table in AGENTS.md (if a table exists) or note it:
206
- ```
207
- | `{persona}-engineer` | .opencode/agents/{persona}-engineer.md | <short role description> |
208
- ```
209
-
210
- ## Step 9: Show summary
211
-
212
- Report:
213
- - Engineer file created at `.opencode/agents/{persona}-engineer.md`
214
- - Skills installed from skills.sh (list each with source and install count)
215
- - Signals with no quality skill found on skills.sh (list each)
216
- - Skills that failed validation or install (list each with reason)
217
- - `fullstack-engineer.md` updated (additive, list new skills added)
218
- - How to use: "This agent will be spawned by the lead during `/plan-apply` for tasks matching its specialty."
219
- - "Restart opencode for the `pc-subagent-tiers` plugin to pick up the new engineer and rebuild `build.md` and `plan.md` from the updated fullstack abilities."
1
+ ---
2
+ name: pc-make-engineer
3
+ description: Create a custom engineer agent via persona-driven interactive design. Invoked by the /make-engineer command.
4
+ license: MIT
5
+ ---
6
+
7
+ Create one file only: `.opencode/agents/{persona}-engineer.md`. The `pc-subagent-tiers` plugin creates tier variants (`.build.md`, `.fast.md`, `.plan.md`) at startup, so you never write those. It also generates `build.md` and `plan.md`, the only two primary agents: never create or edit those either.
8
+
9
+ Fidelity to the [template](template.md) is the whole job. The file contains frontmatter plus one identity paragraph plus the `## Abilities` section. No other `##` headings. No expertise notes, architecture details, conventions, file maps, or workflow steps. Those belong in skills. Always set `mode: subagent`. Engineers are reached through `task()`, never picked by a human, so a primary engineer would only clutter the agent picker. Never write `model:` and never write `color:`. The `pc-subagent-tiers` plugin derives a colour from the agent name at startup, which is why the same persona looks the same in every project; `primary` and `warning` belong to the build and plan agents. Only reference skills installed in the project's `.agents/skills/` directory.
10
+
11
+ Skills first: you must complete Step 4 (present the form, discover skills for every detected signal and architecture, let the user confirm the set, then install 5-10 skills) before writing any file.
12
+
13
+ ## Step 1: Ask persona (always, closed choice)
14
+
15
+ Ask the user this question using the `question` tool:
16
+
17
+ > **"What type of engineer are you creating?"**
18
+ >
19
+ > - Frontend: UI components, pages, mobile, styling, browser
20
+ > - Layout Designer: Design systems, CSS architecture, Storybook, a11y
21
+ > - Backend: APIs, databases, auth, services
22
+ > - Data: Data pipelines, ETL, analytics, ML models, data quality
23
+ > - DevOps: CI/CD, infra, Docker, deploy
24
+ > - Security: Auth, secrets, vulnerability scanning, hardening
25
+ > - Mobile: React Native, Flutter, native iOS/Android
26
+ > - API / Integration: REST/GraphQL APIs, webhooks, third-party integrations
27
+ > - QA: Test automation, E2E, regression, performance testing
28
+
29
+ The chosen persona determines everything: what to detect, what questions to ask, what skills to suggest.
30
+
31
+ If the user passes the persona as an argument (e.g. `/make-engineer frontend`) or selects "Type your own answer", accept any single-word persona name and skip to Step 2.
32
+
33
+ ## Step 2: Detect signals from source roots
34
+
35
+ Check `source-roots.json` first. Read `.opencode/source-roots.json`. If it doesn't exist or has empty roots, ask the user which directories to scan using the `question` tool with the project's top-level directories as options.
36
+
37
+ Also read `ARCHITECTURE.md` and `DESIGN.md` for context on the tech stack.
38
+
39
+ Scan for persona-relevant signals only. Look in manifest files (`package.json`, `tsconfig.json`, `*.csproj`, `pyproject.toml`, `requirements.txt`, `go.mod`, `Cargo.toml`, etc.) and project structure:
40
+
41
+ - Language: primary language(s) and version(s)
42
+ - Framework: web, backend, or mobile framework
43
+ - Data layer: ORM, database client, cache client
44
+ - Testing: test framework, test config files, test directories
45
+ - Styling: CSS framework, CSS-in-JS, design tokens
46
+ - Architecture: FSD, monolith, microservices, feature dirs
47
+ - i18n: internationalization libs
48
+ - CI/CD: workflow definition files
49
+ - Cloud / IaC: cloud provider config, infrastructure-as-code files
50
+ - Monitoring: observability/monitoring config or deps
51
+ - Linting: linter, formatter, and their config files
52
+ - Dependency Injection: DI/IoC containers, hook frameworks
53
+
54
+ Report what was detected as a signal inventory. This list drives Step 4 deterministically:
55
+
56
+ ```
57
+ Signal inventory:
58
+ <signal-type>: <signal-value> (<source>)
59
+ <signal-type>: <signal-value> (<source>)
60
+ ...
61
+ ```
62
+
63
+ ## Step 3: Persona-specific form (recommend and confirm)
64
+
65
+ Present a short form using the `question` tool. Each question is a closed choice or yes-no. Every option that matches a detected signal from Step 2 must be marked (Recommended) and pre-selected. The user just confirms or overrides.
66
+
67
+ Ask 2-5 questions total:
68
+
69
+ 1. Architecture / patterns (always ask for `frontend`, `backend`, `layout`, `api` personas; optional otherwise). Use `multiple: true`. Pre-select the architecture detected in Step 2 and mark it (Recommended); offer common alternatives so the user can opt in even when the codebase does not signal one yet. Options map to the known sources in the [signal mapping](signal-mapping.md) reference:
70
+ - Feature-Sliced Design (FSD)
71
+ - Design patterns: singleton, observer, factory, hooks, HOC, compound, render-props, provider
72
+ - Rendering patterns: SSR, RSC, streaming, static, islands, progressive hydration
73
+ - Performance patterns: bundle splitting, tree-shaking, dynamic import, route-based
74
+ - Microservices
75
+ - Monolith / layered
76
+ 2. Up to 4 more questions, only where Step 2 detected multiple options or where the user's choice genuinely matters (e.g. which test runner, which styling approach, which cloud). Skip anything with a single detected option and just use it silently.
77
+
78
+ Rules:
79
+ - Options matching a detected signal are (Recommended) and pre-selected.
80
+ - Never ask about things where only one option was detected.
81
+ - Keep the whole form to 5 questions max.
82
+ - The user's selections here (plus Step 2 signals) become the recommended skill set that Step 4 resolves, confirms, and installs.
83
+
84
+ ## Step 4: Skill discovery, confirmation, and install
85
+
86
+ Complete this step fully before writing anything in Step 5. The agent file is worthless without real skills. The flow is: discover candidates, confirm with the user, install the confirmed set, verify.
87
+
88
+ ### 4a. Pre-check already-installed skills
89
+
90
+ Before searching, build a map of what's already available:
91
+
92
+ 1. List every directory in `.agents/skills/`
93
+ 2. Read `skills-lock.json` for npx-installed skills
94
+ 3. For each detected signal from Step 2, check if an already-installed skill covers it
95
+ 4. Mark covered signals as already-satisfied
96
+
97
+ Report:
98
+
99
+ ```
100
+ Already installed:
101
+ <skill-name> covers <signal>
102
+ ...
103
+ Signals still needing skills:
104
+ - <signal-type>: <signal-value>
105
+ ...
106
+ ```
107
+
108
+ ### 4b. Ensure `find-skills` is available
109
+
110
+ Check if `.agents/skills/find-skills/SKILL.md` exists. If not, install it:
111
+
112
+ ```bash
113
+ npx skills add -y vercel-labs/skills@find-skills
114
+ ```
115
+
116
+ If it can't be installed, stop and tell the user: "find-skills is required for skill discovery. Install it manually with `npx skills add -y vercel-labs/skills@find-skills` and re-run."
117
+
118
+ ### 4c. Search and resolve
119
+
120
+ For each uncovered signal, run `npx skills find` with the query and resolve architecture/patterns via the known direct sources. Follow the [signal mapping](signal-mapping.md) reference for the full table of queries, known direct sources, quality filter, recommended set assembly, and post-install verification.
121
+
122
+ ### 4d. Confirm the skill set (the form)
123
+
124
+ Present the recommended set to the user as a multi-select form using the `question` tool with `multiple: true`, and pre-select every recommended skill. This is the confirmation gate.
125
+
126
+ - Group the options by category: Architecture, Development, Testing, Infrastructure.
127
+ - For each skill show: name, one-line description, source (`owner/repo`), and install count (or "curated source" for known direct source entries).
128
+ - Every recommended skill is checked by default; the user unchecks anything unwanted.
129
+ - Include a short note that they can request additional skills by name.
130
+ - Nothing installs until the user submits this form.
131
+
132
+ The submitted selection is the confirmed set. Install only the confirmed set in the next step.
133
+
134
+ ### 4e. Install the confirmed set
135
+
136
+ Install each confirmed skill (project-local). Always pass `-y` to skip the skills CLI's own prompt. Use the syntax that matches the source:
137
+
138
+ ```bash
139
+ # skills.sh index entries (from npx skills find):
140
+ npx skills add -y <owner/repo@skill-name>
141
+
142
+ # known direct sources (Step 4c):
143
+ npx skills add -y feature-sliced/skills
144
+ npx skills add -y PatternsDev/skills --skill <skill-name>
145
+ ```
146
+
147
+ Project-local only. Do not use the `-g` flag.
148
+
149
+ Then run the [post-install verification](signal-mapping.md) procedure for each installed skill.
150
+
151
+ ## Step 5: Fill the template
152
+
153
+ Before creating the file, check if `.opencode/agents/{persona}-engineer.md` already exists. If it does, call the `question` tool:
154
+
155
+ ```json
156
+ {
157
+ "questions": [
158
+ {
159
+ "header": "Overwrite engineer",
160
+ "question": "An engineer named \"{persona}-engineer\" already exists. Overwrite or cancel?",
161
+ "options": [
162
+ { "label": "Overwrite", "description": "Proceed, preserving the existing color frontmatter value unless a new one is chosen." },
163
+ { "label": "Cancel", "description": "Stop. Do not modify the existing file." }
164
+ ]
165
+ }
166
+ ]
167
+ }
168
+ ```
169
+
170
+ - If `Overwrite`: proceed, but preserve the existing `color:` frontmatter value unless the user chose a new one.
171
+ - If `Cancel`: stop.
172
+
173
+ Fill the [template](template.md). All the research from Steps 2-4 (signal detection, project analysis, tech stack knowledge) was for selecting the right skills. The agent file itself is just the template. Do not write project knowledge, architecture notes, coding conventions, file maps, testing patterns, or workflow instructions into the file. Those belong in skills and guardrails.
174
+
175
+ Follow the [template](template.md) reference for the full structure, description quality bar, identity paragraph rules, category rules, and structural validation checklist.
176
+
177
+ ## Step 6: Validate the file
178
+
179
+ After writing the agent file, run both checks from the [template](template.md) reference:
180
+
181
+ 1. Structural validation: verify frontmatter, no `model:` field, `## Abilities` is the only `##` heading, one identity paragraph, abilities categorized, one file only.
182
+ 2. Skill reference validation: verify every `@skill-name` in `## Abilities` exists in `.agents/skills/` and in `skills-lock.json`.
183
+
184
+ If either check fails, fix the file and re-validate.
185
+
186
+ ## Step 7: Update fullstack-engineer.md abilities
187
+
188
+ `fullstack-engineer.md` is `mode: subagent`, but it is also the body that `pc-subagent-tiers` copies into `build.md` and `plan.md` on every startup. So every skill listed here reaches both primary agents, which is why it accumulates all of them: it plans and delegates rather than doing parallel implementation itself.
189
+
190
+ After creating the persona engineer and validating its references, additively merge new skills into fullstack:
191
+
192
+ 1. Read `.agents/skills/` directory to list all installed skills.
193
+ 2. Read `skills-lock.json` for npx-installed skills.
194
+ 3. Read the current `fullstack-engineer.md`.
195
+ 4. Parse its existing `## Abilities` section to find which skills are already listed.
196
+ 5. Append-only: add only skills that are not already in the file (dedup by skill name).
197
+ 6. Preserve the frontmatter (mode, color, permissions, model if stamped), the identity paragraph, and all existing ability lines.
198
+ 7. Remove any old startup directive line. The `pc-system-reminders` plugin loads abilities for every session.
199
+ 8. Write the file back.
200
+
201
+ Merge new skills into existing categories. If a new skill belongs to "Development" and that line already exists, append to it. If a new category is needed, add it. Do not overwrite the Abilities section.
202
+
203
+ ## Step 8: Update AGENTS.md
204
+
205
+ Add the new agent to the agents table in AGENTS.md (if a table exists) or note it:
206
+ ```
207
+ | `{persona}-engineer` | .opencode/agents/{persona}-engineer.md | <short role description> |
208
+ ```
209
+
210
+ ## Step 9: Show summary
211
+
212
+ Report:
213
+ - Engineer file created at `.opencode/agents/{persona}-engineer.md`
214
+ - Skills installed from skills.sh (list each with source and install count)
215
+ - Signals with no quality skill found on skills.sh (list each)
216
+ - Skills that failed validation or install (list each with reason)
217
+ - `fullstack-engineer.md` updated (additive, list new skills added)
218
+ - How to use: "This agent will be spawned by the lead during `/plan-apply` for tasks matching its specialty."
219
+ - "Restart opencode for the `pc-subagent-tiers` plugin to pick up the new engineer and rebuild `build.md` and `plan.md` from the updated fullstack abilities."