@plainconceptsplatform/agent-harness 2.0.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 (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +419 -0
  3. package/package.json +68 -0
  4. package/src/commands/join.js +244 -0
  5. package/src/commands/shared.js +27 -0
  6. package/src/commands/single.js +79 -0
  7. package/src/commands/update.js +109 -0
  8. package/src/commands/wizard.js +134 -0
  9. package/src/content/.agents/skills/browser-automation/SKILL.md +66 -0
  10. package/src/content/.agents/skills/pc-guardrails-generic/SKILL.md +68 -0
  11. package/src/content/.agents/skills/pc-guardrails-project/SKILL.md +8 -0
  12. package/src/content/.agents/skills/pc-make-architecture/SKILL.md +51 -0
  13. package/src/content/.agents/skills/pc-make-architecture/structure-template.md +38 -0
  14. package/src/content/.agents/skills/pc-make-design/SKILL.md +68 -0
  15. package/src/content/.agents/skills/pc-make-engineer/SKILL.md +219 -0
  16. package/src/content/.agents/skills/pc-make-engineer/signal-mapping.md +68 -0
  17. package/src/content/.agents/skills/pc-make-engineer/template.md +81 -0
  18. package/src/content/.agents/skills/pc-make-evidence-scaffold/SKILL.md +18 -0
  19. package/src/content/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +29 -0
  20. package/src/content/.agents/skills/pc-make-guardrails/SKILL.md +74 -0
  21. package/src/content/.agents/skills/pc-make-guardrails/category-reference.md +68 -0
  22. package/src/content/.agents/skills/pc-make-merge-risk-assess/SKILL.md +70 -0
  23. package/src/content/.agents/skills/pc-make-merge-risk-assess/category-reference.md +98 -0
  24. package/src/content/.agents/skills/pc-make-user-model/SKILL.md +66 -0
  25. package/src/content/.agents/skills/pc-ops-evidence/SKILL.md +127 -0
  26. package/src/content/.agents/skills/pc-ops-ship/SKILL.md +18 -0
  27. package/src/content/.agents/skills/pc-plan-apply/SKILL.md +83 -0
  28. package/src/content/.agents/skills/pc-plan-apply/simple-mode.md +21 -0
  29. package/src/content/.agents/skills/pc-plan-archive/SKILL.md +63 -0
  30. package/src/content/.agents/skills/pc-plan-explore/SKILL.md +9 -0
  31. package/src/content/.agents/skills/pc-plan-goal/SKILL.md +94 -0
  32. package/src/content/.agents/skills/pc-plan-goal/branching.md +30 -0
  33. package/src/content/.agents/skills/pc-plan-goal/failure-policy.md +30 -0
  34. package/src/content/.agents/skills/pc-plan-goal/output-mode.md +9 -0
  35. package/src/content/.agents/skills/pc-plan-goal/output.md +68 -0
  36. package/src/content/.agents/skills/pc-plan-propose/SKILL.md +125 -0
  37. package/src/content/.agents/skills/pc-plan-propose/task-annotation.md +39 -0
  38. package/src/content/.agents/skills/pc-plan-quick/SKILL.md +62 -0
  39. package/src/content/.agents/skills/pc-plan-story/SKILL.md +146 -0
  40. package/src/content/.agents/skills/pc-repo-audit/SKILL.md +44 -0
  41. package/src/content/.agents/skills/pc-repo-help/SKILL.md +91 -0
  42. package/src/content/.agents/skills/pc-repo-initialize/SKILL.md +130 -0
  43. package/src/content/.agents/skills/pc-repo-onboard/SKILL.md +87 -0
  44. package/src/content/.agents/skills/pc-repo-verify/SKILL.md +34 -0
  45. package/src/content/.agents/skills/pc-userstory-az/SKILL.md +157 -0
  46. package/src/content/.agents/skills/pc-userstory-browser/SKILL.md +132 -0
  47. package/src/content/.agents/skills/pc-userstory-gh/SKILL.md +120 -0
  48. package/src/content/.agents/skills/pc-userstory-jira/SKILL.md +131 -0
  49. package/src/content/.opencode/_gitignore +7 -0
  50. package/src/content/.opencode/commands/init.md +5 -0
  51. package/src/content/.opencode/commands/make-architecture.md +5 -0
  52. package/src/content/.opencode/commands/make-design.md +5 -0
  53. package/src/content/.opencode/commands/make-engineer.md +5 -0
  54. package/src/content/.opencode/commands/make-evidence-scaffold.md +5 -0
  55. package/src/content/.opencode/commands/make-guardrails.md +5 -0
  56. package/src/content/.opencode/commands/make-user-model.md +5 -0
  57. package/src/content/.opencode/commands/ops-backlog.md +10 -0
  58. package/src/content/.opencode/commands/ops-evidence.md +9 -0
  59. package/src/content/.opencode/commands/ops-review.md +8 -0
  60. package/src/content/.opencode/commands/ops-ship.md +9 -0
  61. package/src/content/.opencode/commands/plan-apply.md +9 -0
  62. package/src/content/.opencode/commands/plan-archive.md +5 -0
  63. package/src/content/.opencode/commands/plan-explore.md +9 -0
  64. package/src/content/.opencode/commands/plan-goal.md +5 -0
  65. package/src/content/.opencode/commands/plan-propose.md +9 -0
  66. package/src/content/.opencode/commands/plan-quick.md +5 -0
  67. package/src/content/.opencode/commands/plan-story.md +9 -0
  68. package/src/content/.opencode/commands/repo-audit.md +5 -0
  69. package/src/content/.opencode/commands/repo-help.md +5 -0
  70. package/src/content/.opencode/commands/repo-initialize.md +5 -0
  71. package/src/content/.opencode/commands/repo-onboard.md +5 -0
  72. package/src/content/.opencode/commands/repo-verify.md +5 -0
  73. package/src/content/.opencode/package.json +10 -0
  74. package/src/content/.opencode/plugins/pc-subagent-monitor.js +139 -0
  75. package/src/content/.opencode/plugins/pc-subagent-tiers.js +179 -0
  76. package/src/content/.opencode/plugins/pc-system-reminders.js +96 -0
  77. package/src/content/.opencode/plugins/pc-system-reminders.test.js +35 -0
  78. package/src/content/.opencode/tui/pc-subagents.tsx +98 -0
  79. package/src/content/.opencode/tui.json +6 -0
  80. package/src/content/AGENTS.md +71 -0
  81. package/src/content/ARCHITECTURE.md +16 -0
  82. package/src/content/DESIGN.md +16 -0
  83. package/src/content/opencode.jsonc +31 -0
  84. package/src/content/openspec/changes/archive/.gitkeep +0 -0
  85. package/src/content/openspec/config.yaml +20 -0
  86. package/src/content/openspec/specs/.gitkeep +0 -0
  87. package/src/content/skills-lock.json +17 -0
  88. package/src/fragments/archive/az.md +95 -0
  89. package/src/fragments/archive/gh.md +94 -0
  90. package/src/fragments/archive/gl.md +94 -0
  91. package/src/fragments/archive/none.md +73 -0
  92. package/src/fragments/guardrails/codegraph.md +7 -0
  93. package/src/fragments/guardrails/humanizer.md +4 -0
  94. package/src/fragments/guardrails/memory.md +4 -0
  95. package/src/fragments/guardrails/rtk.md +3 -0
  96. package/src/fragments/guardrails/simple-english.md +4 -0
  97. package/src/fragments/ops-backlog/az.md +29 -0
  98. package/src/fragments/ops-backlog/gh.md +30 -0
  99. package/src/fragments/ops-backlog/jira.md +29 -0
  100. package/src/fragments/ops-evidence/az.md +41 -0
  101. package/src/fragments/ops-evidence/gh.md +53 -0
  102. package/src/fragments/ops-evidence/jira.md +38 -0
  103. package/src/fragments/ops-review/az.md +63 -0
  104. package/src/fragments/ops-review/gh.md +53 -0
  105. package/src/fragments/ops-review/gl.md +57 -0
  106. package/src/fragments/ops-ship/az.md +81 -0
  107. package/src/fragments/ops-ship/gh.md +69 -0
  108. package/src/fragments/ops-ship/gl.md +86 -0
  109. package/src/index.js +107 -0
  110. package/src/presets/agents-content.json +53 -0
  111. package/src/presets/browser.json +22 -0
  112. package/src/presets/clean.json +21 -0
  113. package/src/presets/models.json +68 -0
  114. package/src/presets/openspec.json +1 -0
  115. package/src/presets/optimization.json +37 -0
  116. package/src/presets/platforms.json +76 -0
  117. package/src/presets/quota.json +16 -0
  118. package/src/presets/source.json +23 -0
  119. package/src/steps/browser/index.js +91 -0
  120. package/src/steps/clean/index.js +120 -0
  121. package/src/steps/copy/agents.js +118 -0
  122. package/src/steps/copy/commands.js +91 -0
  123. package/src/steps/copy/fullstack-engineer.js +83 -0
  124. package/src/steps/copy/index.js +88 -0
  125. package/src/steps/copy/opencode-json.js +129 -0
  126. package/src/steps/copy/skills.js +196 -0
  127. package/src/steps/metadata/index.js +108 -0
  128. package/src/steps/models/format.js +88 -0
  129. package/src/steps/models/index.js +64 -0
  130. package/src/steps/models/write.js +34 -0
  131. package/src/steps/openspec/index.js +136 -0
  132. package/src/steps/optimization/codegraph.js +127 -0
  133. package/src/steps/optimization/humanizer.js +17 -0
  134. package/src/steps/optimization/index.js +163 -0
  135. package/src/steps/optimization/memory.js +88 -0
  136. package/src/steps/optimization/patch-guardrails.js +108 -0
  137. package/src/steps/optimization/quota.js +119 -0
  138. package/src/steps/optimization/simple-english.js +17 -0
  139. package/src/steps/optimization/skills-lock.js +30 -0
  140. package/src/steps/platform/index.js +109 -0
  141. package/src/steps/source/index.js +123 -0
  142. package/src/utils/copy.js +108 -0
  143. package/src/utils/exec-spinner.js +47 -0
  144. package/src/utils/exec.js +134 -0
  145. package/src/utils/legacy-check.js +30 -0
  146. package/src/utils/models-cache.js +58 -0
  147. package/src/utils/models-pricing.js +42 -0
  148. package/src/utils/paths.js +64 -0
  149. package/src/utils/process.js +3 -0
  150. package/src/utils/terminal.js +6 -0
  151. package/src/utils/update-manifest.js +49 -0
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: pc-guardrails-generic
3
+ description: Generic guardrails, foundational rules that all agents follow. Users add specialized guardrails skills for specific concerns. Covers secrets, code quality, security, tool usage, and engineer workflow.
4
+ license: MIT
5
+ ---
6
+
7
+ ## Transitive loads (optimization skills)
8
+
9
+ The marker sections below may contain instructions for selected optimization skills. These are mandatory. If a section says "call `skill("xxx")`", you must call the skill tool with that exact name before doing any work.
10
+
11
+ ## Secrets
12
+
13
+ - Treat `.env` files as write-only: write to them when configuring, read credentials from the environment or secret store at runtime.
14
+ - Keep credentials, API keys, and tokens out of logs and output.
15
+ - Stage secrets through environment variables or secret stores, committed only in encrypted or template form.
16
+
17
+ ## Code
18
+
19
+ - Run tests before marking done.
20
+ - Run lint/build before pushing.
21
+ - Keep changes small and focused.
22
+ - Comments are for WHY, not WHAT. Use them only when the code does something non-obvious or the reason cannot be inferred from context. Keep comment ratio under 10%. If more than 10% of lines in a file are comments, refactor for clarity instead.
23
+ - Each file should have one clear responsibility. Split by domain or feature (e.g. `user-constants.ts`, `order-types.ts`, `auth-config.ts`) rather than creating catch-all files like `constants.js`, `types.ts`, `config.js`, or `utils.ts` that collect unrelated things. A file that imports from many unrelated modules is a sign it should be split.
24
+
25
+ ## Temporary files
26
+
27
+ - Create scratch files only under `$REPO_ROOT/.opencode/.tmp/`; create a task-specific child directory when needed.
28
+ - Keep final artifacts in their required repository path. Copy or move a scratch artifact into that path before reporting it.
29
+ - Never use operating-system temporary directories or paths outside `$REPO_ROOT`.
30
+ - Remove scratch files when the task ends unless they are needed to diagnose a failure.
31
+
32
+ ## Security
33
+
34
+ - Validate all inputs.
35
+ - Escape all outputs.
36
+ - Keep credentials in environment variables or secret stores, committed only in encrypted or template form.
37
+
38
+ ## Communication
39
+
40
+ - Ask for clarification if unclear.
41
+ - Report blockers immediately.
42
+ - Show progress when asked.
43
+
44
+ <!-- PC-GUARDRAILS-RTK-START -->
45
+ <!-- PC-GUARDRAILS-RTK-END -->
46
+
47
+ <!-- PC-GUARDRAILS-CODEGRAPH-START -->
48
+ <!-- PC-GUARDRAILS-CODEGRAPH-END -->
49
+
50
+ <!-- PC-GUARDRAILS-MEMORY-START -->
51
+ <!-- PC-GUARDRAILS-MEMORY-END -->
52
+
53
+ <!-- PC-GUARDRAILS-SIMPLE-ENGLISH-START -->
54
+ <!-- PC-GUARDRAILS-SIMPLE-ENGLISH-END -->
55
+
56
+ <!-- PC-GUARDRAILS-HUMANIZER-START -->
57
+ <!-- PC-GUARDRAILS-HUMANIZER-END -->
58
+
59
+ ## Engineer workflow (when spawned)
60
+
61
+ When the lead spawns you via the task tool, your assigned task IDs and text are already in your prompt:
62
+
63
+ 1. The `pc-system-reminders` plugin has already loaded the skills listed under your `## Abilities`, guardrails first.
64
+ 2. Gather context using the project-selected tools described above.
65
+ 3. Implement your assigned tasks in dependency order. Edit only files within your assigned scope.
66
+ 4. Run the project's tests/lint before marking done (see Code above).
67
+ 5. Record the task result through the project-selected workflow.
68
+ 6. Return a summary containing: task IDs done, files changed, tests/lint result, and any decisions made. Then you exit; you do not poll, claim, or wait for more work.
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: pc-guardrails-project
3
+ description: Project-specific guardrails extracted from ARCHITECTURE.md and project config files. Populated by /make-guardrails. Load this skill before implementing any change to understand boundaries, conventions, and constraints for this codebase.
4
+ license: MIT
5
+ ---
6
+
7
+ <!-- This skill is a placeholder until /make-guardrails is run. -->
8
+ <!-- /make-guardrails will populate this file with project-specific rules. -->
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: pc-make-architecture
3
+ description: Generate or update ARCHITECTURE.md by analyzing the codebase structure. Safe to run at any time. Invoked by the /make-architecture command and the repo-initialize flow.
4
+ license: MIT
5
+ ---
6
+
7
+ # Make Architecture
8
+
9
+ Analyze the architecture of this codebase and generate or update `ARCHITECTURE.md` in the project root.
10
+
11
+ ## Steps
12
+
13
+ 1. **Check current state**
14
+
15
+ Read `ARCHITECTURE.md`. Determine which mode to use:
16
+ - Does not exist or is a placeholder (no real content): Generate mode. Create from scratch.
17
+ - Exists with content and has a `<!-- Last updated:` footer: Update mode. Incrementally update (see step 2b).
18
+ - Exists with content but no timestamp: warn the user, then proceed in Generate mode (full regeneration).
19
+
20
+ 2a. **Generate mode: analyze the codebase**
21
+
22
+ Read `.opencode/source-roots.json` when present. Only analyze those roots plus this repo's docs/config files.
23
+
24
+ Use file tools to discover the architecture: `glob` for folder structure, `grep` for route/model/schema definitions, `read` config files, CI/CD workflows, Dockerfiles, README, changelogs, ADRs.
25
+
26
+ 2b. **Update mode: incremental analysis**
27
+
28
+ Extract the `<!-- Last updated: <ISO date> -->` timestamp from the existing file. Then:
29
+ - Run `git log --oneline --since="<date>" -- <source roots>` to find what changed since the last analysis.
30
+ - If nothing changed: report "Architecture unchanged since last update" and stop.
31
+ - For each changed area, understand what's affected.
32
+ - Update only the affected sections. Preserve manually-added content in unchanged sections.
33
+ - If the changes are too pervasive (more than ~40% of sections affected), fall back to Generate mode.
34
+
35
+ 3. **Write ARCHITECTURE.md**
36
+
37
+ Write (or update) `ARCHITECTURE.md` following the [structure template](structure-template.md) reference. That reference defines every section, the rules for writing, and the timestamp footer format.
38
+
39
+ 4. **Store summary in configured persistent context**
40
+
41
+ `write_note` MCP tool with title `architecture-summary` containing:
42
+ - The ISO timestamp of this run
43
+ - A bullet list of top-level components found (every top-level component must appear)
44
+ - Any key architectural decisions or risks identified
45
+
46
+ 5. **Report**
47
+
48
+ Tell the user:
49
+ - Whether ARCHITECTURE.md was generated or updated (and which sections changed)
50
+ - Top-level components found
51
+ - Tip: "Rerun `/make-architecture` any time the architecture changes significantly."
@@ -0,0 +1,38 @@
1
+ # ARCHITECTURE.md structure template
2
+
3
+ Write (or update) `ARCHITECTURE.md` following this structure. Only include sections relevant to the project; omit sections with no evidence.
4
+
5
+ - Architecture Overview: what the system is, what problem it solves, major architectural style
6
+ - 1. Project Structure: annotated directory tree with purpose of each major directory
7
+ - 2. High-Level System Diagram: Mermaid diagram of actors, services, data stores, external systems
8
+ - 3. Core Components: each major component: name, responsibility, key files, technologies, inputs/outputs
9
+ - 3.1 Frontend / User Interface (if present)
10
+ - 3.2 Backend / Server / API (if present)
11
+ - 3.3 Shared Libraries / Common Code (if present)
12
+ - 3.4 CLI / Scripts / Automation (if present)
13
+ - 4. Data Flow: request lifecycle, key user journeys, sequence diagram for main runtime flow
14
+ - 5. Data Stores: all persistent storage: type, purpose, schemas, migration approach
15
+ - 6. External Integrations / APIs: each integration: method, config location, auth, failure behavior
16
+ - 7. Key Technologies: full stack summary with architectural relevance of each
17
+ - 8. Deployment & Infrastructure: build artifacts, env config, containerization, CI/CD, hosting
18
+ - 9. Security Architecture: auth, authz, secrets, input validation, trust boundaries
19
+ - 10. Monitoring & Observability: logging, metrics, tracing, error reporting
20
+ - 11. Performance & Scalability: caching, batching, concurrency, known bottlenecks
21
+ - 12. Development Workflow: local setup, install/dev/test/build/lint commands
22
+ - 13. Testing Strategy: test frameworks, locations, coverage gates, gaps
23
+ - 14. Architectural Decisions & Rationale: key choices with evidence and tradeoffs
24
+ - 15. Constraints, Risks, and Technical Debt: tight coupling, TODOs, operational risks
25
+ - 16. Future Considerations: documented roadmap + reasonable recommendations (labeled as such)
26
+ - 17. Project Identification: name, language, type, runtime, date of review, maintainer
27
+ - 18. Glossary / Acronyms: project-specific terms an agent or new developer needs to know
28
+
29
+ Append at the very end of the file:
30
+ ```
31
+ <!-- Last updated: <current ISO timestamp> -->
32
+ ```
33
+
34
+ Rules:
35
+ - Be specific and concrete: include actual directories, files, modules, commands.
36
+ - Mark anything undiscoverable as "Not evident from the repository".
37
+ - Use Mermaid diagrams where helpful.
38
+ - Write as if this document will be committed and maintained over time.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: pc-make-design
3
+ description: Generate or update DESIGN.md by analyzing the codebase design system (Tailwind, CSS vars, tokens, UI framework config). Safe to run at any time. Invoked by the /make-design command and the repo-initialize flow.
4
+ license: MIT
5
+ ---
6
+
7
+ # Make Design
8
+
9
+ Analyze the design system of this codebase and generate or update `DESIGN.md` in the project root.
10
+
11
+ Reference material:
12
+ Overview: https://stitch.withgoogle.com/docs/design-md/overview/
13
+ Format: https://stitch.withgoogle.com/docs/design-md/format/
14
+ Spec: https://github.com/google-labs-code/design.md
15
+
16
+ Examples from the spec repo:
17
+ https://github.com/google-labs-code/design.md/blob/main/examples/atmospheric-glass/DESIGN.md
18
+ https://github.com/google-labs-code/design.md/blob/main/examples/paws-and-paths/DESIGN.md
19
+
20
+ ## Steps
21
+
22
+ 1. **Check current state**
23
+
24
+ Read `DESIGN.md`. Determine which mode to use:
25
+ - Does not exist or is a placeholder (no real content): Generate mode. Create from scratch.
26
+ - Exists with content and has a `<!-- Last updated:` footer: Update mode. Incrementally update (see step 2b).
27
+ - Exists with content but no timestamp: warn the user, then proceed in Generate mode (full regeneration).
28
+
29
+ 2a. **Generate mode: analyze the codebase**
30
+
31
+ Read `.opencode/source-roots.json` when present. Only analyze those roots.
32
+
33
+ Use file tools to discover the design system: `glob` for CSS files, Tailwind config, PostCSS config, component files, design token definitions (JS/TS/JSON/YAML), theme files, UI framework config (shadcn, MUI, Chakra, etc.).
34
+
35
+ 2b. **Update mode: incremental analysis**
36
+
37
+ Extract the `<!-- Last updated: <ISO date> -->` timestamp from the existing file. Then:
38
+ - Run `git log --oneline --since="<date>" -- <source roots>` to find what changed since the last analysis.
39
+ - If nothing changed: report "Design system unchanged since last update" and stop.
40
+ - For changed CSS/token/component files, understand what uses them.
41
+ - Update only the affected tokens and sections. Preserve manually-added content in unchanged sections.
42
+ - If the changes are too pervasive (entire token system replaced), fall back to Generate mode.
43
+
44
+ 3. **Write DESIGN.md**
45
+
46
+ Write (or update) `DESIGN.md`. The output must:
47
+ - Begin with YAML frontmatter containing all structured design tokens (colors, typography, spacing, elevation, motion, radii, shadows, etc.)
48
+ - Follow with free-form Markdown describing the look and feel and capturing design intent that token values alone cannot convey
49
+ - Be entirely self-contained: reference no files, variables, or paths from the codebase
50
+ - Use valid YAML design token format for all token values
51
+
52
+ Append at the very end of the file:
53
+ ```
54
+ <!-- Last updated: <current ISO timestamp> -->
55
+ ```
56
+
57
+ 4. **Store summary in configured persistent context**
58
+
59
+ `write_note` MCP tool with title `design-summary` containing:
60
+ - The ISO timestamp of this run
61
+ - Key design tokens found (color palette, fonts, spacing scale)
62
+
63
+ 5. **Report**
64
+
65
+ Tell the user:
66
+ - Whether DESIGN.md was generated or updated (and which tokens/sections changed)
67
+ - Key design tokens found (color palette, fonts, spacing scale)
68
+ - Tip: "Rerun `/make-design` any time your design system changes."
@@ -0,0 +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."
@@ -0,0 +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".
@@ -0,0 +1,81 @@
1
+ # Agent file template
2
+
3
+ The agent file is exactly this structure: frontmatter plus one identity paragraph plus the `## Abilities` section. No other sections. No other content.
4
+
5
+ ```markdown
6
+ ---
7
+ description: <one sentence naming the persona + top 3-5 detected technologies>
8
+ mode: primary
9
+ color: <pick: primary|secondary|accent|error|info: avoid colors used by existing agents; warning is reserved for the lead engineer>
10
+ permission:
11
+ edit: allow
12
+ bash: allow
13
+ read: allow
14
+ glob: allow
15
+ grep: allow
16
+ ---
17
+
18
+ <One paragraph: "You are a {persona} engineer specializing in {top technologies}. You own all work in {scope/files}." Keep it to 2-3 sentences max.>
19
+
20
+ ## Abilities
21
+ - Guardrails: @pc-guardrails-generic, @pc-guardrails-project
22
+ - Development: <@installed-skill-1>, <@installed-skill-2>, ...
23
+ - Testing: <@installed-skill-for-testing>, ...
24
+ - Infrastructure: <@installed-skill-for-devops>, ...
25
+ ```
26
+
27
+ That is the entire file: frontmatter, one identity paragraph, and the `## Abilities` section. The always-installed `pc-system-reminders` plugin loads the listed skills for every session. Replace every `<...>` placeholder with real values from your research. Remove any ability category line that has no skills assigned (besides Guardrails which is always present).
28
+
29
+ ## Description quality bar
30
+
31
+ The `description:` field is the matching key for `/plan-apply`. The lead compares task domain text against agent descriptions to pick the right specialist. A weak description means the wrong engineer gets spawned.
32
+
33
+ Bad: `"A frontend engineer for React"`
34
+ Good: `"Frontend engineer for Ink 7 + React 19 TUI, FSD architecture, Inversify DI, design tokens, and i18n"`
35
+
36
+ Rules:
37
+ - Name the persona explicitly
38
+ - List the top 3-5 detected technologies from Step 2
39
+ - One sentence, no padding
40
+
41
+ ## Identity paragraph
42
+
43
+ The identity paragraph sits between frontmatter and `## Abilities`. It tells the engineer who it is and what it owns in 2-3 sentences max. Not a spec, not a knowledge dump, a quick scoping statement.
44
+
45
+ Bad: 5 paragraphs of architecture details, FSD rules, design tokens, file maps, testing patterns.
46
+ Good: `"You are a frontend engineer specializing in terminal UI development with Ink 7 + React 19. You own all work in the FSD layers: src/app/, src/widgets/, src/features/, src/entities/, and src/shared/."`
47
+
48
+ Rules:
49
+ - State the persona and specialization in one sentence
50
+ - State what files or layers the engineer owns in one sentence
51
+ - Never exceed 3 sentences
52
+
53
+ ## Category rules
54
+
55
+ - Development = language/framework/UI/DI skills. Testing = test/lint/typecheck skills. Infrastructure = DevOps/CI/CD/cloud skills.
56
+ - Only include ability categories that have at least one real skill (besides Guardrails which is always present).
57
+ - Name follows `{persona}-engineer` pattern (e.g. `frontend-engineer`, `backend-engineer`).
58
+ - Read existing agents' `color:` frontmatter first: pick a color not already used.
59
+ - `warning` is reserved for the lead (fullstack) engineer, the planning agent. Never assign it to a spawned specialist.
60
+
61
+ ## Structural validation checklist
62
+
63
+ After writing the agent file, verify:
64
+
65
+ 1. Frontmatter exists: starts with `---`, has `description`, `mode: primary`, `color`, `permission` block.
66
+ 2. No `model:` field in the frontmatter. The `pc-subagent-tiers` plugin injects it.
67
+ 3. `## Abilities` is the only `##` heading. No other `##` sections exist in the file.
68
+ 4. One identity paragraph before `## Abilities`: 2-3 sentences max, not multiple paragraphs.
69
+ 5. Abilities are categorized: each line starts with `- Guardrails:`, `- Development:`, `- Testing:`, or `- Infrastructure:`. No bare `@skill-name` lines.
70
+ 6. One file only: no `.build.md`, `.fast.md`, or `.plan.md` variant was created.
71
+
72
+ If any check fails, rewrite the file to match the template exactly.
73
+
74
+ ## Skill reference validation
75
+
76
+ 1. Parse every `@skill-name` from the `## Abilities` section (excluding `@pc-guardrails-generic` and `@pc-guardrails-project` which are installed at init).
77
+ 2. For each: check `.agents/skills/<skill-name>/SKILL.md` exists.
78
+ 3. For each: check `skills-lock.json` contains the skill.
79
+ 4. If `.agents/skills/<skill-name>/SKILL.md` exists but `skills-lock.json` is missing the entry: manually patch `skills-lock.json` using the Edit tool (same procedure as in the signal mapping reference). Re-read `skills-lock.json` to confirm it is valid JSON.
80
+ 5. If `.agents/skills/<skill-name>/SKILL.md` is missing: try to install it: `npx skills add -y <owner/repo@skill-name>` (search `skills-lock.json` or `npx skills find` for the owner/repo). If install fails or the skill can't be found on skills.sh, remove the reference from the file, warn the user, and note it in the summary.
81
+ 6. Re-read the file to confirm all remaining `@skill-name` references are valid.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: pc-make-evidence-scaffold
3
+ description: DEPRECATED. Visual evidence is now built into pc-ops-evidence using playwright-cli + pnpm run dev. No per-project scaffold is needed. This skill is kept for backward compatibility but should not be used.
4
+ license: MIT
5
+ ---
6
+
7
+ # DEPRECATED
8
+
9
+ This skill is no longer needed. Visual evidence uses a two-phase architecture:
10
+
11
+ 1. **Agent phase:** `pc-ops-evidence` writes a `capturePlan` in `evidence.json` (the agent sandbox cannot run Docker or headless Chromium)
12
+ 2. **CI phase:** A separate "Visual evidence" CI workflow reads the capturePlan and captures screenshots on a runner with full Docker and Chrome access
13
+
14
+ No per-project scaffold, fixture apps, or scenario registries are required. The `pc-ops-evidence` skill handles everything generically.
15
+
16
+ If you previously ran `/make-evidence-scaffold` and have a `src/visual-evidence/` directory or `visual-evidence` scripts in `package.json`, you can delete them — the new system does not use them.
17
+
18
+ To capture evidence for a change, just run `/ops-evidence` or let `/plan-goal` handle it automatically.