@plainconceptsplatform/agent-harness 2.4.0 → 2.5.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 (81) hide show
  1. package/README.md +435 -437
  2. package/cli/fragments/archive/az.md +97 -95
  3. package/cli/fragments/archive/gh.md +96 -94
  4. package/cli/fragments/archive/gl.md +96 -94
  5. package/cli/fragments/archive/none.md +75 -73
  6. package/cli/fragments/guardrails/codegraph.md +5 -7
  7. package/cli/fragments/guardrails/humanizer.md +4 -4
  8. package/cli/fragments/guardrails/memory.md +4 -4
  9. package/cli/fragments/guardrails/rtk.md +3 -3
  10. package/cli/fragments/guardrails/simple-english.md +4 -4
  11. package/cli/fragments/ops-backlog/az.md +1 -1
  12. package/cli/fragments/ops-backlog/gh.md +1 -1
  13. package/cli/fragments/ops-backlog/jira.md +1 -1
  14. package/cli/fragments/ops-evidence/az.md +44 -41
  15. package/cli/fragments/ops-evidence/gh.md +54 -53
  16. package/cli/fragments/ops-evidence/jira.md +42 -38
  17. package/cli/fragments/ops-review/az.md +1 -1
  18. package/cli/fragments/ops-review/gh.md +1 -1
  19. package/cli/fragments/ops-review/gl.md +1 -1
  20. package/cli/fragments/ops-ship/az.md +81 -80
  21. package/cli/fragments/ops-ship/gh.md +68 -68
  22. package/cli/fragments/ops-ship/gl.md +85 -85
  23. package/cli/presets/agents-content.json +34 -53
  24. package/cli/steps/copy/agents.js +18 -17
  25. package/cli/steps/copy/opencode-json.js +5 -1
  26. package/cli/steps/copy/skills.js +98 -5
  27. package/cli/steps/optimization/patch-guardrails.js +5 -3
  28. package/cli/utils/copy.js +8 -3
  29. package/cli/utils/update-manifest.js +28 -2
  30. package/harness/.agents/skills/pc-guardrails-generic/SKILL.md +47 -68
  31. package/harness/.agents/skills/pc-make-architecture/SKILL.md +31 -51
  32. package/harness/.agents/skills/pc-make-design/SKILL.md +45 -68
  33. package/harness/.agents/skills/pc-make-engineer/SKILL.md +59 -219
  34. package/harness/.agents/skills/pc-make-engineer/signal-mapping.md +53 -68
  35. package/harness/.agents/skills/pc-make-engineer/template.md +42 -80
  36. package/harness/.agents/skills/pc-make-evidence-scaffold/SKILL.md +18 -18
  37. package/harness/.agents/skills/pc-make-evidence-scaffold/evidence-contract.md +29 -29
  38. package/harness/.agents/skills/pc-make-guardrails/SKILL.md +43 -74
  39. package/harness/.agents/skills/pc-make-guardrails/category-reference.md +10 -5
  40. package/harness/.agents/skills/pc-make-merge-risk-assess/category-reference.md +26 -7
  41. package/harness/.agents/skills/pc-make-user-model/SKILL.md +56 -66
  42. package/harness/.agents/skills/pc-ops-evidence/SKILL.md +133 -127
  43. package/harness/.agents/skills/pc-plan-apply/SKILL.md +14 -5
  44. package/harness/.agents/skills/pc-plan-apply/simple-mode.md +21 -21
  45. package/harness/.agents/skills/pc-plan-archive/SKILL.md +66 -66
  46. package/harness/.agents/skills/pc-plan-explore/SKILL.md +19 -2
  47. package/harness/.agents/skills/pc-plan-goal/SKILL.md +11 -7
  48. package/harness/.agents/skills/pc-plan-goal/output-mode.md +1 -0
  49. package/harness/.agents/skills/pc-plan-goal/output.md +71 -65
  50. package/harness/.agents/skills/pc-plan-propose/SKILL.md +1 -1
  51. package/harness/.agents/skills/pc-plan-quick/SKILL.md +46 -62
  52. package/harness/.agents/skills/pc-plan-story/SKILL.md +48 -149
  53. package/harness/.agents/skills/pc-repo-help/SKILL.md +89 -91
  54. package/harness/.agents/skills/pc-repo-initialize/SKILL.md +112 -130
  55. package/harness/.agents/skills/pc-repo-onboard/SKILL.md +32 -87
  56. package/harness/.agents/skills/pc-repo-verify/SKILL.md +2 -0
  57. package/harness/.agents/skills/pc-userstory-az/SKILL.md +71 -157
  58. package/harness/.agents/skills/pc-userstory-browser/SKILL.md +50 -122
  59. package/harness/.agents/skills/pc-userstory-gh/SKILL.md +63 -120
  60. package/harness/.agents/skills/pc-userstory-jira/SKILL.md +74 -131
  61. package/harness/.opencode/commands/init.md +5 -5
  62. package/harness/.opencode/commands/make-architecture.md +5 -5
  63. package/harness/.opencode/commands/make-design.md +5 -5
  64. package/harness/.opencode/commands/make-engineer.md +5 -5
  65. package/harness/.opencode/commands/make-evidence-scaffold.md +5 -5
  66. package/harness/.opencode/commands/make-guardrails.md +5 -5
  67. package/harness/.opencode/commands/make-user-model.md +5 -5
  68. package/harness/.opencode/commands/plan-apply.md +9 -9
  69. package/harness/.opencode/commands/plan-goal.md +5 -5
  70. package/harness/.opencode/commands/plan-quick.md +5 -5
  71. package/harness/.opencode/commands/plan-story.md +9 -9
  72. package/harness/.opencode/commands/repo-audit.md +5 -5
  73. package/harness/.opencode/commands/repo-initialize.md +5 -5
  74. package/harness/.opencode/commands/repo-onboard.md +5 -5
  75. package/harness/.opencode/commands/repo-verify.md +5 -5
  76. package/harness/.opencode/plugins/pc-subagent-monitor.js +82 -2
  77. package/harness/.opencode/plugins/pc-subagent-tiers.js +9 -6
  78. package/harness/.opencode/plugins/pc-system-reminders.js +312 -3
  79. package/harness/AGENTS.md +49 -71
  80. package/harness/opencode.jsonc +1 -1
  81. package/package.json +1 -1
