@plainconceptsplatform/agent-harness 3.5.0 → 3.7.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/LICENSE +21 -21
- package/README.md +471 -454
- package/cli/commands/join.js +259 -259
- package/cli/commands/migrate.js +310 -310
- package/cli/commands/shared.js +27 -27
- package/cli/commands/single.js +79 -79
- package/cli/commands/update.js +121 -121
- package/cli/commands/wizard.js +134 -134
- package/cli/fragments/archive/az.md +97 -97
- package/cli/fragments/archive/gh.md +96 -96
- package/cli/fragments/archive/gl.md +96 -96
- package/cli/fragments/archive/none.md +75 -75
- package/cli/fragments/guardrails/codegraph.md +5 -5
- 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 +28 -28
- package/cli/fragments/ops-backlog/gh.md +28 -28
- package/cli/fragments/ops-backlog/jira.md +28 -28
- package/cli/fragments/ops-review/az.md +62 -62
- package/cli/fragments/ops-review/gh.md +51 -51
- package/cli/fragments/ops-review/gl.md +55 -55
- package/cli/fragments/ops-ship/az.md +81 -81
- package/cli/fragments/ops-ship/gh.md +67 -67
- package/cli/fragments/ops-ship/gl.md +84 -84
- package/cli/index.js +116 -116
- package/cli/presets/agents-content.json +34 -34
- package/cli/presets/browser.json +10 -10
- package/cli/presets/clean.json +21 -21
- package/cli/presets/models.json +68 -68
- package/cli/presets/optimization.json +32 -32
- package/cli/presets/platforms.json +76 -76
- package/cli/presets/source.json +23 -23
- package/cli/steps/browser/index.js +48 -48
- package/cli/steps/clean/index.js +120 -120
- package/cli/steps/copy/agents.js +120 -120
- package/cli/steps/copy/commands.js +79 -79
- package/cli/steps/copy/fullstack-engineer.js +89 -89
- package/cli/steps/copy/index.js +88 -88
- package/cli/steps/copy/opencode-json.js +324 -324
- package/cli/steps/copy/skills.js +316 -316
- package/cli/steps/metadata/index.js +115 -115
- package/cli/steps/models/format.js +88 -88
- package/cli/steps/models/index.js +64 -64
- package/cli/steps/models/write.js +38 -38
- package/cli/steps/openspec/index.js +136 -136
- package/cli/steps/optimization/codegraph.js +141 -141
- package/cli/steps/optimization/detect.js +66 -66
- package/cli/steps/optimization/humanizer.js +17 -17
- package/cli/steps/optimization/index.js +158 -158
- package/cli/steps/optimization/memory.js +91 -91
- package/cli/steps/optimization/patch-guardrails.js +111 -111
- package/cli/steps/optimization/simple-english.js +17 -17
- package/cli/steps/optimization/skills-lock.js +30 -30
- package/cli/steps/platform/index.js +109 -109
- package/cli/steps/source/index.js +123 -123
- package/cli/utils/agent-color.js +111 -111
- package/cli/utils/copy.js +134 -134
- package/cli/utils/exec-spinner.js +47 -47
- package/cli/utils/exec.js +134 -134
- package/cli/utils/legacy-check.js +30 -30
- package/cli/utils/models-cache.js +58 -58
- package/cli/utils/models-pricing.js +42 -42
- package/cli/utils/paths.js +81 -81
- package/cli/utils/process.js +3 -3
- package/cli/utils/terminal.js +6 -6
- package/cli/utils/update-manifest.js +75 -75
- package/harness/.opencode/_gitignore +10 -10
- 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-guardrails.md +5 -5
- package/harness/.opencode/commands/make-user-model.md +5 -5
- package/harness/.opencode/commands/ops-backlog.md +10 -10
- package/harness/.opencode/commands/ops-review.md +10 -10
- package/harness/.opencode/commands/ops-ship.md +9 -9
- package/harness/.opencode/commands/plan-apply.md +9 -9
- package/harness/.opencode/commands/plan-archive.md +7 -7
- package/harness/.opencode/commands/plan-explore.md +11 -11
- package/harness/.opencode/commands/plan-goal.md +5 -5
- package/harness/.opencode/commands/plan-propose.md +11 -11
- package/harness/.opencode/commands/plan-quick.md +7 -7
- package/harness/.opencode/commands/plan-story.md +11 -11
- package/harness/.opencode/commands/repo-audit.md +7 -7
- package/harness/.opencode/commands/repo-help.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/package.json +5 -5
- package/harness/.opencode/plugins/pc-commit-coauthor.js +41 -0
- package/harness/.opencode/plugins/pc-subagent-monitor.js +184 -184
- package/harness/.opencode/plugins/pc-subagent-tiers.js +367 -367
- package/harness/.opencode/plugins/pc-system-reminders.js +404 -386
- package/harness/.opencode/scripts/check-diff.mjs +279 -252
- package/harness/.opencode/scripts/code-rules.mjs +288 -288
- package/harness/.opencode/scripts/platform-manifest.mjs +112 -0
- package/harness/AGENTS.md +49 -49
- package/harness/ARCHITECTURE.md +13 -13
- package/harness/DESIGN.md +13 -13
- package/harness/opencode.jsonc +36 -36
- package/harness/openspec/config.yaml +20 -20
- package/harness/skills-lock.json +17 -17
- package/package.json +14 -12
- package/skills/README.md +18 -18
- package/skills/agent-harness-cli/SKILL.md +86 -86
- package/skills/browser-automation/SKILL.md +72 -72
- package/skills/pc-guardrails-generic/SKILL.md +53 -53
- package/skills/pc-guardrails-project/SKILL.md +8 -8
- package/skills/pc-make-architecture/SKILL.md +33 -32
- package/skills/pc-make-architecture/structure-template.md +64 -64
- package/skills/pc-make-design/SKILL.md +45 -45
- package/skills/pc-make-engineer/SKILL.md +59 -59
- package/skills/pc-make-engineer/signal-mapping.md +53 -53
- package/skills/pc-make-engineer/template.md +36 -36
- package/skills/pc-make-guardrails/SKILL.md +44 -44
- package/skills/pc-make-guardrails/category-reference.md +112 -112
- package/skills/pc-make-merge-risk-assess/SKILL.md +70 -70
- package/skills/pc-make-merge-risk-assess/category-reference.md +114 -114
- package/skills/pc-make-user-model/SKILL.md +56 -56
- package/skills/pc-ops-ship/SKILL.md +22 -22
- package/skills/pc-plan-apply/SKILL.md +88 -88
- package/skills/pc-plan-apply/simple-mode.md +21 -21
- package/skills/pc-plan-archive/SKILL.md +66 -66
- package/skills/pc-plan-explore/SKILL.md +21 -21
- package/skills/pc-plan-goal/SKILL.md +91 -91
- package/skills/pc-plan-goal/branching.md +39 -39
- package/skills/pc-plan-goal/failure-policy.md +30 -30
- package/skills/pc-plan-goal/output-mode.md +10 -10
- package/skills/pc-plan-goal/output.md +71 -71
- package/skills/pc-plan-propose/SKILL.md +125 -125
- package/skills/pc-plan-propose/task-annotation.md +39 -39
- package/skills/pc-plan-quick/SKILL.md +46 -46
- package/skills/pc-plan-story/SKILL.md +93 -93
- package/skills/pc-repo-audit/SKILL.md +44 -44
- package/skills/pc-repo-help/SKILL.md +87 -87
- package/skills/pc-repo-initialize/SKILL.md +119 -119
- package/skills/pc-repo-onboard/SKILL.md +32 -32
- package/skills/pc-repo-verify/SKILL.md +150 -150
- package/skills/pc-userstory-az/SKILL.md +71 -71
- package/skills/pc-userstory-browser/SKILL.md +64 -64
- package/skills/pc-userstory-gh/SKILL.md +63 -63
- package/skills/pc-userstory-jira/SKILL.md +74 -74
|
@@ -1,86 +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.
|
|
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-commit-coauthor, 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.
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: browser-automation
|
|
3
|
-
description: Reliable, composable browser automation using agent-browser. Use when capturing screenshots of a locally running app, clicking UI elements, reading page content, or automating browser interactions on localhost.
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: Requires agent-browser CLI installed (Rust binary) and running.
|
|
6
|
-
metadata:
|
|
7
|
-
author: copilots
|
|
8
|
-
version: "2.0"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
This skill operates on `localhost` URLs only. Screenshots, clicks, typing, scrolling, and reads on locally running apps are in scope. External services (github.com, dev.azure.com, npmjs.com, etc.) are out of scope for browser tools.
|
|
12
|
-
|
|
13
|
-
The only exception: when the user selects "Others (Browser)" as their backlog platform during onboarding, the `pc-userstory` skill may navigate to work item URLs the user explicitly provides. That is the sole case where external navigation is permitted, and only to URLs the user explicitly gives you.
|
|
14
|
-
|
|
15
|
-
## Best-practice workflow
|
|
16
|
-
|
|
17
|
-
1. Open the page: `agent-browser open <url>` (launches its own Chrome; reuses the running daemon)
|
|
18
|
-
2. Take a snapshot: `agent-browser snapshot` to get the accessibility tree with `@ref` handles
|
|
19
|
-
3. Interact by ref: `agent-browser click @e2`, `agent-browser fill @e3 "text"`
|
|
20
|
-
4. Wait when needed: `agent-browser wait --load networkidle` or `agent-browser wait <selector>`
|
|
21
|
-
5. Confirm the result with a fresh `snapshot`, `get text`, or `screenshot`
|
|
22
|
-
|
|
23
|
-
Refs like `@e2` come from the last snapshot and go stale after page changes: retake the snapshot after navigation or dynamic updates before reusing them. When a click fails because another element covers the target (consent banner, modal), dismiss or interact with the covering element, then take a fresh snapshot before retrying.
|
|
24
|
-
|
|
25
|
-
## Tool access
|
|
26
|
-
|
|
27
|
-
- MCP tools (inside OpenCode): `agent_browser_open`, `agent_browser_snapshot`, `agent_browser_click`, `agent_browser_fill`, `agent_browser_type`, `agent_browser_wait_for_selector`, `agent_browser_screenshot`, `agent_browser_eval`, `agent_browser_close` — configured in `opencode.jsonc` with `--tools core`
|
|
28
|
-
- CLI (any agent, any host): every command below works identically via bash
|
|
29
|
-
- Diagnose the install: `agent-browser doctor`
|
|
30
|
-
|
|
31
|
-
## Selecting elements
|
|
32
|
-
|
|
33
|
-
- Prefer refs from `snapshot` (`@e1`, `@e2`, ...) over CSS selectors
|
|
34
|
-
- CSS selectors also work: `agent-browser click "#submit"`, `agent-browser fill "#email" "text"`
|
|
35
|
-
- Semantic locators: `agent-browser find role button click --name "Submit"`, `find text "Sign In" click`, `find label "Email" fill "value"`, `find testid <id> click`
|
|
36
|
-
- Native selects: `agent-browser select <sel> <value>`
|
|
37
|
-
|
|
38
|
-
## Reading state
|
|
39
|
-
|
|
40
|
-
- `agent-browser get text <sel>` — text content of an element
|
|
41
|
-
- `agent-browser get value <sel>` — input value
|
|
42
|
-
- `agent-browser snapshot` — structured accessibility tree (preferred for parsing)
|
|
43
|
-
- `agent-browser screenshot [path]` — `--full` for full page, `--annotate` for numbered labels
|
|
44
|
-
- `agent-browser read` — agent-readable markdown of the active tab (no Chrome launch for URL reads)
|
|
45
|
-
|
|
46
|
-
## Tabs and sessions
|
|
47
|
-
|
|
48
|
-
- `agent-browser tab` lists tabs with stable `t1`, `t2` ids; `tab new --label <name>` and `tab <label>` switch
|
|
49
|
-
- `agent-browser close` closes the browser; `close --all` closes every session
|
|
50
|
-
|
|
51
|
-
## CLI-first debugging
|
|
52
|
-
|
|
53
|
-
- `agent-browser doctor` — diagnose install, Chrome, and daemon state
|
|
54
|
-
- `agent-browser console` — view console messages; `agent-browser errors` — uncaught exceptions
|
|
55
|
-
- `agent-browser eval "<js>"` — run JavaScript in the page
|
|
56
|
-
- `agent-browser network requests --filter api` — inspect tracked requests
|
|
57
|
-
|
|
58
|
-
## Troubleshooting
|
|
59
|
-
|
|
60
|
-
- Stale ref: take a fresh `snapshot` after any navigation or DOM change
|
|
61
|
-
- Covered click: the error names the covering element; dismiss it, re-snapshot, retry
|
|
62
|
-
- Selector fails: confirm the content exists with `agent-browser get text` or a snapshot before retrying
|
|
63
|
-
- Daemon or Chrome issues: run `agent-browser doctor`
|
|
64
|
-
|
|
65
|
-
## Scope
|
|
66
|
-
|
|
67
|
-
- Screenshots of locally running app on `localhost` URLs: in scope
|
|
68
|
-
- Click, type, scroll, read on `localhost` pages: in scope
|
|
69
|
-
- Navigate to work item URLs the user explicitly provides (when backlog platform is "Others (Browser)"): in scope
|
|
70
|
-
- Navigate to external services for non-work-item purposes: out of scope
|
|
71
|
-
- DevOps or GitHub CLI operations via browser tools: out of scope
|
|
72
|
-
- Reading or modifying production systems via browser tools: out of scope
|
|
1
|
+
---
|
|
2
|
+
name: browser-automation
|
|
3
|
+
description: Reliable, composable browser automation using agent-browser. Use when capturing screenshots of a locally running app, clicking UI elements, reading page content, or automating browser interactions on localhost.
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires agent-browser CLI installed (Rust binary) and running.
|
|
6
|
+
metadata:
|
|
7
|
+
author: copilots
|
|
8
|
+
version: "2.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
This skill operates on `localhost` URLs only. Screenshots, clicks, typing, scrolling, and reads on locally running apps are in scope. External services (github.com, dev.azure.com, npmjs.com, etc.) are out of scope for browser tools.
|
|
12
|
+
|
|
13
|
+
The only exception: when the user selects "Others (Browser)" as their backlog platform during onboarding, the `pc-userstory` skill may navigate to work item URLs the user explicitly provides. That is the sole case where external navigation is permitted, and only to URLs the user explicitly gives you.
|
|
14
|
+
|
|
15
|
+
## Best-practice workflow
|
|
16
|
+
|
|
17
|
+
1. Open the page: `agent-browser open <url>` (launches its own Chrome; reuses the running daemon)
|
|
18
|
+
2. Take a snapshot: `agent-browser snapshot` to get the accessibility tree with `@ref` handles
|
|
19
|
+
3. Interact by ref: `agent-browser click @e2`, `agent-browser fill @e3 "text"`
|
|
20
|
+
4. Wait when needed: `agent-browser wait --load networkidle` or `agent-browser wait <selector>`
|
|
21
|
+
5. Confirm the result with a fresh `snapshot`, `get text`, or `screenshot`
|
|
22
|
+
|
|
23
|
+
Refs like `@e2` come from the last snapshot and go stale after page changes: retake the snapshot after navigation or dynamic updates before reusing them. When a click fails because another element covers the target (consent banner, modal), dismiss or interact with the covering element, then take a fresh snapshot before retrying.
|
|
24
|
+
|
|
25
|
+
## Tool access
|
|
26
|
+
|
|
27
|
+
- MCP tools (inside OpenCode): `agent_browser_open`, `agent_browser_snapshot`, `agent_browser_click`, `agent_browser_fill`, `agent_browser_type`, `agent_browser_wait_for_selector`, `agent_browser_screenshot`, `agent_browser_eval`, `agent_browser_close` — configured in `opencode.jsonc` with `--tools core`
|
|
28
|
+
- CLI (any agent, any host): every command below works identically via bash
|
|
29
|
+
- Diagnose the install: `agent-browser doctor`
|
|
30
|
+
|
|
31
|
+
## Selecting elements
|
|
32
|
+
|
|
33
|
+
- Prefer refs from `snapshot` (`@e1`, `@e2`, ...) over CSS selectors
|
|
34
|
+
- CSS selectors also work: `agent-browser click "#submit"`, `agent-browser fill "#email" "text"`
|
|
35
|
+
- Semantic locators: `agent-browser find role button click --name "Submit"`, `find text "Sign In" click`, `find label "Email" fill "value"`, `find testid <id> click`
|
|
36
|
+
- Native selects: `agent-browser select <sel> <value>`
|
|
37
|
+
|
|
38
|
+
## Reading state
|
|
39
|
+
|
|
40
|
+
- `agent-browser get text <sel>` — text content of an element
|
|
41
|
+
- `agent-browser get value <sel>` — input value
|
|
42
|
+
- `agent-browser snapshot` — structured accessibility tree (preferred for parsing)
|
|
43
|
+
- `agent-browser screenshot [path]` — `--full` for full page, `--annotate` for numbered labels
|
|
44
|
+
- `agent-browser read` — agent-readable markdown of the active tab (no Chrome launch for URL reads)
|
|
45
|
+
|
|
46
|
+
## Tabs and sessions
|
|
47
|
+
|
|
48
|
+
- `agent-browser tab` lists tabs with stable `t1`, `t2` ids; `tab new --label <name>` and `tab <label>` switch
|
|
49
|
+
- `agent-browser close` closes the browser; `close --all` closes every session
|
|
50
|
+
|
|
51
|
+
## CLI-first debugging
|
|
52
|
+
|
|
53
|
+
- `agent-browser doctor` — diagnose install, Chrome, and daemon state
|
|
54
|
+
- `agent-browser console` — view console messages; `agent-browser errors` — uncaught exceptions
|
|
55
|
+
- `agent-browser eval "<js>"` — run JavaScript in the page
|
|
56
|
+
- `agent-browser network requests --filter api` — inspect tracked requests
|
|
57
|
+
|
|
58
|
+
## Troubleshooting
|
|
59
|
+
|
|
60
|
+
- Stale ref: take a fresh `snapshot` after any navigation or DOM change
|
|
61
|
+
- Covered click: the error names the covering element; dismiss it, re-snapshot, retry
|
|
62
|
+
- Selector fails: confirm the content exists with `agent-browser get text` or a snapshot before retrying
|
|
63
|
+
- Daemon or Chrome issues: run `agent-browser doctor`
|
|
64
|
+
|
|
65
|
+
## Scope
|
|
66
|
+
|
|
67
|
+
- Screenshots of locally running app on `localhost` URLs: in scope
|
|
68
|
+
- Click, type, scroll, read on `localhost` pages: in scope
|
|
69
|
+
- Navigate to work item URLs the user explicitly provides (when backlog platform is "Others (Browser)"): in scope
|
|
70
|
+
- Navigate to external services for non-work-item purposes: out of scope
|
|
71
|
+
- DevOps or GitHub CLI operations via browser tools: out of scope
|
|
72
|
+
- Reading or modifying production systems via browser tools: out of scope
|
|
@@ -1,53 +1,53 @@
|
|
|
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
|
-
- Zero comments by default. Write one only for what the code cannot show and we do not control: a vendor bug, an external contract, a legal rule. Leave every file you touch with no comment slop, old or new.
|
|
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
|
-
- `node .opencode/scripts/check-diff.mjs` enforces the comment and test rules on the diff and must exit 0.
|
|
32
|
-
|
|
33
|
-
<!-- PC-GUARDRAILS-RTK-START -->
|
|
34
|
-
<!-- PC-GUARDRAILS-RTK-END -->
|
|
35
|
-
|
|
36
|
-
<!-- PC-GUARDRAILS-CODEGRAPH-START -->
|
|
37
|
-
<!-- PC-GUARDRAILS-CODEGRAPH-END -->
|
|
38
|
-
|
|
39
|
-
<!-- PC-GUARDRAILS-MEMORY-START -->
|
|
40
|
-
<!-- PC-GUARDRAILS-MEMORY-END -->
|
|
41
|
-
|
|
42
|
-
<!-- PC-GUARDRAILS-SIMPLE-ENGLISH-START -->
|
|
43
|
-
<!-- PC-GUARDRAILS-SIMPLE-ENGLISH-END -->
|
|
44
|
-
|
|
45
|
-
<!-- PC-GUARDRAILS-HUMANIZER-START -->
|
|
46
|
-
<!-- PC-GUARDRAILS-HUMANIZER-END -->
|
|
47
|
-
|
|
48
|
-
## Engineer workflow (when spawned)
|
|
49
|
-
|
|
50
|
-
The lead puts your task IDs and their text in your prompt. Two things about that are not up to you:
|
|
51
|
-
|
|
52
|
-
- 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).
|
|
53
|
-
- 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.
|
|
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
|
+
- Zero comments by default. Write one only for what the code cannot show and we do not control: a vendor bug, an external contract, a legal rule. Leave every file you touch with no comment slop, old or new.
|
|
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
|
+
- `node .opencode/scripts/check-diff.mjs` enforces the comment and test rules on the diff and must exit 0.
|
|
32
|
+
|
|
33
|
+
<!-- PC-GUARDRAILS-RTK-START -->
|
|
34
|
+
<!-- PC-GUARDRAILS-RTK-END -->
|
|
35
|
+
|
|
36
|
+
<!-- PC-GUARDRAILS-CODEGRAPH-START -->
|
|
37
|
+
<!-- PC-GUARDRAILS-CODEGRAPH-END -->
|
|
38
|
+
|
|
39
|
+
<!-- PC-GUARDRAILS-MEMORY-START -->
|
|
40
|
+
<!-- PC-GUARDRAILS-MEMORY-END -->
|
|
41
|
+
|
|
42
|
+
<!-- PC-GUARDRAILS-SIMPLE-ENGLISH-START -->
|
|
43
|
+
<!-- PC-GUARDRAILS-SIMPLE-ENGLISH-END -->
|
|
44
|
+
|
|
45
|
+
<!-- PC-GUARDRAILS-HUMANIZER-START -->
|
|
46
|
+
<!-- PC-GUARDRAILS-HUMANIZER-END -->
|
|
47
|
+
|
|
48
|
+
## Engineer workflow (when spawned)
|
|
49
|
+
|
|
50
|
+
The lead puts your task IDs and their text in your prompt. Two things about that are not up to you:
|
|
51
|
+
|
|
52
|
+
- 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).
|
|
53
|
+
- 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.
|
|
@@ -1,8 +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. -->
|
|
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. -->
|
|
@@ -1,32 +1,33 @@
|
|
|
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
|
-
Write `ARCHITECTURE.md` in the project root from what the codebase actually contains, following the [structure template](structure-template.md).
|
|
10
|
-
|
|
11
|
-
## Rules
|
|
12
|
-
|
|
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
|
-
- Never analyze outside `.opencode/source-roots.json` when it exists, plus this repo's own docs and config.
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
|
24
|
-
| Has content
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
+
Write `ARCHITECTURE.md` in the project root from what the codebase actually contains, following the [structure template](structure-template.md).
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
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
|
+
- Never analyze outside `.opencode/source-roots.json` when it exists, plus this repo's own docs and config.
|
|
15
|
+
- When `docs/platform/` exists, the Kitchen-Sink template owns the platform code it documents (session and auth, permissions, audit, feature flags, errors, security headers, API surfaces, web shell). For those topics link to the page in `docs/platform/` instead of describing them again: a second description drifts on the next template update.
|
|
16
|
+
- The footer is the file's last line, and it is the run's own ISO timestamp: `<!-- Last updated: <ISO date> -->`.
|
|
17
|
+
- 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.
|
|
18
|
+
|
|
19
|
+
## Modes
|
|
20
|
+
|
|
21
|
+
| The existing file | Mode |
|
|
22
|
+
|---|---|
|
|
23
|
+
| Missing, or a placeholder with no real content | Generate |
|
|
24
|
+
| Has content and a `<!-- Last updated:` footer | Update |
|
|
25
|
+
| Has content but no footer | Warn the user, then Generate |
|
|
26
|
+
|
|
27
|
+
**Generate.** Discover the architecture with the file tools: `glob` for structure, `grep` for routes, models and schemas, `read` for config, CI workflows, Dockerfiles, README, changelogs and ADRs.
|
|
28
|
+
|
|
29
|
+
**Update.** `git log --oneline --since="<footer date>" -- <source roots>` says what moved. Nothing changed means nothing to write: say "Architecture unchanged since last update" and stop. Otherwise rewrite only the affected sections and leave the rest, including anything hand-written, as it stands. Past roughly 40% of sections affected, fall back to Generate.
|
|
30
|
+
|
|
31
|
+
## Report
|
|
32
|
+
|
|
33
|
+
Whether the file was generated or updated and which sections changed, the top-level components found, and that `/make-architecture` can be re-run whenever the architecture moves.
|