@plainconceptsplatform/agent-harness 2.0.0 → 2.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.
Files changed (117) hide show
  1. package/README.md +426 -419
  2. package/package.json +3 -3
  3. package/src/commands/join.js +244 -244
  4. package/src/commands/shared.js +27 -27
  5. package/src/commands/single.js +79 -79
  6. package/src/commands/update.js +109 -109
  7. package/src/commands/wizard.js +134 -134
  8. package/src/content/.agents/skills/browser-automation/SKILL.md +66 -66
  9. package/src/content/.agents/skills/pc-guardrails-generic/SKILL.md +68 -68
  10. package/src/content/.agents/skills/pc-guardrails-project/SKILL.md +8 -8
  11. package/src/content/.agents/skills/pc-make-architecture/SKILL.md +51 -51
  12. package/src/content/.agents/skills/pc-make-architecture/structure-template.md +38 -38
  13. package/src/content/.agents/skills/pc-make-design/SKILL.md +68 -68
  14. package/src/content/.agents/skills/pc-make-engineer/SKILL.md +219 -219
  15. package/src/content/.agents/skills/pc-make-engineer/signal-mapping.md +68 -68
  16. package/src/content/.agents/skills/pc-make-engineer/template.md +81 -81
  17. package/src/content/.agents/skills/pc-make-evidence-scaffold/SKILL.md +18 -18
  18. package/src/content/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +29 -29
  19. package/src/content/.agents/skills/pc-make-guardrails/SKILL.md +74 -74
  20. package/src/content/.agents/skills/pc-make-guardrails/category-reference.md +68 -68
  21. package/src/content/.agents/skills/pc-make-merge-risk-assess/SKILL.md +70 -70
  22. package/src/content/.agents/skills/pc-make-merge-risk-assess/category-reference.md +98 -98
  23. package/src/content/.agents/skills/pc-make-user-model/SKILL.md +66 -66
  24. package/src/content/.agents/skills/pc-ops-evidence/SKILL.md +127 -127
  25. package/src/content/.agents/skills/pc-ops-ship/SKILL.md +18 -18
  26. package/src/content/.agents/skills/pc-plan-apply/SKILL.md +83 -83
  27. package/src/content/.agents/skills/pc-plan-apply/simple-mode.md +21 -21
  28. package/src/content/.agents/skills/pc-plan-archive/SKILL.md +63 -63
  29. package/src/content/.agents/skills/pc-plan-explore/SKILL.md +9 -9
  30. package/src/content/.agents/skills/pc-plan-goal/SKILL.md +94 -94
  31. package/src/content/.agents/skills/pc-plan-goal/branching.md +30 -30
  32. package/src/content/.agents/skills/pc-plan-goal/failure-policy.md +30 -30
  33. package/src/content/.agents/skills/pc-plan-goal/output-mode.md +9 -9
  34. package/src/content/.agents/skills/pc-plan-goal/output.md +68 -68
  35. package/src/content/.agents/skills/pc-plan-propose/SKILL.md +125 -125
  36. package/src/content/.agents/skills/pc-plan-propose/task-annotation.md +39 -39
  37. package/src/content/.agents/skills/pc-plan-quick/SKILL.md +62 -62
  38. package/src/content/.agents/skills/pc-plan-story/SKILL.md +146 -146
  39. package/src/content/.agents/skills/pc-repo-audit/SKILL.md +44 -44
  40. package/src/content/.agents/skills/pc-repo-help/SKILL.md +91 -91
  41. package/src/content/.agents/skills/pc-repo-initialize/SKILL.md +130 -130
  42. package/src/content/.agents/skills/pc-repo-onboard/SKILL.md +87 -87
  43. package/src/content/.agents/skills/pc-repo-verify/SKILL.md +34 -34
  44. package/src/content/.agents/skills/pc-userstory-az/SKILL.md +157 -157
  45. package/src/content/.agents/skills/pc-userstory-browser/SKILL.md +132 -132
  46. package/src/content/.agents/skills/pc-userstory-gh/SKILL.md +120 -120
  47. package/src/content/.agents/skills/pc-userstory-jira/SKILL.md +131 -131
  48. package/src/content/.opencode/_gitignore +9 -7
  49. package/src/content/.opencode/commands/init.md +5 -5
  50. package/src/content/.opencode/commands/make-architecture.md +5 -5
  51. package/src/content/.opencode/commands/make-design.md +5 -5
  52. package/src/content/.opencode/commands/make-engineer.md +5 -5
  53. package/src/content/.opencode/commands/make-evidence-scaffold.md +5 -5
  54. package/src/content/.opencode/commands/make-guardrails.md +5 -5
  55. package/src/content/.opencode/commands/make-user-model.md +5 -5
  56. package/src/content/.opencode/commands/ops-backlog.md +10 -10
  57. package/src/content/.opencode/commands/ops-evidence.md +9 -9
  58. package/src/content/.opencode/commands/ops-review.md +8 -8
  59. package/src/content/.opencode/commands/ops-ship.md +9 -9
  60. package/src/content/.opencode/commands/plan-apply.md +9 -9
  61. package/src/content/.opencode/commands/plan-archive.md +5 -5
  62. package/src/content/.opencode/commands/plan-explore.md +9 -9
  63. package/src/content/.opencode/commands/plan-goal.md +5 -5
  64. package/src/content/.opencode/commands/plan-propose.md +9 -9
  65. package/src/content/.opencode/commands/plan-quick.md +5 -5
  66. package/src/content/.opencode/commands/plan-story.md +9 -9
  67. package/src/content/.opencode/commands/repo-audit.md +5 -5
  68. package/src/content/.opencode/commands/repo-help.md +5 -5
  69. package/src/content/.opencode/commands/repo-initialize.md +5 -5
  70. package/src/content/.opencode/commands/repo-onboard.md +5 -5
  71. package/src/content/.opencode/commands/repo-verify.md +5 -5
  72. package/src/content/.opencode/plugins/pc-subagent-monitor.js +139 -139
  73. package/src/content/.opencode/plugins/pc-subagent-tiers.js +281 -179
  74. package/src/content/.opencode/plugins/pc-system-reminders.js +96 -96
  75. package/src/content/.opencode/tui/pc-subagents.tsx +98 -98
  76. package/src/content/.opencode/tui.json +6 -6
  77. package/src/content/AGENTS.md +71 -71
  78. package/src/content/opencode.jsonc +39 -31
  79. package/src/fragments/archive/az.md +95 -95
  80. package/src/fragments/archive/gh.md +94 -94
  81. package/src/fragments/archive/gl.md +94 -94
  82. package/src/fragments/archive/none.md +73 -73
  83. package/src/fragments/guardrails/codegraph.md +7 -7
  84. package/src/fragments/guardrails/humanizer.md +4 -4
  85. package/src/fragments/guardrails/memory.md +4 -4
  86. package/src/fragments/guardrails/rtk.md +3 -3
  87. package/src/fragments/guardrails/simple-english.md +4 -4
  88. package/src/fragments/ops-backlog/az.md +28 -28
  89. package/src/fragments/ops-backlog/gh.md +29 -29
  90. package/src/fragments/ops-backlog/jira.md +28 -28
  91. package/src/fragments/ops-evidence/az.md +41 -41
  92. package/src/fragments/ops-evidence/gh.md +53 -53
  93. package/src/fragments/ops-evidence/jira.md +38 -38
  94. package/src/fragments/ops-review/az.md +62 -62
  95. package/src/fragments/ops-review/gh.md +52 -52
  96. package/src/fragments/ops-review/gl.md +56 -56
  97. package/src/fragments/ops-ship/az.md +80 -80
  98. package/src/fragments/ops-ship/gh.md +68 -68
  99. package/src/fragments/ops-ship/gl.md +85 -85
  100. package/src/index.js +107 -107
  101. package/src/presets/agents-content.json +53 -53
  102. package/src/presets/models.json +68 -68
  103. package/src/steps/copy/agents.js +118 -118
  104. package/src/steps/copy/commands.js +91 -91
  105. package/src/steps/copy/fullstack-engineer.js +85 -83
  106. package/src/steps/copy/index.js +88 -88
  107. package/src/steps/copy/opencode-json.js +147 -129
  108. package/src/steps/copy/skills.js +196 -196
  109. package/src/steps/metadata/index.js +108 -108
  110. package/src/steps/models/write.js +34 -34
  111. package/src/steps/optimization/patch-guardrails.js +108 -108
  112. package/src/utils/copy.js +108 -108
  113. package/src/utils/legacy-check.js +30 -30
  114. package/src/utils/models-cache.js +58 -58
  115. package/src/utils/paths.js +67 -64
  116. package/src/utils/update-manifest.js +49 -49
  117. package/src/content/.opencode/plugins/pc-system-reminders.test.js +0 -35