@@ -1,65 +1,71 @@
1
- # Output procedure
2
-
3
- Before output, require `verify`, `archive`, a clean working tree, no active change directory, and an archive directory for `{change-id}`.
4
-
5
- ## Restore stash
6
-
7
- If the goal created `goal-wip`, restore it after the mode-specific operation. When restoration conflicts, leave the stash intact, report its `git stash list` reference, and do not drop user work.
8
-
9
- ## Default mode
10
-
11
- Synchronize the default branch, merge, delete the feature branch, then restore the stash:
12
-
13
- ```bash
14
- git switch "$DEFAULT_BRANCH"
15
-
16
- if git remote get-url origin >/dev/null 2>&1; then
17
- git pull origin "$DEFAULT_BRANCH"
18
- fi
19
-
20
- git merge --no-ff "$BRANCH" -m "goal: {title} ({change-id})"
21
- git branch -d "$BRANCH"
22
- ```
23
-
24
- If the merge conflicts, abort it and use the failure policy. Do not push the default branch.
25
-
26
- ## Push mode
27
-
28
- Push the feature branch:
29
-
30
- ```bash
31
- git push -u origin "$BRANCH"
32
- ```
33
-
34
- Restore the stash and leave the branch available.
35
-
36
- ## PR mode
37
-
38
- Push the feature branch, then load `pc-ops-ship` to create a PR into `$DEFAULT_BRANCH`. Supply title, change id, functional summary, delivered acceptance criteria, task count, verification result, archive path, and commits. Do not merge the PR.
39
-
40
- Restore the stash.
41
-
42
- ## Final report
43
-
44
- Print:
45
-
46
- ```text
47
- Goal: {title}
48
- Change ID: {change-id}
49
- Scope classification: focused | standard | complex
50
- Functional outcome: {one-sentence result}
51
- Branch: {branch}
52
- Tasks: {completed}/{total}
53
- Acceptance criteria: {passed}/{total}
54
- Commits: {proposal, apply, archive}
55
- Verification: passed | failed
56
- Archived: yes | no
57
- Archive path: {path or none}
58
- Output mode: default | push | pr
59
- Final state: merged locally | pushed branch | PR URL | branch preserved after failure
60
- Stash restoration: not needed | restored | preserved after conflict
61
- ```
62
-
63
- ## External gate
64
-
65
- An unattended caller must verify `openspec list --json` is empty and run the project's lint and typecheck commands before any later git operation.
1
+ # Output procedure
2
+
3
+ Before output, require `verify`, `archive`, a clean working tree, no active change directory, and an archive directory for `{change-id}`.
4
+
5
+ ## Restore stash
6
+
7
+ If the goal created `goal-wip`, restore it after the mode-specific operation. When restoration conflicts, leave the stash intact, report its `git stash list` reference, and do not drop user work.
8
+
9
+ ## Default mode
10
+
11
+ Synchronize the default branch, merge, delete the feature branch, then restore the stash:
12
+
13
+ ```bash
14
+ git switch "$DEFAULT_BRANCH"
15
+
16
+ if git remote get-url origin >/dev/null 2>&1; then
17
+ git pull origin "$DEFAULT_BRANCH"
18
+ fi
19
+
20
+ git merge --no-ff "$BRANCH" -m "goal: {title} ({change-id})"
21
+ git branch -d "$BRANCH"
22
+ ```
23
+
24
+ If the merge conflicts, abort it and use the failure policy. Do not push the default branch.
25
+
26
+ ## Push mode
27
+
28
+ Push the feature branch:
29
+
30
+ ```bash
31
+ git push -u origin "$BRANCH"
32
+ ```
33
+
34
+ Restore the stash and leave the branch available.
35
+
36
+ ## PR mode
37
+
38
+ Push the feature branch, then load `pc-ops-ship` to create a PR into `$DEFAULT_BRANCH`. Supply title, change id, functional summary, delivered acceptance criteria, task count, verification result, archive path, and commits. Do not merge the PR.
39
+
40
+ Restore the stash.
41
+
42
+ ## Branch mode
43
+
44
+ Leave `$BRANCH` in place with its commits. Merge nothing, push nothing, delete nothing.
45
+
46
+ Restore the stash.
47
+
48
+ ## Final report
49
+
50
+ Print:
51
+
52
+ ```text
53
+ Goal: {title}
54
+ Change ID: {change-id}
55
+ Scope classification: focused | standard | complex
56
+ Functional outcome: {one-sentence result}
57
+ Branch: {branch}
58
+ Tasks: {completed}/{total}
59
+ Acceptance criteria: {passed}/{total}
60
+ Commits: {proposal, apply, archive}
61
+ Verification: passed | failed
62
+ Archived: yes | no
63
+ Archive path: {path or none}
64
+ Output mode: default | push | pr | branch
65
+ Final state: merged locally | pushed branch | PR URL | branch preserved | branch preserved after failure
66
+ Stash restoration: not needed | restored | preserved after conflict
67
+ ```
68
+
69
+ ## External gate
70
+
71
+ An unattended caller must verify `openspec list --json` is empty and run the project's lint and typecheck commands before any later git operation.
@@ -6,7 +6,7 @@ license: MIT
6
6
 
