@plainconceptsplatform/agent-harness 2.7.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +12 -6
  2. package/cli/commands/migrate.js +1 -1
  3. package/cli/presets/quota.json +6 -2
  4. package/cli/steps/copy/opencode-json.js +260 -135
  5. package/cli/steps/copy/skills.js +12 -2
  6. package/cli/steps/optimization/quota.js +36 -20
  7. package/cli/utils/copy.js +0 -1
  8. package/harness/.opencode/_gitignore +9 -9
  9. package/harness/.opencode/package.json +1 -5
  10. package/harness/.opencode/plugins/pc-subagent-monitor.js +144 -179
  11. package/harness/.opencode/plugins/pc-subagent-tiers.js +216 -248
  12. package/harness/.opencode/plugins/pc-system-reminders.js +386 -434
  13. package/harness/opencode.jsonc +21 -32
  14. package/package.json +3 -1
  15. package/skills/README.md +18 -0
  16. package/skills/agent-harness-cli/SKILL.md +86 -0
  17. package/skills/pc-guardrails-generic/SKILL.md +52 -0
  18. package/{harness/.agents/skills → skills}/pc-make-architecture/SKILL.md +1 -0
  19. package/skills/pc-make-architecture/structure-template.md +64 -0
  20. package/{harness/.agents/skills → skills}/pc-make-engineer/SKILL.md +59 -59
  21. package/{harness/.agents/skills → skills}/pc-make-engineer/template.md +36 -42
  22. package/{harness/.agents/skills → skills}/pc-make-guardrails/SKILL.md +1 -0
  23. package/{harness/.agents/skills → skills}/pc-make-guardrails/category-reference.md +40 -1
  24. package/harness/.agents/skills/pc-guardrails-generic/SKILL.md +0 -47
  25. package/harness/.agents/skills/pc-make-architecture/structure-template.md +0 -38
  26. package/harness/.agents/skills/pc-make-evidence-scaffold/SKILL.md +0 -18
  27. package/harness/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +0 -29
  28. package/harness/.opencode/commands/make-evidence-scaffold.md +0 -5
  29. package/harness/.opencode/tui/pc-subagents.tsx +0 -98
  30. package/harness/.opencode/tui.json +0 -6
  31. /package/{harness/.agents/skills → skills}/browser-automation/SKILL.md +0 -0
  32. /package/{harness/.agents/skills → skills}/pc-guardrails-project/SKILL.md +0 -0
  33. /package/{harness/.agents/skills → skills}/pc-make-design/SKILL.md +0 -0
  34. /package/{harness/.agents/skills → skills}/pc-make-engineer/signal-mapping.md +0 -0
  35. /package/{harness/.agents/skills → skills}/pc-make-merge-risk-assess/SKILL.md +0 -0
  36. /package/{harness/.agents/skills → skills}/pc-make-merge-risk-assess/category-reference.md +0 -0
  37. /package/{harness/.agents/skills → skills}/pc-make-user-model/SKILL.md +0 -0
  38. /package/{harness/.agents/skills → skills}/pc-ops-evidence/SKILL.md +0 -0
  39. /package/{harness/.agents/skills → skills}/pc-ops-ship/SKILL.md +0 -0
  40. /package/{harness/.agents/skills → skills}/pc-plan-apply/SKILL.md +0 -0
  41. /package/{harness/.agents/skills → skills}/pc-plan-apply/simple-mode.md +0 -0
  42. /package/{harness/.agents/skills → skills}/pc-plan-archive/SKILL.md +0 -0
  43. /package/{harness/.agents/skills → skills}/pc-plan-explore/SKILL.md +0 -0
  44. /package/{harness/.agents/skills → skills}/pc-plan-goal/SKILL.md +0 -0
  45. /package/{harness/.agents/skills → skills}/pc-plan-goal/branching.md +0 -0
  46. /package/{harness/.agents/skills → skills}/pc-plan-goal/failure-policy.md +0 -0
  47. /package/{harness/.agents/skills → skills}/pc-plan-goal/output-mode.md +0 -0
  48. /package/{harness/.agents/skills → skills}/pc-plan-goal/output.md +0 -0
  49. /package/{harness/.agents/skills → skills}/pc-plan-propose/SKILL.md +0 -0
  50. /package/{harness/.agents/skills → skills}/pc-plan-propose/task-annotation.md +0 -0
  51. /package/{harness/.agents/skills → skills}/pc-plan-quick/SKILL.md +0 -0
  52. /package/{harness/.agents/skills → skills}/pc-plan-story/SKILL.md +0 -0
  53. /package/{harness/.agents/skills → skills}/pc-repo-audit/SKILL.md +0 -0
  54. /package/{harness/.agents/skills → skills}/pc-repo-help/SKILL.md +0 -0
  55. /package/{harness/.agents/skills → skills}/pc-repo-initialize/SKILL.md +0 -0
  56. /package/{harness/.agents/skills → skills}/pc-repo-onboard/SKILL.md +0 -0
  57. /package/{harness/.agents/skills → skills}/pc-repo-verify/SKILL.md +0 -0
  58. /package/{harness/.agents/skills → skills}/pc-userstory-az/SKILL.md +0 -0
  59. /package/{harness/.agents/skills → skills}/pc-userstory-browser/SKILL.md +0 -0
  60. /package/{harness/.agents/skills → skills}/pc-userstory-gh/SKILL.md +0 -0
  61. /package/{harness/.agents/skills → skills}/pc-userstory-jira/SKILL.md +0 -0
