@hobin/developer 0.1.1 → 0.1.3

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 (33) hide show
  1. package/README.md +61 -20
  2. package/SOURCES.md +104 -0
  3. package/extensions/developer.ts +202 -44
  4. package/extensions/references/behavior-preserving-structural-change.md +149 -0
  5. package/extensions/skills.ts +1 -16
  6. package/extensions/state.ts +96 -10
  7. package/extensions/tui.ts +140 -25
  8. package/package.json +11 -25
  9. package/skills/abstraction-review/references/field-card.md +7 -0
  10. package/skills/abstraction-review/references/recipe-cards.md +67 -0
  11. package/skills/abstraction-review/references/repair-table.md +5 -0
  12. package/skills/model/SKILL.md +6 -1
  13. package/skills/model/references/problem-modeling.md +294 -235
  14. package/skills/model/references/worked-models-and-specialized-techniques.md +218 -0
  15. package/skills/naming-judgment/SKILL.md +5 -3
  16. package/skills/naming-judgment/references/domain-naming.md +202 -0
  17. package/skills/schedule/SKILL.md +1 -1
  18. package/skills/schedule/references/structural-change-timing.md +80 -13
  19. package/skills/signal/SKILL.md +2 -2
  20. package/skills/signal/references/structural-movement.md +202 -0
  21. package/skills/sketch/SKILL.md +35 -8
  22. package/skills/sketch/references/abstraction-barriers-and-closure.md +160 -0
  23. package/skills/sketch/references/abstraction-composition-and-state.md +184 -0
  24. package/skills/sketch/references/composition-generative-recursion-and-accumulators.md +196 -0
  25. package/skills/sketch/references/data-driven-design.md +177 -0
  26. package/skills/sketch/references/data-shape-template-catalog.md +241 -0
  27. package/skills/sketch/references/generic-operations-and-languages.md +134 -0
  28. package/skills/sketch/references/processes-state-and-time.md +171 -0
  29. package/skills/sketch/references/responsibility-and-variation.md +245 -0
  30. package/skills/verify/references/verifier-selection-and-pass-but-wrong.md +61 -3
  31. package/skills/naming-judgment/references/elements-of-clojure-naming.md +0 -74
  32. package/skills/signal/references/flocking-and-structural-movement.md +0 -157
  33. package/skills/sketch/references/design-recipe-and-abstraction-barriers.md +0 -169