7
7
  # Plan Propose
8
8
 
9
- **READ-ONLY UNTIL CONFIRMED.** Until the Step 3 checkpoint resolves to `yes`, this entire skill is read-only. You MUST NOT write, edit, or create any file. Build everything in context. Files hit disk only in Step 4. After Step 5, the skill ends; if the user keeps chatting without invoking a new command, remain read-only. Writing requires either an explicit user command (e.g. `/plan-apply`) or the Step 3 `yes` confirmation.
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
10
 
11
11
  ## Input
12
12
 
@@ -1,62 +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
- This command is strictly read-only. You may read files, search code, and use `todowrite` to create Todo pane items. You MUST NOT write, edit, or create any file. After completing the checklist and asking the user what's next, if the user continues chatting without invoking a new command (e.g. `/plan-apply`) or explicitly requesting implementation, remain read-only. The only output of this command is the Todo pane checklist and a question to the user.
8
-
9
- Lightweight planning for focused changes. Reads the codebase, creates a task checklist in the Todo pane using `todowrite`, and stops. This is a thinking tool, not a file writer.
10
-
11
- When to use this instead of `/plan-explore` then `/plan-propose`:
12
- - The task is clear and well-scoped (not a half-formed idea)
13
- - You don't need to think through alternatives or investigate deeply
14
- - You want a task list in under a minute, not a full proposal
15
-
16
- ## Step 1: Understand the task
17
-
18
- Read the user's description. Use `glob` and `grep` to locate the relevant files, components, and patterns in the codebase. Read the key files to understand what exists and what needs to change.
19
-
20
- ## Step 2: Create the plan in the Todo pane
21
-
22
- Use `todowrite` to create one todo item per task. Each item must be:
23
-
24
- - Concrete and actionable: include file paths or areas in the task text when possible
25
- - Ordered by logical dependency: dependencies first
26
- - Granular: one clear action per item, not a bundle
27
-
28
- Example `todowrite` call:
29
-
30
- ```json
31
- {
32
- "todos": [
33
- { "content": "Add Project model to src/types.ts", "status": "pending", "priority": "high" },
34
- { "content": "Add projectId field to LoopOptions in src/types.ts", "status": "pending", "priority": "high" },
35
- { "content": "Create Project RPC endpoints in src/rpc/project/", "status": "pending", "priority": "medium" },
36
- { "content": "Build Accept page UI in src/board/components/CreateForm.tsx", "status": "pending", "priority": "medium" },
37
- { "content": "Run typecheck and fix errors", "status": "pending", "priority": "low" }
38
- ]
39
- }
40
- ```
41
-
42
- ## Step 3: Ask what's next
43
-
44
- Call the `question` tool:
45
-
46
- ```json
47
- {
48
- "questions": [
49
- {
50
- "header": "What next",
51
- "question": "What next?",
52
- "options": [
53
- { "label": "/plan-apply", "description": "Implement these tasks now (creates a feature branch and works through them)." },
54
- { "label": "/plan-propose", "description": "Turn this into a full OpenSpec proposal with agent assignments." },
55
- { "label": "Start on specific tasks", "description": "Tell me which tasks to start on." }
56
- ]
57
- }
58
- ]
59
- }
60
- ```
61
-
62
- Do not create any files. Do not run `/plan-apply` or `/plan-propose` automatically. The only output is the Todo pane checklist.
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 typecheck and fix errors", "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,149 +1,48 @@
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
- <!-- PC-OPTIMIZATION-MEMORY-START -->
25
- <!-- PC-OPTIMIZATION-MEMORY-END -->
26
-
27
- Use `glob` and `grep` to locate the relevant files, components, types, and patterns that the feature touches. Read the key files to understand:
28
-
29
- - **Who** the users are (check auth, roles, user models, route guards)
30
- - **What** the current state is (existing components, API endpoints, data models, types)
31
- - **Where** the change would land (file paths, directory structure, module boundaries)
32
- - **Why** it matters (business logic, validation rules, existing UX flows)
33
-
34
- 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.
35
-
36
- Map the feature description to concrete codebase artifacts:
37
-
38
- ```
39
- Relevant artifacts:
40
- Models: <model names and file paths>
41
- Components: <component names and file paths>
42
- Endpoints: <route or API paths>
43
- Types: <type definitions and file paths>
44
- Patterns: <architectural patterns in use (FSD, monolith, etc.)>
45
- ```
46
-
47
- ## Step 3: Draft the user story
48
-
49
- Write the story using the user-story skill's format. Ground every field in the codebase analysis from Step 2:
50
-
51
- ### Use Case
52
-
53
- - **As a** [specific persona derived from auth/roles/user models in the repo — never "user"]
54
- - **I want to** [action that maps to a concrete code change — reference the component, endpoint, or model involved]
55
- - **so that** [real outcome tied to business logic or UX flow found in the codebase]
56
-
57
- ### Acceptance Criteria (Gherkin)
58
-
59
- Write scenarios with preconditions grounded in the actual codebase state:
60
-
61
- - **Scenario:** [brief description]
62
- - **Given:** [precondition referencing real state — e.g. "the user is authenticated via the JWT middleware in src/auth/middleware.ts"]
63
- - **and Given:** [additional preconditions — existing data models, current UI state, config values]
64
- - **When:** [trigger that maps to a concrete user action on a real component or endpoint]
65
- - **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"]
66
-
67
- ### Edge Cases
68
-
69
- List 2-3 edge cases derived from what the code currently does:
70
-
71
- - What happens when [existing validation/constraint] is violated?
72
- - What if [existing data state] is empty/null/migration-incomplete?
73
- - What about [existing role/permission boundary]?
74
-
75
- ### Summary
76
-
77
- Write a one-line value-focused summary (not a feature title).
78
-
79
- ## Step 4: Humanize
80
-
81
- Load the `@humanizer` skill and run it on the drafted story text from Step 3. AI-generated stories tend to:
82
-
83
- - Overuse em dashes and rule-of-three lists
84
- - Use promotional language ("seamless", "powerful", "comprehensive")
85
- - Use passive voice and negative parallelisms
86
- - Stack vague attributions
87
- - Inflate symbolism in the summary line
88
-
89
- 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.
90
-
91
- ## Step 5: Diagram (when the story has a flow)
92
-
93
- 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.
94
-
95
- When to draw:
96
- - Multi-step flows (login → action → confirmation)
97
- - State transitions (status changes on a work item, order state machine)
98
- - Component interactions (frontend → API → service → DB)
99
-
100
- When to skip:
101
- - Simple CRUD on a single resource
102
- - Stories with a single step and no preconditions beyond auth
103
-
104
- If the input included an exploration diagram, extend it with the story's new flow rather than redrawing from scratch.
105
-
106
- ## Step 6: Validate
107
-
108
- Run every quality check from the user-story skill:
109
-
110
- - No generic "As a user" — the persona must be specific and grounded in repo context
111
- - "So that" must express real motivation, not restate "I want to"
112
- - Single When / single Then per scenario — if multiple, note that the story should split
113
- - Thens must be testable and measurable — reference real system behavior, not vague improvements
114
- - No technical tasks disguised as user stories (if there's no user outcome, say so)
115
-
116
- If any check fails, fix the story and re-validate. Do not show a story to the user that fails validation.
117
-
118
- ## Step 7: Present the story
119
-
120
- Display the complete user story to the user:
121
-
122
- - Summary
123
- - Use Case (As a / I want to / so that)
124
- - Acceptance Criteria (all scenarios with full Given/When/Then)
125
- - Edge Cases
126
- - Diagram (if produced in Step 5)
127
- - Codebase artifacts the story is grounded in (file paths, component names, types)
128
-
129
- ## Step 8: Ask what's next
130
-
131
- Call the `question` tool:
132
-
133
- ```json
134
- {
135
- "questions": [
136
- {
137
- "header": "What next",
138
- "question": "What next?",
139
- "options": [
140
- { "label": "/plan-propose", "description": "Turn this user story into a full OpenSpec proposal with design, specs, and tasks." },
141
- { "label": "/plan-quick", "description": "Create a lightweight task checklist from this story." },
142
- { "label": "Refine the story", "description": "Iterate on the story with feedback." }
143
- ]
144
- }
145
- ]
146
- }
147
- ```
148
-
149
- Do not create any files. Do not run `/plan-propose` or `/plan-quick` automatically. The only output is the user story.
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 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
+ <!-- PC-OPTIMIZATION-MEMORY-START -->
14
+ <!-- PC-OPTIMIZATION-MEMORY-END -->
15
+
16
+ ## Rules
17
+
18
+ - 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 and one question.
19
+ - 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.
20
+ - Never show the user a story that fails the `@user-story` checks. Fix it first.
21
+ - Every `Given`, `When` and `Then` names something real, and every `Then` is testable: a file, endpoint, model or field somebody can point at.
22
+
23
+ ## Flow
24
+
25
+ 1. Load `@user-story`.
26
+ 2. 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.
27
+ 3. Draft the story against that inventory, with two or three edge cases taken from what the code does today: a violated constraint, an empty or half-migrated state, a permission boundary.
28
+ 4. Load `@humanizer` and run it over the prose. It cleans prose, not structure: paths, component names and Gherkin stay exact.
29
+ 5. 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.
30
+ 6. Show the story with the artefacts it is grounded in, then ask what is next.
31
+
32
+ ## Contracts
33
+
34
+ ```json
35
+ {
36
+ "questions": [
37
+ {
38
+ "header": "What next",
39
+ "question": "What next?",
40
+ "options": [
41
+ { "label": "/plan-propose", "description": "Turn this user story into a full OpenSpec proposal with design, specs, and tasks." },
42
+ { "label": "/plan-quick", "description": "Create a lightweight task checklist from this story." },
43
+ { "label": "Refine the story", "description": "Iterate on the story with feedback." }
44
+ ]
45
+ }
46
+ ]
47
+ }
48
+ ```