@plainconceptsplatform/agent-harness 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +435 -437
- package/cli/fragments/archive/az.md +97 -95
- package/cli/fragments/archive/gh.md +96 -94
- package/cli/fragments/archive/gl.md +96 -94
- package/cli/fragments/archive/none.md +75 -73
- package/cli/fragments/guardrails/codegraph.md +5 -7
- package/cli/fragments/guardrails/humanizer.md +4 -4
- package/cli/fragments/guardrails/memory.md +4 -4
- package/cli/fragments/guardrails/rtk.md +3 -3
- package/cli/fragments/guardrails/simple-english.md +4 -4
- package/cli/fragments/ops-backlog/az.md +1 -1
- package/cli/fragments/ops-backlog/gh.md +1 -1
- package/cli/fragments/ops-backlog/jira.md +1 -1
- package/cli/fragments/ops-evidence/az.md +44 -41
- package/cli/fragments/ops-evidence/gh.md +54 -53
- package/cli/fragments/ops-evidence/jira.md +42 -38
- package/cli/fragments/ops-review/az.md +1 -1
- package/cli/fragments/ops-review/gh.md +1 -1
- package/cli/fragments/ops-review/gl.md +1 -1
- package/cli/fragments/ops-ship/az.md +81 -80
- package/cli/fragments/ops-ship/gh.md +68 -68
- package/cli/fragments/ops-ship/gl.md +85 -85
- package/cli/presets/agents-content.json +34 -53
- package/cli/steps/copy/agents.js +18 -17
- package/cli/steps/copy/opencode-json.js +5 -1
- package/cli/steps/copy/skills.js +98 -5
- package/cli/steps/optimization/patch-guardrails.js +5 -3
- package/cli/utils/copy.js +8 -3
- package/cli/utils/update-manifest.js +28 -2
- package/harness/.agents/skills/pc-guardrails-generic/SKILL.md +47 -68
- package/harness/.agents/skills/pc-make-architecture/SKILL.md +31 -51
- package/harness/.agents/skills/pc-make-design/SKILL.md +45 -68
- package/harness/.agents/skills/pc-make-engineer/SKILL.md +59 -219
- package/harness/.agents/skills/pc-make-engineer/signal-mapping.md +53 -68
- package/harness/.agents/skills/pc-make-engineer/template.md +42 -80
- package/harness/.agents/skills/pc-make-evidence-scaffold/SKILL.md +18 -18
- package/harness/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +29 -29
- package/harness/.agents/skills/pc-make-guardrails/SKILL.md +43 -74
- package/harness/.agents/skills/pc-make-guardrails/category-reference.md +10 -5
- package/harness/.agents/skills/pc-make-merge-risk-assess/category-reference.md +26 -7
- package/harness/.agents/skills/pc-make-user-model/SKILL.md +56 -66
- package/harness/.agents/skills/pc-ops-evidence/SKILL.md +133 -127
- package/harness/.agents/skills/pc-plan-apply/SKILL.md +14 -5
- package/harness/.agents/skills/pc-plan-apply/simple-mode.md +21 -21
- package/harness/.agents/skills/pc-plan-archive/SKILL.md +66 -66
- package/harness/.agents/skills/pc-plan-explore/SKILL.md +19 -2
- package/harness/.agents/skills/pc-plan-goal/SKILL.md +11 -7
- package/harness/.agents/skills/pc-plan-goal/output-mode.md +1 -0
- package/harness/.agents/skills/pc-plan-goal/output.md +71 -65
- package/harness/.agents/skills/pc-plan-propose/SKILL.md +1 -1
- package/harness/.agents/skills/pc-plan-quick/SKILL.md +46 -62
- package/harness/.agents/skills/pc-plan-story/SKILL.md +48 -149
- package/harness/.agents/skills/pc-repo-help/SKILL.md +89 -91
- package/harness/.agents/skills/pc-repo-initialize/SKILL.md +112 -130
- package/harness/.agents/skills/pc-repo-onboard/SKILL.md +32 -87
- package/harness/.agents/skills/pc-repo-verify/SKILL.md +2 -0
- package/harness/.agents/skills/pc-userstory-az/SKILL.md +71 -157
- package/harness/.agents/skills/pc-userstory-browser/SKILL.md +50 -122
- package/harness/.agents/skills/pc-userstory-gh/SKILL.md +63 -120
- package/harness/.agents/skills/pc-userstory-jira/SKILL.md +74 -131
- package/harness/.opencode/commands/init.md +5 -5
- package/harness/.opencode/commands/make-architecture.md +5 -5
- package/harness/.opencode/commands/make-design.md +5 -5
- package/harness/.opencode/commands/make-engineer.md +5 -5
- package/harness/.opencode/commands/make-evidence-scaffold.md +5 -5
- package/harness/.opencode/commands/make-guardrails.md +5 -5
- package/harness/.opencode/commands/make-user-model.md +5 -5
- package/harness/.opencode/commands/plan-apply.md +9 -9
- package/harness/.opencode/commands/plan-goal.md +5 -5
- package/harness/.opencode/commands/plan-quick.md +5 -5
- package/harness/.opencode/commands/plan-story.md +9 -9
- package/harness/.opencode/commands/repo-audit.md +5 -5
- package/harness/.opencode/commands/repo-initialize.md +5 -5
- package/harness/.opencode/commands/repo-onboard.md +5 -5
- package/harness/.opencode/commands/repo-verify.md +5 -5
- package/harness/.opencode/plugins/pc-subagent-monitor.js +82 -2
- package/harness/.opencode/plugins/pc-subagent-tiers.js +9 -6
- package/harness/.opencode/plugins/pc-system-reminders.js +312 -3
- package/harness/AGENTS.md +49 -71
- package/harness/opencode.jsonc +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# Evidence contract
|
|
2
|
-
|
|
3
|
-
Evidence captured by `/
|
|
4
|
-
- ordered capture images (`01-{label}.png/webp`, ...) and/or `flow.gif`
|
|
5
|
-
- `evidence.json`: the manifest, schema below.
|
|
6
|
-
|
|
7
|
-
## version 1 schema
|
|
8
|
-
|
|
9
|
-
```jsonc
|
|
10
|
-
{
|
|
11
|
-
"version": 1,
|
|
12
|
-
"changeId": "...",
|
|
13
|
-
"required": true,
|
|
14
|
-
"status": "passed", // passed | skipped | failed | blocked
|
|
15
|
-
"assets": [ { "type": "screenshot", "path": "openspec/changes/archive/<dated>-<id>/evidence/01-final.png", "caption": "...", "bytes": 0, "format": "png" } ],
|
|
16
|
-
"reason": "...", // skipped | blocked
|
|
17
|
-
"failedStep": "...", // failed
|
|
18
|
-
"prMarkdown": "## Evidence ..."
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Statuses
|
|
23
|
-
|
|
24
|
-
- `passed`: evidence required and produced.
|
|
25
|
-
- `skipped`: evidence not required (see decision rule). Exit success.
|
|
26
|
-
- `blocked`: required but could not run (no harness, app won't start, budget exceeded). Not a skip. Surface it.
|
|
27
|
-
- `failed`: a project harness ran and its assertions failed. Surface it.
|
|
28
|
-
|
|
29
|
-
`blocked` (required but unrunnable) is never treated as a skip.
|
|
1
|
+
# Evidence contract
|
|
2
|
+
|
|
3
|
+
Evidence captured by `/ops-evidence` lives at `openspec/changes/archive/<dated>-<id>/evidence/`. A standalone pre-archive capture may use `openspec/changes/<id>/evidence/`, but archive moves it into the archived change before publication. That folder contains only:
|
|
4
|
+
- ordered capture images (`01-{label}.png/webp`, ...) and/or `flow.gif`
|
|
5
|
+
- `evidence.json`: the manifest, schema below.
|
|
6
|
+
|
|
7
|
+
## version 1 schema
|
|
8
|
+
|
|
9
|
+
```jsonc
|
|
10
|
+
{
|
|
11
|
+
"version": 1,
|
|
12
|
+
"changeId": "...",
|
|
13
|
+
"required": true,
|
|
14
|
+
"status": "passed", // passed | skipped | failed | blocked
|
|
15
|
+
"assets": [ { "type": "screenshot", "path": "openspec/changes/archive/<dated>-<id>/evidence/01-final.png", "caption": "...", "bytes": 0, "format": "png" } ],
|
|
16
|
+
"reason": "...", // skipped | blocked
|
|
17
|
+
"failedStep": "...", // failed
|
|
18
|
+
"prMarkdown": "## Evidence ..."
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Statuses
|
|
23
|
+
|
|
24
|
+
- `passed`: evidence required and produced.
|
|
25
|
+
- `skipped`: evidence not required (see decision rule). Exit success.
|
|
26
|
+
- `blocked`: required but could not run (no harness, app won't start, budget exceeded). Not a skip. Surface it.
|
|
27
|
+
- `failed`: a project harness ran and its assertions failed. Surface it.
|
|
28
|
+
|
|
29
|
+
`blocked` (required but unrunnable) is never treated as a skip.
|
|
@@ -1,74 +1,43 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pc-make-guardrails
|
|
3
|
-
description: Generate or update the pc-guardrails-project skill from ARCHITECTURE.md and relevant project files, then wire it into every engineer agent. Invoked by the /make-guardrails command and the repo-initialize flow.
|
|
4
|
-
license: MIT
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Make Guardrails
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
3. **Extract guardrails**
|
|
45
|
-
|
|
46
|
-
From the documents and code graph analysis, extract concrete, actionable rules. Follow the [category reference](category-reference.md) for the full list of categories, rule quality standards, and the skill file template.
|
|
47
|
-
|
|
48
|
-
4. **Write the skill**
|
|
49
|
-
|
|
50
|
-
Write (or update) `.agents/skills/pc-guardrails-project/SKILL.md` using the template from the [category reference](category-reference.md). Only include sections that have real rules. Omit empty sections.
|
|
51
|
-
|
|
52
|
-
5. **Update agents**
|
|
53
|
-
|
|
54
|
-
For every `*-engineer.md` in `.opencode/agents/`, add `@pc-guardrails-project` to the Guardrails ability line (skip if already present). Keep the line's existing entries exactly as they are: only insert `@pc-guardrails-project` after `@pc-guardrails-generic`, using this pattern:
|
|
55
|
-
```markdown
|
|
56
|
-
## Abilities
|
|
57
|
-
- Guardrails: @pc-guardrails-generic, @pc-guardrails-project[, ...existing entries unchanged]
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Exclude tier variant files (`*-engineer.build.md`, `*-engineer.fast.md`, `*-engineer.plan.md`): they are generated copies; only update the base templates.
|
|
61
|
-
|
|
62
|
-
6. **Store summary in configured persistent context**
|
|
63
|
-
|
|
64
|
-
`write_note` MCP tool with title `guardrails-summary` containing:
|
|
65
|
-
- The ISO timestamp of this run
|
|
66
|
-
- Number of rules per category
|
|
67
|
-
|
|
68
|
-
7. **Report**
|
|
69
|
-
|
|
70
|
-
Tell the user:
|
|
71
|
-
- Whether the skill was generated or updated (and which categories changed)
|
|
72
|
-
- Number of rules extracted per category
|
|
73
|
-
- Number of agent files updated
|
|
74
|
-
- Tip: "Rerun `/make-guardrails` any time the architecture or conventions change significantly."
|
|
1
|
+
---
|
|
2
|
+
name: pc-make-guardrails
|
|
3
|
+
description: Generate or update the pc-guardrails-project skill from ARCHITECTURE.md and relevant project files, then wire it into every engineer agent. Invoked by the /make-guardrails command and the repo-initialize flow.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Make Guardrails
|
|
8
|
+
|
|
9
|
+
Turn this project's own documentation into `.agents/skills/pc-guardrails-project/SKILL.md`: the rules and constraints its agents work under, per the [category reference](category-reference.md).
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
13
|
+
- Never regenerate over a file that carries a `<!-- Last updated:` footer. `pc-guardrails-project` is the one skill a team is expected to hand-edit, and a full rewrite silently drops that work. Read the file first and pick the mode.
|
|
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
|
+
- Never write an empty category. Omit it.
|
|
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
|
+
|
|
18
|
+
## Sources
|
|
19
|
+
|
|
20
|
+
`ARCHITECTURE.md` is the primary one. Then whatever else exists: `DESIGN.md`, `AGENTS.md`, `README.md`, `CONTRIBUTING.md`, `.opencode/harness.json`, `openspec/config.yaml`, the root manifests (`package.json`, `tsconfig.json`, `biome.json`, `.eslintrc*`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`), and the CI definitions (`.github/workflows/*`, `azure-pipelines.yml`). Lint and formatter config is where the conventions are actually enforced, so it outranks any document that describes them.
|
|
21
|
+
|
|
22
|
+
## Modes
|
|
23
|
+
|
|
24
|
+
| The existing skill file | Mode |
|
|
25
|
+
|---|---|
|
|
26
|
+
| Missing | Generate |
|
|
27
|
+
| Has a `<!-- Last updated:` footer | Update |
|
|
28
|
+
| Exists with no footer | Generate |
|
|
29
|
+
|
|
30
|
+
**Update.** If `ARCHITECTURE.md` has not changed since the footer date, say "Guardrails up to date" and stop. Otherwise `git log --oneline --since="<footer date>" -- <config, lint config, CI workflows>`, update only the affected categories, and leave the rest, including hand-written rules, as they stand. A new architecture, framework or platform is a Generate.
|
|
31
|
+
|
|
32
|
+
## Wiring
|
|
33
|
+
|
|
34
|
+
Every `*-engineer.md` in `.opencode/agents/` gets `@pc-guardrails-project` on its Guardrails line, right after `@pc-guardrails-generic`, with its existing entries untouched:
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
## Abilities
|
|
38
|
+
- Guardrails: @pc-guardrails-generic, @pc-guardrails-project[, ...existing entries unchanged]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Report
|
|
42
|
+
|
|
43
|
+
Whether the skill was generated or updated and which categories changed, the rule count per category, how many agent files were wired, and that `/make-guardrails` can be re-run whenever the conventions move.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Guardrails category reference
|
|
2
2
|
|
|
3
|
-
From the documents and code graph analysis, extract
|
|
3
|
+
From the documents and code graph analysis, extract the rules an agent could break without noticing. Only include a category if you found real evidence for it.
|
|
4
4
|
|
|
5
5
|
- Architecture constraints: layer boundaries, module dependencies, forbidden imports, directory ownership rules (e.g. "src/api/ must not import from src/ui/"). Verify actual import boundaries with the project-selected analysis tools.
|
|
6
|
-
- File organization:
|
|
6
|
+
- File organization: the god-files and dumping-ground constants this project has already accumulated, named. The general principle is in `pc-guardrails-generic`; what belongs here is where this codebase keeps breaking it.
|
|
7
7
|
- Naming conventions: file naming, component naming, API route conventions, branch naming
|
|
8
8
|
- Code style: formatter config, lint rules, import ordering, max line length. Derive from actual config files.
|
|
9
9
|
- Testing rules: test file locations, naming, coverage gates, what must be tested before merge
|
|
@@ -15,9 +15,14 @@ From the documents and code graph analysis, extract concrete, actionable rules i
|
|
|
15
15
|
- Domain-specific rules: anything in `openspec/config.yaml` context or `ARCHITECTURE.md` constraints/risks sections
|
|
16
16
|
|
|
17
17
|
Each rule must be:
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
18
|
+
|
|
19
|
+
- **Negative.** State the boundary and what breaks when it is crossed, not the behaviour you want: `Never import Microsoft.EntityFrameworkCore.* in Application; it is a layer violation and the build does not catch it`, not `Keep Application framework-free`. A prohibition removes an option; a preference competes with everything else the model knows about writing code, and loses.
|
|
20
|
+
- **Concrete**: "Use `pnpm` not `npm`" not "Use the right package manager".
|
|
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
|
+
- **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.
|
|
24
|
+
|
|
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.
|
|
21
26
|
|
|
22
27
|
## Skill template
|
|
23
28
|
|
|
@@ -2,22 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
From the project guardrails, architecture, and code analysis, extract concrete, testable risk indicators in these categories. Only include a category if you found real evidence for it.
|
|
4
4
|
|
|
5
|
-
- **Calculation integrity**: changes to
|
|
5
|
+
- **Calculation integrity**: changes to whatever this project computes and cannot get wrong — an engine, its formula inputs, its reference tables, its assumptions. Any file under that namespace is an indicator. See the worked example below for the shape.
|
|
6
6
|
- **Audit & compliance**: modifications to audit appenders, audit log storage, hash-chaining, or tamper-evident mechanisms. Any change that could affect regulatory traceability.
|
|
7
7
|
- **Authentication & authorization**: changes to auth middleware, permission checks, role definitions, token issuance, or session management. Changes to `.RequirePermission()` calls or permission seed data.
|
|
8
8
|
- **Data schema & migration**: EF Core entity changes, new migrations, column type changes, constraint additions/removals, or seed data modifications. Schema changes are always risky because they affect production data.
|
|
9
|
-
- **Reference data versioning**: changes to effective-dated configuration,
|
|
9
|
+
- **Reference data versioning**: changes to effective-dated configuration, rate or band tables, assumptions, or any constant an output depends on. Changes to versioning or snapshot logic.
|
|
10
10
|
- **Cross-boundary violations**: imports that break the layering direction (e.g. Domain referencing Application, Application referencing ASP.NET), cross-context data access bypassing ports.
|
|
11
11
|
- **Security surface**: new endpoints without authorization, input validation removal, secrets exposure, dependency version downgrades, or changes to security scanning configuration.
|
|
12
|
-
- **Financial correctness**: any change that could produce
|
|
12
|
+
- **Financial correctness**: where the project handles money, any change that could produce a wrong amount — tax, currency, precision, rounding, or the type money is stored in.
|
|
13
13
|
- **State machine transitions**: modifications to entity lifecycle transitions (e.g. quote status flow, approval gates, sign-off logic). Breaking a state machine can leave data in unrecoverable states.
|
|
14
14
|
- **Integration contracts**: changes to external API contracts, webhook payloads, or CRM integration ports. Breaking integrations can cascade to downstream systems.
|
|
15
15
|
|
|
16
16
|
Each indicator must be:
|
|
17
|
-
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
17
|
+
|
|
18
|
+
- **Concrete**: name the type, method or path — "Changes to `OrderTotal.Calculate`" not "Changes to important calculations".
|
|
19
|
+
- **Evidence-based**: derived from the project guardrails, the architecture, and actual code paths.
|
|
20
|
+
- **Detectable**: findable by reading the PR diff alone — file paths, class names, method names, import changes.
|
|
21
|
+
- **Exclusive**: each indicator belongs to one category. Never repeat it in a second.
|
|
22
|
+
- **Not enforced elsewhere.** Skip anything CI already fails the build on. An indicator that duplicates a required check adds a human review the pipeline did not need.
|
|
23
|
+
|
|
24
|
+
**At most 40 indicators, across all categories.** Rank by what a missed regression costs and cut from the bottom. A file this size is read on every merge decision, and past roughly this many, compliance drops regardless of how good each line is — so an indicator that will not change a verdict is worse than absent.
|
|
25
|
+
|
|
26
|
+
## Worked example
|
|
27
|
+
|
|
28
|
+
One project's calculation-integrity indicator, for shape only. Replace it with
|
|
29
|
+
this repository's own: edits between the `PC-PROJECT-EXAMPLE` markers are
|
|
30
|
+
carried over when the harness updates, and anything outside them is replaced by
|
|
31
|
+
the shipped version.
|
|
32
|
+
|
|
33
|
+
<!-- PC-PROJECT-EXAMPLE-START -->
|
|
34
|
+
```markdown
|
|
35
|
+
### Calculation Integrity
|
|
36
|
+
- Any change under `src/pricing/engine/` — `RateEngine.Compute` is static and deterministic, and every change to it needs a golden vector in `PricingParityTests`. A wrong number here is invisible in review and correct-looking in production.
|
|
37
|
+
- Any change to a rate table, band, or assumption constant, including its effective dates. The engine reads them by date, so an edit silently rewrites past outputs.
|
|
38
|
+
```
|
|
39
|
+
<!-- PC-PROJECT-EXAMPLE-END -->
|
|
21
40
|
|
|
22
41
|
## Skill template
|
|
23
42
|
|
|
@@ -1,66 +1,56 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pc-make-user-model
|
|
3
|
-
description: Set the model for a tier (plan, build, or fast). Team-wide or user-local override. Invoked by the /make-user-model command.
|
|
4
|
-
license: MIT
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
<team|user> config updated
|
|
60
|
-
<tier> model -> <resolved-id>
|
|
61
|
-
file: <path written>
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
Restart opencode for the change to take effect. The `pc-subagent-tiers` plugin reads the model configs at startup and injects tier-suffixed agent variants (`<engineer>.<tier>`) into the live config. After restart, `/plan-apply` will spawn agents on the new model.
|
|
65
|
-
|
|
66
|
-
This command edits `harness.json` (team) or `harness.user.json` (user) only. It never modifies agent files, `opencode.json`, or `tasks.md`. Tier variants are generated in-memory by the `pc-subagent-tiers` plugin at startup: no file re-stamping needed.
|
|
1
|
+
---
|
|
2
|
+
name: pc-make-user-model
|
|
3
|
+
description: Set the model for a tier (plan, build, or fast). Team-wide or user-local override. Invoked by the /make-user-model command.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Point one tier at one model, in the team config or in a machine-local override.
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
- Only `models.<tier>` in `.opencode/harness.json` or `.opencode/harness.user.json` changes. Agent files, `opencode.jsonc` and `tasks.md` are not this command's business, and tier variants are rebuilt from these configs at startup anyway.
|
|
12
|
+
- Never guess the id behind `current`: read it from the status line. A guessed id writes a model that does not exist into the team's config.
|
|
13
|
+
- Never write anything when the arguments do not parse. Print the usage and stop.
|
|
14
|
+
- Preserve the file's other fields and its 2-space formatting.
|
|
15
|
+
|
|
16
|
+
## Contract
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/make-user-model <tier> <model>
|
|
20
|
+
/make-user-model user <tier> <model>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`user` writes `.opencode/harness.user.json`, which is gitignored and wins on this machine only; without it the target is `.opencode/harness.json`, which is shared. `<tier>` is exactly `plan`, `build` or `fast`. `<model>` is a fully-qualified id (`opencode/big-pickle`) or `current` for the model this session is running.
|
|
24
|
+
|
|
25
|
+
No arguments means show the `models` block from both files, team first, then the usage. Change nothing.
|
|
26
|
+
|
|
27
|
+
A team config that does not exist yet is a stop: onboarding has not run. A missing user config is created as `{ "models": {} }`.
|
|
28
|
+
|
|
29
|
+
An id with no `/` in it is malformed; confirm before writing it:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"questions": [
|
|
34
|
+
{
|
|
35
|
+
"header": "Malformed model id",
|
|
36
|
+
"question": "\"<model>\" doesn't look like a valid model id (expected provider/model-id). Write it anyway?",
|
|
37
|
+
"options": [
|
|
38
|
+
{ "label": "yes", "description": "Write the value as-is to the config file." },
|
|
39
|
+
{ "label": "no", "description": "Cancel. Do not write anything." }
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Report
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
<team|user> config updated
|
|
50
|
+
<tier> model -> <resolved-id>
|
|
51
|
+
file: <path written>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The change lands on the next opencode start, when `pc-subagent-tiers` reads the configs and rebuilds the tier variants.
|
|
55
|
+
|
|
56
|
+
Arguments: `$ARGUMENTS`
|