@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 +0,0 @@
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 one before doing any work.
10
-
11
- ## Secrets
12
-
13
- - Treat `.env` files as write-only: write to them when configuring, and read credentials at runtime from the environment or the secret store.
14
- - Never put a credential, API key or token in a log line, an output, or a commit in anything but encrypted or template form. Anything printed is in a CI log that outlives the run.
15
-
16
- ## Code
17
-
18
- - Comments are for WHY, not WHAT. Use them only where the code does something non-obvious or the reason cannot be inferred from context. Past a 10% comment ratio in a file, refactor for clarity instead.
19
- - Never add a file that collects unrelated things — `constants.js`, `types.ts`, `config.js`, `utils.ts`. One responsibility per file, split by domain or feature (`user-constants.ts`, `order-types.ts`, `auth-config.ts`). A file importing from many unrelated modules is already the symptom.
20
-
21
- ## Temporary files
22
-
23
- - Never write outside `$REPO_ROOT`, and never to an operating-system temporary directory: the next step and the next agent cannot see it, and nobody cleans it up. Scratch goes under `$REPO_ROOT/.opencode/.tmp/`, in a task-specific child directory when needed (enforced by pc-system-reminders).
24
- - Never report a path under `.tmp/` as a deliverable. Copy or move the artifact to its required repository path first.
25
- - Never leave scratch files behind at the end of a task, unless they are the evidence for a failure you are reporting.
26
-
27
- <!-- PC-GUARDRAILS-RTK-START -->
28
- <!-- PC-GUARDRAILS-RTK-END -->
29
-
30
- <!-- PC-GUARDRAILS-CODEGRAPH-START -->
31
- <!-- PC-GUARDRAILS-CODEGRAPH-END -->
32
-
33
- <!-- PC-GUARDRAILS-MEMORY-START -->
34
- <!-- PC-GUARDRAILS-MEMORY-END -->
35
-
36
- <!-- PC-GUARDRAILS-SIMPLE-ENGLISH-START -->
37
- <!-- PC-GUARDRAILS-SIMPLE-ENGLISH-END -->
38
-
39
- <!-- PC-GUARDRAILS-HUMANIZER-START -->
40
- <!-- PC-GUARDRAILS-HUMANIZER-END -->
41
-
42
- ## Engineer workflow (when spawned)
43
-
44
- The lead put your task IDs and their text in your prompt. Two things about that are not up to you:
45
-
46
- - 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).
47
- - Edit only files in your assigned scope, then return a summary: task IDs done, files changed, tests and lint result, decisions made. Then you exit. Never poll for more work, and never claim a task the lead did not give you: the lead spawns with the work in hand, so a worker that waits is a worker that hangs the wave.
@@ -1,38 +0,0 @@
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.
@@ -1,18 +0,0 @@
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, run `/ops-evidence`.
@@ -1,29 +0,0 @@
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,5 +0,0 @@
1
- ---
2
- description: DEPRECATED. Per-project evidence scaffolds are gone; run /ops-evidence instead.
3
- ---
4
-
5
- Load the `pc-make-evidence-scaffold` skill.
@@ -1,98 +0,0 @@
1
- /** @jsxImportSource @opentui/solid */
2
- import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui"
3
- import { createSignal, For, Show } from "solid-js"
4
- import { readFile } from "node:fs/promises"
5
- import { join } from "node:path"
6
-
7
- const id = "ob.subagents"
8
-
9
- type Row = { id: string; agent: string; model: string; task: string; status: string }
10
-
11
- // Renders a live "Subagents" panel in the session sidebar.
12
- //
13
- // Server plugins (opencode.json) cannot draw UI, only TUI plugins (tui.json)
14
- // can, via the `sidebar_content` slot. This panel is fed by the
15
- // `.opencode/harness-run.json` state file that the `pc-subagent-monitor` server
16
- // plugin maintains, so the two cooperate: server plugin = data producer,
17
- // this TUI plugin = renderer.
18
- const tui: TuiPlugin = async (api) => {
19
- const statePath = join(process.cwd(), ".opencode", "harness-run.json")
20
- const [rows, setRows] = createSignal<Row[]>([])
21
- // Only show live subagents, finished/failed ones are kept in harness-run.json
22
- // for recovery but are not navigable targets the user cares about here.
23
- // Entries marked stale (left "running" by a crashed process) are not live.
24
- const active = () => rows().filter((r) => r.status === "running")
25
-
26
- const refresh = async () => {
27
- try {
28
- const data = JSON.parse(await readFile(statePath, "utf-8"))
29
- const agents = data?.agents ?? {}
30
- setRows(
31
- Object.entries(agents)
32
- .filter(([, a]: [string, any]) => !a?.stale)
33
- .map(([sid, a]: [string, any]) => ({
34
- id: sid,
35
- agent: a?.agent ?? "?",
36
- model: a?.model ?? "",
37
- task: Array.isArray(a?.tasks) && a.tasks.length ? a.tasks.join(",") : (a?.title ?? ""),
38
- status: a?.status ?? "running",
39
- })),
40
- )
41
- } catch (err: any) {
42
- // Missing file = genuinely idle. Anything else (transient read/parse
43
- // hiccup) keeps the last good rows instead of flashing "idle" mid-run.
44
- if (err?.code === "ENOENT") setRows([])
45
- }
46
- }
47
-
48
- await refresh()
49
- // session.updated fires constantly; debounce so we don't re-read the file
50
- // on every keystroke-sized event.
51
- let timer: ReturnType<typeof setTimeout> | null = null
52
- const scheduleRefresh = () => {
53
- if (timer) return
54
- timer = setTimeout(() => {
55
- timer = null
56
- void refresh()
57
- }, 200)
58
- }
59
- for (const evt of ["session.created", "session.idle", "session.updated"]) {
60
- try {
61
- api.event.on(evt as any, scheduleRefresh)
62
- } catch {
63
- /* event type unavailable on this host, ignore */
64
- }
65
- }
66
-
67
- api.slots.register({
68
- order: 50,
69
- slots: {
70
- sidebar_content() {
71
- return (
72
- <box flexDirection="column">
73
- <text>Subagents</text>
74
- <Show when={active().length === 0}>
75
- <text> idle</text>
76
- </Show>
77
- <For each={active()}>
78
- {(r) => (
79
- <box onMouseUp={() => api.route.navigate("session", { sessionID: r.id })}>
80
- <text>
81
- {"▶ "}
82
- {r.agent}
83
- {r.model ? ` · ${r.model}` : ""}
84
- {r.task ? `, ${r.task}` : ""}
85
- </text>
86
- </box>
87
- )}
88
- </For>
89
- </box>
90
- )
91
- },
92
- },
93
- })
94
- }
95
-
96
- const pluginModule: TuiPluginModule & { id: string } = { id, tui }
97
-
98
- export default pluginModule
@@ -1,6 +0,0 @@
1
- {
2
- "$schema": "https://opencode.ai/tui.json",
3
- "plugin": [
4
- "./tui/pc-subagents.tsx"
5
- ]
6
- }