@plainconceptsplatform/agent-harness 2.0.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.
Files changed (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +419 -0
  3. package/package.json +68 -0
  4. package/src/commands/join.js +244 -0
  5. package/src/commands/shared.js +27 -0
  6. package/src/commands/single.js +79 -0
  7. package/src/commands/update.js +109 -0
  8. package/src/commands/wizard.js +134 -0
  9. package/src/content/.agents/skills/browser-automation/SKILL.md +66 -0
  10. package/src/content/.agents/skills/pc-guardrails-generic/SKILL.md +68 -0
  11. package/src/content/.agents/skills/pc-guardrails-project/SKILL.md +8 -0
  12. package/src/content/.agents/skills/pc-make-architecture/SKILL.md +51 -0
  13. package/src/content/.agents/skills/pc-make-architecture/structure-template.md +38 -0
  14. package/src/content/.agents/skills/pc-make-design/SKILL.md +68 -0
  15. package/src/content/.agents/skills/pc-make-engineer/SKILL.md +219 -0
  16. package/src/content/.agents/skills/pc-make-engineer/signal-mapping.md +68 -0
  17. package/src/content/.agents/skills/pc-make-engineer/template.md +81 -0
  18. package/src/content/.agents/skills/pc-make-evidence-scaffold/SKILL.md +18 -0
  19. package/src/content/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +29 -0
  20. package/src/content/.agents/skills/pc-make-guardrails/SKILL.md +74 -0
  21. package/src/content/.agents/skills/pc-make-guardrails/category-reference.md +68 -0
  22. package/src/content/.agents/skills/pc-make-merge-risk-assess/SKILL.md +70 -0
  23. package/src/content/.agents/skills/pc-make-merge-risk-assess/category-reference.md +98 -0
  24. package/src/content/.agents/skills/pc-make-user-model/SKILL.md +66 -0
  25. package/src/content/.agents/skills/pc-ops-evidence/SKILL.md +127 -0
  26. package/src/content/.agents/skills/pc-ops-ship/SKILL.md +18 -0
  27. package/src/content/.agents/skills/pc-plan-apply/SKILL.md +83 -0
  28. package/src/content/.agents/skills/pc-plan-apply/simple-mode.md +21 -0
  29. package/src/content/.agents/skills/pc-plan-archive/SKILL.md +63 -0
  30. package/src/content/.agents/skills/pc-plan-explore/SKILL.md +9 -0
  31. package/src/content/.agents/skills/pc-plan-goal/SKILL.md +94 -0
  32. package/src/content/.agents/skills/pc-plan-goal/branching.md +30 -0
  33. package/src/content/.agents/skills/pc-plan-goal/failure-policy.md +30 -0
  34. package/src/content/.agents/skills/pc-plan-goal/output-mode.md +9 -0
  35. package/src/content/.agents/skills/pc-plan-goal/output.md +68 -0
  36. package/src/content/.agents/skills/pc-plan-propose/SKILL.md +125 -0
  37. package/src/content/.agents/skills/pc-plan-propose/task-annotation.md +39 -0
  38. package/src/content/.agents/skills/pc-plan-quick/SKILL.md +62 -0
  39. package/src/content/.agents/skills/pc-plan-story/SKILL.md +146 -0
  40. package/src/content/.agents/skills/pc-repo-audit/SKILL.md +44 -0
  41. package/src/content/.agents/skills/pc-repo-help/SKILL.md +91 -0
  42. package/src/content/.agents/skills/pc-repo-initialize/SKILL.md +130 -0
  43. package/src/content/.agents/skills/pc-repo-onboard/SKILL.md +87 -0
  44. package/src/content/.agents/skills/pc-repo-verify/SKILL.md +34 -0
  45. package/src/content/.agents/skills/pc-userstory-az/SKILL.md +157 -0
  46. package/src/content/.agents/skills/pc-userstory-browser/SKILL.md +132 -0
  47. package/src/content/.agents/skills/pc-userstory-gh/SKILL.md +120 -0
  48. package/src/content/.agents/skills/pc-userstory-jira/SKILL.md +131 -0
  49. package/src/content/.opencode/_gitignore +7 -0
  50. package/src/content/.opencode/commands/init.md +5 -0
  51. package/src/content/.opencode/commands/make-architecture.md +5 -0
  52. package/src/content/.opencode/commands/make-design.md +5 -0
  53. package/src/content/.opencode/commands/make-engineer.md +5 -0
  54. package/src/content/.opencode/commands/make-evidence-scaffold.md +5 -0
  55. package/src/content/.opencode/commands/make-guardrails.md +5 -0
  56. package/src/content/.opencode/commands/make-user-model.md +5 -0
  57. package/src/content/.opencode/commands/ops-backlog.md +10 -0
  58. package/src/content/.opencode/commands/ops-evidence.md +9 -0
  59. package/src/content/.opencode/commands/ops-review.md +8 -0
  60. package/src/content/.opencode/commands/ops-ship.md +9 -0
  61. package/src/content/.opencode/commands/plan-apply.md +9 -0
  62. package/src/content/.opencode/commands/plan-archive.md +5 -0
  63. package/src/content/.opencode/commands/plan-explore.md +9 -0
  64. package/src/content/.opencode/commands/plan-goal.md +5 -0
  65. package/src/content/.opencode/commands/plan-propose.md +9 -0
  66. package/src/content/.opencode/commands/plan-quick.md +5 -0
  67. package/src/content/.opencode/commands/plan-story.md +9 -0
  68. package/src/content/.opencode/commands/repo-audit.md +5 -0
  69. package/src/content/.opencode/commands/repo-help.md +5 -0
  70. package/src/content/.opencode/commands/repo-initialize.md +5 -0
  71. package/src/content/.opencode/commands/repo-onboard.md +5 -0
  72. package/src/content/.opencode/commands/repo-verify.md +5 -0
  73. package/src/content/.opencode/package.json +10 -0
  74. package/src/content/.opencode/plugins/pc-subagent-monitor.js +139 -0
  75. package/src/content/.opencode/plugins/pc-subagent-tiers.js +179 -0
  76. package/src/content/.opencode/plugins/pc-system-reminders.js +96 -0
  77. package/src/content/.opencode/plugins/pc-system-reminders.test.js +35 -0
  78. package/src/content/.opencode/tui/pc-subagents.tsx +98 -0
  79. package/src/content/.opencode/tui.json +6 -0
  80. package/src/content/AGENTS.md +71 -0
  81. package/src/content/ARCHITECTURE.md +16 -0
  82. package/src/content/DESIGN.md +16 -0
  83. package/src/content/opencode.jsonc +31 -0
  84. package/src/content/openspec/changes/archive/.gitkeep +0 -0
  85. package/src/content/openspec/config.yaml +20 -0
  86. package/src/content/openspec/specs/.gitkeep +0 -0
  87. package/src/content/skills-lock.json +17 -0
  88. package/src/fragments/archive/az.md +95 -0
  89. package/src/fragments/archive/gh.md +94 -0
  90. package/src/fragments/archive/gl.md +94 -0
  91. package/src/fragments/archive/none.md +73 -0
  92. package/src/fragments/guardrails/codegraph.md +7 -0
  93. package/src/fragments/guardrails/humanizer.md +4 -0
  94. package/src/fragments/guardrails/memory.md +4 -0
  95. package/src/fragments/guardrails/rtk.md +3 -0
  96. package/src/fragments/guardrails/simple-english.md +4 -0
  97. package/src/fragments/ops-backlog/az.md +29 -0
  98. package/src/fragments/ops-backlog/gh.md +30 -0
  99. package/src/fragments/ops-backlog/jira.md +29 -0
  100. package/src/fragments/ops-evidence/az.md +41 -0
  101. package/src/fragments/ops-evidence/gh.md +53 -0
  102. package/src/fragments/ops-evidence/jira.md +38 -0
  103. package/src/fragments/ops-review/az.md +63 -0
  104. package/src/fragments/ops-review/gh.md +53 -0
  105. package/src/fragments/ops-review/gl.md +57 -0
  106. package/src/fragments/ops-ship/az.md +81 -0
  107. package/src/fragments/ops-ship/gh.md +69 -0
  108. package/src/fragments/ops-ship/gl.md +86 -0
  109. package/src/index.js +107 -0
  110. package/src/presets/agents-content.json +53 -0
  111. package/src/presets/browser.json +22 -0
  112. package/src/presets/clean.json +21 -0
  113. package/src/presets/models.json +68 -0
  114. package/src/presets/openspec.json +1 -0
  115. package/src/presets/optimization.json +37 -0
  116. package/src/presets/platforms.json +76 -0
  117. package/src/presets/quota.json +16 -0
  118. package/src/presets/source.json +23 -0
  119. package/src/steps/browser/index.js +91 -0
  120. package/src/steps/clean/index.js +120 -0
  121. package/src/steps/copy/agents.js +118 -0
  122. package/src/steps/copy/commands.js +91 -0
  123. package/src/steps/copy/fullstack-engineer.js +83 -0
  124. package/src/steps/copy/index.js +88 -0
  125. package/src/steps/copy/opencode-json.js +129 -0
  126. package/src/steps/copy/skills.js +196 -0
  127. package/src/steps/metadata/index.js +108 -0
  128. package/src/steps/models/format.js +88 -0
  129. package/src/steps/models/index.js +64 -0
  130. package/src/steps/models/write.js +34 -0
  131. package/src/steps/openspec/index.js +136 -0
  132. package/src/steps/optimization/codegraph.js +127 -0
  133. package/src/steps/optimization/humanizer.js +17 -0
  134. package/src/steps/optimization/index.js +163 -0
  135. package/src/steps/optimization/memory.js +88 -0
  136. package/src/steps/optimization/patch-guardrails.js +108 -0
  137. package/src/steps/optimization/quota.js +119 -0
  138. package/src/steps/optimization/simple-english.js +17 -0
  139. package/src/steps/optimization/skills-lock.js +30 -0
  140. package/src/steps/platform/index.js +109 -0
  141. package/src/steps/source/index.js +123 -0
  142. package/src/utils/copy.js +108 -0
  143. package/src/utils/exec-spinner.js +47 -0
  144. package/src/utils/exec.js +134 -0
  145. package/src/utils/legacy-check.js +30 -0
  146. package/src/utils/models-cache.js +58 -0
  147. package/src/utils/models-pricing.js +42 -0
  148. package/src/utils/paths.js +64 -0
  149. package/src/utils/process.js +3 -0
  150. package/src/utils/terminal.js +6 -0
  151. package/src/utils/update-manifest.js +49 -0
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: pc-plan-story
3
+ description: Write a detailed, repo-aware user story from a feature idea or need. Loads the @user-story skill for Mike Cohn format + Gherkin acceptance criteria, analyzes the codebase for concrete context, and produces a development-ready story. Use when the user wants to write a user story, create a story from a feature idea, or turn a need into a structured story with acceptance criteria. Invoked by the /plan-story command.
4
+ license: MIT
5
+ ---
6
+
7
+ Write a user story grounded in the actual codebase. Load the `@user-story` skill and follow its format (Mike Cohn "As a / I want to / so that" + Gherkin "Given / When / Then"). The story must be specific: real personas, real file paths, real component names, real data models — not generic placeholders.
8
+
9
+ This skill is read-only. You may read files, search code, and use `todowrite` to create Todo pane items. The only output is the user story itself and a question to the user. No files, no OpenSpec changes, no branches.
10
+
11
+ ## Input
12
+
13
+ The caller provides:
14
+ - A feature description, user need, or rough idea. This is the seed for the story.
15
+ - Exploration findings may accompany it — including diagrams (Mermaid, ASCII, or inline markdown). When provided, use them as context: the story should align with the explored scope, decisions, and recommended approach.
16
+ - If `$ARGUMENTS` is empty, ask the user what feature or need they want to capture.
17
+
18
+ ## Step 1: Load the user-story skill
19
+
20
+ Load the `@user-story` skill now. Follow its format, anti-patterns, and quality checks for the rest of this skill. Every story produced must pass the user-story skill's validation.
21
+
22
+ ## Step 2: Analyze the codebase
23
+
24
+ Use `glob` and `grep` to locate the relevant files, components, types, and patterns that the feature touches. Read the key files to understand:
25
+
26
+ - **Who** the users are (check auth, roles, user models, route guards)
27
+ - **What** the current state is (existing components, API endpoints, data models, types)
28
+ - **Where** the change would land (file paths, directory structure, module boundaries)
29
+ - **Why** it matters (business logic, validation rules, existing UX flows)
30
+
31
+ If exploration findings or diagrams were provided, incorporate them: align the story's scope with the explored boundaries, reference the components and flows the diagram highlights, and respect any out-of-scope decisions the exploration made.
32
+
33
+ Map the feature description to concrete codebase artifacts:
34
+
35
+ ```
36
+ Relevant artifacts:
37
+ Models: <model names and file paths>
38
+ Components: <component names and file paths>
39
+ Endpoints: <route or API paths>
40
+ Types: <type definitions and file paths>
41
+ Patterns: <architectural patterns in use (FSD, monolith, etc.)>
42
+ ```
43
+
44
+ ## Step 3: Draft the user story
45
+
46
+ Write the story using the user-story skill's format. Ground every field in the codebase analysis from Step 2:
47
+
48
+ ### Use Case
49
+
50
+ - **As a** [specific persona derived from auth/roles/user models in the repo — never "user"]
51
+ - **I want to** [action that maps to a concrete code change — reference the component, endpoint, or model involved]
52
+ - **so that** [real outcome tied to business logic or UX flow found in the codebase]
53
+
54
+ ### Acceptance Criteria (Gherkin)
55
+
56
+ Write scenarios with preconditions grounded in the actual codebase state:
57
+
58
+ - **Scenario:** [brief description]
59
+ - **Given:** [precondition referencing real state — e.g. "the user is authenticated via the JWT middleware in src/auth/middleware.ts"]
60
+ - **and Given:** [additional preconditions — existing data models, current UI state, config values]
61
+ - **When:** [trigger that maps to a concrete user action on a real component or endpoint]
62
+ - **Then:** [testable outcome referencing actual system behavior — e.g. "the response from POST /api/projects includes the new projectId field defined in src/types/Project.ts"]
63
+
64
+ ### Edge Cases
65
+
66
+ List 2-3 edge cases derived from what the code currently does:
67
+
68
+ - What happens when [existing validation/constraint] is violated?
69
+ - What if [existing data state] is empty/null/migration-incomplete?
70
+ - What about [existing role/permission boundary]?
71
+
72
+ ### Summary
73
+
74
+ Write a one-line value-focused summary (not a feature title).
75
+
76
+ ## Step 4: Humanize
77
+
78
+ Load the `@humanizer` skill and run it on the drafted story text from Step 3. AI-generated stories tend to:
79
+
80
+ - Overuse em dashes and rule-of-three lists
81
+ - Use promotional language ("seamless", "powerful", "comprehensive")
82
+ - Use passive voice and negative parallelisms
83
+ - Stack vague attributions
84
+ - Inflate symbolism in the summary line
85
+
86
+ Apply the humanizer's audit → fix loop to all prose in the story: the summary, the use case, the scenario descriptions, and the edge case notes. Preserve all technical details, file paths, component names, and Gherkin structure — the humanizer cleans prose, not structure or accuracy.
87
+
88
+ ## Step 5: Diagram (when the story has a flow)
89
+
90
+ If the story involves a user journey, state transition, or component interaction that benefits from visualization, produce a Mermaid diagram. Keep it minimal: the happy path only, no exhaustive enumeration of every branch.
91
+
92
+ When to draw:
93
+ - Multi-step flows (login → action → confirmation)
94
+ - State transitions (status changes on a work item, order state machine)
95
+ - Component interactions (frontend → API → service → DB)
96
+
97
+ When to skip:
98
+ - Simple CRUD on a single resource
99
+ - Stories with a single step and no preconditions beyond auth
100
+
101
+ If the input included an exploration diagram, extend it with the story's new flow rather than redrawing from scratch.
102
+
103
+ ## Step 6: Validate
104
+
105
+ Run every quality check from the user-story skill:
106
+
107
+ - No generic "As a user" — the persona must be specific and grounded in repo context
108
+ - "So that" must express real motivation, not restate "I want to"
109
+ - Single When / single Then per scenario — if multiple, note that the story should split
110
+ - Thens must be testable and measurable — reference real system behavior, not vague improvements
111
+ - No technical tasks disguised as user stories (if there's no user outcome, say so)
112
+
113
+ If any check fails, fix the story and re-validate. Do not show a story to the user that fails validation.
114
+
115
+ ## Step 7: Present the story
116
+
117
+ Display the complete user story to the user:
118
+
119
+ - Summary
120
+ - Use Case (As a / I want to / so that)
121
+ - Acceptance Criteria (all scenarios with full Given/When/Then)
122
+ - Edge Cases
123
+ - Diagram (if produced in Step 5)
124
+ - Codebase artifacts the story is grounded in (file paths, component names, types)
125
+
126
+ ## Step 8: Ask what's next
127
+
128
+ Call the `question` tool:
129
+
130
+ ```json
131
+ {
132
+ "questions": [
133
+ {
134
+ "header": "What next",
135
+ "question": "What next?",
136
+ "options": [
137
+ { "label": "/plan-propose", "description": "Turn this user story into a full OpenSpec proposal with design, specs, and tasks." },
138
+ { "label": "/plan-quick", "description": "Create a lightweight task checklist from this story." },
139
+ { "label": "Refine the story", "description": "Iterate on the story with feedback." }
140
+ ]
141
+ }
142
+ ]
143
+ }
144
+ ```
145
+
146
+ Do not create any files. Do not run `/plan-propose` or `/plan-quick` automatically. The only output is the user story.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: pc-repo-audit
3
+ description: Audit every configured repository source root against the fullstack engineer's abilities and guardrails. Read-only. Invoked by the /repo-audit command.
4
+ license: MIT
5
+ ---
6
+
7
+ # Repo Audit
8
+
9
+ Audit the repository without modifying files, installing dependencies, creating backlog items, pushing, or contacting external platforms.
10
+
11
+ ## Step 1: Load the audit rules
12
+
13
+ 1. Read `.opencode/agents/fullstack-engineer.md`.
14
+ 2. Parse every `@skill-name` in its `## Abilities` section.
15
+ 3. Load every listed skill, guardrails first. If a referenced skill is missing, record it as a finding and continue with the installed abilities.
16
+
17
+ ## Step 2: Establish scope
18
+
19
+ 1. Read `.opencode/source-roots.json` when it exists. Use its non-empty `roots` array; otherwise use the repository root.
20
+ 2. Inventory every root before judging it. Identify applications, services, libraries, tests, frontend or website projects, infrastructure, CI, package manifests, lockfiles, and generated-output rules.
21
+ 3. Keep every read and command inside a configured source root or the repository root.
22
+
23
+ ## Step 3: Audit every project
24
+
25
+ Apply the loaded abilities and guardrails to each discovered project. Assess:
26
+
27
+ - Architecture, module boundaries, naming, and duplicated responsibilities.
28
+ - Tests, linting, type checks, builds, CI, and whether their configured commands match the project.
29
+ - Dependency manifests, lockfiles, package-manager declarations, runtime versions, and workspace configuration.
30
+ - Security and repository hygiene, including generated files, ignored artifacts, and likely secrets in tracked files.
31
+ - Documentation and configuration drift across `AGENTS.md`, architecture/design documents, project scripts, and CI.
32
+
33
+ For dependency findings, identify the exact manifest and lockfile involved. State the repository-defined remediation and immutable dependency validation command; never run a mutation-capable install during this audit.
34
+
35
+ ## Step 4: Report
36
+
37
+ Deduplicate findings across roots and report them grouped by project. Every finding must include:
38
+
39
+ - Severity: critical, high, medium, or low.
40
+ - Affected root and path.
41
+ - Evidence and the applicable guardrail or ability, when one exists.
42
+ - Impact and a concrete remediation or verification command.
43
+
44
+ End with the projects audited, checks that could not run and why, and a short prioritized remediation list. If no findings exist, state that explicitly and list residual verification gaps.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: pc-repo-help
3
+ description: The full command reference for this project - every /command with when to use it and the typical workflows. Load when the user asks for help, the command list, or at the end of repo initialization. Invoked by the /repo-help command and the repo-initialize flow.
4
+ license: MIT
5
+ ---
6
+
7
+ # Repo Help
8
+
9
+ Display the following reference to the user exactly as written. Do not summarize.
10
+
11
+ ## Commands
12
+
13
+ ### Not sure where to start?
14
+
15
+ **`/init`** (alias: `/repo-initialize`): Initialize the project. Presents a single form with all setup questions (project type, history, architecture, design, evidence), then executes the selected steps.
16
+
17
+ **`/repo-onboard`**: Guided tour of the project and its agentic infrastructure. Explains agents, commands, skills, OpenSpec workflow, and configuration. Read-only: no files modified.
18
+
19
+ **`/repo-audit`**: Read-only health audit of every configured source root. Loads the fullstack engineer's abilities, checks guardrails, architecture, tooling, dependencies, lockfiles, tests, and CI, then reports prioritized findings.
20
+
21
+ **`/plan-explore`**: Your backlog is unclear, you have a half-formed idea, or you need to think through a problem before committing to a plan. This is a thinking partner, not an executor.
22
+
23
+ **`/plan-story <feature or need>`**: Write a detailed, repo-aware user story from a feature idea. Loads the `@user-story` skill (Mike Cohn format + Gherkin acceptance criteria), analyzes your codebase for concrete context, and produces a development-ready story with specific personas, real outcomes, and testable criteria grounded in your actual file paths, component names, and data models. No files written — just the story.
24
+
25
+ **`/plan-propose <url or idea>`**: You have a work item URL, or a clear idea and you want to turn it into a structured plan (proposal, specs, tasks). Enriches each task with the best matching agent and model before showing you the plan. Nothing is implemented until you confirm.
26
+
27
+ ---
28
+
29
+ ### Ready to implement?
30
+
31
+ **`/plan-quick <task>`**: Quick plan for focused changes. Reads the codebase, creates a task checklist in the Todo pane. No files, no OpenSpec. Then you decide: `/plan-apply` to implement, or `/plan-propose` for a full OpenSpec plan.
32
+
33
+ **`/plan-apply`**: Implement a plan. Detects the source automatically: OpenSpec-annotated tasks (from `/plan-propose`) run as parallel subagent waves; Todo pane tasks (from `/plan-quick`) run sequentially in-session.
34
+
35
+ **`/plan-goal <feature or URL>`**: Fully autonomous, no confirmations. Branches off `main`, then runs propose → apply → archive on that branch (each phase its own commit). Default: merges to `main` and deletes the branch. Add `push` keyword to push the branch only. Add `pr` keyword to push + create a PR. Built for loop-engineering / unattended runs. Stops only on a hard failure, leaving the branch unmerged.
36
+
37
+ ---
38
+
39
+ ### Done implementing?
40
+
41
+ **`/ops-ship`**: Create a PR for the current feature branch with screenshots if UI changed.
42
+
43
+ **`/ops-review`**: Read and triage PR review feedback. If you share a PR URL or say "I've added comments to the PR", it reads and classifies the review comments so you know what to fix. Fixing is done via `/plan-apply`.
44
+
45
+ **`/ops-backlog`**: Create an issue in the backlog platform (GitHub, Azure DevOps, Jira) from a description.
46
+
47
+ **`/ops-evidence`**: Produce evidence a completed change works and publish it to the originating issue/PR. Uses `playwright-cli` (headless) and `pnpm run dev` to capture screenshots at desktop and mobile viewports, writes `evidence/evidence.json` (passed/skipped/failed/blocked), and upserts an idempotent verified comment. Best-effort; `/plan-goal` runs it automatically. Works inside CI containers.
48
+
49
+ **`/plan-archive`**: Mark a completed change as archived in OpenSpec. Run this after the PR is merged.
50
+
51
+ ---
52
+
53
+ ### Maintaining the project?
54
+
55
+ **`/make-engineer`**: Add a custom specialist engineer to the team. Interactive persona-driven form: pick a persona, then confirm an inspected-and-recommended set of skills (architecture/patterns like FSD or design patterns, framework, testing, infra) before anything installs. Future `/plan-apply` runs will prefer it when its domain matches.
56
+
57
+ **`/make-architecture`**: Regenerate `ARCHITECTURE.md` from the current codebase. Safe to rerun any time the architecture evolves.
58
+
59
+ **`/make-design`**: Regenerate `DESIGN.md` from the design system (Tailwind, CSS vars, tokens, etc.).
60
+
61
+ **`/make-evidence-scaffold`**: DEPRECATED. Evidence is now built into `/ops-evidence` using `playwright-cli` + `pnpm run dev`. No per-project scaffold needed.
62
+
63
+ **`/make-guardrails`**: Generate a `pc-guardrails-project` skill from `ARCHITECTURE.md` and project config files. Extracts concrete rules (architecture boundaries, naming, code style, testing, git workflow) that all agents must follow. Updates every `*-engineer.md` to load the skill.
64
+
65
+ **`/repo-verify`**: Verify the current branch against applicable guardrails and project checks. Runs immutable dependency installs/restores, configured builds, and tests for every discovered project, repairs relevant failures, checks dependency/lockfile consistency, and reports `VERIFIED` only when every required check passes. It runs automatically in `/plan-goal`.
66
+
67
+ **`/make-user-model <tier> <model>`**: Set the model for a tier (`plan`, `build`, or `fast`). Writes to `.opencode/harness.json` (`models`). Use `user` prefix for a personal override: `/make-user-model user fast opencode/big-pickle`. Use a model id or `current` for the active session model. Restart opencode for the `pc-subagent-tiers` plugin to rebuild tier agents.
68
+
69
+ ---
70
+
71
+ ### Typical workflows
72
+
73
+ **Complex change:**
74
+ ```
75
+ /plan-explore ← optional: think it through first
76
+ /plan-propose ← create the plan
77
+ /plan-apply ← implement with the team
78
+ /ops-ship ← ship
79
+ /plan-archive ← close out
80
+ ```
81
+
82
+ **Quick change:**
83
+ ```
84
+ /plan-quick ← create a focused task list
85
+ /plan-apply ← implement
86
+ ```
87
+
88
+ **Unattended / loop-engineering:**
89
+ ```
90
+ /plan-goal <description> ← full pipeline, no interaction
91
+ ```
@@ -0,0 +1,130 @@
1
+ ---
2
+ name: pc-repo-initialize
3
+ description: Initialize the project. Presents a single form with all setup questions, then executes selected steps. Invoked by the /init command (alias: /repo-initialize).
4
+ license: MIT
5
+ ---
6
+ Check if `AGENTS.md` contains the `<!-- PC-NOT-INITIALIZED -->` marker.
7
+
8
+ - If no: tell the user the project is already initialized. Suggest running `/make-architecture` or `/make-design` if they want to refresh those docs.
9
+ - If yes: run the sequence below.
10
+
11
+ ## Step 1: Ask everything at once
12
+
13
+ Call the `question` tool with all five questions in a single batch (do not ask them one at a time). Use exactly these fields:
14
+
15
+ ```json
16
+ {
17
+ "questions": [
18
+ {
19
+ "header": "Type",
20
+ "question": "What type of project is this?",
21
+ "options": [
22
+ { "label": "brownfield", "description": "Existing codebase. Generate docs from your code." },
23
+ { "label": "greenfield", "description": "Starting from scratch, little or no existing code." }
24
+ ]
25
+ },
26
+ {
27
+ "header": "History",
28
+ "question": "Archive project history into OpenSpec?",
29
+ "options": [
30
+ { "label": "Yes", "description": "Scan codebase for existing docs, changelogs, decisions and archive them." },
31
+ { "label": "No", "description": "Skip history archival." }
32
+ ]
33
+ },
34
+ {
35
+ "header": "Architecture",
36
+ "question": "Generate ARCHITECTURE.md from the codebase?",
37
+ "options": [
38
+ { "label": "Yes", "description": "Analyze project structure and generate architecture documentation." },
39
+ { "label": "No", "description": "Skip, leave as placeholder." }
40
+ ]
41
+ },
42
+ {
43
+ "header": "Design",
44
+ "question": "Generate DESIGN.md from the design system?",
45
+ "options": [
46
+ { "label": "Yes", "description": "Analyze Tailwind, CSS vars, tokens and generate design documentation." },
47
+ { "label": "No", "description": "Skip, leave as placeholder." }
48
+ ]
49
+ },
50
+ {
51
+ "header": "Evidence",
52
+ "question": "Enable visual evidence capture for this project? (playwright-cli + pnpm run dev; no per-project scaffold needed)",
53
+ "options": [
54
+ { "label": "Yes", "description": "Evidence will be captured automatically by /plan-goal using playwright-cli + pnpm run dev." },
55
+ { "label": "No", "description": "Skip evidence capture." }
56
+ ]
57
+ }
58
+ ]
59
+ }
60
+ ```
61
+
62
+ ## Step 2: Execute selected steps
63
+
64
+ Based on the user's answers, run the selected steps in order:
65
+
66
+ ### Sync skills (always)
67
+
68
+ Ensure all skills listed in `skills-lock.json` are installed. Run `npx skills experimental_install --yes` in the project root. This installs the core and selected optional skills queued by onboarding. If the command fails or is unavailable, warn the user but continue because optional skills can be installed manually later.
69
+
70
+ ### Archive project history (if Yes)
71
+
72
+ Scan the codebase for existing documentation, changelogs, ADRs, README files, or notable history. Create an OpenSpec archive entry that captures this history.
73
+
74
+ Before scanning, load source roots from `.opencode/source-roots.json` when present. Only scan those roots plus this repo's docs/config files.
75
+
76
+ ```bash
77
+ openspec new change "project-history"
78
+ ```
79
+
80
+ Write a `proposal.md` inside that change summarizing:
81
+ - What this project is
82
+ - Key decisions already made (inferred from code and docs)
83
+ - Known tech debt or constraints visible in the codebase
84
+ - Current state of the project
85
+
86
+ Then archive it immediately (`-y` skips the confirmation prompt so this never blocks):
87
+
88
+ ```bash
89
+ openspec archive "project-history" -y
90
+ ```
91
+
92
+ ### Generate ARCHITECTURE.md (if Yes)
93
+
94
+ Load the `pc-make-architecture` skill now. Follow every step defined in it.
95
+
96
+ ### Generate DESIGN.md (if Yes)
97
+
98
+ Load the `pc-make-design` skill now. Follow every step defined in it.
99
+
100
+ ### Generate guardrails (always)
101
+
102
+ Load the `pc-make-guardrails` skill now. Follow every step defined in it.
103
+
104
+ ### Visual evidence (if Yes)
105
+
106
+ Evidence is built into the `pc-ops-evidence` skill using `playwright-cli` + `pnpm run dev`. No scaffold is needed — it works out of the box as long as the project has a root `pnpm run dev` script that starts the full app stack with mock auth. Ensure `playwright-cli` is installed (handled by `opencode-ci.md` in CI).
107
+
108
+ ## Step 3: Show help
109
+
110
+ Load the `pc-repo-help` skill and display the full command reference exactly as written.
111
+
112
+ ## Step 4: Confirm
113
+
114
+ Tell the user:
115
+
116
+ ```
117
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
118
+ Initialization complete.
119
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
120
+
121
+ Restart OpenCode now.
122
+ Nothing will work correctly until you do.
123
+ After restarting you are ready to work.
124
+ ```
125
+
126
+ If the user answered Yes to Question 5 (Evidence), no post-init step is needed. Evidence works automatically via `pc-ops-evidence` using `playwright-cli` + `pnpm run dev`.
127
+
128
+ ## Init scope
129
+
130
+ During init, write only to: ARCHITECTURE.md, DESIGN.md, AGENTS.md, openspec/, .agents/skills/. Read source files for analysis. Feature implementation, branches, PRs, and project source file modification are outside init's scope.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: pc-repo-onboard
3
+ description: Walk the user through the project and its agentic infrastructure. Explains what exists, how agents work, and how to use the system. Invoked by the /repo-onboard command.
4
+ license: MIT
5
+ ---
6
+
7
+ This command is a guided tour. Read and explain only.
8
+
9
+ ## Step 1: Project overview
10
+
11
+ Read `AGENTS.md`, `ARCHITECTURE.md`, and `DESIGN.md`. Summarize:
12
+
13
+ - What this project is (name, purpose, domain)
14
+ - Tech stack (languages, frameworks, build system)
15
+ - Project structure (key directories and what they contain)
16
+
17
+ Keep it to 3 to 5 bullet points. Focus on what a new contributor needs to know.
18
+
19
+ ## Step 2: Agent infrastructure
20
+
21
+ Inspect `.opencode/agents/` and list every agent file. For each agent, read its frontmatter and summarize:
22
+
23
+ - Agent name and role (primary, subagent, or specialist)
24
+ - Model tier it uses (plan, build, or fast)
25
+ - Key abilities: what it can do
26
+
27
+ Present as a table:
28
+
29
+ | Agent | Role | Tier | Purpose |
30
+ |---|---|---|---|
31
+ | ... | ... | ... | ... |
32
+
33
+ Then explain the agent selection model:
34
+ - Primary agents appear in Tab and handle direct user interaction
35
+ - Subagent engineers are spawned by the lead for parallel implementation waves
36
+ - Specialist engineers are preferred when their domain matches the task; `fullstack-engineer` is the user's planning agent (`mode: primary`), not a spawned worker. If no specialist matches, create one with `/make-engineer`.
37
+
38
+ ## Step 3: Command reference
39
+
40
+ Read every `.md` file in `.opencode/commands/`. List each command with its name and description:
41
+
42
+ | Command | What it does |
43
+ |---|---|
44
+ | ... | ... |
45
+
46
+ Group them by workflow phase if possible:
47
+ - Planning: plan-explore, plan-story, plan-propose, plan-quick, plan-goal
48
+ - Implementation: plan-apply, plan-archive
49
+ - Maintenance: make-architecture, make-design, make-engineer, make-guardrails, make-evidence-scaffold
50
+ - Shipping: ops-ship, ops-review, ops-backlog, ops-evidence
51
+ - Quality: repo-audit, repo-verify
52
+ - Setup: init, make-user-model, repo-help
53
+
54
+ ## Step 4: Skills
55
+
56
+ Inspect `.agents/skills/` (if present). List installed skills with a one-line description each. Note which are platform-specific (userstory, pullrequest) vs general-purpose, and identify `pc-repo-audit` as read-only and `pc-repo-verify` as the current-branch verification gate.
57
+
58
+ ## Step 5: OpenSpec workflow
59
+
60
+ Explain the OpenSpec change lifecycle:
61
+
62
+ 1. Explore (`/plan-explore`): investigate and discuss, no files created
63
+ 2. Propose (`/plan-propose`): structured plan, saved to `openspec/changes/`
64
+ 3. Apply (`/plan-apply`): implement tasks via parallel subagent waves
65
+ 4. Archive (`/plan-archive`): finalize and clean up
66
+
67
+ Explain `openspec/config.yaml`: what it contains and why it matters.
68
+
69
+ ## Step 6: Configuration
70
+
71
+ Explain `harness.json`:
72
+ - What each field controls (platform, models, agents, tools, source)
73
+ - How to change the model for a tier (`/make-user-model`)
74
+ - What `agents.maxConcurrent` does
75
+
76
+ ## Step 7: Quick tips
77
+
78
+ End with 3 to 5 practical tips:
79
+
80
+ - How to start working: "Run `/plan-goal` with a description of what you want to build"
81
+ - How to add a specialist: "Run `/make-engineer`"
82
+ - How to regenerate docs: "Run `/make-architecture` or `/make-design`"
83
+ - How to audit the whole repository: "Run `/repo-audit`"
84
+ - How to verify an active branch: "Run `/repo-verify`"
85
+ - How to set up visual evidence: "Run `/make-evidence-scaffold` (UI projects) so `/plan-goal` can prove changes with screenshots"
86
+ - How to see all commands: "Run `/repo-help`"
87
+ - How to refresh config after changes: "Re-run `npx @plainconceptsplatform/agent-harness` in the terminal"
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: pc-repo-verify
3
+ description: Verify and repair current-branch changes using applicable fullstack engineer abilities, project checks, and dependency rules. Invoked by /repo-verify and the plan-goal pipeline.
4
+ license: MIT
5
+ ---
6
+
7
+ # Repo Verify
8
+
9
+ Verify the current branch before it is archived, shipped, or handed to an external automation gate. Work only on the current branch: do not switch branches, push, create pull requests or backlog items, or contact external platforms.
10
+
11
+ ## Step 1: Load verification rules
12
+
13
+ 1. Read `.opencode/agents/fullstack-engineer.md`.
14
+ 2. Parse every `@skill-name` in its `## Abilities` section.
15
+ 3. Load every listed skill, guardrails first. A missing referenced skill is a verification failure; report it and do not claim `VERIFIED`.
16
+
17
+ ## Step 2: Determine changed scope
18
+
19
+ 1. Read `.opencode/source-roots.json` when it exists. Use its non-empty `roots` array; otherwise use the repository root.
20
+ 2. Inspect `git diff` against the branch base and the working tree. Map every changed path to a configured root and discovered project.
21
+ 3. Discover every project in every configured source root. Read each project's manifest, scripts, test configuration, CI configuration, and applicable guardrail instructions.
22
+ 4. Build a check matrix. Include every discovered project's repository-defined immutable dependency install or restore command, build command, and test command, even when that project is untouched. Add changed-scope lint, typecheck, migration, generated-artifact, documentation, evidence, and required repository-wide checks from loaded guardrails.
23
+
24
+ ## Step 3: Verify and repair
25
+
26
+ Run every discovered project's repository-defined immutable dependency install or restore command, build command, and test command. Run the changed-scope lint, typecheck, migration, generated-artifact, documentation, and evidence checks. A project without one of those commands is the only allowed skip, and the report must name the missing command.
27
+
28
+ When a dependency manifest changes, require its ecosystem lockfile to change when the package manager uses one. The dependency install or restore command must validate that lockfile without mutating it.
29
+
30
+ When a check fails, repair only the current branch's relevant files and rerun the failed check. Continue until every applicable check passes or a hard blocker prevents progress. Never hide a failure by deleting tests, weakening checks, or reverting requested work.
31
+
32
+ ## Step 4: Result
33
+
34
+ Report a check matrix with command, affected project, result, and skip reason where applicable. Report `VERIFIED` only when every applicable check passed, every dependency change has consistent lockfiles, and no required ability is missing. Otherwise report `NOT VERIFIED`, the blockers, and the exact next command.