package/README.md CHANGED
@@ -3,9 +3,10 @@
3
3
  Adaptive product-development judgment for [Pi](https://pi.dev).
4
4
 
5
5
  Developer combines a small, branch-aware coordination extension with ten
6
- independent skills. It routes one concrete question at a time, records the
7
- resulting evidence, and preserves unresolved questions without turning product
8
- development into a fixed lifecycle.
6
+ independent skills. It routes one concrete question or green-to-green movement
7
+ at a time, records the resulting evidence, and preserves unresolved questions.
8
+ Its default topology gives feature work a useful backbone without turning every
9
+ task into a fixed lifecycle.
9
10
 
10
11
  ## Install
11
12
 
@@ -86,10 +87,26 @@ Developer adds two model-facing protocol tools:
86
87
  1. `developer_route_question` opens one route for one concrete question.
87
88
  2. The route target is `direct` or one currently available Developer skill.
88
89
  3. A skill route returns the exact Pi-discovered `SKILL.md` instructions and canonical
89
- path; a direct route keeps implementation tools available for the justified
90
- action.
90
+ path; a direct route declares one movement, its stable landing, and its narrow
91
+ verification. A behavior-preserving structural route also loads the focused
92
+ execution profile based on flocking-style movement and small tidyings.
91
93
  4. `developer_record_judgment` closes the route with a status, result, evidence,
92
- artifacts, and any newly opened questions.
94
+ artifacts, and any newly opened questions. Developer then routes again from
95
+ the stable landing before another movement.
96
+
97
+ The conditional default topology is:
98
+
99
+ ```text
100
+ clarify when needed → model consequential cases
101
+ → sketch the first feature implementation surface OR signal existing-code movement
102
+ → one direct green-to-green movement → re-route from evidence
103
+ → verify before completion
104
+ ```
105
+
106
+ This is not a mandatory phase sequence. A stage may be not applicable and new
107
+ evidence may route backward or sideways. One guard is deliberate: a resolved
108
+ model cannot flow straight into mutation. New feature work receives an initial
109
+ `sketch`; existing-code structural work receives a `signal` first.
93
110
 
94
111
  Product code is still read, edited, executed, and tested with Pi's normal tools.
95
112
  Developer's tools only route and record judgment; they do not implement product
@@ -129,8 +146,12 @@ These are routing states, not product-completion claims. In particular:
129
146
  - A resolved `specify` judgment is not user acceptance.
130
147
  - A resolved `verify` judgment is not timeless proof after later changes.
131
148
 
132
- Pending questions receive stable IDs. A later route revisits one by passing the
133
- exact ID; wording similarity is never used as identity.
149
+ Pending questions receive stable internal IDs, but users do not type them.
150
+ Selecting `/develop questions` focuses the question in branch state; the next
151
+ route automatically associates that focus. A sole pending question or an exact
152
+ question match is also associated automatically. Resolved and not-applicable
153
+ judgments remove the associated question immediately; needs-evidence and blocked
154
+ judgments retain the same identity.
134
155
 
135
156
  ## Skills
136
157
 
@@ -140,12 +161,12 @@ or the user may invoke one directly with `/skill:<name>`.
140
161
  | Skill | Helps decide |
141
162
  | --- | --- |
142
163
  | `specify` | Product meaning, scope, invariants, risks, and blocking unknowns |
143
- | `model` | Logic for Programmers-style condition spaces, guarantees, and verification targets |
144
- | `sketch` | SICP-style abstraction barriers and HtDP-style data-directed design recipes |
145
- | `signal` | Flocking-style small structural movement and model-code mismatch |
146
- | `naming-judgment` | Elements of Clojure-style domain sense and change-preserving names |
164
+ | `model` | Condition spaces, contracts, replacement, transitions, guarantees, and verification targets |
165
+ | `sketch` | Data-driven skeletons, abstraction and composition boundaries, state, responsibility, and variation |
166
+ | `signal` | Evidence-backed structural movement and model-code mismatch |
167
+ | `naming-judgment` | Domain sense, honest effects, and change-preserving names |
147
168
  | `abstraction-review` | Whether a candidate should be kept, revised, split, rejected, or deferred |
148
- | `schedule` | Tidy First-style behavior/structure timing: now, after, or never |
169
+ | `schedule` | Behavior/structure timing: now, after, or never |
149
170
  | `verify` | Verifier selection, evidence relevance, and pass-but-wrong risk |
150
171
  | `visualize` | The smallest visual surface that lowers judgment cost |
151
172
  | `adversarial-eval` | Finite, escalating attempts to falsify a skill or implementation claim |
@@ -154,10 +175,27 @@ Pi's loaded resource metadata is authoritative. If package configuration filters
154
175
  or disables a skill, Developer cannot route to it even if its file exists in the
155
176
  npm package.
156
177
 
157
- Several skills link to detailed documents under their own `references/`
158
- directory. Pi loads the `SKILL.md` instructions on demand; the instructions say
159
- when the additional reference is worth reading and resolve it relative to the
160
- skill directory. Small, already-settled judgments do not need the extra context.
178
+ Several skills link to detailed capability documents under their own
179
+ `references/` directory. Pi loads the `SKILL.md` instructions on demand; the
180
+ instructions say when each reference is worth reading and resolve it relative to
181
+ the skill directory. A reference may synthesize several sources because the
182
+ leaf's question, not a book title, owns the capability. Each source-derived
183
+ reference includes a source trace, and [SOURCES.md](./SOURCES.md) maps the full
184
+ book coverage across leaves and the direct path. Small, settled judgments do not
185
+ need the extra context.
186
+
187
+ Primary references retain the capability's core insight and one complete case.
188
+ When a question has materially different derivation rules, the skill routes a
189
+ more focused supporting reference—for example, data-shape templates separately
190
+ from generative recursion, or representation barriers separately from state and
191
+ time. This follows Pi's documented progressive-disclosure structure: supporting
192
+ files stay relative to their skill and load only when the unresolved question
193
+ needs them. `SOURCES.md` also records the reference-quality contract used to
194
+ prevent source summaries from replacing executable judgment recipes.
195
+
196
+ Developer treats Pi's loaded `systemPromptOptions.skills` metadata as the skill
197
+ SSOT. It does not rescan the package and cannot route a skill Pi filtered,
198
+ disabled, or replaced through resource configuration.
161
199
 
162
200
  ## State, branches, and compaction
163
201
 
@@ -166,8 +204,9 @@ stored in tool-result details. Developer reconstructs state from the current
166
204
  session branch on startup and tree navigation, so a fork inherits only the
167
205
  events on its branch.
168
206
 
169
- The current event contract is `developer/v2`. Legacy `developer/v1` routing
170
- history can be replayed, but removed inferred fields are not revived.
207
+ The current event contract is `developer/v3`. Legacy `developer/v1` and
208
+ `developer/v2` routing history can be replayed, but new framing and verification
209
+ obligations are not retroactively inferred.
171
210
 
172
211
  Developer uses Pi's normal compaction. Each new agent turn receives current
173
212
  protocol state, and route results place identity and recovery metadata before
@@ -201,11 +240,13 @@ pinning, and security behavior.
201
240
  ```text
202
241
  extensions/
203
242
  ├── developer.ts # command, protocol tools, events, and Pi integration
243
+ ├── references/ # direct execution profiles loaded through tool results
204
244
  ├── state.ts # replayable developer/v2 branch state
205
- ├── skills.ts # Pi-native skill discovery and instruction loading
245
+ ├── skills.ts # loaded-skill filtering and instruction rendering
206
246
  ├── tool-policy.ts # strict-mode active-tool reconciliation
207
247
  └── tui.ts # selectors, widget, status panel, and prompt preparation
208
248
  skills/ # ten independently loadable Pi skills
249
+ SOURCES.md # source-to-capability maintenance trace
209
250
  evals/ # model-dependent scenarios and workspace assertions
210
251
  tests/ # deterministic state, policy, extension, and TUI tests
211
252
  ```
package/SOURCES.md ADDED
@@ -0,0 +1,104 @@
1
+ # Source-to-Capability Trace
2
+
3
+ Developer is organized around questions the agent must answer, not around books.
4
+ This maintainer document records how source material is decomposed across leaf
5
+ skills and the direct execution path. It is not a Pi runtime resource or a
6
+ required workflow.
7
+
8
+ ## Ownership Rule
9
+
10
+ A source idea belongs where its observable job is performed:
11
+
12
+ - product meaning and change pressure go to `specify`;
13
+ - cases, rules, contracts, and transitions go to `model`;
14
+ - implementable boundaries and collaborations go to `sketch`;
15
+ - visible structural movement goes to `signal`;
16
+ - candidate stability goes to `abstraction-review`;
17
+ - timing goes to `schedule`;
18
+ - names go to `naming-judgment`;
19
+ - claim-to-evidence judgment goes to `verify`;
20
+ - already-justified mutation goes to the `direct` route.
21
+
22
+ No source implies a mandatory route order. Several leaves may use different
23
+ parts of the same source because they answer different questions.
24
+
25
+ ## Runtime Reference Quality
26
+
27
+ `SKILL.md` owns discovery, the core question, output, completion, and conditional
28
+ routing. A reference loaded through that route must be usable without reopening
29
+ the original source or reconstructing unstated steps.
30
+
31
+ Match detail to the reference's job:
32
+
33
+ - a concept or design reference needs the core insight, input, derivation rule,
34
+ completed example, counterexample or failure diagnosis, output, and boundary;
35
+ - a recipe card needs a trigger, input artifact, construction rule, output
36
+ artifact, observable stop, and repair direction;
37
+ - a diagnostic table needs a symptom, evidence path, repair artifact, and
38
+ re-check;
39
+ - a worked-example file needs enough context to show why the decision follows,
40
+ not only a polished final answer;
41
+ - a mutation protocol needs an entry contract, safe intermediate states,
42
+ evidence rhythm, reroute conditions, and a stable landing.
43
+
44
+ Split a reference when independent questions would otherwise make it expensive
45
+ to load, but keep the central insight and one complete example in the primary
46
+ reference. Splitting by chapter title or merely to shorten a file is not a
47
+ capability boundary.
48
+
49
+ ## Capability Matrix
50
+
51
+ | Source | Capability extracted | Primary owner | Supporting owner or execution path |
52
+ | --- | --- | --- | --- |
53
+ | *99 Bottles of OOP*, ch. 1-2 | simple concrete baseline, Shameless Green, cost-effective and intention-revealing tests | `verify` | `signal`, `schedule` |
54
+ | *99 Bottles of OOP*, ch. 3-4 | real change pressure, point of attack, closest pair, smallest difference, horizontal movement | `signal` | `direct` behavior-preserving protocol |
55
+ | *99 Bottles of OOP*, ch. 4-5 | stable landings, responsibility-derived names, argument and data movement | `abstraction-review`, `naming-judgment` | `direct` behavior-preserving protocol |
56
+ | *99 Bottles of OOP*, ch. 5-8 | responsibility separation, messages, type transitions, polymorphism, dependency direction, object creation at the edge, factory tradeoffs | `sketch`, `abstraction-review` | `model`, `schedule` |
57
+ | *99 Bottles of OOP*, ch. 9 | unit boundaries, context independence, role verification, obsolete-test removal | `verify` | `sketch` |
58
+ | *How to Design Programs* | information analysis, data definitions, examples, templates, structural and generative recursion, accumulators, iterative refinement | `sketch` | `model`, `verify`, `signal`, `abstraction-review` |
59
+ | *Structure and Interpretation of Computer Programs*, ch. 1-2 | procedural abstraction, process shape, higher-order composition, data abstraction, closure, conventional interfaces, multiple representations | `sketch`, `abstraction-review` | `model` |
60
+ | *Structure and Interpretation of Computer Programs*, ch. 3 | state, identity, history, concurrency, streams, constraint propagation | `model`, `sketch` | `abstraction-review`, `verify` |
61
+ | *Structure and Interpretation of Computer Programs*, ch. 4-5 | language/evaluator boundaries and explicit execution machinery | `sketch`, `abstraction-review` | imported only when a real DSL, interpreter, compiler, or runtime boundary exists |
62
+ | *Logic for Programmers*, ch. 2-3 | predicates, sets, quantifiers, logical refactoring, runtime-semantic caveats | `model` | `verify` |
63
+ | *Logic for Programmers*, ch. 4-6 | partial specifications, properties, contracts, replacement, proof limits | `model`, `verify` | `abstraction-review` |
64
+ | *Logic for Programmers*, ch. 7-12 | relational constraints, decision tables, domain/time/system models, solvers, logic programming | `model` | `verify` |
65
+ | *Elements of Clojure*: Names | narrow and consistent sense, honest effects and scope crossing | `naming-judgment` | `model` |
66
+ | *Elements of Clojure*: Idioms | language-specific conventions and explicit operational semantics | project conventions or `direct` | generalized only when the semantic lesson survives the language |
67
+ | *Elements of Clojure*: Indirection | abstraction cost, module environment/model/interface/assumptions, principled versus adaptable systems | `sketch`, `abstraction-review` | `schedule` |
68
+ | *Elements of Clojure*: Composition | units of computation and pull-transform-push process boundaries | `sketch` | `naming-judgment`, `verify` |
69
+ | *Tidy First?* | separate behavior from structure, small tidyings, optionality, reversibility, first/after/later/never | `schedule` | `direct` behavior-preserving protocol, `signal` |
70
+
71
+ ## Intentionally Not Imported As Universal Rules
72
+
73
+ Source coverage does not mean copying every example or language idiom into every
74
+ task. The following remain contextual:
75
+
76
+ - Ruby class and factory shapes from *99 Bottles* are evidence about
77
+ responsibility and variation, not a destination for every design.
78
+ - Scheme evaluators, register machines, and compiler details from SICP are used
79
+ only for tasks that actually expose those runtime or language boundaries.
80
+ - Clojure-specific arities, option maps, atoms, macros, and interop idioms stay
81
+ subordinate to the target project's language and conventions.
82
+ - Logic solvers, formal proof, TLA+, Prolog, and answer-set programming are
83
+ selected only when the modeled uncertainty and risk justify their cost.
84
+ - HtDP recipes are adapted to existing repositories; they do not require adding
85
+ pedagogical comments, signatures, or templates to production code.
86
+
87
+ These exclusions prevent a respected source from becoming a framework-shaped
88
+ answer imposed on unrelated product work.
89
+
90
+ ## Reassembly Check
91
+
92
+ When adding or revising a source-derived reference, record:
93
+
94
+ ```text
95
+ Source location: book, edition/version, chapter or section
96
+ Capability: the question or action the idea improves
97
+ Owner: one leaf or the direct path
98
+ Boundary: what the owner must not absorb
99
+ Observable effect: the artifact, decision, or safer execution behavior expected
100
+ ```
101
+
102
+ Create a new leaf only when a recurring question has a distinct input, output,
103
+ completion condition, and boundary that no existing owner can express. A new
104
+ source, technique, or vocabulary is not by itself evidence for a new leaf.