@plainconceptsplatform/agent-harness 2.0.0 → 2.1.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 +426 -419
- package/package.json +3 -3
- package/src/commands/join.js +244 -244
- package/src/commands/shared.js +27 -27
- package/src/commands/single.js +79 -79
- package/src/commands/update.js +109 -109
- package/src/commands/wizard.js +134 -134
- package/src/content/.agents/skills/browser-automation/SKILL.md +66 -66
- package/src/content/.agents/skills/pc-guardrails-generic/SKILL.md +68 -68
- package/src/content/.agents/skills/pc-guardrails-project/SKILL.md +8 -8
- package/src/content/.agents/skills/pc-make-architecture/SKILL.md +51 -51
- package/src/content/.agents/skills/pc-make-architecture/structure-template.md +38 -38
- package/src/content/.agents/skills/pc-make-design/SKILL.md +68 -68
- package/src/content/.agents/skills/pc-make-engineer/SKILL.md +219 -219
- package/src/content/.agents/skills/pc-make-engineer/signal-mapping.md +68 -68
- package/src/content/.agents/skills/pc-make-engineer/template.md +81 -81
- package/src/content/.agents/skills/pc-make-evidence-scaffold/SKILL.md +18 -18
- package/src/content/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +29 -29
- package/src/content/.agents/skills/pc-make-guardrails/SKILL.md +74 -74
- package/src/content/.agents/skills/pc-make-guardrails/category-reference.md +68 -68
- package/src/content/.agents/skills/pc-make-merge-risk-assess/SKILL.md +70 -70
- package/src/content/.agents/skills/pc-make-merge-risk-assess/category-reference.md +98 -98
- package/src/content/.agents/skills/pc-make-user-model/SKILL.md +66 -66
- package/src/content/.agents/skills/pc-ops-evidence/SKILL.md +127 -127
- package/src/content/.agents/skills/pc-ops-ship/SKILL.md +18 -18
- package/src/content/.agents/skills/pc-plan-apply/SKILL.md +83 -83
- package/src/content/.agents/skills/pc-plan-apply/simple-mode.md +21 -21
- package/src/content/.agents/skills/pc-plan-archive/SKILL.md +63 -63
- package/src/content/.agents/skills/pc-plan-explore/SKILL.md +9 -9
- package/src/content/.agents/skills/pc-plan-goal/SKILL.md +94 -94
- package/src/content/.agents/skills/pc-plan-goal/branching.md +30 -30
- package/src/content/.agents/skills/pc-plan-goal/failure-policy.md +30 -30
- package/src/content/.agents/skills/pc-plan-goal/output-mode.md +9 -9
- package/src/content/.agents/skills/pc-plan-goal/output.md +68 -68
- package/src/content/.agents/skills/pc-plan-propose/SKILL.md +125 -125
- package/src/content/.agents/skills/pc-plan-propose/task-annotation.md +39 -39
- package/src/content/.agents/skills/pc-plan-quick/SKILL.md +62 -62
- package/src/content/.agents/skills/pc-plan-story/SKILL.md +146 -146
- package/src/content/.agents/skills/pc-repo-audit/SKILL.md +44 -44
- package/src/content/.agents/skills/pc-repo-help/SKILL.md +91 -91
- package/src/content/.agents/skills/pc-repo-initialize/SKILL.md +130 -130
- package/src/content/.agents/skills/pc-repo-onboard/SKILL.md +87 -87
- package/src/content/.agents/skills/pc-repo-verify/SKILL.md +34 -34
- package/src/content/.agents/skills/pc-userstory-az/SKILL.md +157 -157
- package/src/content/.agents/skills/pc-userstory-browser/SKILL.md +132 -132
- package/src/content/.agents/skills/pc-userstory-gh/SKILL.md +120 -120
- package/src/content/.agents/skills/pc-userstory-jira/SKILL.md +131 -131
- package/src/content/.opencode/_gitignore +9 -7
- package/src/content/.opencode/commands/init.md +5 -5
- package/src/content/.opencode/commands/make-architecture.md +5 -5
- package/src/content/.opencode/commands/make-design.md +5 -5
- package/src/content/.opencode/commands/make-engineer.md +5 -5
- package/src/content/.opencode/commands/make-evidence-scaffold.md +5 -5
- package/src/content/.opencode/commands/make-guardrails.md +5 -5
- package/src/content/.opencode/commands/make-user-model.md +5 -5
- package/src/content/.opencode/commands/ops-backlog.md +10 -10
- package/src/content/.opencode/commands/ops-evidence.md +9 -9
- package/src/content/.opencode/commands/ops-review.md +8 -8
- package/src/content/.opencode/commands/ops-ship.md +9 -9
- package/src/content/.opencode/commands/plan-apply.md +9 -9
- package/src/content/.opencode/commands/plan-archive.md +5 -5
- package/src/content/.opencode/commands/plan-explore.md +9 -9
- package/src/content/.opencode/commands/plan-goal.md +5 -5
- package/src/content/.opencode/commands/plan-propose.md +9 -9
- package/src/content/.opencode/commands/plan-quick.md +5 -5
- package/src/content/.opencode/commands/plan-story.md +9 -9
- package/src/content/.opencode/commands/repo-audit.md +5 -5
- package/src/content/.opencode/commands/repo-help.md +5 -5
- package/src/content/.opencode/commands/repo-initialize.md +5 -5
- package/src/content/.opencode/commands/repo-onboard.md +5 -5
- package/src/content/.opencode/commands/repo-verify.md +5 -5
- package/src/content/.opencode/plugins/pc-subagent-monitor.js +139 -139
- package/src/content/.opencode/plugins/pc-subagent-tiers.js +281 -179
- package/src/content/.opencode/plugins/pc-system-reminders.js +96 -96
- package/src/content/.opencode/tui/pc-subagents.tsx +98 -98
- package/src/content/.opencode/tui.json +6 -6
- package/src/content/AGENTS.md +71 -71
- package/src/content/opencode.jsonc +39 -31
- package/src/fragments/archive/az.md +95 -95
- package/src/fragments/archive/gh.md +94 -94
- package/src/fragments/archive/gl.md +94 -94
- package/src/fragments/archive/none.md +73 -73
- package/src/fragments/guardrails/codegraph.md +7 -7
- package/src/fragments/guardrails/humanizer.md +4 -4
- package/src/fragments/guardrails/memory.md +4 -4
- package/src/fragments/guardrails/rtk.md +3 -3
- package/src/fragments/guardrails/simple-english.md +4 -4
- package/src/fragments/ops-backlog/az.md +28 -28
- package/src/fragments/ops-backlog/gh.md +29 -29
- package/src/fragments/ops-backlog/jira.md +28 -28
- package/src/fragments/ops-evidence/az.md +41 -41
- package/src/fragments/ops-evidence/gh.md +53 -53
- package/src/fragments/ops-evidence/jira.md +38 -38
- package/src/fragments/ops-review/az.md +62 -62
- package/src/fragments/ops-review/gh.md +52 -52
- package/src/fragments/ops-review/gl.md +56 -56
- package/src/fragments/ops-ship/az.md +80 -80
- package/src/fragments/ops-ship/gh.md +68 -68
- package/src/fragments/ops-ship/gl.md +85 -85
- package/src/index.js +107 -107
- package/src/presets/agents-content.json +53 -53
- package/src/presets/models.json +68 -68
- package/src/steps/copy/agents.js +118 -118
- package/src/steps/copy/commands.js +91 -91
- package/src/steps/copy/fullstack-engineer.js +85 -83
- package/src/steps/copy/index.js +88 -88
- package/src/steps/copy/opencode-json.js +147 -129
- package/src/steps/copy/skills.js +196 -196
- package/src/steps/metadata/index.js +108 -108
- package/src/steps/models/write.js +34 -34
- package/src/steps/optimization/patch-guardrails.js +108 -108
- package/src/utils/copy.js +108 -108
- package/src/utils/legacy-check.js +30 -30
- package/src/utils/models-cache.js +58 -58
- package/src/utils/paths.js +67 -64
- package/src/utils/update-manifest.js +49 -49
- package/src/content/.opencode/plugins/pc-system-reminders.test.js +0 -35
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
# Agent file template
|
|
2
|
-
|
|
3
|
-
The agent file is exactly this structure: frontmatter plus one identity paragraph plus the `## Abilities` section. No other sections. No other content.
|
|
4
|
-
|
|
5
|
-
```markdown
|
|
6
|
-
---
|
|
7
|
-
description: <one sentence naming the persona + top 3-5 detected technologies>
|
|
8
|
-
mode:
|
|
9
|
-
color: <pick: primary|secondary|accent|error|info: avoid colors used by existing agents; warning is reserved for the
|
|
10
|
-
permission:
|
|
11
|
-
edit: allow
|
|
12
|
-
bash: allow
|
|
13
|
-
read: allow
|
|
14
|
-
glob: allow
|
|
15
|
-
grep: allow
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
<One paragraph: "You are a {persona} engineer specializing in {top technologies}. You own all work in {scope/files}." Keep it to 2-3 sentences max.>
|
|
19
|
-
|
|
20
|
-
## Abilities
|
|
21
|
-
- Guardrails: @pc-guardrails-generic, @pc-guardrails-project
|
|
22
|
-
- Development: <@installed-skill-1>, <@installed-skill-2>, ...
|
|
23
|
-
- Testing: <@installed-skill-for-testing>, ...
|
|
24
|
-
- Infrastructure: <@installed-skill-for-devops>, ...
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
That is the entire file: frontmatter, one identity paragraph, and the `## Abilities` section. The always-installed `pc-system-reminders` plugin loads the listed skills for every session. Replace every `<...>` placeholder with real values from your research. Remove any ability category line that has no skills assigned (besides Guardrails which is always present).
|
|
28
|
-
|
|
29
|
-
## Description quality bar
|
|
30
|
-
|
|
31
|
-
The `description:` field is the matching key for `/plan-apply`. The lead compares task domain text against agent descriptions to pick the right specialist. A weak description means the wrong engineer gets spawned.
|
|
32
|
-
|
|
33
|
-
Bad: `"A frontend engineer for React"`
|
|
34
|
-
Good: `"Frontend engineer for Ink 7 + React 19 TUI, FSD architecture, Inversify DI, design tokens, and i18n"`
|
|
35
|
-
|
|
36
|
-
Rules:
|
|
37
|
-
- Name the persona explicitly
|
|
38
|
-
- List the top 3-5 detected technologies from Step 2
|
|
39
|
-
- One sentence, no padding
|
|
40
|
-
|
|
41
|
-
## Identity paragraph
|
|
42
|
-
|
|
43
|
-
The identity paragraph sits between frontmatter and `## Abilities`. It tells the engineer who it is and what it owns in 2-3 sentences max. Not a spec, not a knowledge dump, a quick scoping statement.
|
|
44
|
-
|
|
45
|
-
Bad: 5 paragraphs of architecture details, FSD rules, design tokens, file maps, testing patterns.
|
|
46
|
-
Good: `"You are a frontend engineer specializing in terminal UI development with Ink 7 + React 19. You own all work in the FSD layers: src/app/, src/widgets/, src/features/, src/entities/, and src/shared/."`
|
|
47
|
-
|
|
48
|
-
Rules:
|
|
49
|
-
- State the persona and specialization in one sentence
|
|
50
|
-
- State what files or layers the engineer owns in one sentence
|
|
51
|
-
- Never exceed 3 sentences
|
|
52
|
-
|
|
53
|
-
## Category rules
|
|
54
|
-
|
|
55
|
-
- Development = language/framework/UI/DI skills. Testing = test/lint/typecheck skills. Infrastructure = DevOps/CI/CD/cloud skills.
|
|
56
|
-
- Only include ability categories that have at least one real skill (besides Guardrails which is always present).
|
|
57
|
-
- Name follows `{persona}-engineer` pattern (e.g. `frontend-engineer`, `backend-engineer`).
|
|
58
|
-
- Read existing agents' `color:` frontmatter first: pick a color not already used.
|
|
59
|
-
- `warning` is reserved for the lead (fullstack) engineer, the planning agent. Never assign it to a spawned specialist.
|
|
60
|
-
|
|
61
|
-
## Structural validation checklist
|
|
62
|
-
|
|
63
|
-
After writing the agent file, verify:
|
|
64
|
-
|
|
65
|
-
1. Frontmatter exists: starts with `---`, has `description`, `mode:
|
|
66
|
-
2. No `model:` field in the frontmatter. The `pc-subagent-tiers` plugin injects it.
|
|
67
|
-
3. `## Abilities` is the only `##` heading. No other `##` sections exist in the file.
|
|
68
|
-
4. One identity paragraph before `## Abilities`: 2-3 sentences max, not multiple paragraphs.
|
|
69
|
-
5. Abilities are categorized: each line starts with `- Guardrails:`, `- Development:`, `- Testing:`, or `- Infrastructure:`. No bare `@skill-name` lines.
|
|
70
|
-
6. One file only: no `.build.md`, `.fast.md`, or `.plan.md` variant was created.
|
|
71
|
-
|
|
72
|
-
If any check fails, rewrite the file to match the template exactly.
|
|
73
|
-
|
|
74
|
-
## Skill reference validation
|
|
75
|
-
|
|
76
|
-
1. Parse every `@skill-name` from the `## Abilities` section (excluding `@pc-guardrails-generic` and `@pc-guardrails-project` which are installed at init).
|
|
77
|
-
2. For each: check `.agents/skills/<skill-name>/SKILL.md` exists.
|
|
78
|
-
3. For each: check `skills-lock.json` contains the skill.
|
|
79
|
-
4. If `.agents/skills/<skill-name>/SKILL.md` exists but `skills-lock.json` is missing the entry: manually patch `skills-lock.json` using the Edit tool (same procedure as in the signal mapping reference). Re-read `skills-lock.json` to confirm it is valid JSON.
|
|
80
|
-
5. If `.agents/skills/<skill-name>/SKILL.md` is missing: try to install it: `npx skills add -y <owner/repo@skill-name>` (search `skills-lock.json` or `npx skills find` for the owner/repo). If install fails or the skill can't be found on skills.sh, remove the reference from the file, warn the user, and note it in the summary.
|
|
81
|
-
6. Re-read the file to confirm all remaining `@skill-name` references are valid.
|
|
1
|
+
# Agent file template
|
|
2
|
+
|
|
3
|
+
The agent file is exactly this structure: frontmatter plus one identity paragraph plus the `## Abilities` section. No other sections. No other content.
|
|
4
|
+
|
|
5
|
+
```markdown
|
|
6
|
+
---
|
|
7
|
+
description: <one sentence naming the persona + top 3-5 detected technologies>
|
|
8
|
+
mode: subagent
|
|
9
|
+
color: <pick: primary|secondary|accent|error|info: avoid colors used by existing agents; warning is reserved for the build and plan primaries>
|
|
10
|
+
permission:
|
|
11
|
+
edit: allow
|
|
12
|
+
bash: allow
|
|
13
|
+
read: allow
|
|
14
|
+
glob: allow
|
|
15
|
+
grep: allow
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<One paragraph: "You are a {persona} engineer specializing in {top technologies}. You own all work in {scope/files}." Keep it to 2-3 sentences max.>
|
|
19
|
+
|
|
20
|
+
## Abilities
|
|
21
|
+
- Guardrails: @pc-guardrails-generic, @pc-guardrails-project
|
|
22
|
+
- Development: <@installed-skill-1>, <@installed-skill-2>, ...
|
|
23
|
+
- Testing: <@installed-skill-for-testing>, ...
|
|
24
|
+
- Infrastructure: <@installed-skill-for-devops>, ...
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
That is the entire file: frontmatter, one identity paragraph, and the `## Abilities` section. The always-installed `pc-system-reminders` plugin loads the listed skills for every session. Replace every `<...>` placeholder with real values from your research. Remove any ability category line that has no skills assigned (besides Guardrails which is always present).
|
|
28
|
+
|
|
29
|
+
## Description quality bar
|
|
30
|
+
|
|
31
|
+
The `description:` field is the matching key for `/plan-apply`. The lead compares task domain text against agent descriptions to pick the right specialist. A weak description means the wrong engineer gets spawned.
|
|
32
|
+
|
|
33
|
+
Bad: `"A frontend engineer for React"`
|
|
34
|
+
Good: `"Frontend engineer for Ink 7 + React 19 TUI, FSD architecture, Inversify DI, design tokens, and i18n"`
|
|
35
|
+
|
|
36
|
+
Rules:
|
|
37
|
+
- Name the persona explicitly
|
|
38
|
+
- List the top 3-5 detected technologies from Step 2
|
|
39
|
+
- One sentence, no padding
|
|
40
|
+
|
|
41
|
+
## Identity paragraph
|
|
42
|
+
|
|
43
|
+
The identity paragraph sits between frontmatter and `## Abilities`. It tells the engineer who it is and what it owns in 2-3 sentences max. Not a spec, not a knowledge dump, a quick scoping statement.
|
|
44
|
+
|
|
45
|
+
Bad: 5 paragraphs of architecture details, FSD rules, design tokens, file maps, testing patterns.
|
|
46
|
+
Good: `"You are a frontend engineer specializing in terminal UI development with Ink 7 + React 19. You own all work in the FSD layers: src/app/, src/widgets/, src/features/, src/entities/, and src/shared/."`
|
|
47
|
+
|
|
48
|
+
Rules:
|
|
49
|
+
- State the persona and specialization in one sentence
|
|
50
|
+
- State what files or layers the engineer owns in one sentence
|
|
51
|
+
- Never exceed 3 sentences
|
|
52
|
+
|
|
53
|
+
## Category rules
|
|
54
|
+
|
|
55
|
+
- Development = language/framework/UI/DI skills. Testing = test/lint/typecheck skills. Infrastructure = DevOps/CI/CD/cloud skills.
|
|
56
|
+
- Only include ability categories that have at least one real skill (besides Guardrails which is always present).
|
|
57
|
+
- Name follows `{persona}-engineer` pattern (e.g. `frontend-engineer`, `backend-engineer`).
|
|
58
|
+
- Read existing agents' `color:` frontmatter first: pick a color not already used.
|
|
59
|
+
- `warning` is reserved for the lead (fullstack) engineer, the planning agent. Never assign it to a spawned specialist.
|
|
60
|
+
|
|
61
|
+
## Structural validation checklist
|
|
62
|
+
|
|
63
|
+
After writing the agent file, verify:
|
|
64
|
+
|
|
65
|
+
1. Frontmatter exists: starts with `---`, has `description`, `mode: subagent`, `color`, `permission` block.
|
|
66
|
+
2. No `model:` field in the frontmatter. The `pc-subagent-tiers` plugin injects it.
|
|
67
|
+
3. `## Abilities` is the only `##` heading. No other `##` sections exist in the file.
|
|
68
|
+
4. One identity paragraph before `## Abilities`: 2-3 sentences max, not multiple paragraphs.
|
|
69
|
+
5. Abilities are categorized: each line starts with `- Guardrails:`, `- Development:`, `- Testing:`, or `- Infrastructure:`. No bare `@skill-name` lines.
|
|
70
|
+
6. One file only: no `.build.md`, `.fast.md`, or `.plan.md` variant was created.
|
|
71
|
+
|
|
72
|
+
If any check fails, rewrite the file to match the template exactly.
|
|
73
|
+
|
|
74
|
+
## Skill reference validation
|
|
75
|
+
|
|
76
|
+
1. Parse every `@skill-name` from the `## Abilities` section (excluding `@pc-guardrails-generic` and `@pc-guardrails-project` which are installed at init).
|
|
77
|
+
2. For each: check `.agents/skills/<skill-name>/SKILL.md` exists.
|
|
78
|
+
3. For each: check `skills-lock.json` contains the skill.
|
|
79
|
+
4. If `.agents/skills/<skill-name>/SKILL.md` exists but `skills-lock.json` is missing the entry: manually patch `skills-lock.json` using the Edit tool (same procedure as in the signal mapping reference). Re-read `skills-lock.json` to confirm it is valid JSON.
|
|
80
|
+
5. If `.agents/skills/<skill-name>/SKILL.md` is missing: try to install it: `npx skills add -y <owner/repo@skill-name>` (search `skills-lock.json` or `npx skills find` for the owner/repo). If install fails or the skill can't be found on skills.sh, remove the reference from the file, warn the user, and note it in the summary.
|
|
81
|
+
6. Re-read the file to confirm all remaining `@skill-name` references are valid.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: pc-make-evidence-scaffold
|
|
3
|
-
description: DEPRECATED. Visual evidence is now built into pc-ops-evidence using playwright-cli + pnpm run dev. No per-project scaffold is needed. This skill is kept for backward compatibility but should not be used.
|
|
4
|
-
license: MIT
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# DEPRECATED
|
|
8
|
-
|
|
9
|
-
This skill is no longer needed. Visual evidence uses a two-phase architecture:
|
|
10
|
-
|
|
11
|
-
1. **Agent phase:** `pc-ops-evidence` writes a `capturePlan` in `evidence.json` (the agent sandbox cannot run Docker or headless Chromium)
|
|
12
|
-
2. **CI phase:** A separate "Visual evidence" CI workflow reads the capturePlan and captures screenshots on a runner with full Docker and Chrome access
|
|
13
|
-
|
|
14
|
-
No per-project scaffold, fixture apps, or scenario registries are required. The `pc-ops-evidence` skill handles everything generically.
|
|
15
|
-
|
|
16
|
-
If you previously ran `/make-evidence-scaffold` and have a `src/visual-evidence/` directory or `visual-evidence` scripts in `package.json`, you can delete them — the new system does not use them.
|
|
17
|
-
|
|
18
|
-
To capture evidence for a change, just run `/ops-evidence` or let `/plan-goal` handle it automatically.
|
|
1
|
+
---
|
|
2
|
+
name: pc-make-evidence-scaffold
|
|
3
|
+
description: DEPRECATED. Visual evidence is now built into pc-ops-evidence using playwright-cli + pnpm run dev. No per-project scaffold is needed. This skill is kept for backward compatibility but should not be used.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# DEPRECATED
|
|
8
|
+
|
|
9
|
+
This skill is no longer needed. Visual evidence uses a two-phase architecture:
|
|
10
|
+
|
|
11
|
+
1. **Agent phase:** `pc-ops-evidence` writes a `capturePlan` in `evidence.json` (the agent sandbox cannot run Docker or headless Chromium)
|
|
12
|
+
2. **CI phase:** A separate "Visual evidence" CI workflow reads the capturePlan and captures screenshots on a runner with full Docker and Chrome access
|
|
13
|
+
|
|
14
|
+
No per-project scaffold, fixture apps, or scenario registries are required. The `pc-ops-evidence` skill handles everything generically.
|
|
15
|
+
|
|
16
|
+
If you previously ran `/make-evidence-scaffold` and have a `src/visual-evidence/` directory or `visual-evidence` scripts in `package.json`, you can delete them — the new system does not use them.
|
|
17
|
+
|
|
18
|
+
To capture evidence for a change, just run `/ops-evidence` or let `/plan-goal` handle it automatically.
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# Evidence contract
|
|
2
|
-
|
|
3
|
-
Evidence captured by `/plan-goal` 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
|
+
# Evidence contract
|
|
2
|
+
|
|
3
|
+
Evidence captured by `/plan-goal` 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,74 @@
|
|
|
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
|
-
Analyze `ARCHITECTURE.md` and other project files to generate or update a `pc-guardrails-project` skill: a set of rules and constraints extracted from the project's own documentation that agents must follow.
|
|
10
|
-
|
|
11
|
-
## Steps
|
|
12
|
-
|
|
13
|
-
1. **Check current state**
|
|
14
|
-
|
|
15
|
-
Read `.agents/skills/pc-guardrails-project/SKILL.md`. Determine which mode to use:
|
|
16
|
-
- Does not exist: Generate mode. Create from scratch.
|
|
17
|
-
- Exists and has a `<!-- Last updated:` footer: Update mode. Incrementally update.
|
|
18
|
-
- Exists but no timestamp: proceed in Generate mode (full regeneration).
|
|
19
|
-
|
|
20
|
-
2a. **Generate mode: read source documents**
|
|
21
|
-
|
|
22
|
-
Read ALL of the following that exist:
|
|
23
|
-
- `ARCHITECTURE.md` (primary source)
|
|
24
|
-
- `DESIGN.md` (design system, component conventions)
|
|
25
|
-
- `AGENTS.md` (existing agent instructions, optimizations)
|
|
26
|
-
- `README.md` (setup, conventions)
|
|
27
|
-
- `CONTRIBUTING.md` (if present)
|
|
28
|
-
- `.opencode/harness.json` (platform, models, concurrency)
|
|
29
|
-
- `openspec/config.yaml` (if present: domain context and rules)
|
|
30
|
-
- Root config files: `package.json`, `tsconfig.json`, `biome.json`, `.eslintrc*`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`: whatever exists
|
|
31
|
-
- CI/CD workflows: `.github/workflows/*`, `azure-pipelines.yml`: whatever exists
|
|
32
|
-
|
|
33
|
-
Use file tools to discover constraints: `read` the documents above, `grep` for lint/formatter config rules.
|
|
34
|
-
|
|
35
|
-
2b. **Update mode: incremental analysis**
|
|
36
|
-
|
|
37
|
-
Extract the `<!-- Last updated: <ISO date> -->` timestamp from the existing skill file. Then:
|
|
38
|
-
- Read `ARCHITECTURE.md` and check its `<!-- Last updated:` timestamp. If ARCHITECTURE.md hasn't changed since the guardrails were last generated, report "Guardrails up to date" and stop.
|
|
39
|
-
- Run `git log --oneline --since="<date>" -- <config files, lint configs, CI workflows>` to find what convention/config files changed.
|
|
40
|
-
- If nothing changed: report "Guardrails up to date" and stop.
|
|
41
|
-
- Update only the affected rule categories. Preserve manually-added rules in unchanged categories.
|
|
42
|
-
- If changes are pervasive (new architecture, new framework, new platform), fall back to Generate mode.
|
|
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
|
+
Analyze `ARCHITECTURE.md` and other project files to generate or update a `pc-guardrails-project` skill: a set of rules and constraints extracted from the project's own documentation that agents must follow.
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. **Check current state**
|
|
14
|
+
|
|
15
|
+
Read `.agents/skills/pc-guardrails-project/SKILL.md`. Determine which mode to use:
|
|
16
|
+
- Does not exist: Generate mode. Create from scratch.
|
|
17
|
+
- Exists and has a `<!-- Last updated:` footer: Update mode. Incrementally update.
|
|
18
|
+
- Exists but no timestamp: proceed in Generate mode (full regeneration).
|
|
19
|
+
|
|
20
|
+
2a. **Generate mode: read source documents**
|
|
21
|
+
|
|
22
|
+
Read ALL of the following that exist:
|
|
23
|
+
- `ARCHITECTURE.md` (primary source)
|
|
24
|
+
- `DESIGN.md` (design system, component conventions)
|
|
25
|
+
- `AGENTS.md` (existing agent instructions, optimizations)
|
|
26
|
+
- `README.md` (setup, conventions)
|
|
27
|
+
- `CONTRIBUTING.md` (if present)
|
|
28
|
+
- `.opencode/harness.json` (platform, models, concurrency)
|
|
29
|
+
- `openspec/config.yaml` (if present: domain context and rules)
|
|
30
|
+
- Root config files: `package.json`, `tsconfig.json`, `biome.json`, `.eslintrc*`, `Cargo.toml`, `go.mod`, `pyproject.toml`, `pom.xml`: whatever exists
|
|
31
|
+
- CI/CD workflows: `.github/workflows/*`, `azure-pipelines.yml`: whatever exists
|
|
32
|
+
|
|
33
|
+
Use file tools to discover constraints: `read` the documents above, `grep` for lint/formatter config rules.
|
|
34
|
+
|
|
35
|
+
2b. **Update mode: incremental analysis**
|
|
36
|
+
|
|
37
|
+
Extract the `<!-- Last updated: <ISO date> -->` timestamp from the existing skill file. Then:
|
|
38
|
+
- Read `ARCHITECTURE.md` and check its `<!-- Last updated:` timestamp. If ARCHITECTURE.md hasn't changed since the guardrails were last generated, report "Guardrails up to date" and stop.
|
|
39
|
+
- Run `git log --oneline --since="<date>" -- <config files, lint configs, CI workflows>` to find what convention/config files changed.
|
|
40
|
+
- If nothing changed: report "Guardrails up to date" and stop.
|
|
41
|
+
- Update only the affected rule categories. Preserve manually-added rules in unchanged categories.
|
|
42
|
+
- If changes are pervasive (new architecture, new framework, new platform), fall back to Generate mode.
|
|
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,68 +1,68 @@
|
|
|
1
|
-
# Guardrails category reference
|
|
2
|
-
|
|
3
|
-
From the documents and code graph analysis, extract concrete, actionable rules in these categories. Only include a category if you found real evidence for it.
|
|
4
|
-
|
|
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: avoid god-files and dumping-ground constants. Each file should have one clear responsibility. Split by domain or feature instead (e.g. `user-constants.ts`, `order-types.ts`, `auth-config.ts`). A file that imports from 5+ unrelated modules is a sign it should be split.
|
|
7
|
-
- Naming conventions: file naming, component naming, API route conventions, branch naming
|
|
8
|
-
- Code style: formatter config, lint rules, import ordering, max line length. Derive from actual config files.
|
|
9
|
-
- Testing rules: test file locations, naming, coverage gates, what must be tested before merge
|
|
10
|
-
- Build & deployment: build commands, env requirements, deployment targets, CI gates
|
|
11
|
-
- Data & state: migration rules, schema change process, state management patterns
|
|
12
|
-
- Security: auth boundaries, input validation requirements, secrets handling
|
|
13
|
-
- Dependencies: package manager, lockfile rules, upgrade policy, forbidden packages
|
|
14
|
-
- Git workflow: branch naming, commit message format, PR process (platform-specific from `harness.json`)
|
|
15
|
-
- Domain-specific rules: anything in `openspec/config.yaml` context or `ARCHITECTURE.md` constraints/risks sections
|
|
16
|
-
|
|
17
|
-
Each rule must be:
|
|
18
|
-
- Concrete: "Use `pnpm` not `npm`" not "Use the right package manager"
|
|
19
|
-
- Evidence-based: derive from the files/code graph you analyzed, do not invent rules
|
|
20
|
-
- Actionable: an agent can check it before acting
|
|
21
|
-
|
|
22
|
-
## Skill template
|
|
23
|
-
|
|
24
|
-
Write (or update) `.agents/skills/pc-guardrails-project/SKILL.md`:
|
|
25
|
-
|
|
26
|
-
```markdown
|
|
27
|
-
---
|
|
28
|
-
name: pc-guardrails-project
|
|
29
|
-
description: Project-specific rules and constraints extracted from ARCHITECTURE.md. Load this skill before implementing any change to understand boundaries, conventions, and constraints for this codebase.
|
|
30
|
-
license: MIT
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
# Project Guardrails
|
|
34
|
-
|
|
35
|
-
> Auto-generated by `/make-guardrails`. Regenerate with the same command when architecture or conventions change.
|
|
36
|
-
|
|
37
|
-
## Architecture Constraints
|
|
38
|
-
- <rule>
|
|
39
|
-
- <rule>
|
|
40
|
-
|
|
41
|
-
## Naming Conventions
|
|
42
|
-
- <rule>
|
|
43
|
-
|
|
44
|
-
## Code Style
|
|
45
|
-
- <rule>
|
|
46
|
-
|
|
47
|
-
## Testing
|
|
48
|
-
- <rule>
|
|
49
|
-
|
|
50
|
-
## Build & Deployment
|
|
51
|
-
- <rule>
|
|
52
|
-
|
|
53
|
-
## Data & State
|
|
54
|
-
- <rule>
|
|
55
|
-
|
|
56
|
-
## Security
|
|
57
|
-
- <rule>
|
|
58
|
-
|
|
59
|
-
## Dependencies
|
|
60
|
-
- <rule>
|
|
61
|
-
|
|
62
|
-
## Git Workflow
|
|
63
|
-
- <rule>
|
|
64
|
-
|
|
65
|
-
<!-- Last updated: <current ISO timestamp> -->
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Only include sections that have real rules. Omit empty sections.
|
|
1
|
+
# Guardrails category reference
|
|
2
|
+
|
|
3
|
+
From the documents and code graph analysis, extract concrete, actionable rules in these categories. Only include a category if you found real evidence for it.
|
|
4
|
+
|
|
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: avoid god-files and dumping-ground constants. Each file should have one clear responsibility. Split by domain or feature instead (e.g. `user-constants.ts`, `order-types.ts`, `auth-config.ts`). A file that imports from 5+ unrelated modules is a sign it should be split.
|
|
7
|
+
- Naming conventions: file naming, component naming, API route conventions, branch naming
|
|
8
|
+
- Code style: formatter config, lint rules, import ordering, max line length. Derive from actual config files.
|
|
9
|
+
- Testing rules: test file locations, naming, coverage gates, what must be tested before merge
|
|
10
|
+
- Build & deployment: build commands, env requirements, deployment targets, CI gates
|
|
11
|
+
- Data & state: migration rules, schema change process, state management patterns
|
|
12
|
+
- Security: auth boundaries, input validation requirements, secrets handling
|
|
13
|
+
- Dependencies: package manager, lockfile rules, upgrade policy, forbidden packages
|
|
14
|
+
- Git workflow: branch naming, commit message format, PR process (platform-specific from `harness.json`)
|
|
15
|
+
- Domain-specific rules: anything in `openspec/config.yaml` context or `ARCHITECTURE.md` constraints/risks sections
|
|
16
|
+
|
|
17
|
+
Each rule must be:
|
|
18
|
+
- Concrete: "Use `pnpm` not `npm`" not "Use the right package manager"
|
|
19
|
+
- Evidence-based: derive from the files/code graph you analyzed, do not invent rules
|
|
20
|
+
- Actionable: an agent can check it before acting
|
|
21
|
+
|
|
22
|
+
## Skill template
|
|
23
|
+
|
|
24
|
+
Write (or update) `.agents/skills/pc-guardrails-project/SKILL.md`:
|
|
25
|
+
|
|
26
|
+
```markdown
|
|
27
|
+
---
|
|
28
|
+
name: pc-guardrails-project
|
|
29
|
+
description: Project-specific rules and constraints extracted from ARCHITECTURE.md. Load this skill before implementing any change to understand boundaries, conventions, and constraints for this codebase.
|
|
30
|
+
license: MIT
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# Project Guardrails
|
|
34
|
+
|
|
35
|
+
> Auto-generated by `/make-guardrails`. Regenerate with the same command when architecture or conventions change.
|
|
36
|
+
|
|
37
|
+
## Architecture Constraints
|
|
38
|
+
- <rule>
|
|
39
|
+
- <rule>
|
|
40
|
+
|
|
41
|
+
## Naming Conventions
|
|
42
|
+
- <rule>
|
|
43
|
+
|
|
44
|
+
## Code Style
|
|
45
|
+
- <rule>
|
|
46
|
+
|
|
47
|
+
## Testing
|
|
48
|
+
- <rule>
|
|
49
|
+
|
|
50
|
+
## Build & Deployment
|
|
51
|
+
- <rule>
|
|
52
|
+
|
|
53
|
+
## Data & State
|
|
54
|
+
- <rule>
|
|
55
|
+
|
|
56
|
+
## Security
|
|
57
|
+
- <rule>
|
|
58
|
+
|
|
59
|
+
## Dependencies
|
|
60
|
+
- <rule>
|
|
61
|
+
|
|
62
|
+
## Git Workflow
|
|
63
|
+
- <rule>
|
|
64
|
+
|
|
65
|
+
<!-- Last updated: <current ISO timestamp> -->
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Only include sections that have real rules. Omit empty sections.
|