@@ -1,47 +1,36 @@
1
1
  {
2
2
  "$schema": "https://opencode.ai/config.json",
3
- "instructions": [
4
- "AGENTS.md"
5
- ],
6
- "plugin": [
7
- "@mohak34/opencode-notifier@0.2.8"
8
- ],
9
3
  "mcp": {
10
- "agent-browser": {
11
- "type": "local",
12
- "command": ["agent-browser", "mcp", "--tools", "core"],
13
- "enabled": true
4
+ "servers": {
5
+ "agent-browser": {
6
+ "type": "local",
7
+ "command": ["agent-browser", "mcp", "--tools", "core"],
8
+ "disabled": false
9
+ }
10
+ },
11
+ "timeout": {
12
+ "catalog": 300000,
13
+ "execution": 300000
14
14
  }
15
15
  },
16
- "experimental": {
17
- "mcp_timeout": 300000
18
- },
19
16
  "compaction": {
20
17
  "auto": true,
21
- "prune": true,
22
- "reserved": 10000
18
+ "buffer": 10000
23
19
  },
24
- "permission": {
25
- "question": "allow",
26
- "todowrite": "allow",
27
- "skill": "allow"
28
- },
29
- "skills": {
30
- "paths": [".agents/skills"]
31
- },
32
- // build and plan are the only primaries, and plan is the default: a session
33
- // starts read-only and you switch to build once you know what to change.
34
- // The pc-subagent-tiers plugin
35
- // regenerates .opencode/agents/{build,plan}.md from fullstack-engineer.md on
36
- // every startup and overrides these two entries with the resolved tier model,
37
- // so what is here is only the floor if the plugin cannot run. Every engineer
38
- // is mode: subagent and reached through task(), never picked by a human.
20
+ "permissions": [
21
+ { "action": "question", "resource": "*", "effect": "allow" },
22
+ { "action": "skill", "resource": "*", "effect": "allow" }
23
+ ],
24
+ "skills": [".agents/skills"],
39
25
  "default_agent": "plan",
40
- "agent": {
26
+ "agents": {
41
27
  "build": { "mode": "primary" },
42
28
  "plan": {
43
29
  "mode": "primary",
44
- "permission": { "edit": "deny", "task": "deny" }
30
+ "permissions": [
31
+ { "action": "edit", "resource": "*", "effect": "deny" },
32
+ { "action": "subagent", "resource": "*", "effect": "deny" }
33
+ ]
45
34
  }
46
35
  }
47
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plainconceptsplatform/agent-harness",
3
- "version": "2.7.0",
3
+ "version": "3.0.1",
4
4
  "description": "Installs the Plain Concepts Platform Harness into any codebase, and keeps it up to date. Wires OpenCode, OpenSpec, codegraph, and agentmemory into a multi-agent workflow that runs on native parallel subagents.",
5
5
  "keywords": [
6
6
  "opencode",
@@ -29,8 +29,10 @@
29
29
  "files": [
30
30
  "cli",
31
31
  "harness",
32
+ "skills",
32
33
  "!cli/**/*.test.js",
33
34
  "!harness/**/*.test.js",
35
+ "!skills/**/*.test.js",
34
36
  "!harness/**/node_modules"
35
37
  ],
36
38
  "publishConfig": {
@@ -0,0 +1,18 @@
1
+ # skills/
2
+
3
+ Two kinds of skills live here, both discoverable by `npx skills`:
4
+
5
+ | Kind | Directories | Purpose |
6
+ | --- | --- | --- |
7
+ | Installable `pc-*` + `browser-automation` | `pc-*`, `browser-automation` | What the CLI copies into a target project under `.agents/skills/` during onboarding. Plain Concepts' own skills. |
8
+ | CLI-self | `agent-harness-cli` | Skills for agents working on THIS CLI repo (driving `npx @plainconceptsplatform/agent-harness`). Never copied into target projects. |
9
+
10
+ Discoverability: any `SKILL.md` in a subdirectory here is auto-discovered by OpenCode, Claude Code, and `npx skills` (which scans `./skills/` as a recognized project-skill location).
11
+
12
+ ## Using one
13
+
14
+ Point your agent at the directory, or copy a skill into wherever your tool discovers skills:
15
+
16
+ ```bash
17
+ cp -r skills/agent-harness-cli ~/.claude/skills/
18
+ ```
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: agent-harness-cli
3
+ description: Drive the agent-harness CLI - install the Plain Concepts Platform Harness into a repository, bring an existing one up to date, set up a teammate's machine, or rerun a single step. Load when asked to install, update, or repair the Platform Harness, when a repo needs AI/agent scaffolding set up, or when a command like `npx @plainconceptsplatform/agent-harness` fails and needs diagnosing.
4
+ license: MIT
5
+ ---
6
+
7
+ # agent-harness CLI
8
+
9
+ `agent-harness` installs the **Plain Concepts Platform Harness** into a repository and keeps it up to date. The harness is Plain Concepts' own, and it is the set of files agents work from: slash commands, `pc-*` skills (the `pc-` is Plain Concepts), an agent team, OpenCode plugins, an OpenSpec workspace, and generated `ARCHITECTURE.md` and `DESIGN.md`.
10
+
11
+ Everything runs against the **current working directory**. `cd` into the target repository first; there is no `--path` flag.
12
+
13
+ ## Pick the right verb
14
+
15
+ Read the repo before running anything. `.opencode/harness.json` is the marker for "harness already installed".
16
+
17
+ | Situation | Command |
18
+ | --- | --- |
19
+ | No `.opencode/harness.json` | `npx @plainconceptsplatform/agent-harness@latest` (the install wizard) |
20
+ | Harness present, want the latest release's files | `npx @plainconceptsplatform/agent-harness@latest update` |
21
+ | Harness present, new machine or new teammate | `npx @plainconceptsplatform/agent-harness join` |
22
+ | One specific thing needs redoing | a single step command, see below |
23
+
24
+ Requires Node.js 18+.
25
+
26
+ ## The install wizard is interactive
27
+
28
+ The wizard asks about source scope, backlog and repository platform, three models, and optional token-optimization tools. **Do not run it in a non-interactive shell.** It will hang or abort. If you cannot present prompts to a human, say so and hand the command to the user rather than trying to drive it.
29
+
30
+ Everything else (`update`, and the single-step commands other than `platform`, `models`, `optimization`) runs without prompts.
31
+
32
+ ## Single-step commands
33
+
34
+ Run one step without the full wizard. Each reuses context from `.opencode/harness.json` when it needs to.
35
+
36
+ ```
37
+ clean Remove pre-existing AI files (AGENTS.md, .cursorrules, CLAUDE.md, ...)
38
+ platform Choose backlog + repository platform
39
+ copy Copy agents, skills, commands, docs into the repo
40
+ openspec Initialize the OpenSpec workspace
41
+ models Choose plan / build / fast models
42
+ optimization Configure RTK, quota, Simple English, codegraph, agentmemory, humanizer
43
+ browser Install agent-browser (npm package + its Chrome for Testing)
44
+ metadata Rewrite .opencode/harness.json
45
+ ```
46
+
47
+ `metadata` last if you ran several, because it refreshes the config the others read.
48
+
49
+ ## What lands in the repo
50
+
51
+ ```
52
+ .opencode/
53
+ harness.json harness config: platform, models, agents.maxConcurrent
54
+ harness-managed.json hash per managed file, so update spares your edits
55
+ harness.user.json per-developer model override (gitignored)
56
+ harness-run.json live subagent wave state (gitignored)
57
+ commands/ slash commands
58
+ plugins/ pc-subagent-monitor, pc-subagent-tiers, pc-system-reminders
59
+ agents/ fullstack-engineer + user-created *-engineer files
60
+ .agents/skills/ pc-* skills
61
+ AGENTS.md ARCHITECTURE.md DESIGN.md
62
+ ```
63
+
64
+ After a fresh install, the next move is `/repo-initialize` inside OpenCode. That is what generates real `ARCHITECTURE.md` and `DESIGN.md` and activates the agent team. Installing the harness alone does not do it.
65
+
66
+ ## `update` is edit-safe
67
+
68
+ `update` compares each managed file against the hash recorded in `.opencode/harness-managed.json`. Files you changed by hand are left alone and reported as preserved. Generated skills (`pc-guardrails-project`, `pc-merge-risk-assess`) are never overwritten once populated. So `update` is safe to run repeatedly, and a second consecutive run should report no changes.
69
+
70
+ ## Diagnosing failures
71
+
72
+ **"This project was set up by opencode-onboard v1".** The repo has v1 state files or `ob-*` skills. v2 renamed both and does not migrate. Re-onboard on a clean branch; do not try to rename the files by hand, because the marker comments inside the installed skills changed too.
73
+
74
+ **"No config found. Run the wizard first."** `update` or a step needs `.opencode/harness.json` and it is absent. Run the wizard.
75
+
76
+ **A platform step reports nothing and changes nothing.** Platform content is injected into `<!-- PC-PLATFORM-*-START/END -->` marker pairs. If a marker pair is missing from the target file, injection is skipped silently. Check the markers exist before concluding the step worked.
77
+
78
+ **Skills missing after install.** Skill installation ends with `npx skills experimental_install --yes`, run once at the end of the optimization step. If it failed, rerun it directly in the repo.
79
+
80
+ **Platform CLI warnings.** The harness expects `gh` (GitHub), `az` + azure-devops extension (Azure DevOps), `acli` (Jira), `glab` (GitLab), each authenticated. These are warnings, not fatal; the harness installs, but the matching `/ops-*` flows will not work until the CLI is present.
81
+
82
+ ## Rules
83
+
84
+ - Never edit `.opencode/harness.json` by hand to change models. Use `/make-user-model <tier> <model>` inside OpenCode, or the `models` step.
85
+ - Never commit `harness.user.json` or `harness-run.json`. Both belong in `.opencode/.gitignore`, which `join` verifies.
86
+ - `clean` deletes files. Confirm with the user before running it on a repo that already has AI configuration worth keeping.
@@ -0,0 +1,52 @@
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 name the optimization skills this project selected. Load each before doing any work.
10
+
11
+ ## Secrets
12
+
13
+ - Treat `.env` files as write-only: write to them when configuring, read credentials at runtime from the environment or secret store.
14
+ - Never put a credential, API key, or token in a log line, output, or commit in anything but encrypted or template form.
15
+
16
+ ## Code
17
+
18
+ - The default is zero comments. Add one only where the code is genuinely non-obvious. Past 10% comment-to-code ratio, refactor for clarity. Never add comments that restate the code, label variables, TODOs without a linked issue, commented-out code, separator banners, or auto-generated docstrings/JSDoc/XML docs unless explicitly asked.
19
+ - Never add a file that collects unrelated things — `constants.js`, `types.ts`, `utils.ts`. One responsibility per file, split by domain. A file importing from many unrelated modules is already the symptom.
20
+
21
+ ## Temporary files
22
+
23
+ - Never write outside `$REPO_ROOT` or an OS temp directory: the next agent cannot see it and nobody cleans it up. Scratch goes under `$REPO_ROOT/.opencode/.tmp/` (enforced by pc-system-reminders).
24
+ - Never report a `.tmp/` path as a deliverable. Copy or move the artifact to its repository path first. Never leave scratch files behind unless they are evidence for a failure you are reporting.
25
+
26
+ ## Tests
27
+
28
+ - Never write more tests than the change requires. A bug fix gets one regression test. A new function gets tests for its public contract, not every internal branch. Never aim for a coverage number.
29
+ - Never test framework or library internals. Test your code's contract, not that EF Core saves a tracked entity.
30
+ - Never generate integration, e2e, or snapshot tests unless explicitly asked. Mock nothing you do not own — use a fake that records state. Never add a test that duplicates a type-check or linter rule.
31
+
32
+ <!-- PC-GUARDRAILS-RTK-START -->
33
+ <!-- PC-GUARDRAILS-RTK-END -->
34
+
35
+ <!-- PC-GUARDRAILS-CODEGRAPH-START -->
36
+ <!-- PC-GUARDRAILS-CODEGRAPH-END -->
37
+
38
+ <!-- PC-GUARDRAILS-MEMORY-START -->
39
+ <!-- PC-GUARDRAILS-MEMORY-END -->
40
+
41
+ <!-- PC-GUARDRAILS-SIMPLE-ENGLISH-START -->
42
+ <!-- PC-GUARDRAILS-SIMPLE-ENGLISH-END -->
43
+
44
+ <!-- PC-GUARDRAILS-HUMANIZER-START -->
45
+ <!-- PC-GUARDRAILS-HUMANIZER-END -->
46
+
47
+ ## Engineer workflow (when spawned)
48
+
49
+ The lead puts your task IDs and their text in your prompt. Two things about that are not up to you:
50
+
51
+ - Load every skill under your `## Abilities` before you start, guardrails first, one `skill` call per `@skill-name`. Editing, shell and spawning are blocked until you have (pc-system-reminders).
52
+ - Edit only files in your assigned scope, then return: task IDs done, files changed, tests and lint result, decisions made. Then exit. Never poll for more work or claim a task the lead did not give you.
@@ -13,6 +13,7 @@ Write `ARCHITECTURE.md` in the project root from what the codebase actually cont
13
13
  - Never regenerate over a file that carries a `<!-- Last updated:` footer. That footer is what makes the next run incremental, and a full rewrite silently drops whatever a human added by hand. Read the file first and pick the mode.
14
14
  - Never analyze outside `.opencode/source-roots.json` when it exists, plus this repo's own docs and config.
15
15
  - The footer is the file's last line, and it is the run's own ISO timestamp: `<!-- Last updated: <ISO date> -->`.
16
+ - Follow the writing rules and self-check defined in the [structure template](structure-template.md). After generating, re-read each section: if a section only describes what exists without stating what breaks when its constraints are violated, rewrite it as constraint-embedded prose or cut it. The file is not written until the self-check passes.
16
17
 
17
18
  ## Modes
18
19
 
@@ -0,0 +1,64 @@
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.
39
+
40
+ ## Writing rules
41
+
42
+ These rules govern the voice and shape of every section. The ARCHITECTURE.md is the primary artifact an agent reads to understand the system's invariants — it must teach constraints, not just inventory structure. These are enforced by re-reading each section after generation (see the self-check in the skill).
43
+
44
+ 1. **Every section must answer "what breaks if this is violated," not just "what exists."** A section that only describes structure without stating the constraint it protects and the consequence of crossing it is reference material, not architecture. "The system has four modules" is structure; "Modules must not cross-reference each other in Domain or Application, and flow goes through port interfaces or domain events" is a constraint.
45
+
46
+ 2. **Architectural decisions must carry their rationale and what they superseded.** A decision table row that says "Adopt X" is a fact; "Adopt X because Y, supersedes decision Z which assumed W" is a constraint that teaches an agent why a change would be wrong. If a decision was reached after rejecting an alternative, name the alternative and why it was rejected.
47
+
48
+ 3. **State boundaries as prohibitions with consequences.** "Layering is enforced: Api → Application → Domain" is a constraint. "Api → Application → Domain" alone is a dependency list. "Only the Composition namespace in Api reaches Infrastructure" is a constraint; "Api depends on Infrastructure" is a fact. Prefer the constraint form: name the boundary, state who must not cross it, and what breaks when it is crossed.
49
+
50
+ 4. **Include what was tried and rejected, not just what was chosen.** The most valuable architecture decisions are the ones where an alternative was tested and found wanting. A section that says "dynamic sessions were rejected because they accept no volumes, cost more at scale, and are blocked by policy" teaches an agent more than "the engine runs as a container app."
51
+
52
+ 5. **Narrative over inventory.** Describe how the system behaves, what holds it together, and where the seams are. A reader who understands the constraints can infer the structure; a reader who only sees the structure cannot infer the constraints.
53
+
54
+ ## Self-check (before writing the file)
55
+
56
+ Re-read every section you are about to write. Then:
57
+
58
+ 1. **Identify inventory-only sections.** If a section describes what exists without stating what breaks when its constraints are violated, rewrite it as constraint-embedded prose or cut it.
59
+
60
+ 2. **Check decision rows.** Every row in the decisions table must carry its rationale. If a decision has no "why," it is a fact, not a decision — cut it or find the rationale.
61
+
62
+ 3. **Scan for bare dependency lists.** "Api depends on Application depends on Domain" is a fact. Rewrite it as: name the boundary, state who must not cross it, and what breaks when it is crossed.
63
+
64
+ 4. **Verify rejected alternatives are present where they matter.** If a significant architectural choice was made, the rejected alternative and the reason for rejection should be in the document. An agent that does not know what was rejected will propose it again.
@@ -1,59 +1,59 @@
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, `.opencode/agents/{persona}-engineer.md`, from the [template](template.md). The research behind it is for choosing the right skills, not for filling the file: expertise notes, architecture, conventions, file maps and workflow steps belong in skills.
8
-
9
- ## Rules
10
-
11
- - Never write the agent file before the user has confirmed the skill set and it is installed. An engineer whose abilities do not exist cannot work.
12
- - Never write `model:` or `color:`. `pc-subagent-tiers` injects both at startup, so a hand-picked colour is overwritten.
13
- - Never create `*.build.md`, `*.fast.md`, `*.plan.md`, `build.md` or `plan.md`. The plugin regenerates all of them every startup and anything written there is lost.
14
- - `mode: subagent`. Engineers are reached through `task()`, and a primary would clutter the two-entry list a human picks from.
15
- - The only `##` heading is `## Abilities`, and the identity paragraph is two or three sentences carrying no project knowledge.
16
- - Every `@skill` under `## Abilities` exists in `.agents/skills/` and in `skills-lock.json`. A name that is not installed is skipped rather than blocking the worker, so a typo costs the agent that ability in silence.
17
- - Project-local installs only: `npx skills add -y ...`, never `-g`.
18
- - At most five form questions, and only where more than one option was detected. A signal with one option is used without asking.
19
-
20
- ## Contracts
21
-
22
- Personas: `frontend`, `layout`, `backend`, `data`, `devops`, `security`, `mobile`, `api`, `qa`. A persona passed as an argument (`/make-engineer frontend`) or typed by the user is taken as given.
23
-
24
- Signals to detect: language, framework, data layer, testing, styling, architecture, i18n, CI/CD, cloud and IaC, monitoring, linting, dependency injection.
25
-
26
- Discovery needs `find-skills`, and has no fallback without it:
27
-
28
- ```bash
29
- npx skills add -y vercel-labs/skills@find-skills
30
- ```
31
-
32
- When `.opencode/agents/{persona}-engineer.md` already exists, ask before touching it:
33
-
34
- ```json
35
- {
36
- "questions": [
37
- {
38
- "header": "Overwrite engineer",
39
- "question": "An engineer named \"{persona}-engineer\" already exists. Overwrite or cancel?",
40
- "options": [
41
- { "label": "Overwrite", "description": "Rewrite the file from the template." },
42
- { "label": "Cancel", "description": "Stop. Do not modify the existing file." }
43
- ]
44
- }
45
- ]
46
- }
47
- ```
48
-
49
- `fullstack-engineer.md` is the body `pc-subagent-tiers` copies into `build.md` and `plan.md`, so every skill listed there reaches both primaries. Merge into it additively: add only skills it does not already list, put them in the category lines that already exist where they fit, and leave its frontmatter, identity paragraph and existing ability lines alone.
50
-
51
- ## Flow
52
-
53
- 1. **Persona.** Ask with the `question` tool unless it arrived as an argument. The answer decides what to detect, what to ask, and which skills to look for.
54
- 2. **Signals.** Read `.opencode/source-roots.json` (if it is missing or empty, ask which directories to scan), then `ARCHITECTURE.md`, `DESIGN.md`, and the manifests (`package.json`, `tsconfig.json`, `*.csproj`, `pyproject.toml`, `go.mod`, `Cargo.toml`). Detect what the persona needs and report the inventory.
55
- 3. **Form.** Present the detected options with the `question` tool, pre-selected and marked `(Recommended)`. For `frontend`, `backend`, `layout` and `api`, one question is architecture and patterns, whose options come from the [signal mapping](signal-mapping.md) tables.
56
- 4. **Skills.** A signal already covered by a skill in `.agents/skills/` or `skills-lock.json` needs no search. Map each remaining signal to a query through the [signal mapping](signal-mapping.md), present the candidates as one multi-select `question` grouped by category (name, one line, `owner/repo`, install count), install what the user confirms, and verify each one landed in both `.agents/skills/` and the lockfile.
57
- 5. **Write** the file from the [template](template.md).
58
- 6. **Merge** the new skills into `fullstack-engineer.md`.
59
- 7. **Report** the file created, the skills installed, the signals with no quality skill, whatever failed, and that opencode has to restart before `pc-subagent-tiers` picks the engineer up.
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, `.opencode/agents/{persona}-engineer.md`, from the [template](template.md). The research behind it is for choosing the right skills, not for filling the file: expertise notes, architecture, conventions, file maps and workflow steps belong in skills.
8
+
9
+ ## Rules
10
+
11
+ - Never write the agent file before the user has confirmed the skill set and it is installed. An engineer whose abilities do not exist cannot work.
12
+ - Never write `model:` or `color:`. `pc-subagent-tiers` injects both at startup, so a hand-picked colour is overwritten.
13
+ - Never create `*.build.md`, `*.fast.md`, `*.plan.md`, `build.md` or `plan.md`. The plugin regenerates all of them every startup and anything written there is lost.
14
+ - `mode: subagent`. Engineers are reached through the subagent tool, and a primary would clutter the two-entry list a human picks from.
15
+ - The only `##` heading is `## Abilities`, and the identity paragraph is two or three sentences carrying no project knowledge.
16
+ - Every `@skill` under `## Abilities` exists in `.agents/skills/` and in `skills-lock.json`. A name that is not installed is skipped rather than blocking the worker, so a typo costs the agent that ability in silence.
17
+ - Project-local installs only: `npx skills add -y ...`, never `-g`.
18
+ - At most five form questions, and only where more than one option was detected. A signal with one option is used without asking.
19
+
20
+ ## Contracts
21
+
22
+ Personas: `frontend`, `layout`, `backend`, `data`, `devops`, `security`, `mobile`, `api`, `qa`. A persona passed as an argument (`/make-engineer frontend`) or typed by the user is taken as given.
23
+
24
+ Signals to detect: language, framework, data layer, testing, styling, architecture, i18n, CI/CD, cloud and IaC, monitoring, linting, dependency injection.
25
+
26
+ Discovery needs `find-skills`, and has no fallback without it:
27
+
28
+ ```bash
29
+ npx skills add -y vercel-labs/skills@find-skills
30
+ ```
31
+
32
+ When `.opencode/agents/{persona}-engineer.md` already exists, ask before touching it:
33
+
34
+ ```json
35
+ {
36
+ "questions": [
37
+ {
38
+ "header": "Overwrite engineer",
39
+ "question": "An engineer named \"{persona}-engineer\" already exists. Overwrite or cancel?",
40
+ "options": [
41
+ { "label": "Overwrite", "description": "Rewrite the file from the template." },
42
+ { "label": "Cancel", "description": "Stop. Do not modify the existing file." }
43
+ ]
44
+ }
45
+ ]
46
+ }
47
+ ```
48
+
49
+ `fullstack-engineer.md` is the body `pc-subagent-tiers` copies into `build.md` and `plan.md`, so every skill listed there reaches both primaries. Merge into it additively: add only skills it does not already list, put them in the category lines that already exist where they fit, and leave its frontmatter, identity paragraph and existing ability lines alone.
50
+
51
+ ## Flow
52
+
53
+ 1. **Persona.** Ask with the `question` tool unless it arrived as an argument. The answer decides what to detect, what to ask, and which skills to look for.
54
+ 2. **Signals.** Read `.opencode/source-roots.json` (if it is missing or empty, ask which directories to scan), then `ARCHITECTURE.md`, `DESIGN.md`, and the manifests (`package.json`, `tsconfig.json`, `*.csproj`, `pyproject.toml`, `go.mod`, `Cargo.toml`). Detect what the persona needs and report the inventory.
55
+ 3. **Form.** Present the detected options with the `question` tool, pre-selected and marked `(Recommended)`. For `frontend`, `backend`, `layout` and `api`, one question is architecture and patterns, whose options come from the [signal mapping](signal-mapping.md) tables.
56
+ 4. **Skills.** A signal already covered by a skill in `.agents/skills/` or `skills-lock.json` needs no search. Map each remaining signal to a query through the [signal mapping](signal-mapping.md), present the candidates as one multi-select `question` grouped by category (name, one line, `owner/repo`, install count), install what the user confirms, and verify each one landed in both `.agents/skills/` and the lockfile.
57
+ 5. **Write** the file from the [template](template.md).
58
+ 6. **Merge** the new skills into `fullstack-engineer.md`.
59
+ 7. **Report** the file created, the skills installed, the signals with no quality skill, whatever failed, and that opencode has to restart before `pc-subagent-tiers` picks the engineer up.
@@ -1,42 +1,36 @@
1
- # Agent file template
2
-
3
- The whole file, with nothing else in it:
4
-
5
- ```markdown
6
- ---
7
- description: <one sentence naming the persona + top 3-5 detected technologies>
8
- mode: subagent
9
- permission:
10
- edit: allow
11
- bash: allow
12
- read: allow
13
- glob: allow
14
- grep: allow
15
- ---
16
-
17
- <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.>
18
-
19
- ## Abilities
20
- - Guardrails: @pc-guardrails-generic, @pc-guardrails-project
21
- - Development: <@installed-skill-1>, <@installed-skill-2>, ...
22
- - Testing: <@installed-skill-for-testing>, ...
23
- - Infrastructure: <@installed-skill-for-devops>, ...
24
- ```
25
-
26
- Replace every `<...>` placeholder with real values, and drop any category line with no skills in it (Guardrails always stays). Development is language, framework, UI and DI skills; Testing is test, lint and typecheck skills; Infrastructure is DevOps, CI/CD and cloud skills.
27
-
28
- ## Description quality bar
29
-
30
- `description:` is the matching key for `/plan-apply`: the lead compares a task's domain text against it to pick a specialist, so a vague one gets the wrong engineer spawned.
31
-
32
- Bad: `"A frontend engineer for React"`
33
-
34
- Good: `"Frontend engineer for Ink 7 + React 19 TUI, FSD architecture, Inversify DI, design tokens, and i18n"`
35
-
36
- Name the persona, list the three to five technologies actually detected, one sentence, no padding.
37
-
38
- ## Identity paragraph
39
-
40
- Two or three sentences: who the engineer is, and what files or layers it owns. A knowledge dump here is knowledge the lead cannot reuse and the engineer did not ask for.
41
-
42
- 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/."`
1
+ # Agent file template
2
+
3
+ The whole file, with nothing else in it:
4
+
5
+ ```markdown
6
+ ---
7
+ description: <one sentence naming the persona + top 3-5 detected technologies>
8
+ mode: subagent
9
+ ---
10
+
11
+ <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.>
12
+
13
+ ## Abilities
14
+ - Guardrails: @pc-guardrails-generic, @pc-guardrails-project
15
+ - Development: <@installed-skill-1>, <@installed-skill-2>, ...
16
+ - Testing: <@installed-skill-for-testing>, ...
17
+ - Infrastructure: <@installed-skill-for-devops>, ...
18
+ ```
19
+
20
+ Replace every `<...>` placeholder with real values, and drop any category line with no skills in it (Guardrails always stays). Development is language, framework, UI and DI skills; Testing is test, lint and typecheck skills; Infrastructure is DevOps, CI/CD and cloud skills.
21
+
22
+ ## Description quality bar
23
+
24
+ `description:` is the matching key for `/plan-apply`: the lead compares a task's domain text against it to pick a specialist, so a vague one gets the wrong engineer spawned.
25
+
26
+ Bad: `"A frontend engineer for React"`
27
+
28
+ Good: `"Frontend engineer for Ink 7 + React 19 TUI, FSD architecture, Inversify DI, design tokens, and i18n"`
29
+
30
+ Name the persona, list the three to five technologies actually detected, one sentence, no padding.
31
+
32
+ ## Identity paragraph
33
+
34
+ Two or three sentences: who the engineer is, and what files or layers it owns. A knowledge dump here is knowledge the lead cannot reuse and the engineer did not ask for.
35
+
36
+ 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/."`
@@ -14,6 +14,7 @@ Turn this project's own documentation into `.agents/skills/pc-guardrails-project
14
14
  - Never invent a rule the project does not state somewhere. A guardrail that came from nowhere is one nobody agreed to, and it will be followed anyway.
15
15
  - Never write an empty category. Omit it.
16
16
  - Never touch a tier variant (`*-engineer.build.md`, `*-engineer.fast.md`, `*-engineer.plan.md`): they are regenerated from the base templates every startup.
17
+ - Before writing the file, run the self-check defined in the [category reference](category-reference.md): count rules, cut positive phrasing and reference facts, strip anything already enforced by tooling or by `pc-guardrails-generic`, and re-count. The file is not written until the self-check passes.
17
18
 
18
19
  ## Sources
19
20
 
@@ -20,12 +20,26 @@ Each rule must be:
20
20
  - **Concrete**: "Use `pnpm` not `npm`" not "Use the right package manager".
21
21
  - **Evidence-based**: derived from the files and code graph you analyzed. Never invent a rule the project does not state or demonstrate somewhere.
22
22
  - **Not enforced elsewhere.** Skip anything the formatter, linter, type checker, test suite, CI gate or a harness plugin already fails the build on. A rule restating `biome.json` is read on every load and changes nothing: the build was going to catch it. Write the rules that nothing but a careful reader would catch.
23
- - **Not already in `pc-guardrails-generic`.** That skill loads alongside this one, every request. Secrets, comment discipline, scratch-file location and one-responsibility-per-file are its rules, not this file's.
23
+ - **Not already in `pc-guardrails-generic`.** That skill loads alongside this one, every request. Secrets, zero-comment default, scratch-file location, one-responsibility-per-file, minimal-test discipline, and the engineer workflow are its rules, not this file's.
24
24
 
25
25
  **At most 40 rules, across all categories.** Rank by what a violation costs and cut from the bottom; a category with nothing consequential in it gets no rules at all. This cap is the point of the exercise, not tidiness: compliance falls away as a rule file grows, so the 41st rule does not just cost its own tokens, it dilutes the 40 that matter. If more than 40 survive every bar above, the excess is a sign the project's constraints belong in a linter rule or a CI check instead.
26
26
 
27
+ ## Contrastive example
28
+
29
+ **Bad** (reference fact — cut):
30
+ > - The SQL Server database name is `myapp`, lowercase.
31
+
32
+ The agent reads the connection string in config. It costs tokens on every load and the agent cannot "break" it.
33
+
34
+ **Good** (negative constraint with consequence — keep):
35
+ > - Never add a cached column for a value that is derived from another entity; a later edit to the source leaves the cache stale, and nothing in the build catches it.
36
+
37
+ The agent could break this without noticing, nothing mechanically enforces it, and the consequence is stated.
38
+
27
39
  ## Skill template
28
40
 
41
+ Each section holds constraints an agent could break without noticing, not reference facts. "Naming Conventions" does not mean "list how files are named" — it means "name the conventions whose violation is silent and costly." "Build & Deployment" does not mean "list the build commands" — it means "name the build rules a developer could violate without CI catching it." If a section has only reference facts, omit it entirely.
42
+
29
43
  Write (or update) `.agents/skills/pc-guardrails-project/SKILL.md`:
30
44
 
31
45
  ```markdown
@@ -71,3 +85,28 @@ license: MIT
71
85
  ```
72
86
 
73
87
  Only include sections that have real rules. Omit empty sections.
88
+
89
+ ## Self-check (before writing the file)
90
+
91
+ Re-read the output you are about to write. Then:
92
+
93
+ 1. **Count the rules** (every bullet under every section). If there are more than 40, cut from the bottom — rank by what a violation costs and remove the cheapest until you are at or under 40. A rule file past 40 dilutes the ones that matter.
94
+
95
+ 2. **Scan for positive phrasing and reference facts.** Cut or rewrite any rule that:
96
+ - States what something is named, rather than what must not be named that way and why.
97
+ - Lists a port number, a database name, a package version, a SDK version, or a connection string. The agent discovers these by reading config.
98
+ - Describes how something works (e.g. "auth uses a smart scheme that forwards to JWT or Cookies"), rather than what must not be done with it.
99
+ - Restates a project's tech stack as a list ("Frontend: React 19, Next.js 15, TypeScript…"). That is reference material, not a constraint.
100
+
101
+ 3. **Strip anything already enforced by tooling.** Remove a rule if any of these already fails the build on its violation:
102
+ - Biome / ESLint / Prettier / Steiger / lint:fsd
103
+ - NetArchTest / architecture test projects
104
+ - Semgrep / Trivy / TruffleHog / SBOM checks
105
+ - Coverage gates (`scripts/check-coverage.mjs`)
106
+ - `.editorconfig`, `Directory.Build.props`, NuGet audit gates
107
+ - CI workflow steps (`app-ci.yml`, `ci.yml`)
108
+ - GitHub branch protection / required checks. If the build catches it, the rule costs tokens and adds nothing. The only exception is a rule whose enforcement is partial or non-obvious (e.g. architecture tests enforce layering but a developer could still import a namespace through reflection or a transitive dependency — that nuance is worth a rule).
109
+
110
+ 4. **Strip anything already in `pc-guardrails-generic`.** That skill loads on every request alongside this one. Its rules are: secrets discipline, zero-comment default (WHY not WHAT, 10% ceiling, no auto-generated docstrings), scratch-file location, one-responsibility-per-file, minimal-test discipline (one regression test per bug, no framework/library tests, no integration/e2e/snapshot unless asked, no mock-assertion of third-party calls), and the engineer workflow. Do not restate any of them here.
111
+
112
+ 5. **Re-count after cutting.** If you are still over 40, you are writing reference material, not constraints. Cut harder.