@widnyana/design-thinking 0.0.1 → 0.0.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 CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  # design-thinking — a pi package
2
3
 
3
4
  AI coding agents ship code before asking what breaks. This extension flips the
@@ -12,12 +13,35 @@ gist](https://gist.github.com/r17x/90eb2f7be93932b5693753aedb09c01a),
12
13
  originally Effect-TS), generalized into this stack-agnostic pi package.
13
14
  Licensed MIT — see [LICENSE](LICENSE).
14
15
 
16
+ ## Why
17
+
18
+ A prose plan doesn't survive contact with review. An agent proposes "add
19
+ rate limiting, handle errors," the plan reads fine, and the diff either
20
+ matches it or it doesn't — prose gives no way to check which. Two failure
21
+ modes follow from that: the agent picks an unstated failure path (swallow
22
+ the error, retry silently, drop the request) nobody agreed to, or the
23
+ reviewer approves a plan that was never specific enough to catch the
24
+ mismatch once the code lands.
25
+
26
+ Design Graph replaces the prose plan with something that can be diffed.
27
+ Nodes are functions, edges are data and error/escape paths, boundaries are
28
+ named — fixed before code exists. `/cg-review` then reconstructs the graph
29
+ the code actually implements and diffs it against the one that was planned,
30
+ finding by finding, ending in a VERDICT. The notation is the same shape in
31
+ Go, Rust, Python, or TypeScript, so the check doesn't depend on the stack.
32
+
33
+ Skip it for a one-line fix — prose is fine there. Reach for `/dt` when the
34
+ change has a failure path worth agreeing on before it's written.
35
+
15
36
  ## Install
16
37
 
17
38
  ```bash
18
39
  # from npm
19
40
  pi install npm:@widnyana/design-thinking
20
41
 
42
+ # via OMP
43
+ omp install npm:@widnyana/design-thinking
44
+
21
45
  # pinned version
22
46
  pi install npm:@widnyana/design-thinking@0.0.1
23
47
 
@@ -61,20 +61,28 @@ Pipeline: shapes → graph(A) → cardinality → E(⟳retry ↯escape ☠die)
61
61
  🔒 parse at boundaries → ⛈ orthogonal behavior → scope → test-R → verdict.
62
62
 
63
63
  Rules:
64
- - Design, plan, and review answers must render a Design Graph in Graph Protocol
65
- form — fixed sections: PROBLEM, SHAPES, GRAPH, CARDINALITY, BOUNDARIES,
66
- BEHAVIOR, SCOPE, TEST LAYERS, VERDICT.
64
+ - ANY turn that will end in code or file edits (feature, change, fix,
65
+ refactor — the model does NOT get to reclassify the request): render the
66
+ Design Graph in Graph Protocol form and any clarifying questions FIRST;
67
+ ZERO file edits until the user approves the design. Reading/exploring code
68
+ first is fine; the FIRST edit is not allowed before the graph.
69
+ - Design, plan, and review answers must render a Design Graph — fixed
70
+ sections: PROBLEM, SHAPES, GRAPH, CARDINALITY, BOUNDARIES, BEHAVIOR, SCOPE,
71
+ TEST LAYERS, VERDICT.
67
72
  - The happy path (A) stays readable; failure handling lives at defined join points.
68
73
  - Each layer scopes its own E; inner errors never leak through.
69
74
  - If the code doesn't match the call graph, the implementation is wrong.
70
- - For build/fix/refactor tasks: present the Design Graph and any clarifying
71
- questions FIRST; implement only after the user approves the design.
72
75
  - Adapt vocabulary to the current language/stack; never the discipline.
73
76
 
74
77
  Full specs — read these when a section needs detail:
75
78
  - ${REF_DIR}/protocol.md (Graph Protocol: notation spec + worked example)
76
79
  - ${REF_DIR}/method.md (the §1–§10 method, generalized)
77
80
  - ${REF_DIR}/design-graph.md (the artifact spec + completeness checklist)
81
+ Skills load BY NAME into the agent (/skill:<name>); the files above are named
82
+ by stem, NOT by skill name. Exact mapping:
83
+ /skill:graph-protocol → protocol.md /skill:design-method → method.md
84
+ /skill:design-graph → design-graph.md
85
+ NEVER read references/<skill-name>.md — no such files exist.
78
86
  `.trim();
79
87
 
80
88
  interface DtState {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widnyana/design-thinking",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "description": "Design Thinking · Design Graph · Graph Protocol — a stack-agnostic design methodology for pi. Turns every plan, review, and refactor into an annotated call graph. Method originally by r17x; generalized to a pi package by widnyana.",
6
6
  "author": {
@@ -13,6 +13,9 @@ A Design Graph is not documentation written after the fact. It is drawn
13
13
  **before** implementation (planning), **reconstructed** from implementation
14
14
  (review), and **compared** against implementation (verdict). The graph is the
15
15
  contract; the code is one instantiation of it.
16
+ **Hard gate:** when a turn will produce code or file edits, the graph comes
17
+ first — render it (and any clarifying questions), get the user's approval,
18
+ and only then write code that matches it.
16
19
 
17
20
  ---
18
21
 
@@ -8,6 +8,13 @@ The method is language-neutral. Where it says "Effect", "gen", or "pipe" in the
8
8
  Effect-TS appendix (`effect-ts.md`), substitute your stack's equivalent: Result
9
9
  types, exceptions at layer joins, middleware, RAII, constructor injection —
10
10
  whatever your language provides. The discipline never changes, only the vocabulary.
11
+ **Hard gate — applies in every harness (pi, omp, Claude Code, any agent):**
12
+ When the user asks for a feature, change, fix, or refactor — or when any turn
13
+ will end in proposed code or file edits — you MUST render the Design Graph
14
+ (Graph Protocol) and any clarifying questions BEFORE touching any file, and
15
+ implement only after the user approves the design. Reading and exploring code
16
+ first is fine; the FIRST edit is not allowed before the graph. This rule is
17
+ not optional and not stack-dependent.
11
18
 
12
19
  Render every result in [Graph Protocol](protocol.md) format.
13
20
 
@@ -23,6 +23,9 @@ A Design Graph is not documentation written after the fact. It is drawn
23
23
  **before** implementation (planning), **reconstructed** from implementation
24
24
  (review), and **compared** against implementation (verdict). The graph is the
25
25
  contract; the code is one instantiation of it.
26
+ **Hard gate:** when a turn will produce code or file edits, the graph comes
27
+ first — render it (and any clarifying questions), get the user's approval,
28
+ and only then write code that matches it.
26
29
 
27
30
  ---
28
31
 
@@ -17,6 +17,13 @@ The method is language-neutral. Where it says "Effect", "gen", or "pipe" in the
17
17
  Effect-TS appendix (`effect-ts.md`), substitute your stack's equivalent: Result
18
18
  types, exceptions at layer joins, middleware, RAII, constructor injection —
19
19
  whatever your language provides. The discipline never changes, only the vocabulary.
20
+ **Hard gate — applies in every harness (pi, omp, Claude Code, any agent):**
21
+ When the user asks for a feature, change, fix, or refactor — or when any turn
22
+ will end in proposed code or file edits — you MUST render the Design Graph
23
+ (Graph Protocol) and any clarifying questions BEFORE touching any file, and
24
+ implement only after the user approves the design. Reading and exploring code
25
+ first is fine; the FIRST edit is not allowed before the graph. This rule is
26
+ not optional and not stack-dependent.
20
27
 
21
28
  Render every result in [Graph Protocol](/skill:graph-protocol) format.
22
29