@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.
- package/README.md +61 -20
- package/SOURCES.md +104 -0
- package/extensions/developer.ts +202 -44
- package/extensions/references/behavior-preserving-structural-change.md +149 -0
- package/extensions/skills.ts +1 -16
- package/extensions/state.ts +96 -10
- package/extensions/tui.ts +140 -25
- package/package.json +11 -25
- package/skills/abstraction-review/references/field-card.md +7 -0
- package/skills/abstraction-review/references/recipe-cards.md +67 -0
- package/skills/abstraction-review/references/repair-table.md +5 -0
- package/skills/model/SKILL.md +6 -1
- package/skills/model/references/problem-modeling.md +294 -235
- package/skills/model/references/worked-models-and-specialized-techniques.md +218 -0
- package/skills/naming-judgment/SKILL.md +5 -3
- package/skills/naming-judgment/references/domain-naming.md +202 -0
- package/skills/schedule/SKILL.md +1 -1
- package/skills/schedule/references/structural-change-timing.md +80 -13
- package/skills/signal/SKILL.md +2 -2
- package/skills/signal/references/structural-movement.md +202 -0
- package/skills/sketch/SKILL.md +35 -8
- package/skills/sketch/references/abstraction-barriers-and-closure.md +160 -0
- package/skills/sketch/references/abstraction-composition-and-state.md +184 -0
- package/skills/sketch/references/composition-generative-recursion-and-accumulators.md +196 -0
- package/skills/sketch/references/data-driven-design.md +177 -0
- package/skills/sketch/references/data-shape-template-catalog.md +241 -0
- package/skills/sketch/references/generic-operations-and-languages.md +134 -0
- package/skills/sketch/references/processes-state-and-time.md +171 -0
- package/skills/sketch/references/responsibility-and-variation.md +245 -0
- package/skills/verify/references/verifier-selection-and-pass-but-wrong.md +61 -3
- package/skills/naming-judgment/references/elements-of-clojure-naming.md +0 -74
- package/skills/signal/references/flocking-and-structural-movement.md +0 -157
- package/skills/sketch/references/design-recipe-and-abstraction-barriers.md +0 -169
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
Use this deck when the review needs a construction rule, not only a layer name.
|
|
4
4
|
Each card must produce an artifact and a stop check.
|
|
5
5
|
|
|
6
|
+
Read [the worked examples](worked-examples.md) when a card's compact rule is not
|
|
7
|
+
enough to calibrate a real candidate. When a stop check fails, use
|
|
8
|
+
[the repair table](repair-table.md) instead of polishing the same surface.
|
|
9
|
+
|
|
6
10
|
## Contents
|
|
7
11
|
|
|
8
12
|
- Pocket Deck
|
|
9
13
|
- Procedure -> Process Reality Check
|
|
10
14
|
- Movement Pattern Extraction
|
|
15
|
+
- Responsibility Boundary
|
|
11
16
|
- Invariant Iteration
|
|
12
17
|
- Data Abstraction Boundary
|
|
13
18
|
- Closure Composition Unit
|
|
@@ -23,6 +28,7 @@ Each card must produce an artifact and a stop check.
|
|
|
23
28
|
| --- | --- | --- | --- | --- | --- |
|
|
24
29
|
| Procedure -> Process Reality Check | Result is plausible but process shape is unclear | procedure text, sample input, expected result | trace deferred work, state updates, duplicated work, cost | result, shape, and cost are all explainable | move to Law or Time |
|
|
25
30
|
| Movement Pattern Extraction | Similar cases move together but differ in stable roles | concrete cases side by side, common movement, varying roles | keep common movement as body; lift stable variation roles to parameters, callbacks, or strategies | old cases become simple calls and new case is expressible | split, inline, or return to Language |
|
|
31
|
+
| Responsibility Boundary | Knowledge and behavior appear owned by the wrong unit | current owners, messages, data, callers, change reasons | group knowledge with behavior and state the smallest role contract | representative change becomes local without context leaks | split, inline, or return to Model |
|
|
26
32
|
| Invariant Iteration | Recursion or state should become a stable transition | original meaning, state variables, transition candidate | write `processed meaning + remaining meaning = original meaning` using the domain operation | initial, step, and final checks pass | return to Run trace or reduce state variables |
|
|
27
33
|
| Data Abstraction Boundary | Caller knows raw representation | domain value, operations, representation candidates | create constructor, selector, predicate, and operation vocabulary | caller code stops touching raw representation | move to Unit or Engine |
|
|
28
34
|
| Closure Composition Unit | Operation results cannot feed later operations | candidate unit, operation list, preserved meaning | mark closed operations vs observers/finalizers | closed operations build larger values of the same unit | move final effect outside the unit |
|
|
@@ -96,6 +102,48 @@ can be expressed without adding a new option that exposes internals.
|
|
|
96
102
|
Reject if the cases only look textually similar but carry different
|
|
97
103
|
responsibilities. Split if variation roles are not stable.
|
|
98
104
|
|
|
105
|
+
### Responsibility Boundary
|
|
106
|
+
|
|
107
|
+
Use when repeated arguments, data clumps, feature envy, conditional behavior, or
|
|
108
|
+
several change reasons suggest that knowledge and behavior have the wrong owner.
|
|
109
|
+
|
|
110
|
+
Input artifact:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
current owners:
|
|
114
|
+
unit -> knowledge, behavior, coordination, creation
|
|
115
|
+
messages:
|
|
116
|
+
callers -> requests -> receivers
|
|
117
|
+
pressure:
|
|
118
|
+
representative accepted change and affected path
|
|
119
|
+
candidate:
|
|
120
|
+
knowledge and behavior proposed to move together
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Derivation:
|
|
124
|
+
|
|
125
|
+
1. group behavior with the knowledge needed to answer its messages;
|
|
126
|
+
2. separate domain responsibility from coordination and object creation;
|
|
127
|
+
3. state the smallest caller-visible role contract;
|
|
128
|
+
4. identify old context callers should stop knowing;
|
|
129
|
+
5. test a representative change against old and candidate ownership.
|
|
130
|
+
|
|
131
|
+
Output artifact:
|
|
132
|
+
|
|
133
|
+
```text
|
|
134
|
+
responsibility: name and reason to change
|
|
135
|
+
knowledge: data or history it owns
|
|
136
|
+
messages: minimal protocol
|
|
137
|
+
hidden context: mechanics removed from callers
|
|
138
|
+
creation boundary: who selects or constructs it
|
|
139
|
+
rejected alternatives: inline, split, or different owner
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Stop check: the representative change is local to a coherent owner, callers use
|
|
143
|
+
messages rather than extracting its knowledge, and the candidate does not need
|
|
144
|
+
unrelated context from the old host. Reject or split when the candidate is only
|
|
145
|
+
a bag of moved methods, a generic service, or a pattern-shaped destination.
|
|
146
|
+
|
|
99
147
|
### Invariant Iteration
|
|
100
148
|
|
|
101
149
|
Use when state variables or accumulators need meaning.
|
|
@@ -253,3 +301,22 @@ cost:
|
|
|
253
301
|
```
|
|
254
302
|
|
|
255
303
|
If everything must be serialized, the order law is probably too broad.
|
|
304
|
+
|
|
305
|
+
## Source Trace
|
|
306
|
+
|
|
307
|
+
- Harold Abelson and Gerald Jay Sussman with Julie Sussman, *Structure and
|
|
308
|
+
Interpretation of Computer Programs*, Second Edition, MIT Press, 1996:
|
|
309
|
+
procedure/process distinction, data abstraction, closure, generic dispatch,
|
|
310
|
+
state/history, and metalinguistic boundaries.
|
|
311
|
+
- Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram
|
|
312
|
+
Krishnamurthi, *How to Design Programs, Second Edition*, MIT Press, 2018:
|
|
313
|
+
templates, abstraction from concrete examples, generative recursion, and
|
|
314
|
+
accumulator invariants.
|
|
315
|
+
- Sandi Metz, Katrina Owen, and TJ Stankus, *99 Bottles of OOP*, Second
|
|
316
|
+
Edition, version 2.2.2, 2024: movement patterns, responsibility extraction,
|
|
317
|
+
messages, substitution, polymorphic roles, type transitions, and factory
|
|
318
|
+
tradeoffs.
|
|
319
|
+
- Hillel Wayne, *Logic for Programmers*, version 0.14.0, May 4, 2026:
|
|
320
|
+
contracts, safe replacement, invariants, and meaning-preserving model changes.
|
|
321
|
+
- Zachary Tellman, *Elements of Clojure*, 2019: indirection cost, module
|
|
322
|
+
assumptions, principled components, adaptable interfaces, and composition.
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
Use this table when a wished abstraction failed, or when the observed symptom is
|
|
4
4
|
clearer than the broken layer.
|
|
5
5
|
|
|
6
|
+
The named repairs refer to [the recipe cards](recipe-cards.md). Record the result
|
|
7
|
+
on [the field card](field-card.md); use [worked examples](worked-examples.md) only
|
|
8
|
+
when the selected card still lacks a concrete calibration case.
|
|
9
|
+
|
|
6
10
|
## Diagnostic Loop
|
|
7
11
|
|
|
8
12
|
```text
|
|
@@ -38,6 +42,7 @@ If the repair output is empty, the review only explained the problem.
|
|
|
38
42
|
| Helpers have nice names but the domain rule is invisible | Language | Restate desired vocabulary | primitive/combination/abstraction vocabulary | new case can be spoken without representation detail |
|
|
39
43
|
| Similar functions differ only by predicate, term, next step, or strategy | Language/Unit | Movement Pattern Extraction | common movement plus variation role table | old cases become simple calls |
|
|
40
44
|
| Similar-looking code has different responsibilities | Unit/Boundary | Reject or split the abstraction | responsibility split note | no shared unit is promoted |
|
|
45
|
+
| Extracted unit still needs unrelated context from its old host | Unit/Boundary | Responsibility Boundary | owner/message map | representative change is local to one coherent owner |
|
|
41
46
|
| Caller reads object fields, list indexes, tags, or provider-specific shape | Boundary | Data Abstraction Boundary | constructor/selector/predicate/operation list | caller no longer touches representation primitive |
|
|
42
47
|
| Operation result cannot be fed into later operations | Unit | Closure Composition Unit | closed operation table | closed operations build larger units |
|
|
43
48
|
| Chainable API forces final side effects into the chain | Unit/Boundary | Split closed operations from finalizers | observer/finalizer boundary | closed operations and boundary effects are distinct |
|
package/skills/model/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: model
|
|
3
|
-
description: "Model the condition space behind a requirement, invariant, bug, policy, workflow, or code behavior using cases, predicates, rules, forbidden states, transitions, objectives, guarantee placement, and verification targets. Use when correctness depends on combinations, absence or default semantics, state, time, or policy interaction
|
|
3
|
+
description: "Model the condition space behind a requirement, invariant, bug, policy, workflow, or code behavior using cases, predicates, rules, forbidden states, transitions, objectives, guarantee placement, and verification targets. Use when correctness depends on combinations, absence or default semantics, contracts, replacement, state, time, or policy interaction."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Model
|
|
@@ -74,3 +74,8 @@ structural work, mutate artifacts, or make the final evidence judgment.
|
|
|
74
74
|
Read [the problem-modeling reference](references/problem-modeling.md) for
|
|
75
75
|
policy-heavy, stateful, optimization, safety-critical, or otherwise complex
|
|
76
76
|
condition spaces.
|
|
77
|
+
|
|
78
|
+
Read [the worked models and specialized techniques](references/worked-models-and-specialized-techniques.md)
|
|
79
|
+
when a boolean policy, relational constraint, replacement, temporal rule, proof
|
|
80
|
+
obligation, solver encoding, logic program, or plan needs a complete calibration
|
|
81
|
+
example rather than the compact procedure alone.
|