@plainconceptsplatform/agent-harness 3.5.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +471 -454
  3. package/cli/commands/join.js +259 -259
  4. package/cli/commands/migrate.js +310 -310
  5. package/cli/commands/shared.js +27 -27
  6. package/cli/commands/single.js +79 -79
  7. package/cli/commands/update.js +121 -121
  8. package/cli/commands/wizard.js +134 -134
  9. package/cli/fragments/archive/az.md +97 -97
  10. package/cli/fragments/archive/gh.md +96 -96
  11. package/cli/fragments/archive/gl.md +96 -96
  12. package/cli/fragments/archive/none.md +75 -75
  13. package/cli/fragments/guardrails/codegraph.md +5 -5
  14. package/cli/fragments/guardrails/humanizer.md +4 -4
  15. package/cli/fragments/guardrails/memory.md +4 -4
  16. package/cli/fragments/guardrails/rtk.md +3 -3
  17. package/cli/fragments/guardrails/simple-english.md +4 -4
  18. package/cli/fragments/ops-backlog/az.md +28 -28
  19. package/cli/fragments/ops-backlog/gh.md +28 -28
  20. package/cli/fragments/ops-backlog/jira.md +28 -28
  21. package/cli/fragments/ops-review/az.md +62 -62
  22. package/cli/fragments/ops-review/gh.md +51 -51
  23. package/cli/fragments/ops-review/gl.md +55 -55
  24. package/cli/fragments/ops-ship/az.md +81 -81
  25. package/cli/fragments/ops-ship/gh.md +67 -67
  26. package/cli/fragments/ops-ship/gl.md +84 -84
  27. package/cli/index.js +116 -116
  28. package/cli/presets/agents-content.json +34 -34
  29. package/cli/presets/browser.json +10 -10
  30. package/cli/presets/clean.json +21 -21
  31. package/cli/presets/models.json +68 -68
  32. package/cli/presets/optimization.json +32 -32
  33. package/cli/presets/platforms.json +76 -76
  34. package/cli/presets/source.json +23 -23
  35. package/cli/steps/browser/index.js +48 -48
  36. package/cli/steps/clean/index.js +120 -120
  37. package/cli/steps/copy/agents.js +120 -120
  38. package/cli/steps/copy/commands.js +79 -79
  39. package/cli/steps/copy/fullstack-engineer.js +89 -89
  40. package/cli/steps/copy/index.js +88 -88
  41. package/cli/steps/copy/opencode-json.js +324 -324
  42. package/cli/steps/copy/skills.js +316 -316
  43. package/cli/steps/metadata/index.js +115 -115
  44. package/cli/steps/models/format.js +88 -88
  45. package/cli/steps/models/index.js +64 -64
  46. package/cli/steps/models/write.js +38 -38
  47. package/cli/steps/openspec/index.js +136 -136
  48. package/cli/steps/optimization/codegraph.js +141 -141
  49. package/cli/steps/optimization/detect.js +66 -66
  50. package/cli/steps/optimization/humanizer.js +17 -17
  51. package/cli/steps/optimization/index.js +158 -158
  52. package/cli/steps/optimization/memory.js +91 -91
  53. package/cli/steps/optimization/patch-guardrails.js +111 -111
  54. package/cli/steps/optimization/simple-english.js +17 -17
  55. package/cli/steps/optimization/skills-lock.js +30 -30
  56. package/cli/steps/platform/index.js +109 -109
  57. package/cli/steps/source/index.js +123 -123
  58. package/cli/utils/agent-color.js +111 -111
  59. package/cli/utils/copy.js +134 -134
  60. package/cli/utils/exec-spinner.js +47 -47
  61. package/cli/utils/exec.js +134 -134
  62. package/cli/utils/legacy-check.js +30 -30
  63. package/cli/utils/models-cache.js +58 -58
  64. package/cli/utils/models-pricing.js +42 -42
  65. package/cli/utils/paths.js +81 -81
  66. package/cli/utils/process.js +3 -3
  67. package/cli/utils/terminal.js +6 -6
  68. package/cli/utils/update-manifest.js +75 -75
  69. package/harness/.opencode/_gitignore +10 -10
  70. package/harness/.opencode/commands/init.md +5 -5
  71. package/harness/.opencode/commands/make-architecture.md +5 -5
  72. package/harness/.opencode/commands/make-design.md +5 -5
  73. package/harness/.opencode/commands/make-engineer.md +5 -5
  74. package/harness/.opencode/commands/make-guardrails.md +5 -5
  75. package/harness/.opencode/commands/make-user-model.md +5 -5
  76. package/harness/.opencode/commands/ops-backlog.md +10 -10
  77. package/harness/.opencode/commands/ops-review.md +10 -10
  78. package/harness/.opencode/commands/ops-ship.md +9 -9
  79. package/harness/.opencode/commands/plan-apply.md +9 -9
  80. package/harness/.opencode/commands/plan-archive.md +7 -7
  81. package/harness/.opencode/commands/plan-explore.md +11 -11
  82. package/harness/.opencode/commands/plan-goal.md +5 -5
  83. package/harness/.opencode/commands/plan-propose.md +11 -11
  84. package/harness/.opencode/commands/plan-quick.md +7 -7
  85. package/harness/.opencode/commands/plan-story.md +11 -11
  86. package/harness/.opencode/commands/repo-audit.md +7 -7
  87. package/harness/.opencode/commands/repo-help.md +5 -5
  88. package/harness/.opencode/commands/repo-initialize.md +5 -5
  89. package/harness/.opencode/commands/repo-onboard.md +5 -5
  90. package/harness/.opencode/commands/repo-verify.md +5 -5
  91. package/harness/.opencode/package.json +5 -5
  92. package/harness/.opencode/plugins/pc-commit-coauthor.js +41 -0
  93. package/harness/.opencode/plugins/pc-subagent-monitor.js +184 -184
  94. package/harness/.opencode/plugins/pc-subagent-tiers.js +367 -367
  95. package/harness/.opencode/plugins/pc-system-reminders.js +404 -386
  96. package/harness/.opencode/scripts/check-diff.mjs +279 -252
  97. package/harness/.opencode/scripts/code-rules.mjs +288 -288
  98. package/harness/.opencode/scripts/platform-manifest.mjs +112 -0
  99. package/harness/AGENTS.md +49 -49
  100. package/harness/ARCHITECTURE.md +13 -13
  101. package/harness/DESIGN.md +13 -13
  102. package/harness/opencode.jsonc +36 -36
  103. package/harness/openspec/config.yaml +20 -20
  104. package/harness/skills-lock.json +17 -17
  105. package/package.json +14 -12
  106. package/skills/README.md +18 -18
  107. package/skills/agent-harness-cli/SKILL.md +86 -86
  108. package/skills/browser-automation/SKILL.md +72 -72
  109. package/skills/pc-guardrails-generic/SKILL.md +53 -53
  110. package/skills/pc-guardrails-project/SKILL.md +8 -8
  111. package/skills/pc-make-architecture/SKILL.md +33 -32
  112. package/skills/pc-make-architecture/structure-template.md +64 -64
  113. package/skills/pc-make-design/SKILL.md +45 -45
  114. package/skills/pc-make-engineer/SKILL.md +59 -59
  115. package/skills/pc-make-engineer/signal-mapping.md +53 -53
  116. package/skills/pc-make-engineer/template.md +36 -36
  117. package/skills/pc-make-guardrails/SKILL.md +44 -44
  118. package/skills/pc-make-guardrails/category-reference.md +112 -112
  119. package/skills/pc-make-merge-risk-assess/SKILL.md +70 -70
  120. package/skills/pc-make-merge-risk-assess/category-reference.md +114 -114
  121. package/skills/pc-make-user-model/SKILL.md +56 -56
  122. package/skills/pc-ops-ship/SKILL.md +22 -22
  123. package/skills/pc-plan-apply/SKILL.md +88 -88
  124. package/skills/pc-plan-apply/simple-mode.md +21 -21
  125. package/skills/pc-plan-archive/SKILL.md +66 -66
  126. package/skills/pc-plan-explore/SKILL.md +21 -21
  127. package/skills/pc-plan-goal/SKILL.md +91 -91
  128. package/skills/pc-plan-goal/branching.md +39 -39
  129. package/skills/pc-plan-goal/failure-policy.md +30 -30
  130. package/skills/pc-plan-goal/output-mode.md +10 -10
  131. package/skills/pc-plan-goal/output.md +71 -71
  132. package/skills/pc-plan-propose/SKILL.md +125 -125
  133. package/skills/pc-plan-propose/task-annotation.md +39 -39
  134. package/skills/pc-plan-quick/SKILL.md +46 -46
  135. package/skills/pc-plan-story/SKILL.md +93 -93
  136. package/skills/pc-repo-audit/SKILL.md +44 -44
  137. package/skills/pc-repo-help/SKILL.md +87 -87
  138. package/skills/pc-repo-initialize/SKILL.md +119 -119
  139. package/skills/pc-repo-onboard/SKILL.md +32 -32
  140. package/skills/pc-repo-verify/SKILL.md +150 -150
  141. package/skills/pc-userstory-az/SKILL.md +71 -71
  142. package/skills/pc-userstory-browser/SKILL.md +64 -64
  143. package/skills/pc-userstory-gh/SKILL.md +63 -63
  144. package/skills/pc-userstory-jira/SKILL.md +74 -74
