@plannotator/pi-extension 0.19.16 → 0.19.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/assistant-message.ts +1 -1
- package/config.ts +1 -1
- package/current-pi-session.ts +1 -1
- package/index.ts +4 -4
- package/package.json +6 -6
- package/plannotator-browser.ts +1 -1
- package/plannotator-events.ts +1 -1
- package/plannotator.html +2 -2
- package/review-editor.html +2 -2
- package/skills/plannotator-last/SKILL.md +4 -0
- package/skills/plannotator-setup-goal/SKILL.md +56 -60
- package/skills/plannotator-setup-goal/agents/openai.yaml +3 -3
- package/skills/plannotator-setup-goal/scripts/scaffold_goal.py +0 -219
|
@@ -7,6 +7,10 @@ description: Open Plannotator on the latest rendered assistant message and use t
|
|
|
7
7
|
|
|
8
8
|
Use this skill when the user wants to annotate the latest assistant response in Plannotator.
|
|
9
9
|
|
|
10
|
+
Do not send a commentary/status message before running the command. The command
|
|
11
|
+
targets the latest rendered assistant response, so a preamble can mistakenly become the
|
|
12
|
+
thing being annotated.
|
|
13
|
+
|
|
10
14
|
Run:
|
|
11
15
|
|
|
12
16
|
```bash
|
|
@@ -1,89 +1,85 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plannotator-setup-goal
|
|
3
|
-
description:
|
|
3
|
+
description: Turn an idea or objective into a goal package for /goal. Interviews the user, builds a reviewed fact sheet via Plannotator, then explores the codebase to produce an execution plan.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Setup Goal
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Turn an idea into a goal package at `goals/<slug>/` through structured discovery, user interview, and codebase exploration.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Phases
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### 1. Rearticulate
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
2. Gather enough context to name the goal, define the intended outcome, identify constraints, find likely project docs, and determine proof of done.
|
|
16
|
-
3. Ask focused questions whenever the goal is vague, risky, too broad, missing a finish line, or missing verification. Do not proceed with guessed critical requirements.
|
|
17
|
-
4. Create a slug from the goal name and scaffold `goals/<slug>/` with:
|
|
14
|
+
State back what the user wants in your own words. If the conversation already has rich context, summarize it. If the goal is bare or vague, do minimal shallow exploration of the codebase to ground your understanding. Keep it to 2-3 sentences. Wait for the user to confirm or correct before continuing.
|
|
18
15
|
|
|
19
|
-
|
|
20
|
-
python3 <skill_dir>/scripts/scaffold_goal.py --root . --slug <slug> --title "<goal title>" --objective "<one sentence outcome>"
|
|
21
|
-
```
|
|
16
|
+
### 2. Interview (grill me)
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
- `brief.md`
|
|
25
|
-
- `plan.md`
|
|
26
|
-
- `verification.md`
|
|
27
|
-
- `blockers.md`
|
|
28
|
-
- `goal-prompt.md`
|
|
29
|
-
6. Gate each critical document with Plannotator before moving on:
|
|
18
|
+
Interview the user such that you can derive every "fact" this goal should produce, & until you reach a complete shared understanding of the desired outcomes. The following questions areas should help you determine facts about the outcome.
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
- What the feature/change is
|
|
21
|
+
- Who it's for
|
|
22
|
+
- What problem it solves
|
|
23
|
+
- What behavior changes
|
|
24
|
+
- What success looks like
|
|
25
|
+
- What's in and out of scope (The most important area to determine facts)
|
|
26
|
+
- What edge cases to consider
|
|
27
|
+
- What constraints or precedent apply
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
8. After all gates pass, present the final path and the exact `/goal` prompt from `goal-prompt.md`.
|
|
29
|
+
Ask questions **one at a time**, waiting for feedback before continuing. For each question, provide your recommended answer. Use the question/answer tool if available.
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
**If a question can be answered by exploring the codebase, explore the codebase instead of asking.**
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
Stop when you feel confident in being able to describe the facts of the goal outcome. Don't pad.
|
|
41
34
|
|
|
42
|
-
|
|
35
|
+
### 3. Fact Sheet
|
|
43
36
|
|
|
44
|
-
|
|
37
|
+
A fact is a simple description of each outcome of a goal. It should be easily testable and verifiable. A fact may describe the function of a specific feature or aspect of a system. A fact may determine specific UI and UX. Again, a fact is literally anything that can be tested and verified in automated or manual testing. Keep fact language simple. In a way, a fact sheet is a design spec, but less verbose & using language the human user can easily visualize & rationalize.
|
|
45
38
|
|
|
46
|
-
`
|
|
39
|
+
Create the goal directory and write `goals/<slug>/facts.md` — a flat list of bulleted facts. Each fact is one line. Add a minimal note only when the fact can't be stated clearly on its own.
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
```bash
|
|
42
|
+
mkdir -p goals/<slug>
|
|
43
|
+
```
|
|
49
44
|
|
|
50
|
-
|
|
45
|
+
Gate the fact sheet with Plannotator:
|
|
51
46
|
|
|
52
|
-
|
|
47
|
+
```bash
|
|
48
|
+
plannotator annotate goals/<slug>/facts.md --gate
|
|
49
|
+
```
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
If denied, revise from feedback and re-gate until approved.
|
|
55
52
|
|
|
56
|
-
|
|
53
|
+
### 4. Plan
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
Explore the codebase. Discover and validate implementation paths toward each fact. Trace through code, identify files and systems involved, surface risks and unknowns. Refine until you have a confident order of operations.
|
|
59
56
|
|
|
60
|
-
|
|
57
|
+
Write `goals/<slug>/plan.md`:
|
|
61
58
|
|
|
62
|
-
|
|
59
|
+
- Solution approach (brief)
|
|
60
|
+
- Ordered steps with the files/systems each touches
|
|
61
|
+
- Verification for each step (concrete commands or checks)
|
|
62
|
+
- Risks or open questions worth flagging
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
- outcome
|
|
66
|
-
- relevant files
|
|
67
|
-
- constraints and non-goals
|
|
68
|
-
- plan acceptance criteria and evidence
|
|
69
|
-
- verification commands
|
|
70
|
-
- ask-before rules
|
|
71
|
-
- instruction to use `goals/<slug>/` as the durable plan and append evidence to `progress.jsonl`
|
|
64
|
+
Gate the plan with Plannotator:
|
|
72
65
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- vague words like "improve" without measurable proof
|
|
77
|
-
- instructions to keep working forever
|
|
78
|
-
- hidden assumptions that are not written into the files
|
|
66
|
+
```bash
|
|
67
|
+
plannotator annotate goals/<slug>/plan.md --gate
|
|
68
|
+
```
|
|
79
69
|
|
|
80
|
-
|
|
70
|
+
If denied, revise from feedback and re-gate until approved.
|
|
81
71
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
72
|
+
### 5. Goal Output
|
|
73
|
+
|
|
74
|
+
Write `goals/<slug>/goal.md`:
|
|
75
|
+
|
|
76
|
+
- The articulated goal (1-3 sentences)
|
|
77
|
+
- Reference to `facts.md` as the shared understanding
|
|
78
|
+
- Reference to `plan.md` as the execution plan
|
|
79
|
+
- Done condition
|
|
80
|
+
|
|
81
|
+
Tell the user:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Done! Launch a goal with `/goal goals/<slug>/goal.md`
|
|
85
|
+
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
|
-
display_name: "
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use $plannotator-setup-goal to
|
|
2
|
+
display_name: "Setup Goal"
|
|
3
|
+
short_description: "Turn an idea into a goal package for /goal"
|
|
4
|
+
default_prompt: "Use $plannotator-setup-goal to turn this idea into a goal package."
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Scaffold a reviewed Codex goal package under goals/<slug>/."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import argparse
|
|
7
|
-
import datetime as dt
|
|
8
|
-
import json
|
|
9
|
-
import re
|
|
10
|
-
import sys
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def slugify(value: str) -> str:
|
|
15
|
-
slug = re.sub(r"[^a-z0-9]+", "-", value.strip().lower()).strip("-")
|
|
16
|
-
slug = re.sub(r"-{2,}", "-", slug)
|
|
17
|
-
return slug or "goal"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def write_file(path: Path, content: str, force: bool) -> None:
|
|
21
|
-
if path.exists() and not force:
|
|
22
|
-
return
|
|
23
|
-
path.write_text(content, encoding="utf-8")
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def brief(title: str, objective: str) -> str:
|
|
27
|
-
return f"""# {title}
|
|
28
|
-
|
|
29
|
-
## Outcome
|
|
30
|
-
|
|
31
|
-
{objective or "TODO: State the concrete outcome in one or two sentences."}
|
|
32
|
-
|
|
33
|
-
## Context
|
|
34
|
-
|
|
35
|
-
- TODO: List the project facts, files, docs, user needs, and constraints Codex must know.
|
|
36
|
-
|
|
37
|
-
## Constraints
|
|
38
|
-
|
|
39
|
-
- TODO: List behavior, APIs, data, UX, performance, compatibility, or process rules that must not regress.
|
|
40
|
-
|
|
41
|
-
## Non-Goals
|
|
42
|
-
|
|
43
|
-
- TODO: List work that is out of scope for this goal.
|
|
44
|
-
|
|
45
|
-
## Ask Before
|
|
46
|
-
|
|
47
|
-
- TODO: List decisions, risky operations, external dependencies, product calls, and destructive changes that require user approval.
|
|
48
|
-
|
|
49
|
-
## Done Means
|
|
50
|
-
|
|
51
|
-
- TODO: Summarize the finish line. Detailed acceptance evidence belongs in `acceptance.md`.
|
|
52
|
-
"""
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def plan(title: str) -> str:
|
|
56
|
-
return f"""# Plan: {title}
|
|
57
|
-
|
|
58
|
-
## Solution Overview
|
|
59
|
-
|
|
60
|
-
TODO: Describe what is being built in plain language. Explain the shape of the solution before diving into tasks.
|
|
61
|
-
|
|
62
|
-
## Why This Approach
|
|
63
|
-
|
|
64
|
-
TODO: Explain why this direction is appropriate for the project, user goal, constraints, and risk level.
|
|
65
|
-
|
|
66
|
-
## How It Will Work
|
|
67
|
-
|
|
68
|
-
TODO: Describe the main moving parts, data flow, user flow, files, APIs, or systems involved. Keep this narrative enough that a reviewer can understand the intended solution.
|
|
69
|
-
|
|
70
|
-
## Slices
|
|
71
|
-
|
|
72
|
-
| Slice | Purpose | Main files or systems | Done when | Risks |
|
|
73
|
-
| --- | --- | --- | --- | --- |
|
|
74
|
-
| 1 | TODO | TODO | TODO | TODO |
|
|
75
|
-
| 2 | TODO | TODO | TODO | TODO |
|
|
76
|
-
|
|
77
|
-
## Sequencing
|
|
78
|
-
|
|
79
|
-
- TODO: Explain the order of execution and which slices block later slices.
|
|
80
|
-
|
|
81
|
-
## Phase Boundaries
|
|
82
|
-
|
|
83
|
-
- TODO: State when this goal should end and a new goal should be created instead of stretching this one.
|
|
84
|
-
|
|
85
|
-
## Steering Notes
|
|
86
|
-
|
|
87
|
-
- TODO: Capture taste calls, product preferences, or review checkpoints the user should steer during execution.
|
|
88
|
-
|
|
89
|
-
## Acceptance Criteria
|
|
90
|
-
|
|
91
|
-
- [ ] TODO: Requirement with concrete observable evidence.
|
|
92
|
-
- [ ] TODO: Requirement with concrete observable evidence.
|
|
93
|
-
|
|
94
|
-
## Required Evidence
|
|
95
|
-
|
|
96
|
-
| Requirement | Evidence to inspect | Where evidence is recorded |
|
|
97
|
-
| --- | --- | --- |
|
|
98
|
-
| TODO | TODO | TODO |
|
|
99
|
-
|
|
100
|
-
## Completion Audit
|
|
101
|
-
|
|
102
|
-
Before marking the goal complete, Codex must map every explicit requirement, file, command, check, and deliverable to real evidence. If any item is missing, incomplete, weakly verified, or uncertain, the goal is not complete.
|
|
103
|
-
"""
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
def verification(title: str) -> str:
|
|
107
|
-
return f"""# Verification: {title}
|
|
108
|
-
|
|
109
|
-
## Commands
|
|
110
|
-
|
|
111
|
-
| Command | Purpose | Expected pass condition | Evidence location |
|
|
112
|
-
| --- | --- | --- | --- |
|
|
113
|
-
| TODO | TODO | TODO | TODO |
|
|
114
|
-
|
|
115
|
-
## Manual Checks
|
|
116
|
-
|
|
117
|
-
- TODO: Add browser checks, screenshots, release checks, PR checks, or human review steps.
|
|
118
|
-
|
|
119
|
-
## Evidence Rules
|
|
120
|
-
|
|
121
|
-
- Record verification results in `progress.jsonl`.
|
|
122
|
-
- Include command, status, timestamp, and artifact path when available.
|
|
123
|
-
- Do not rely on passing tests unless they cover the requirement being claimed.
|
|
124
|
-
"""
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
def blockers(title: str) -> str:
|
|
128
|
-
return f"""# Blockers: {title}
|
|
129
|
-
|
|
130
|
-
## Open Questions
|
|
131
|
-
|
|
132
|
-
- TODO: Questions that must be answered before or during execution.
|
|
133
|
-
|
|
134
|
-
## Stop And Ask
|
|
135
|
-
|
|
136
|
-
- TODO: Conditions that should pause the goal and ask the user.
|
|
137
|
-
|
|
138
|
-
## Dangerous Or High-Risk Actions
|
|
139
|
-
|
|
140
|
-
- TODO: Destructive changes, migrations, dependency changes, security-sensitive work, billing/auth changes, or external operations requiring approval.
|
|
141
|
-
|
|
142
|
-
## Known Blockers
|
|
143
|
-
|
|
144
|
-
- TODO: Current blockers, owners, and next action.
|
|
145
|
-
"""
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
def goal_prompt(slug: str, title: str, objective: str) -> str:
|
|
149
|
-
prompt_objective = objective or f"Complete the reviewed goal package for {title}."
|
|
150
|
-
return f"""# Codex Goal Prompt: {title}
|
|
151
|
-
|
|
152
|
-
After every critical document in this folder is approved with Plannotator, paste or set this goal:
|
|
153
|
-
|
|
154
|
-
```text
|
|
155
|
-
/goal {prompt_objective}
|
|
156
|
-
|
|
157
|
-
Use `goals/{slug}/` as the durable source of truth:
|
|
158
|
-
- Read `brief.md` for the mission, context, constraints, non-goals, and ask-before rules.
|
|
159
|
-
- Follow `plan.md` for the solution overview, implementation slices, risks, and acceptance criteria.
|
|
160
|
-
- Run the checks in `verification.md` and record evidence.
|
|
161
|
-
- Append concrete progress and proof to `progress.jsonl`.
|
|
162
|
-
- Pause and ask the user for anything listed in `blockers.md` or any similarly risky unresolved decision.
|
|
163
|
-
|
|
164
|
-
Do not mark the goal complete until every acceptance item is backed by real evidence and the required verification has passed or the remaining blocker is explicitly documented for the user.
|
|
165
|
-
```
|
|
166
|
-
"""
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
def progress_entry(title: str, objective: str) -> str:
|
|
170
|
-
now = dt.datetime.now(dt.timezone.utc).replace(microsecond=0).isoformat()
|
|
171
|
-
entry = {
|
|
172
|
-
"type": "goal_package_created",
|
|
173
|
-
"timestamp": now,
|
|
174
|
-
"title": title,
|
|
175
|
-
"objective": objective,
|
|
176
|
-
"evidence": "Initial scaffold created; critical documents still require Plannotator gate approval.",
|
|
177
|
-
}
|
|
178
|
-
return json.dumps(entry, ensure_ascii=True) + "\n"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
def parse_args() -> argparse.Namespace:
|
|
182
|
-
parser = argparse.ArgumentParser(description=__doc__)
|
|
183
|
-
parser.add_argument("--root", default=".", help="Project root where goals/ should be created.")
|
|
184
|
-
parser.add_argument("--slug", help="Goal folder name. Defaults to a slugified title.")
|
|
185
|
-
parser.add_argument("--title", required=True, help="Human-readable goal title.")
|
|
186
|
-
parser.add_argument("--objective", default="", help="One-sentence goal outcome.")
|
|
187
|
-
parser.add_argument("--force", action="store_true", help="Overwrite existing scaffold files.")
|
|
188
|
-
return parser.parse_args()
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
def main() -> int:
|
|
192
|
-
args = parse_args()
|
|
193
|
-
root = Path(args.root).resolve()
|
|
194
|
-
slug = slugify(args.slug or args.title)
|
|
195
|
-
goal_dir = root / "goals" / slug
|
|
196
|
-
goal_dir.mkdir(parents=True, exist_ok=True)
|
|
197
|
-
|
|
198
|
-
files = {
|
|
199
|
-
"brief.md": brief(args.title, args.objective),
|
|
200
|
-
"plan.md": plan(args.title),
|
|
201
|
-
"verification.md": verification(args.title),
|
|
202
|
-
"blockers.md": blockers(args.title),
|
|
203
|
-
"goal-prompt.md": goal_prompt(slug, args.title, args.objective),
|
|
204
|
-
}
|
|
205
|
-
for name, content in files.items():
|
|
206
|
-
write_file(goal_dir / name, content, args.force)
|
|
207
|
-
|
|
208
|
-
progress_path = goal_dir / "progress.jsonl"
|
|
209
|
-
if not progress_path.exists() or args.force:
|
|
210
|
-
write_file(progress_path, progress_entry(args.title, args.objective), args.force)
|
|
211
|
-
|
|
212
|
-
print(goal_dir)
|
|
213
|
-
for name in sorted([*files.keys(), "progress.jsonl"]):
|
|
214
|
-
print(goal_dir / name)
|
|
215
|
-
return 0
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if __name__ == "__main__":
|
|
219
|
-
sys.exit(main())
|