@@ -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.
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: primary`. Never write `model:`. 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
- The `fullstack-engineer.md` is `mode: primary`, the planning session agent, not a spawned worker. Having all skills here is fine since it does planning, not parallel implementation.
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."
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:`. 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,68 +1,68 @@
1
- # Signal-to-query mapping
2
-
3
- For each uncovered signal, run a mandatory `npx skills find` with a specific query. Every uncovered signal gets its own search. No signal is skipped. Capture the output of each search.
4
-
5
- | Signal type | Search query |
6
- |---|---|
7
- | Language | `npx skills find "<language-name>"` (e.g. `typescript`, `csharp`, `python`) |
8
- | Framework | `npx skills find "<framework-name>"` (e.g. `react`, `ink`, `angular`, `django`) |
9
- | Architecture | Use the known direct sources below. Optionally also `npx skills find "<pattern-name>"` |
10
- | Testing | `npx skills find "<test-framework> testing"` (e.g. `vitest testing`, `jest testing`) |
11
- | Styling | `npx skills find "<css-framework>"` (e.g. `tailwind`, `css modules`, `design tokens`) |
12
- | Linting | `npx skills find "eslint prettier"` or `"lint format"` |
13
- | CI/CD | `npx skills find "ci cd pipeline"` or `"<platform> actions"` |
14
- | Cloud / IaC | `npx skills find "<cloud-provider> infrastructure"` (e.g. `azure infrastructure`) |
15
- | Monitoring | `npx skills find "observability monitoring"` |
16
- | i18n | `npx skills find "i18n internationalization"` |
17
- | Data layer | `npx skills find "<orm-or-db> orm"` (e.g. `entity framework orm`, `prisma orm`) |
18
- | Dependency Injection | `npx skills find "<di-framework>"` (e.g. `inversify`, `autofac`) |
19
-
20
- If a signal doesn't fit any table row, derive a query from the signal value itself: `npx skills find "<signal-value>"`.
21
-
22
- ## Known direct sources (architecture and patterns)
23
-
24
- Some high-value skills live in dedicated repos and install by direct `owner/repo` reference, so `npx skills find` never surfaces them. When the persona is `frontend` / `backend` / `layout` / `api`, or the user selected an architecture/pattern in Step 3, pull from this table:
25
-
26
- | Selection (Step 3) | Install command | Skill(s) to pick |
27
- |---|---|---|
28
- | Feature-Sliced Design (FSD) | `npx skills add -y feature-sliced/skills` | `feature-sliced-design` |
29
- | Design patterns | `npx skills add -y PatternsDev/skills --skill <name>` | `hooks-pattern`, `hoc-pattern`, `compound-pattern`, `render-props-pattern`, `provider-pattern`, `observer-pattern`, `factory-pattern`, `module-pattern` |
30
- | Rendering patterns | `npx skills add -y PatternsDev/skills --skill <name>` | `server-side-rendering`, `client-side-rendering`, `static-rendering`, `streaming-ssr`, `react-server-components`, `progressive-hydration`, `islands-architecture` |
31
- | Performance patterns | `npx skills add -y PatternsDev/skills --skill <name>` | `bundle-splitting`, `tree-shaking`, `dynamic-import`, `route-based`, `js-performance-patterns`, `react-render-optimization` |
32
- | Modern React (2026 stack) | `npx skills add -y PatternsDev/skills --skill <name>` | `react-2026`, `react-composition-2026`, `react-data-fetching` |
33
-
34
- Rules for this table:
35
- - Pick only skills relevant to the persona and the user's Step 3 selections.
36
- - Cap patterns.dev picks at 2-3 of the most relevant. Full catalog: https://www.patterns.dev/ai/skills/catalog/
37
- - These sources are curated and canonical, so they are exempt from the install-count filter below.
38
- - Add the resolved skills to the recommended set. They are installed only after the user confirms.
39
-
40
- ## Quality filter
41
-
42
- From each search result, select the best candidate using these rules in order:
43
-
44
- 1. Install count at least 100. Skip anything below. Prefer at least 1000.
45
- 2. Official or canonical source. Prefer `vercel-labs`, `anthropics`, `microsoft`, `feature-sliced`, `wshobson`, `github` over unknown authors.
46
- 3. Topical match. The skill description must clearly match the signal. A React skill with 500K installs doesn't cover TypeScript if its description is only about React components.
47
- 4. If the top result is below 100 installs, record "no quality skill found on skills.sh for \<signal\>" and move on.
48
-
49
- ## Assembling the recommended set
50
-
51
- Combine the winners from the `npx skills find` searches and the known direct sources into a single recommended set:
52
-
53
- - Minimum = number of detected persona-relevant signals (if 6 signals detected, aim for at least 6 skills, one per signal minimum)
54
- - Ideal range: 5-8 for most engineers
55
- - Hard cap: 10. If more candidates found, rank by install count and source reputation and keep the top 10.
56
- - No redundant skills. If an already-selected skill covers the same scope as a new candidate (e.g. `vercel-react-best-practices` already covers TypeScript basics), skip the new candidate unless it provides genuinely deeper coverage for a different concern.
57
- - If fewer than 5 skills are found after all searches, note it. The user can still add more in the confirmation form.
58
-
59
- ## Post-install verification
60
-
61
- After each `npx skills add`, verify the skill actually landed and tracked itself in the lockfile:
62
-
63
- 1. Check `.agents/skills/<skill-name>/SKILL.md` exists
64
- 2. Check `skills-lock.json` now contains the skill entry (read it back, do not assume the entry was written)
65
-
66
- If `.agents/skills/<skill-name>/SKILL.md` exists but `skills-lock.json` does not contain the entry: manually patch the lockfile using the Edit tool. Open `skills-lock.json`, add a new entry inside the `"skills"` object using the `owner/repo` from the install command and the structure `"source": "<owner/repo>", "sourceType": "github", "skillPath": "skills/<skill-name>/SKILL.md", "computedHash": "<skill-name>-placeholder"`. Match the existing entries' key naming. Re-read `skills-lock.json` to confirm the entry is valid JSON.
67
-
68
- If `.agents/skills/<skill-name>/SKILL.md` is missing (network glitch, wrong repo name, auth issue): retry the install once. If still failing, drop the skill from the selection and note it in the summary as "install failed".
1
+ # Signal-to-query mapping
2
+
3
+ For each uncovered signal, run a mandatory `npx skills find` with a specific query. Every uncovered signal gets its own search. No signal is skipped. Capture the output of each search.
4
+
5
+ | Signal type | Search query |
6
+ |---|---|
7
+ | Language | `npx skills find "<language-name>"` (e.g. `typescript`, `csharp`, `python`) |
8
+ | Framework | `npx skills find "<framework-name>"` (e.g. `react`, `ink`, `angular`, `django`) |
9
+ | Architecture | Use the known direct sources below. Optionally also `npx skills find "<pattern-name>"` |
10
+ | Testing | `npx skills find "<test-framework> testing"` (e.g. `vitest testing`, `jest testing`) |
11
+ | Styling | `npx skills find "<css-framework>"` (e.g. `tailwind`, `css modules`, `design tokens`) |
12
+ | Linting | `npx skills find "eslint prettier"` or `"lint format"` |
13
+ | CI/CD | `npx skills find "ci cd pipeline"` or `"<platform> actions"` |
14
+ | Cloud / IaC | `npx skills find "<cloud-provider> infrastructure"` (e.g. `azure infrastructure`) |
15
+ | Monitoring | `npx skills find "observability monitoring"` |
16
+ | i18n | `npx skills find "i18n internationalization"` |
17
+ | Data layer | `npx skills find "<orm-or-db> orm"` (e.g. `entity framework orm`, `prisma orm`) |
18
+ | Dependency Injection | `npx skills find "<di-framework>"` (e.g. `inversify`, `autofac`) |
19
+
20
+ If a signal doesn't fit any table row, derive a query from the signal value itself: `npx skills find "<signal-value>"`.
21
+
22
+ ## Known direct sources (architecture and patterns)
23
+
24
+ Some high-value skills live in dedicated repos and install by direct `owner/repo` reference, so `npx skills find` never surfaces them. When the persona is `frontend` / `backend` / `layout` / `api`, or the user selected an architecture/pattern in Step 3, pull from this table:
25
+
26
+ | Selection (Step 3) | Install command | Skill(s) to pick |
27
+ |---|---|---|
28
+ | Feature-Sliced Design (FSD) | `npx skills add -y feature-sliced/skills` | `feature-sliced-design` |
29
+ | Design patterns | `npx skills add -y PatternsDev/skills --skill <name>` | `hooks-pattern`, `hoc-pattern`, `compound-pattern`, `render-props-pattern`, `provider-pattern`, `observer-pattern`, `factory-pattern`, `module-pattern` |
30
+ | Rendering patterns | `npx skills add -y PatternsDev/skills --skill <name>` | `server-side-rendering`, `client-side-rendering`, `static-rendering`, `streaming-ssr`, `react-server-components`, `progressive-hydration`, `islands-architecture` |
31
+ | Performance patterns | `npx skills add -y PatternsDev/skills --skill <name>` | `bundle-splitting`, `tree-shaking`, `dynamic-import`, `route-based`, `js-performance-patterns`, `react-render-optimization` |
32
+ | Modern React (2026 stack) | `npx skills add -y PatternsDev/skills --skill <name>` | `react-2026`, `react-composition-2026`, `react-data-fetching` |
33
+
34
+ Rules for this table:
35
+ - Pick only skills relevant to the persona and the user's Step 3 selections.
36
+ - Cap patterns.dev picks at 2-3 of the most relevant. Full catalog: https://www.patterns.dev/ai/skills/catalog/
37
+ - These sources are curated and canonical, so they are exempt from the install-count filter below.
38
+ - Add the resolved skills to the recommended set. They are installed only after the user confirms.
39
+
40
+ ## Quality filter
41
+
42
+ From each search result, select the best candidate using these rules in order:
43
+
44
+ 1. Install count at least 100. Skip anything below. Prefer at least 1000.
45
+ 2. Official or canonical source. Prefer `vercel-labs`, `anthropics`, `microsoft`, `feature-sliced`, `wshobson`, `github` over unknown authors.
46
+ 3. Topical match. The skill description must clearly match the signal. A React skill with 500K installs doesn't cover TypeScript if its description is only about React components.
47
+ 4. If the top result is below 100 installs, record "no quality skill found on skills.sh for \<signal\>" and move on.
48
+
49
+ ## Assembling the recommended set
50
+
51
+ Combine the winners from the `npx skills find` searches and the known direct sources into a single recommended set:
52
+
53
+ - Minimum = number of detected persona-relevant signals (if 6 signals detected, aim for at least 6 skills, one per signal minimum)
54
+ - Ideal range: 5-8 for most engineers
55
+ - Hard cap: 10. If more candidates found, rank by install count and source reputation and keep the top 10.
56
+ - No redundant skills. If an already-selected skill covers the same scope as a new candidate (e.g. `vercel-react-best-practices` already covers TypeScript basics), skip the new candidate unless it provides genuinely deeper coverage for a different concern.
57
+ - If fewer than 5 skills are found after all searches, note it. The user can still add more in the confirmation form.
58
+
59
+ ## Post-install verification
60
+
61
+ After each `npx skills add`, verify the skill actually landed and tracked itself in the lockfile:
62
+
63
+ 1. Check `.agents/skills/<skill-name>/SKILL.md` exists
64
+ 2. Check `skills-lock.json` now contains the skill entry (read it back, do not assume the entry was written)
65
+
66
+ If `.agents/skills/<skill-name>/SKILL.md` exists but `skills-lock.json` does not contain the entry: manually patch the lockfile using the Edit tool. Open `skills-lock.json`, add a new entry inside the `"skills"` object using the `owner/repo` from the install command and the structure `"source": "<owner/repo>", "sourceType": "github", "skillPath": "skills/<skill-name>/SKILL.md", "computedHash": "<skill-name>-placeholder"`. Match the existing entries' key naming. Re-read `skills-lock.json` to confirm the entry is valid JSON.
67
+
68
+ If `.agents/skills/<skill-name>/SKILL.md` is missing (network glitch, wrong repo name, auth issue): retry the install once. If still failing, drop the skill from the selection and note it in the summary as "install failed".