@@ -1,125 +1,125 @@
1
- ---
2
- name: pc-plan-propose
3
- description: Parse a work item or idea and produce an OpenSpec change plan (proposal.md, specs, tasks.md) with enriched task assignments (agent, tier, depends_on, touches). Load when turning a requirement into a structured plan. Invoked by the /plan-propose command (interactive) and the plan-goal pipeline (autonomous).
4
- license: MIT
5
- ---
6
-
7
- # Plan Propose
8
-
9
- Never write a file before the Step 3 checkpoint resolves to `yes`: build the whole plan in context, and let it hit disk in Step 4. A proposal written before its confirmation is a proposal the user cannot decline.
10
-
11
- ## Input
12
-
13
- The caller provides:
14
- - A work item URL, issue key, or direct feature description. Exploration findings may accompany it; incorporate them.
15
- - Optionally a mode (see below). Default: `interactive`.
16
-
17
- ## Modes
18
-
19
- - `interactive` (default): every checkpoint below is active. Wait for the user at each one.
20
- - `autonomous`: there is no user. Never ask anything. Each checkpoint marked with a stop sign states its autonomous resolution inline.
21
-
22
- ## Step 0.a: Check for unarchived changes (stop)
23
-
24
- Before proposing a new change, inspect `openspec/changes/` (ignore `openspec/changes/archive`). If any change folder exists in `openspec/changes/` (names vary by platform: `gh-*`, `us-*`, or a plain slug), list them in the question text, then call the `question` tool:
25
-
26
- ```json
27
- {
28
- "questions": [
29
- {
30
- "header": "Unarchived changes",
31
- "question": "There are unarchived changes pending:\n{change-name}\n{change-name}\n...\n\nContinue with the proposal or stop to archive first?",
32
- "options": [
33
- { "label": "continue", "description": "Proceed with the proposal." },
34
- { "label": "stop", "description": "End without generating a proposal. Archive the pending change first." }
35
- ]
36
- }
37
- ]
38
- }
39
- ```
40
-
41
- - If the user answers `stop`, end without generating a proposal.
42
- - If the user answers `continue`, proceed to the next step.
43
-
44
- Autonomous mode: do not call the `question` tool; treat the answer as `continue` and proceed.
45
-
46
- ## Step 0.b: Load proposal skill
47
-
48
- If a work item URL or issue key is provided (GitHub Issue, Azure DevOps work item, Jira issue, or browser-based backlog): load `@pc-userstory` skill and fetch the work item before continuing. Backlog platform is set in `.opencode/harness.json` -> `platform.backlog`. If backlog platform is `none`, skip this step and work from direct input.
49
-
50
- ## Step 1: Generate the proposal in memory
51
-
52
- Load `@openspec-propose` skill and follow its instructions to generate proposal.md, specs, and tasks.md. Do not write them to disk yet. Build the complete proposal content in your context.
53
-
54
- ## Step 2: Enrich task assignments
55
-
56
- 1. List every `*-engineer.md` file in `.opencode/agents/`. For each file read:
57
- - `description:` from the YAML frontmatter: the engineer's specialization summary
58
- - `## Abilities` section: the skills listed under Development, Testing, Infrastructure (e.g. `@nodejs-backend`, `@secure-nextjs-api-routes`)
59
-
60
- Build a map of `agent-name -> { description, abilities }`.
61
- 2. For each task, compare the task text and domain against every engineer's description AND abilities. Pick the engineer whose combined profile most closely matches. `fullstack-engineer` is the fallback worker and the body behind `build` and `plan`; prefer a real specialist over it, and never annotate a task with `build` or `plan`, which are the user's own primaries. If no specialist matches a task, leave the agent field blank and record the missing specialization in the proposal. An annotated OpenSpec task needs a real subagent; never substitute the lead or an obsolete generic agent name.
62
- 3. Pick a tier, derive `depends_on`, derive `touches`, and annotate each task line. Follow the [task annotation](task-annotation.md) reference for the full tier selection guide, dependency derivation, touches derivation, and annotation format with examples.
63
-
64
- ## Step 3: Show the plan and ask for confirmation (stop)
65
-
66
- Display the complete proposal to the user:
67
- - Change name and description
68
- - Total task count
69
- - Full task list with agent (including tier suffix) and dependency annotations
70
-
71
- Then call the `question` tool:
72
-
73
- ```json
74
- {
75
- "questions": [
76
- {
77
- "header": "Save proposal",
78
- "question": "Save this proposal?",
79
- "options": [
80
- { "label": "yes", "description": "Write all files to disk and proceed." },
81
- { "label": "edit", "description": "Provide feedback, revise in memory, show again." },
82
- { "label": "stop", "description": "End without writing anything." }
83
- ]
84
- }
85
- ]
86
- }
87
- ```
88
-
89
- - `yes` -> proceed to Step 4 and write all files
90
- - `edit` -> user provides feedback, revise in memory, show again, ask again
91
- - `stop` -> end without writing anything
92
-
93
- Wait for the user's response. Do not proceed without a response.
94
-
95
- Autonomous mode: do not call the `question` tool; treat the answer as `yes` and write the files immediately.
96
-
97
- ## Step 4: Write (only after the Step 3 checkpoint resolves)
98
-
99
- Write the proposal files to `openspec/changes/{change-slug}/`:
100
- - `proposal.md`: the change description and rationale
101
- - `specs/`: any spec files generated
102
- - `tasks.md`: the enriched task list with agent annotations
103
-
104
- ## Step 5: Stop (stop)
105
-
106
- Call the `question` tool:
107
-
108
- ```json
109
- {
110
- "questions": [
111
- {
112
- "header": "Ready to implement",
113
- "question": "Ready to implement?",
114
- "options": [
115
- { "label": "yes", "description": "Load the pc-plan-apply skill to start implementation." },
116
- { "label": "no", "description": "Stop here. You can run /plan-apply later." }
117
- ]
118
- }
119
- ]
120
- }
121
- ```
122
-
123
- Loading `pc-plan-apply` requires explicit user confirmation.
124
-
125
- Autonomous mode: do not call the `question` tool. The PROPOSE stage is complete. Hand the change slug and task count back to the caller (the `/plan-goal` pipeline) so it immediately continues to the apply phase. This is a stage boundary, not the end of the run.
1
+ ---
2
+ name: pc-plan-propose
3
+ description: Parse a work item or idea and produce an OpenSpec change plan (proposal.md, specs, tasks.md) with enriched task assignments (agent, tier, depends_on, touches). Load when turning a requirement into a structured plan. Invoked by the /plan-propose command (interactive) and the plan-goal pipeline (autonomous).
4
+ license: MIT
5
+ ---
6
+
7
+ # Plan Propose
8
+
9
+ Never write a file before the Step 3 checkpoint resolves to `yes`: build the whole plan in context, and let it hit disk in Step 4. A proposal written before its confirmation is a proposal the user cannot decline.
10
+
11
+ ## Input
12
+
13
+ The caller provides:
14
+ - A work item URL, issue key, or direct feature description. Exploration findings may accompany it; incorporate them.
15
+ - Optionally a mode (see below). Default: `interactive`.
16
+
17
+ ## Modes
18
+
19
+ - `interactive` (default): every checkpoint below is active. Wait for the user at each one.
20
+ - `autonomous`: there is no user. Never ask anything. Each checkpoint marked with a stop sign states its autonomous resolution inline.
21
+
22
+ ## Step 0.a: Check for unarchived changes (stop)
23
+
24
+ Before proposing a new change, inspect `openspec/changes/` (ignore `openspec/changes/archive`). If any change folder exists in `openspec/changes/` (names vary by platform: `gh-*`, `us-*`, or a plain slug), list them in the question text, then call the `question` tool:
25
+
26
+ ```json
27
+ {
28
+ "questions": [
29
+ {
30
+ "header": "Unarchived changes",
31
+ "question": "There are unarchived changes pending:\n{change-name}\n{change-name}\n...\n\nContinue with the proposal or stop to archive first?",
32
+ "options": [
33
+ { "label": "continue", "description": "Proceed with the proposal." },
34
+ { "label": "stop", "description": "End without generating a proposal. Archive the pending change first." }
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+ ```
40
+
41
+ - If the user answers `stop`, end without generating a proposal.
42
+ - If the user answers `continue`, proceed to the next step.
43
+
44
+ Autonomous mode: do not call the `question` tool; treat the answer as `continue` and proceed.
45
+
46
+ ## Step 0.b: Load proposal skill
47
+
48
+ If a work item URL or issue key is provided (GitHub Issue, Azure DevOps work item, Jira issue, or browser-based backlog): load `@pc-userstory` skill and fetch the work item before continuing. Backlog platform is set in `.opencode/harness.json` -> `platform.backlog`. If backlog platform is `none`, skip this step and work from direct input.
49
+
50
+ ## Step 1: Generate the proposal in memory
51
+
52
+ Load `@openspec-propose` skill and follow its instructions to generate proposal.md, specs, and tasks.md. Do not write them to disk yet. Build the complete proposal content in your context.
53
+
54
+ ## Step 2: Enrich task assignments
55
+
56
+ 1. List every `*-engineer.md` file in `.opencode/agents/`. For each file read:
57
+ - `description:` from the YAML frontmatter: the engineer's specialization summary
58
+ - `## Abilities` section: the skills listed under Development, Testing, Infrastructure (e.g. `@nodejs-backend`, `@secure-nextjs-api-routes`)
59
+
60
+ Build a map of `agent-name -> { description, abilities }`.
61
+ 2. For each task, compare the task text and domain against every engineer's description AND abilities. Pick the engineer whose combined profile most closely matches. `fullstack-engineer` is the fallback worker and the body behind `build` and `plan`; prefer a real specialist over it, and never annotate a task with `build` or `plan`, which are the user's own primaries. If no specialist matches a task, leave the agent field blank and record the missing specialization in the proposal. An annotated OpenSpec task needs a real subagent; never substitute the lead or an obsolete generic agent name.
62
+ 3. Pick a tier, derive `depends_on`, derive `touches`, and annotate each task line. Follow the [task annotation](task-annotation.md) reference for the full tier selection guide, dependency derivation, touches derivation, and annotation format with examples.
63
+
64
+ ## Step 3: Show the plan and ask for confirmation (stop)
65
+
66
+ Display the complete proposal to the user:
67
+ - Change name and description
68
+ - Total task count
69
+ - Full task list with agent (including tier suffix) and dependency annotations
70
+
71
+ Then call the `question` tool:
72
+
73
+ ```json
74
+ {
75
+ "questions": [
76
+ {
77
+ "header": "Save proposal",
78
+ "question": "Save this proposal?",
79
+ "options": [
80
+ { "label": "yes", "description": "Write all files to disk and proceed." },
81
+ { "label": "edit", "description": "Provide feedback, revise in memory, show again." },
82
+ { "label": "stop", "description": "End without writing anything." }
83
+ ]
84
+ }
85
+ ]
86
+ }
87
+ ```
88
+
89
+ - `yes` -> proceed to Step 4 and write all files
90
+ - `edit` -> user provides feedback, revise in memory, show again, ask again
91
+ - `stop` -> end without writing anything
92
+
93
+ Wait for the user's response. Do not proceed without a response.
94
+
95
+ Autonomous mode: do not call the `question` tool; treat the answer as `yes` and write the files immediately.
96
+
97
+ ## Step 4: Write (only after the Step 3 checkpoint resolves)
98
+
99
+ Write the proposal files to `openspec/changes/{change-slug}/`:
100
+ - `proposal.md`: the change description and rationale
101
+ - `specs/`: any spec files generated
102
+ - `tasks.md`: the enriched task list with agent annotations
103
+
104
+ ## Step 5: Stop (stop)
105
+
106
+ Call the `question` tool:
107
+
108
+ ```json
109
+ {
110
+ "questions": [
111
+ {
112
+ "header": "Ready to implement",
113
+ "question": "Ready to implement?",
114
+ "options": [
115
+ { "label": "yes", "description": "Load the pc-plan-apply skill to start implementation." },
116
+ { "label": "no", "description": "Stop here. You can run /plan-apply later." }
117
+ ]
118
+ }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ Loading `pc-plan-apply` requires explicit user confirmation.
124
+
125
+ Autonomous mode: do not call the `question` tool. The PROPOSE stage is complete. Hand the change slug and task count back to the caller (the `/plan-goal` pipeline) so it immediately continues to the apply phase. This is a stage boundary, not the end of the run.
@@ -1,39 +1,39 @@
1
- # Task annotation reference
2
-
3
- ## Tier selection
4
-
5
- Pick a tier for each task based on complexity:
6
- - `build`: complex code: data models, APIs, auth logic, core business logic, UI components
7
- - `fast`: light work: i18n keys, config changes, env variables, navigation links, simple markup, verification runs
8
- - `plan`: reserved for orchestration, do not use for implementation tasks
9
-
10
- The tier suffix is appended to the agent name with a dot (e.g. `backend-engineer.build`). This is the agent name you write in the annotation. The `pc-subagent-tiers` plugin resolves the model at startup from `models[<tier>]`.
11
-
12
- ## depends_on
13
-
14
- Derive `depends_on` for each task: the OpenSpec task IDs (`N.M`) it logically needs completed first (a task that consumes another's output: UI needs its RPC, tests need the code, a seed needs its migration). Root tasks get `[]`. Reference the IDs OpenSpec already generated. Never invent new ones.
15
-
16
- ## touches
17
-
18
- Derive `touches` for each task: the file path(s)/glob(s) it will create or modify (the task text usually names them, e.g. "Modify src/board/components/CreateForm.tsx"). This lets `pc-plan-apply` serialize same-file tasks that have no logical dependency. Include net-new files.
19
-
20
- ## Annotation format
21
-
22
- Annotate each task line in-place with all three fields:
23
-
24
- ```
25
- - [ ] <task text> <!-- agent: <name>, depends_on: [<ids>], touches: [<globs>] -->
26
- ```
27
-
28
- Example result (note same-file tasks like 1.1/1.2 share `touches`, so `pc-plan-apply` runs them sequentially even with no `depends_on` between them; tier suffix encodes the model):
29
-
30
- ```
31
- - [ ] 1.1 Add Project model to schema <!-- agent: backend-engineer.build, depends_on: [], touches: [src/types.ts] -->
32
- - [ ] 1.2 Add projectId field to LoopOptions <!-- agent: backend-engineer.build, depends_on: [], touches: [src/types.ts] -->
33
- - [ ] 2.1 Project RPC endpoints <!-- agent: backend-engineer.build, depends_on: [1.1], touches: [src/rpc/project/**] -->
34
- - [ ] 3.1 Accept page UI <!-- agent: frontend-engineer.build, depends_on: [2.1], touches: [src/board/components/CreateForm.tsx] -->
35
- - [ ] 3.2 i18n keys for invitation flow <!-- agent: frontend-engineer.fast, depends_on: [3.1], touches: [src/i18n/**] -->
36
- - [ ] 4.1 Run typecheck and fix errors <!-- agent: backend-engineer.fast, depends_on: [2.1,3.1], touches: [] -->
37
- ```
38
-
39
- `pc-plan-apply` reads these annotations to build conflict-free waves: `depends_on` gates ordering, `touches` keeps concurrent agents file-disjoint, and the tier suffix in `agent` determines the model (resolved at startup by the `pc-subagent-tiers` plugin). `depends_on` is mandatory; `touches` is a best-effort hint.
1
+ # Task annotation reference
2
+
3
+ ## Tier selection
4
+
5
+ Pick a tier for each task based on complexity:
6
+ - `build`: complex code: data models, APIs, auth logic, core business logic, UI components
7
+ - `fast`: light work: i18n keys, config changes, env variables, navigation links, simple markup, verification runs
8
+ - `plan`: reserved for orchestration, do not use for implementation tasks
9
+
10
+ The tier suffix is appended to the agent name with a dot (e.g. `backend-engineer.build`). This is the agent name you write in the annotation. The `pc-subagent-tiers` plugin resolves the model at startup from `models[<tier>]`.
11
+
12
+ ## depends_on
13
+
14
+ Derive `depends_on` for each task: the OpenSpec task IDs (`N.M`) it logically needs completed first (a task that consumes another's output: UI needs its RPC, tests need the code, a seed needs its migration). Root tasks get `[]`. Reference the IDs OpenSpec already generated. Never invent new ones.
15
+
16
+ ## touches
17
+
18
+ Derive `touches` for each task: the file path(s)/glob(s) it will create or modify (the task text usually names them, e.g. "Modify src/board/components/CreateForm.tsx"). This lets `pc-plan-apply` serialize same-file tasks that have no logical dependency. Include net-new files.
19
+
20
+ ## Annotation format
21
+
22
+ Annotate each task line in-place with all three fields:
23
+
24
+ ```
25
+ - [ ] <task text> <!-- agent: <name>, depends_on: [<ids>], touches: [<globs>] -->
26
+ ```
27
+
28
+ Example result (note same-file tasks like 1.1/1.2 share `touches`, so `pc-plan-apply` runs them sequentially even with no `depends_on` between them; tier suffix encodes the model):
29
+
30
+ ```
31
+ - [ ] 1.1 Add Project model to schema <!-- agent: backend-engineer.build, depends_on: [], touches: [src/types.ts] -->
32
+ - [ ] 1.2 Add projectId field to LoopOptions <!-- agent: backend-engineer.build, depends_on: [], touches: [src/types.ts] -->
33
+ - [ ] 2.1 Project RPC endpoints <!-- agent: backend-engineer.build, depends_on: [1.1], touches: [src/rpc/project/**] -->
34
+ - [ ] 3.1 Accept page UI <!-- agent: frontend-engineer.build, depends_on: [2.1], touches: [src/board/components/CreateForm.tsx] -->
35
+ - [ ] 3.2 i18n keys for invitation flow <!-- agent: frontend-engineer.fast, depends_on: [3.1], touches: [src/i18n/**] -->
36
+ - [ ] 4.1 Run typecheck and fix errors <!-- agent: backend-engineer.fast, depends_on: [2.1,3.1], touches: [] -->
37
+ ```
38
+
39
+ `pc-plan-apply` reads these annotations to build conflict-free waves: `depends_on` gates ordering, `touches` keeps concurrent agents file-disjoint, and the tier suffix in `agent` determines the model (resolved at startup by the `pc-subagent-tiers` plugin). `depends_on` is mandatory; `touches` is a best-effort hint.
@@ -1,46 +1,46 @@
1
- ---
2
- name: pc-plan-quick
3
- description: "Quick plan: analyze the codebase and create a task checklist using the Todo pane. No files, no OpenSpec. Invoked by the /plan-quick command."
4
- license: MIT
5
- ---
6
-
7
- Lightweight planning for a change that is already clear: read the codebase, write the task list to the Todo pane, stop. Use `/plan-explore` then `/plan-propose` instead when the idea is half-formed, the alternatives need thinking through, or the result should outlive the session.
8
-
9
- ## Rules
10
-
11
- - Never write, edit, or create a file. The only artefacts are Todo items and one question, so there is nothing to review afterwards and nothing to undo.
12
- - Never start the work, and never invoke `/plan-apply` or `/plan-propose` on the user's behalf. The question at the end is where they choose.
13
-
14
- ## Contracts
15
-
16
- One Todo item per task, in dependency order, each one action naming the files it touches:
17
-
18
- ```json
19
- {
20
- "todos": [
21
- { "content": "Add Project model to src/types.ts", "status": "pending", "priority": "high" },
22
- { "content": "Add projectId field to LoopOptions in src/types.ts", "status": "pending", "priority": "high" },
23
- { "content": "Create Project RPC endpoints in src/rpc/project/", "status": "pending", "priority": "medium" },
24
- { "content": "Build Accept page UI in src/board/components/CreateForm.tsx", "status": "pending", "priority": "medium" },
25
- { "content": "Run pnpm verify and check-diff, re-verify after fixes", "status": "pending", "priority": "low" }
26
- ]
27
- }
28
- ```
29
-
30
- Then ask:
31
-
32
- ```json
33
- {
34
- "questions": [
35
- {
36
- "header": "What next",
37
- "question": "What next?",
38
- "options": [
39
- { "label": "/plan-apply", "description": "Implement these tasks now (creates a feature branch and works through them)." },
40
- { "label": "/plan-propose", "description": "Turn this into a full OpenSpec proposal with agent assignments." },
41
- { "label": "Start on specific tasks", "description": "Tell me which tasks to start on." }
42
- ]
43
- }
44
- ]
45
- }
46
- ```
1
+ ---
2
+ name: pc-plan-quick
3
+ description: "Quick plan: analyze the codebase and create a task checklist using the Todo pane. No files, no OpenSpec. Invoked by the /plan-quick command."
4
+ license: MIT
5
+ ---
6
+
7
+ Lightweight planning for a change that is already clear: read the codebase, write the task list to the Todo pane, stop. Use `/plan-explore` then `/plan-propose` instead when the idea is half-formed, the alternatives need thinking through, or the result should outlive the session.
8
+
9
+ ## Rules
10
+
11
+ - Never write, edit, or create a file. The only artefacts are Todo items and one question, so there is nothing to review afterwards and nothing to undo.
12
+ - Never start the work, and never invoke `/plan-apply` or `/plan-propose` on the user's behalf. The question at the end is where they choose.
13
+
14
+ ## Contracts
15
+
16
+ One Todo item per task, in dependency order, each one action naming the files it touches:
17
+
18
+ ```json
19
+ {
20
+ "todos": [
21
+ { "content": "Add Project model to src/types.ts", "status": "pending", "priority": "high" },
22
+ { "content": "Add projectId field to LoopOptions in src/types.ts", "status": "pending", "priority": "high" },
23
+ { "content": "Create Project RPC endpoints in src/rpc/project/", "status": "pending", "priority": "medium" },
24
+ { "content": "Build Accept page UI in src/board/components/CreateForm.tsx", "status": "pending", "priority": "medium" },
25
+ { "content": "Run pnpm verify and check-diff, re-verify after fixes", "status": "pending", "priority": "low" }
26
+ ]
27
+ }
28
+ ```
29
+
30
+ Then ask:
31
+
32
+ ```json
33
+ {
34
+ "questions": [
35
+ {
36
+ "header": "What next",
37
+ "question": "What next?",
38
+ "options": [
39
+ { "label": "/plan-apply", "description": "Implement these tasks now (creates a feature branch and works through them)." },
40
+ { "label": "/plan-propose", "description": "Turn this into a full OpenSpec proposal with agent assignments." },
41
+ { "label": "Start on specific tasks", "description": "Tell me which tasks to start on." }
42
+ ]
43
+ }
44
+ ]
45
+ }
46
+ ```
@@ -1,93 +1,93 @@
1
- ---
2
- name: pc-plan-story
3
- description: Write a detailed, repo-aware user story from a feature idea or need, then wrap it in the repository's issue form and append a structured implementation plan. Loads the @user-story skill for Mike Cohn format + Gherkin acceptance criteria, analyzes the codebase for concrete context, and produces a development-ready story with a plan. 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 this repository. `@user-story` owns the format and the quality bar; `@humanizer` owns the prose. What this skill adds is the grounding: the personas, paths, models and components come out of the codebase, not out of a template.
8
-
9
- ## Input
10
-
11
- A feature description, need, or rough idea, possibly with exploration findings and diagrams to align the scope with. If `$ARGUMENTS` is empty, ask what the user wants to capture.
12
-
13
- The caller may pass exploration findings from a prior `/plan-explore` session. Treat them as the primary source for the codebase inventory; read files only to fill gaps the findings do not cover.
14
-
15
- <!-- PC-OPTIMIZATION-MEMORY-START -->
16
- <!-- PC-OPTIMIZATION-MEMORY-END -->
17
-
18
- ## Rules
19
-
20
- - Never write, edit, or create a file, and never start the work or invoke `/plan-propose` or `/plan-quick`. The only artefacts are the story (with its issue form and plan), and one question.
21
- - Never write `As a user`. The persona comes from the repo's own roles: auth middleware, route guards, user models. A story that could have been written without opening the repo is not worth reviewing.
22
- - Never show the user a story that fails the `@user-story` checks. Fix it first.
23
- - Every `Given`, `When` and `Then` names something real, and every `Then` is testable: a file, endpoint, model or field somebody can point at.
24
- - Never read outside this repository root. The entire inventory and plan must come from files inside this repo.
25
- - Adhere to `${{ env.REPO_RULES }}` and repository documentation (AGENTS.md, ARCHITECTURE.md, DESIGN.md, existing patterns) before finalizing the story.
26
- - Reserve the very top of the body — above the form's first heading — for machine-readable lines that later workflow steps add (split markers, estimate lines). Never place story or plan content there; the workflow reads those lines regardless of the form's shape.
27
-
28
- ## Flow
29
-
30
- 1. Load `@user-story`.
31
-
32
- 2. **Coverage gate.** List every work unit from the input. For each, confirm it has exploration findings concrete enough to write an acceptance scenario: the files it touches, the models or endpoints it changes, the constraints it must respect. If any work unit is missing findings, go back and explore it now by reading the codebase. Do not draft the story until every work unit is covered. This skill's own requirement is coverage: several work units become one story that covers all of them, with at least one acceptance scenario per unit.
33
-
34
- 3. Read the codebase for what the feature touches: who the users are (auth, roles, user models, guards), what exists now (components, endpoints, models, types), where the change lands (paths, module boundaries), and what rules already govern it (validation, existing flows). Incorporate any exploration findings, including their out-of-scope decisions.
35
-
36
- 4. Draft the story against that inventory. Each work unit gets at least one acceptance scenario. Pull two or three edge cases from what the code does today: a violated constraint, an empty or half-migrated state, a permission boundary.
37
-
38
- 5. Apply repository documentation and established conventions. Read AGENTS.md, ARCHITECTURE.md, DESIGN.md and any existing patterns that govern the area being changed. Adjust the story to respect them.
39
-
40
- 6. Load `@humanizer` and run it over the prose. It cleans prose, not structure: paths, component names and Gherkin stay exact.
41
-
42
- 7. Add a Mermaid diagram only for a multi-step flow, a state transition, or a component interaction, and only the happy path. A single-resource CRUD story does not need one. If the input carried an exploration diagram, extend it rather than redrawing.
43
-
44
- 8. **Issue form: discover, select, fill.**
45
-
46
- *Discover:* List the YAML and Markdown forms under `.github/ISSUE_TEMPLATE/`, plus a legacy `.github/issue_template.md` or a root `template.yml`. `config.yml` there only declares contact links, which are not forms: ignore it.
47
-
48
- *Select:* When a form filters by labels and the issue carries one of those labels, that form wins. Otherwise use the repository's default form. When the repository has no form at all, keep the free-form story shape from step 4: there is nothing to wrap around.
49
-
50
- *Fill:* Draw every field's content from your exploration findings. Required fields always get real content; optional fields only when you genuinely have something for them. The story narrative lands in the field that asks for it — proposal, description, or what-happened, depending on the form. The Given/When/Then scenarios go into the form's acceptance-criteria field when it has one; otherwise they stay a section of their own. The Mermaid diagram goes where it reads best inside the filled form.
51
-
52
- 9. **Plan section.** Using the codebase investigation from step 3, produce a structured implementation plan that goes after the story inside the issue form body. Format it as follows:
53
-
54
- Start with a one-line scope summary, then a context paragraph describing what areas the plan touches, how many changes it breaks into, and whether the changes are independent.
55
-
56
- Then break the feature into numbered changes. Each change:
57
-
58
- - **Title** — what the change does.
59
- - **Problem** — what is wrong or what needs to change and why. Name the file, method, or endpoint.
60
- - **Fix** — bullet steps describing the implementation approach. Each step names a concrete file, method, or field.
61
- - **Affected files** — a bullet list of paths with a short note on what changes in each.
62
-
63
- After all changes, add a summary table:
64
-
65
- ```markdown
66
- | Change | Files | Layer |
67
- |---|---|---|
68
- | 1. <title> | <file list> | <Backend | Frontend | Fullstack | Infra | Tests> |
69
- ```
70
-
71
- Then list exclusions — what is explicitly out of scope and why.
72
-
73
- Do not write any files. The plan is part of the story output, read-only. It tells the implementer what to touch and why, so they can start without re-investigating.
74
-
75
- 10. Show the story with the issue form wrapping, the plan, and the artefacts it is grounded in, then ask what is next. If the plan has an open clarification — a wording choice, a missing constraint, an unknown API — ask it before the contracts question.
76
-
77
- ## Contracts
78
-
79
- ```json
80
- {
81
- "questions": [
82
- {
83
- "header": "What next",
84
- "question": "What next?",
85
- "options": [
86
- { "label": "/plan-propose", "description": "Turn this user story into a full OpenSpec proposal with design, specs, and tasks." },
87
- { "label": "/plan-quick", "description": "Create a lightweight task checklist from this story." },
88
- { "label": "Refine the story", "description": "Iterate on the story with feedback." }
89
- ]
90
- }
91
- ]
92
- }
93
- ```
1
+ ---
2
+ name: pc-plan-story
3
+ description: Write a detailed, repo-aware user story from a feature idea or need, then wrap it in the repository's issue form and append a structured implementation plan. Loads the @user-story skill for Mike Cohn format + Gherkin acceptance criteria, analyzes the codebase for concrete context, and produces a development-ready story with a plan. 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 this repository. `@user-story` owns the format and the quality bar; `@humanizer` owns the prose. What this skill adds is the grounding: the personas, paths, models and components come out of the codebase, not out of a template.
8
+
9
+ ## Input
10
+
11
+ A feature description, need, or rough idea, possibly with exploration findings and diagrams to align the scope with. If `$ARGUMENTS` is empty, ask what the user wants to capture.
12
+
13
+ The caller may pass exploration findings from a prior `/plan-explore` session. Treat them as the primary source for the codebase inventory; read files only to fill gaps the findings do not cover.
14
+
15
+ <!-- PC-OPTIMIZATION-MEMORY-START -->
16
+ <!-- PC-OPTIMIZATION-MEMORY-END -->
17
+
18
+ ## Rules
19
+
20
+ - Never write, edit, or create a file, and never start the work or invoke `/plan-propose` or `/plan-quick`. The only artefacts are the story (with its issue form and plan), and one question.
21
+ - Never write `As a user`. The persona comes from the repo's own roles: auth middleware, route guards, user models. A story that could have been written without opening the repo is not worth reviewing.
22
+ - Never show the user a story that fails the `@user-story` checks. Fix it first.
23
+ - Every `Given`, `When` and `Then` names something real, and every `Then` is testable: a file, endpoint, model or field somebody can point at.
24
+ - Never read outside this repository root. The entire inventory and plan must come from files inside this repo.
25
+ - Adhere to `${{ env.REPO_RULES }}` and repository documentation (AGENTS.md, ARCHITECTURE.md, DESIGN.md, existing patterns) before finalizing the story.
26
+ - Reserve the very top of the body — above the form's first heading — for machine-readable lines that later workflow steps add (split markers, estimate lines). Never place story or plan content there; the workflow reads those lines regardless of the form's shape.
27
+
28
+ ## Flow
29
+
30
+ 1. Load `@user-story`.
31
+
32
+ 2. **Coverage gate.** List every work unit from the input. For each, confirm it has exploration findings concrete enough to write an acceptance scenario: the files it touches, the models or endpoints it changes, the constraints it must respect. If any work unit is missing findings, go back and explore it now by reading the codebase. Do not draft the story until every work unit is covered. This skill's own requirement is coverage: several work units become one story that covers all of them, with at least one acceptance scenario per unit.
33
+
34
+ 3. Read the codebase for what the feature touches: who the users are (auth, roles, user models, guards), what exists now (components, endpoints, models, types), where the change lands (paths, module boundaries), and what rules already govern it (validation, existing flows). Incorporate any exploration findings, including their out-of-scope decisions.
35
+
36
+ 4. Draft the story against that inventory. Each work unit gets at least one acceptance scenario. Pull two or three edge cases from what the code does today: a violated constraint, an empty or half-migrated state, a permission boundary.
37
+
38
+ 5. Apply repository documentation and established conventions. Read AGENTS.md, ARCHITECTURE.md, DESIGN.md and any existing patterns that govern the area being changed. Adjust the story to respect them.
39
+
40
+ 6. Load `@humanizer` and run it over the prose. It cleans prose, not structure: paths, component names and Gherkin stay exact.
41
+
42
+ 7. Add a Mermaid diagram only for a multi-step flow, a state transition, or a component interaction, and only the happy path. A single-resource CRUD story does not need one. If the input carried an exploration diagram, extend it rather than redrawing.
43
+
44
+ 8. **Issue form: discover, select, fill.**
45
+
46
+ *Discover:* List the YAML and Markdown forms under `.github/ISSUE_TEMPLATE/`, plus a legacy `.github/issue_template.md` or a root `template.yml`. `config.yml` there only declares contact links, which are not forms: ignore it.
47
+
48
+ *Select:* When a form filters by labels and the issue carries one of those labels, that form wins. Otherwise use the repository's default form. When the repository has no form at all, keep the free-form story shape from step 4: there is nothing to wrap around.
49
+
50
+ *Fill:* Draw every field's content from your exploration findings. Required fields always get real content; optional fields only when you genuinely have something for them. The story narrative lands in the field that asks for it — proposal, description, or what-happened, depending on the form. The Given/When/Then scenarios go into the form's acceptance-criteria field when it has one; otherwise they stay a section of their own. The Mermaid diagram goes where it reads best inside the filled form.
51
+
52
+ 9. **Plan section.** Using the codebase investigation from step 3, produce a structured implementation plan that goes after the story inside the issue form body. Format it as follows:
53
+
54
+ Start with a one-line scope summary, then a context paragraph describing what areas the plan touches, how many changes it breaks into, and whether the changes are independent.
55
+
56
+ Then break the feature into numbered changes. Each change:
57
+
58
+ - **Title** — what the change does.
59
+ - **Problem** — what is wrong or what needs to change and why. Name the file, method, or endpoint.
60
+ - **Fix** — bullet steps describing the implementation approach. Each step names a concrete file, method, or field.
61
+ - **Affected files** — a bullet list of paths with a short note on what changes in each.
62
+
63
+ After all changes, add a summary table:
64
+
65
+ ```markdown
66
+ | Change | Files | Layer |
67
+ |---|---|---|
68
+ | 1. <title> | <file list> | <Backend | Frontend | Fullstack | Infra | Tests> |
69
+ ```
70
+
71
+ Then list exclusions — what is explicitly out of scope and why.
72
+
73
+ Do not write any files. The plan is part of the story output, read-only. It tells the implementer what to touch and why, so they can start without re-investigating.
74
+
75
+ 10. Show the story with the issue form wrapping, the plan, and the artefacts it is grounded in, then ask what is next. If the plan has an open clarification — a wording choice, a missing constraint, an unknown API — ask it before the contracts question.
76
+
77
+ ## Contracts
78
+
79
+ ```json
80
+ {
81
+ "questions": [
82
+ {
83
+ "header": "What next",
84
+ "question": "What next?",
85
+ "options": [
86
+ { "label": "/plan-propose", "description": "Turn this user story into a full OpenSpec proposal with design, specs, and tasks." },
87
+ { "label": "/plan-quick", "description": "Create a lightweight task checklist from this story." },
88
+ { "label": "Refine the story", "description": "Iterate on the story with feedback." }
89
+ ]
90
+ }
91
+ ]
92
+ }
93
+ ```