@plainconceptsplatform/agent-harness 2.7.0 → 2.9.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 +7 -1
- package/cli/commands/migrate.js +1 -1
- package/cli/steps/copy/skills.js +12 -2
- package/package.json +3 -1
- package/skills/README.md +18 -0
- package/skills/agent-harness-cli/SKILL.md +86 -0
- package/{harness/.agents/skills → skills}/pc-make-architecture/SKILL.md +1 -0
- package/skills/pc-make-architecture/structure-template.md +64 -0
- package/{harness/.agents/skills → skills}/pc-make-guardrails/SKILL.md +1 -0
- package/{harness/.agents/skills → skills}/pc-make-guardrails/category-reference.md +39 -0
- package/harness/.agents/skills/pc-make-architecture/structure-template.md +0 -38
- package/harness/.agents/skills/pc-make-evidence-scaffold/SKILL.md +0 -18
- package/harness/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +0 -29
- package/harness/.opencode/commands/make-evidence-scaffold.md +0 -5
- /package/{harness/.agents/skills → skills}/browser-automation/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-guardrails-generic/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-guardrails-project/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-make-design/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-make-engineer/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-make-engineer/signal-mapping.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-make-engineer/template.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-make-merge-risk-assess/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-make-merge-risk-assess/category-reference.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-make-user-model/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-ops-evidence/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-ops-ship/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-apply/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-apply/simple-mode.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-archive/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-explore/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-goal/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-goal/branching.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-goal/failure-policy.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-goal/output-mode.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-goal/output.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-propose/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-propose/task-annotation.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-quick/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-plan-story/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-repo-audit/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-repo-help/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-repo-initialize/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-repo-onboard/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-repo-verify/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-userstory-az/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-userstory-browser/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-userstory-gh/SKILL.md +0 -0
- /package/{harness/.agents/skills → skills}/pc-userstory-jira/SKILL.md +0 -0
package/README.md
CHANGED
|
@@ -400,7 +400,13 @@ Data the CLI reads lives in two places, split by kind:
|
|
|
400
400
|
|
|
401
401
|
Every filename the harness writes into a project is declared once in `cli/utils/paths.js`. Change it there, and remember the OpenCode plugins under `harness/.opencode/plugins/` read those same names at runtime.
|
|
402
402
|
|
|
403
|
-
`skills/` holds skills
|
|
403
|
+
`skills/` holds both the installable `pc-*` skills and the `agent-harness-cli` skill for agents operating this CLI. See [skills/README.md](./skills/README.md). All of them ship to npm and are discoverable by `npx skills`, so you can install individual skills into any project without the full harness:
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
npx skills add PlainConceptsPlatform/agent-harness
|
|
407
|
+
# or scope to a single skill:
|
|
408
|
+
npx skills add PlainConceptsPlatform/agent-harness --skill pc-ops-ship
|
|
409
|
+
```
|
|
404
410
|
|
|
405
411
|
```bash
|
|
406
412
|
git clone https://github.com/PlainConceptsPlatform/agent-harness.git
|
package/cli/commands/migrate.js
CHANGED
|
@@ -9,7 +9,7 @@ import { CONFIG_FILE, MANIFEST_FILE, OPENCODE_DIR, USER_CONFIG_FILE } from '../u
|
|
|
9
9
|
import { exit } from '../utils/process.js'
|
|
10
10
|
|
|
11
11
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
12
|
-
const CONTENT_SKILLS_DIR = path.resolve(__dirname, '../../
|
|
12
|
+
const CONTENT_SKILLS_DIR = path.resolve(__dirname, '../../skills')
|
|
13
13
|
|
|
14
14
|
// State files, old name to new. The run-state file is deleted rather than moved:
|
|
15
15
|
// it is live wave state owned by the monitor plugin and is rebuilt on demand.
|
package/cli/steps/copy/skills.js
CHANGED
|
@@ -5,7 +5,7 @@ import { info, success } from '../../utils/exec.js'
|
|
|
5
5
|
import { canUpdateManagedFile, readUpdateManifest, recordManagedFile, writeUpdateManifest } from '../../utils/update-manifest.js'
|
|
6
6
|
|
|
7
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
8
|
-
const CONTENT_SKILLS_DIR = path.resolve(__dirname, '../../../
|
|
8
|
+
const CONTENT_SKILLS_DIR = path.resolve(__dirname, '../../../skills')
|
|
9
9
|
const CONTENT_SKILLS_LOCK = path.resolve(__dirname, '../../../harness/skills-lock.json')
|
|
10
10
|
|
|
11
11
|
// Userstory skills parse backlog work items: selected by backlogPlatform only.
|
|
@@ -28,7 +28,16 @@ export const SKILL_RENAME = {
|
|
|
28
28
|
'pc-userstory-browser': 'pc-userstory',
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// Skills that ship in the source tree but must never be copied into a target
|
|
32
|
+
// project. agent-harness-cli documents the CLI itself for agents working on
|
|
33
|
+
// THIS repo; it has no value in a consumer repo and would clutter .agents/skills.
|
|
34
|
+
// Listed by directory name as read from CONTENT_SKILLS_DIR.
|
|
35
|
+
export const NON_INSTALLABLE_SKILLS = new Set([
|
|
36
|
+
'agent-harness-cli',
|
|
37
|
+
])
|
|
38
|
+
|
|
31
39
|
function shouldInstallSkill(skill, backlogPlatform, _repoPlatform) {
|
|
40
|
+
if (NON_INSTALLABLE_SKILLS.has(skill)) return false
|
|
32
41
|
if (skill in BACKLOG_PLATFORM_SKILLS) return BACKLOG_PLATFORM_SKILLS[skill] === backlogPlatform
|
|
33
42
|
return true
|
|
34
43
|
}
|
|
@@ -185,7 +194,8 @@ async function installObSkills(backlogPlatform = 'github', repoPlatform, { force
|
|
|
185
194
|
// Build the set of skill names we ship (source dirs, after rename).
|
|
186
195
|
// Only these may be removed during forceOverwrite — project-generated
|
|
187
196
|
// skills (pc-merge-risk-assess, custom loops, etc.) must survive.
|
|
188
|
-
const contentSkills = await fse.readdir(CONTENT_SKILLS_DIR)
|
|
197
|
+
const contentSkills = (await fse.readdir(CONTENT_SKILLS_DIR))
|
|
198
|
+
.filter(name => !NON_INSTALLABLE_SKILLS.has(name))
|
|
189
199
|
const shippedNames = new Set()
|
|
190
200
|
for (const skill of contentSkills) {
|
|
191
201
|
const stat = await fse.stat(path.join(CONTENT_SKILLS_DIR, skill)).catch(() => null)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plainconceptsplatform/agent-harness",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Installs the Plain Concepts Platform Harness into any codebase, and keeps it up to date. Wires OpenCode, OpenSpec, codegraph, and agentmemory into a multi-agent workflow that runs on native parallel subagents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"opencode",
|
|
@@ -29,8 +29,10 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"cli",
|
|
31
31
|
"harness",
|
|
32
|
+
"skills",
|
|
32
33
|
"!cli/**/*.test.js",
|
|
33
34
|
"!harness/**/*.test.js",
|
|
35
|
+
"!skills/**/*.test.js",
|
|
34
36
|
"!harness/**/node_modules"
|
|
35
37
|
],
|
|
36
38
|
"publishConfig": {
|
package/skills/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# skills/
|
|
2
|
+
|
|
3
|
+
Two kinds of skills live here, both discoverable by `npx skills`:
|
|
4
|
+
|
|
5
|
+
| Kind | Directories | Purpose |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| Installable `pc-*` + `browser-automation` | `pc-*`, `browser-automation` | What the CLI copies into a target project under `.agents/skills/` during onboarding. Plain Concepts' own skills. |
|
|
8
|
+
| CLI-self | `agent-harness-cli` | Skills for agents working on THIS CLI repo (driving `npx @plainconceptsplatform/agent-harness`). Never copied into target projects. |
|
|
9
|
+
|
|
10
|
+
Discoverability: any `SKILL.md` in a subdirectory here is auto-discovered by OpenCode, Claude Code, and `npx skills` (which scans `./skills/` as a recognized project-skill location).
|
|
11
|
+
|
|
12
|
+
## Using one
|
|
13
|
+
|
|
14
|
+
Point your agent at the directory, or copy a skill into wherever your tool discovers skills:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
cp -r skills/agent-harness-cli ~/.claude/skills/
|
|
18
|
+
```
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-harness-cli
|
|
3
|
+
description: Drive the agent-harness CLI - install the Plain Concepts Platform Harness into a repository, bring an existing one up to date, set up a teammate's machine, or rerun a single step. Load when asked to install, update, or repair the Platform Harness, when a repo needs AI/agent scaffolding set up, or when a command like `npx @plainconceptsplatform/agent-harness` fails and needs diagnosing.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# agent-harness CLI
|
|
8
|
+
|
|
9
|
+
`agent-harness` installs the **Plain Concepts Platform Harness** into a repository and keeps it up to date. The harness is Plain Concepts' own, and it is the set of files agents work from: slash commands, `pc-*` skills (the `pc-` is Plain Concepts), an agent team, OpenCode plugins, an OpenSpec workspace, and generated `ARCHITECTURE.md` and `DESIGN.md`.
|
|
10
|
+
|
|
11
|
+
Everything runs against the **current working directory**. `cd` into the target repository first; there is no `--path` flag.
|
|
12
|
+
|
|
13
|
+
## Pick the right verb
|
|
14
|
+
|
|
15
|
+
Read the repo before running anything. `.opencode/harness.json` is the marker for "harness already installed".
|
|
16
|
+
|
|
17
|
+
| Situation | Command |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| No `.opencode/harness.json` | `npx @plainconceptsplatform/agent-harness@latest` (the install wizard) |
|
|
20
|
+
| Harness present, want the latest release's files | `npx @plainconceptsplatform/agent-harness@latest update` |
|
|
21
|
+
| Harness present, new machine or new teammate | `npx @plainconceptsplatform/agent-harness join` |
|
|
22
|
+
| One specific thing needs redoing | a single step command, see below |
|
|
23
|
+
|
|
24
|
+
Requires Node.js 18+.
|
|
25
|
+
|
|
26
|
+
## The install wizard is interactive
|
|
27
|
+
|
|
28
|
+
The wizard asks about source scope, backlog and repository platform, three models, and optional token-optimization tools. **Do not run it in a non-interactive shell.** It will hang or abort. If you cannot present prompts to a human, say so and hand the command to the user rather than trying to drive it.
|
|
29
|
+
|
|
30
|
+
Everything else (`update`, and the single-step commands other than `platform`, `models`, `optimization`) runs without prompts.
|
|
31
|
+
|
|
32
|
+
## Single-step commands
|
|
33
|
+
|
|
34
|
+
Run one step without the full wizard. Each reuses context from `.opencode/harness.json` when it needs to.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
clean Remove pre-existing AI files (AGENTS.md, .cursorrules, CLAUDE.md, ...)
|
|
38
|
+
platform Choose backlog + repository platform
|
|
39
|
+
copy Copy agents, skills, commands, docs into the repo
|
|
40
|
+
openspec Initialize the OpenSpec workspace
|
|
41
|
+
models Choose plan / build / fast models
|
|
42
|
+
optimization Configure RTK, quota, Simple English, codegraph, agentmemory, humanizer
|
|
43
|
+
browser Install agent-browser (npm package + its Chrome for Testing)
|
|
44
|
+
metadata Rewrite .opencode/harness.json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`metadata` last if you ran several, because it refreshes the config the others read.
|
|
48
|
+
|
|
49
|
+
## What lands in the repo
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
.opencode/
|
|
53
|
+
harness.json harness config: platform, models, agents.maxConcurrent
|
|
54
|
+
harness-managed.json hash per managed file, so update spares your edits
|
|
55
|
+
harness.user.json per-developer model override (gitignored)
|
|
56
|
+
harness-run.json live subagent wave state (gitignored)
|
|
57
|
+
commands/ slash commands
|
|
58
|
+
plugins/ pc-subagent-monitor, pc-subagent-tiers, pc-system-reminders
|
|
59
|
+
agents/ fullstack-engineer + user-created *-engineer files
|
|
60
|
+
.agents/skills/ pc-* skills
|
|
61
|
+
AGENTS.md ARCHITECTURE.md DESIGN.md
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
After a fresh install, the next move is `/repo-initialize` inside OpenCode. That is what generates real `ARCHITECTURE.md` and `DESIGN.md` and activates the agent team. Installing the harness alone does not do it.
|
|
65
|
+
|
|
66
|
+
## `update` is edit-safe
|
|
67
|
+
|
|
68
|
+
`update` compares each managed file against the hash recorded in `.opencode/harness-managed.json`. Files you changed by hand are left alone and reported as preserved. Generated skills (`pc-guardrails-project`, `pc-merge-risk-assess`) are never overwritten once populated. So `update` is safe to run repeatedly, and a second consecutive run should report no changes.
|
|
69
|
+
|
|
70
|
+
## Diagnosing failures
|
|
71
|
+
|
|
72
|
+
**"This project was set up by opencode-onboard v1".** The repo has v1 state files or `ob-*` skills. v2 renamed both and does not migrate. Re-onboard on a clean branch; do not try to rename the files by hand, because the marker comments inside the installed skills changed too.
|
|
73
|
+
|
|
74
|
+
**"No config found. Run the wizard first."** `update` or a step needs `.opencode/harness.json` and it is absent. Run the wizard.
|
|
75
|
+
|
|
76
|
+
**A platform step reports nothing and changes nothing.** Platform content is injected into `<!-- PC-PLATFORM-*-START/END -->` marker pairs. If a marker pair is missing from the target file, injection is skipped silently. Check the markers exist before concluding the step worked.
|
|
77
|
+
|
|
78
|
+
**Skills missing after install.** Skill installation ends with `npx skills experimental_install --yes`, run once at the end of the optimization step. If it failed, rerun it directly in the repo.
|
|
79
|
+
|
|
80
|
+
**Platform CLI warnings.** The harness expects `gh` (GitHub), `az` + azure-devops extension (Azure DevOps), `acli` (Jira), `glab` (GitLab), each authenticated. These are warnings, not fatal; the harness installs, but the matching `/ops-*` flows will not work until the CLI is present.
|
|
81
|
+
|
|
82
|
+
## Rules
|
|
83
|
+
|
|
84
|
+
- Never edit `.opencode/harness.json` by hand to change models. Use `/make-user-model <tier> <model>` inside OpenCode, or the `models` step.
|
|
85
|
+
- Never commit `harness.user.json` or `harness-run.json`. Both belong in `.opencode/.gitignore`, which `join` verifies.
|
|
86
|
+
- `clean` deletes files. Confirm with the user before running it on a repo that already has AI configuration worth keeping.
|
|
@@ -13,6 +13,7 @@ Write `ARCHITECTURE.md` in the project root from what the codebase actually cont
|
|
|
13
13
|
- Never regenerate over a file that carries a `<!-- Last updated:` footer. That footer is what makes the next run incremental, and a full rewrite silently drops whatever a human added by hand. Read the file first and pick the mode.
|
|
14
14
|
- Never analyze outside `.opencode/source-roots.json` when it exists, plus this repo's own docs and config.
|
|
15
15
|
- The footer is the file's last line, and it is the run's own ISO timestamp: `<!-- Last updated: <ISO date> -->`.
|
|
16
|
+
- Follow the writing rules and self-check defined in the [structure template](structure-template.md). After generating, re-read each section: if a section only describes what exists without stating what breaks when its constraints are violated, rewrite it as constraint-embedded prose or cut it. The file is not written until the self-check passes.
|
|
16
17
|
|
|
17
18
|
## Modes
|
|
18
19
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# ARCHITECTURE.md structure template
|
|
2
|
+
|
|
3
|
+
Write (or update) `ARCHITECTURE.md` following this structure. Only include sections relevant to the project; omit sections with no evidence.
|
|
4
|
+
|
|
5
|
+
- Architecture Overview: what the system is, what problem it solves, major architectural style
|
|
6
|
+
- 1. Project Structure: annotated directory tree with purpose of each major directory
|
|
7
|
+
- 2. High-Level System Diagram: Mermaid diagram of actors, services, data stores, external systems
|
|
8
|
+
- 3. Core Components: each major component: name, responsibility, key files, technologies, inputs/outputs
|
|
9
|
+
- 3.1 Frontend / User Interface (if present)
|
|
10
|
+
- 3.2 Backend / Server / API (if present)
|
|
11
|
+
- 3.3 Shared Libraries / Common Code (if present)
|
|
12
|
+
- 3.4 CLI / Scripts / Automation (if present)
|
|
13
|
+
- 4. Data Flow: request lifecycle, key user journeys, sequence diagram for main runtime flow
|
|
14
|
+
- 5. Data Stores: all persistent storage: type, purpose, schemas, migration approach
|
|
15
|
+
- 6. External Integrations / APIs: each integration: method, config location, auth, failure behavior
|
|
16
|
+
- 7. Key Technologies: full stack summary with architectural relevance of each
|
|
17
|
+
- 8. Deployment & Infrastructure: build artifacts, env config, containerization, CI/CD, hosting
|
|
18
|
+
- 9. Security Architecture: auth, authz, secrets, input validation, trust boundaries
|
|
19
|
+
- 10. Monitoring & Observability: logging, metrics, tracing, error reporting
|
|
20
|
+
- 11. Performance & Scalability: caching, batching, concurrency, known bottlenecks
|
|
21
|
+
- 12. Development Workflow: local setup, install/dev/test/build/lint commands
|
|
22
|
+
- 13. Testing Strategy: test frameworks, locations, coverage gates, gaps
|
|
23
|
+
- 14. Architectural Decisions & Rationale: key choices with evidence and tradeoffs
|
|
24
|
+
- 15. Constraints, Risks, and Technical Debt: tight coupling, TODOs, operational risks
|
|
25
|
+
- 16. Future Considerations: documented roadmap + reasonable recommendations (labeled as such)
|
|
26
|
+
- 17. Project Identification: name, language, type, runtime, date of review, maintainer
|
|
27
|
+
- 18. Glossary / Acronyms: project-specific terms an agent or new developer needs to know
|
|
28
|
+
|
|
29
|
+
Append at the very end of the file:
|
|
30
|
+
```
|
|
31
|
+
<!-- Last updated: <current ISO timestamp> -->
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Rules:
|
|
35
|
+
- Be specific and concrete: include actual directories, files, modules, commands.
|
|
36
|
+
- Mark anything undiscoverable as "Not evident from the repository".
|
|
37
|
+
- Use Mermaid diagrams where helpful.
|
|
38
|
+
- Write as if this document will be committed and maintained over time.
|
|
39
|
+
|
|
40
|
+
## Writing rules
|
|
41
|
+
|
|
42
|
+
These rules govern the voice and shape of every section. The ARCHITECTURE.md is the primary artifact an agent reads to understand the system's invariants — it must teach constraints, not just inventory structure. These are enforced by re-reading each section after generation (see the self-check in the skill).
|
|
43
|
+
|
|
44
|
+
1. **Every section must answer "what breaks if this is violated," not just "what exists."** A section that only describes structure without stating the constraint it protects and the consequence of crossing it is reference material, not architecture. "The system has four modules" is structure; "Modules must not cross-reference each other in Domain or Application, and flow goes through port interfaces or domain events" is a constraint.
|
|
45
|
+
|
|
46
|
+
2. **Architectural decisions must carry their rationale and what they superseded.** A decision table row that says "Adopt X" is a fact; "Adopt X because Y, supersedes decision Z which assumed W" is a constraint that teaches an agent why a change would be wrong. If a decision was reached after rejecting an alternative, name the alternative and why it was rejected.
|
|
47
|
+
|
|
48
|
+
3. **State boundaries as prohibitions with consequences.** "Layering is enforced: Api → Application → Domain" is a constraint. "Api → Application → Domain" alone is a dependency list. "Only the Composition namespace in Api reaches Infrastructure" is a constraint; "Api depends on Infrastructure" is a fact. Prefer the constraint form: name the boundary, state who must not cross it, and what breaks when it is crossed.
|
|
49
|
+
|
|
50
|
+
4. **Include what was tried and rejected, not just what was chosen.** The most valuable architecture decisions are the ones where an alternative was tested and found wanting. A section that says "dynamic sessions were rejected because they accept no volumes, cost more at scale, and are blocked by policy" teaches an agent more than "the engine runs as a container app."
|
|
51
|
+
|
|
52
|
+
5. **Narrative over inventory.** Describe how the system behaves, what holds it together, and where the seams are. A reader who understands the constraints can infer the structure; a reader who only sees the structure cannot infer the constraints.
|
|
53
|
+
|
|
54
|
+
## Self-check (before writing the file)
|
|
55
|
+
|
|
56
|
+
Re-read every section you are about to write. Then:
|
|
57
|
+
|
|
58
|
+
1. **Identify inventory-only sections.** If a section describes what exists without stating what breaks when its constraints are violated, rewrite it as constraint-embedded prose or cut it.
|
|
59
|
+
|
|
60
|
+
2. **Check decision rows.** Every row in the decisions table must carry its rationale. If a decision has no "why," it is a fact, not a decision — cut it or find the rationale.
|
|
61
|
+
|
|
62
|
+
3. **Scan for bare dependency lists.** "Api depends on Application depends on Domain" is a fact. Rewrite it as: name the boundary, state who must not cross it, and what breaks when it is crossed.
|
|
63
|
+
|
|
64
|
+
4. **Verify rejected alternatives are present where they matter.** If a significant architectural choice was made, the rejected alternative and the reason for rejection should be in the document. An agent that does not know what was rejected will propose it again.
|
|
@@ -14,6 +14,7 @@ Turn this project's own documentation into `.agents/skills/pc-guardrails-project
|
|
|
14
14
|
- Never invent a rule the project does not state somewhere. A guardrail that came from nowhere is one nobody agreed to, and it will be followed anyway.
|
|
15
15
|
- Never write an empty category. Omit it.
|
|
16
16
|
- Never touch a tier variant (`*-engineer.build.md`, `*-engineer.fast.md`, `*-engineer.plan.md`): they are regenerated from the base templates every startup.
|
|
17
|
+
- Before writing the file, run the self-check defined in the [category reference](category-reference.md): count rules, cut positive phrasing and reference facts, strip anything already enforced by tooling or by `pc-guardrails-generic`, and re-count. The file is not written until the self-check passes.
|
|
17
18
|
|
|
18
19
|
## Sources
|
|
19
20
|
|
|
@@ -24,8 +24,22 @@ Each rule must be:
|
|
|
24
24
|
|
|
25
25
|
**At most 40 rules, across all categories.** Rank by what a violation costs and cut from the bottom; a category with nothing consequential in it gets no rules at all. This cap is the point of the exercise, not tidiness: compliance falls away as a rule file grows, so the 41st rule does not just cost its own tokens, it dilutes the 40 that matter. If more than 40 survive every bar above, the excess is a sign the project's constraints belong in a linter rule or a CI check instead.
|
|
26
26
|
|
|
27
|
+
## Contrastive example
|
|
28
|
+
|
|
29
|
+
**Bad** (reference fact — cut):
|
|
30
|
+
> - The SQL Server database name is `myapp`, lowercase.
|
|
31
|
+
|
|
32
|
+
The agent reads the connection string in config. It costs tokens on every load and the agent cannot "break" it.
|
|
33
|
+
|
|
34
|
+
**Good** (negative constraint with consequence — keep):
|
|
35
|
+
> - Never add a cached column for a value that is derived from another entity; a later edit to the source leaves the cache stale, and nothing in the build catches it.
|
|
36
|
+
|
|
37
|
+
The agent could break this without noticing, nothing mechanically enforces it, and the consequence is stated.
|
|
38
|
+
|
|
27
39
|
## Skill template
|
|
28
40
|
|
|
41
|
+
Each section holds constraints an agent could break without noticing, not reference facts. "Naming Conventions" does not mean "list how files are named" — it means "name the conventions whose violation is silent and costly." "Build & Deployment" does not mean "list the build commands" — it means "name the build rules a developer could violate without CI catching it." If a section has only reference facts, omit it entirely.
|
|
42
|
+
|
|
29
43
|
Write (or update) `.agents/skills/pc-guardrails-project/SKILL.md`:
|
|
30
44
|
|
|
31
45
|
```markdown
|
|
@@ -71,3 +85,28 @@ license: MIT
|
|
|
71
85
|
```
|
|
72
86
|
|
|
73
87
|
Only include sections that have real rules. Omit empty sections.
|
|
88
|
+
|
|
89
|
+
## Self-check (before writing the file)
|
|
90
|
+
|
|
91
|
+
Re-read the output you are about to write. Then:
|
|
92
|
+
|
|
93
|
+
1. **Count the rules** (every bullet under every section). If there are more than 40, cut from the bottom — rank by what a violation costs and remove the cheapest until you are at or under 40. A rule file past 40 dilutes the ones that matter.
|
|
94
|
+
|
|
95
|
+
2. **Scan for positive phrasing and reference facts.** Cut or rewrite any rule that:
|
|
96
|
+
- States what something is named, rather than what must not be named that way and why.
|
|
97
|
+
- Lists a port number, a database name, a package version, a SDK version, or a connection string. The agent discovers these by reading config.
|
|
98
|
+
- Describes how something works (e.g. "auth uses a smart scheme that forwards to JWT or Cookies"), rather than what must not be done with it.
|
|
99
|
+
- Restates a project's tech stack as a list ("Frontend: React 19, Next.js 15, TypeScript…"). That is reference material, not a constraint.
|
|
100
|
+
|
|
101
|
+
3. **Strip anything already enforced by tooling.** Remove a rule if any of these already fails the build on its violation:
|
|
102
|
+
- Biome / ESLint / Prettier / Steiger / lint:fsd
|
|
103
|
+
- NetArchTest / architecture test projects
|
|
104
|
+
- Semgrep / Trivy / TruffleHog / SBOM checks
|
|
105
|
+
- Coverage gates (`scripts/check-coverage.mjs`)
|
|
106
|
+
- `.editorconfig`, `Directory.Build.props`, NuGet audit gates
|
|
107
|
+
- CI workflow steps (`app-ci.yml`, `ci.yml`)
|
|
108
|
+
- GitHub branch protection / required checks. If the build catches it, the rule costs tokens and adds nothing. The only exception is a rule whose enforcement is partial or non-obvious (e.g. architecture tests enforce layering but a developer could still import a namespace through reflection or a transitive dependency — that nuance is worth a rule).
|
|
109
|
+
|
|
110
|
+
4. **Strip anything already in `pc-guardrails-generic`.** That skill loads on every request alongside this one. Its rules are: secrets discipline, comment discipline (WHY not WHAT, 10% ceiling), scratch-file location, one-responsibility-per-file, and the engineer workflow. Do not restate any of them here.
|
|
111
|
+
|
|
112
|
+
5. **Re-count after cutting.** If you are still over 40, you are writing reference material, not constraints. Cut harder.
|
|
@@ -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.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|