@zalom/plastic 1.0.0-beta.1 → 1.0.0-beta.11

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 (50) hide show
  1. package/PLASTIC.md +21 -5
  2. package/agents/plastic-brainstorming.md +9 -1
  3. package/agents/plastic-executor.md +10 -0
  4. package/agents/plastic-intent-curator.md +7 -5
  5. package/agents/plastic-planner.md +11 -1
  6. package/agents/plastic-spec-specialist.md +9 -1
  7. package/hooks/statusline +150 -41
  8. package/package.json +1 -1
  9. package/scripts/agent-report +142 -0
  10. package/scripts/dashboard.rb +5 -3
  11. package/scripts/doctor.rb +243 -0
  12. package/scripts/lib/bridge.rb +72 -24
  13. package/scripts/lib/frontmatter_writer.rb +130 -0
  14. package/scripts/lib/graph_rebuild.rb +328 -0
  15. package/scripts/lib/installer_core.rb +5 -0
  16. package/scripts/lib/intent_validator.rb +79 -0
  17. package/scripts/lib/links_projection.rb +160 -0
  18. package/scripts/lib/links_section.rb +207 -0
  19. package/scripts/lib/power_tools.rb +76 -0
  20. package/scripts/lib/qmd_hook.rb +38 -25
  21. package/scripts/lib/qmd_sync.rb +21 -0
  22. package/scripts/new-intent +172 -22
  23. package/scripts/project-links +287 -0
  24. package/scripts/qmd-sync +50 -3
  25. package/scripts/rebuild-graph +244 -0
  26. package/scripts/spawn-preamble +18 -1
  27. package/skills/auto/SKILL.md +24 -9
  28. package/skills/auto/evals/evals.json +48 -0
  29. package/skills/auto/references/agent-architecture.md +27 -4
  30. package/skills/auto/references/agent-report-contract.md +86 -0
  31. package/skills/brainstorming/SKILL.md +1 -0
  32. package/skills/brainstorming/evals/evals.json +22 -0
  33. package/skills/continuing/SKILL.md +8 -1
  34. package/skills/continuing/evals/evals.json +9 -0
  35. package/skills/creating-intent/SKILL.md +28 -8
  36. package/skills/creating-intent/evals/evals.json +72 -0
  37. package/skills/creating-intent/references/lifecycle.md +12 -4
  38. package/skills/dashboard/SKILL.md +5 -0
  39. package/skills/dashboard/evals/evals.json +22 -0
  40. package/skills/executing-plan/SKILL.md +2 -2
  41. package/skills/intent-curator/SKILL.md +3 -1
  42. package/skills/intent-curator/evals/evals.json +22 -0
  43. package/skills/linking-intents/SKILL.md +17 -6
  44. package/skills/linking-intents/evals/evals.json +22 -0
  45. package/skills/linking-intents/references/zettelkasten.md +15 -3
  46. package/skills/managing-index/SKILL.md +6 -0
  47. package/skills/managing-index/evals/evals.json +22 -0
  48. package/skills/managing-index/references/zettelkasten-linking.md +7 -2
  49. package/skills/research/SKILL.md +8 -0
  50. package/skills/research/evals/evals.json +22 -0
@@ -21,13 +21,13 @@ Explicit wikilinks in the `## Links` section. Bidirectional — add to both inte
21
21
  ```
22
22
 
23
23
  ### 2. Sources (Backward)
24
- The `sources` array in frontmatter. What influenced this intent — backward links to parent/prior work:
24
+ The `sources` array in frontmatter. The direct ascendant(s) this intent was created from / emerged from the lifecycle of (formation, not topic similarity), backward links to the work it was built out of:
25
25
  ```yaml
26
26
  sources: ["1a", "1a2"]
27
27
  ```
28
28
 
29
29
  ### 3. Chain (Forward)
30
- The `chain` array in frontmatter. What this intent spawned — forward links to children/follow-on work:
30
+ The `chain` array in frontmatter. What this intent spawned AND related-but-not-spawned successors it leads to, forward links to children, follow-on, and related work:
31
31
  ```yaml
32
32
  chain: ["1b1", "1b2"]
33
33
  ```
@@ -41,6 +41,12 @@ tags: [plastic, project-reddit-kb]
41
41
  ## Workflow
42
42
 
43
43
  ### 1. Identify Intents to Connect
44
+
45
+ QMD-first (when available): before scanning the store with grep/Read, run
46
+ `ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or related
47
+ intents to propose as sources/chain, then open the authoritative intent file for any hit you act
48
+ on. The command is a no-op when QMD is absent, so fall back to the directory scan below.
49
+
44
50
  Show existing intents by scanning the store's directory for intent files:
45
51
  ```bash
46
52
  for dir in $STORE_ROOT/store/*/; do
@@ -55,16 +61,21 @@ done
55
61
 
56
62
  ### 2. Choose Connection Type
57
63
  Ask the user which type of connection:
58
- - **source** — "this was influenced by that" (add to `sources[]`, update `chain[]` on the target)
59
- - **cross-reference** — "these are related" (add wikilink in `## Links` of both intents)
64
+ - **source**: "this was CREATED FROM that" (D1). The reciprocal update is one-directional (I1): add the ascendant id to this intent's `sources[]` AND add this intent's id to the ascendant's `chain[]`. A merely-related (not-created-from) connection is NOT a source: record it on the predecessor's `chain[]` only, plus a `## Links` wikilink, with NO `sources` (the related-but-not-spawned rule).
65
+ - **cross-reference**: "these are related" (add wikilink in `## Links` of both intents)
60
66
 
61
67
  ### 3. Apply Connection
62
68
 
63
- **For sources:**
64
- Update frontmatter arrays on both intents:
69
+ **For sources (a true created-from edge only):**
70
+ Update frontmatter arrays on both intents (I1, two-sided):
65
71
  - Add the parent's ID to the child's `sources` array
66
72
  - Add the child's ID to the parent's `chain` array
67
73
 
74
+ For the merely-related case, only the predecessor's `chain` (and both sides' `## Links`)
75
+ get the link, never `sources`. `chain` is NOT strictly the reverse of `sources` (I2):
76
+ relational `chain` entries are valid and must never be "corrected" by adding a reciprocal
77
+ `sources`.
78
+
68
79
  **For cross-references:**
69
80
  Add a wikilink in the `## Links` section of **both** intents (bidirectional).
70
81
 
@@ -0,0 +1,22 @@
1
+ {
2
+ "skill_name": "plastic-linking-intents",
3
+ "notes": "Intent 66a. Spec for the QMD-first discovery step (surface candidate/related intents to propose as sources/chain before grep/Read). Runner is intent 76; this case is a spec, not executed.",
4
+ "evals": [
5
+ {
6
+ "id": 1,
7
+ "scope": "behavior",
8
+ "set": "validation",
9
+ "prompt": "QMD is present. The user says: link this intent to the related upload-pipeline work.",
10
+ "expected_output": "Before scanning the store directory with grep/Read to identify related intents, runs `ruby ~/.plastic/scripts/qmd-sync search \"upload pipeline\"` to surface candidate or related intents to propose as sources/chain, then opens the authoritative intent file for any hit it links. No-op fallback to the directory scan when QMD is absent.",
11
+ "files": [],
12
+ "assertions": [
13
+ {
14
+ "type": "human",
15
+ "check": "qmd-sync search is run before the directory scan; authoritative file opened for any hit before proposing sources/chain",
16
+ "observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
17
+ "result": "pass"
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+ }
@@ -10,6 +10,13 @@ Plastic implements three Zettelkasten structures:
10
10
 
11
11
  INDEX.md is a structure note (hub), not a table of contents.
12
12
 
13
+ `## Links` mirrors the frontmatter graph exactly. Each entry is
14
+ `- [[id--slug|<target's full intent: text>]]` (cross-store: `- [[store:id--slug|...]]`),
15
+ a clickable `id--slug` target with the target's full `intent:` text as the label.
16
+ Ordering is mandatory: all `sources` first (top), then all `chain`, frontmatter order
17
+ preserved within each group. Sources never appear at the end. No source/chain tags, no
18
+ sub-grouping. An intent with empty `sources` and `chain` carries the empty-state comment.
19
+
13
20
  ## Folgezettel IDs
14
21
 
15
22
  IDs encode lineage using Luhmann's alternating convention:
@@ -20,9 +27,14 @@ IDs encode lineage using Luhmann's alternating convention:
20
27
 
21
28
  ## Knowledge Graph
22
29
 
23
- `sources` + `chain` form the double-linked knowledge graph:
24
- - `sources` = what fed into this intent (parents, inspirations, prerequisites)
25
- - `chain` = what this intent produced (children, follow-ups, spin-offs)
30
+ `sources` and `chain` form the directed knowledge graph:
31
+ - `sources` = the direct ascendant(s) this intent was created from / emerged from the
32
+ lifecycle of (formation, not topic similarity); a DAG (acyclic), strong must-load context.
33
+ - `chain` = forward continuations AND related-but-not-spawned successors it leads to; a
34
+ directed graph that may cycle, lighter contributory context.
35
+ - Reciprocity is one-directional: every `sources` edge has a reciprocal `chain` entry (I1),
36
+ but `chain` may carry relational entries with no reciprocal `sources` (I2), so the graph is
37
+ NOT strictly double-linked.
26
38
 
27
39
  ## Dual-Mode
28
40
 
@@ -43,6 +43,12 @@ All completed intents with dates. Links preserved, never deleted.
43
43
 
44
44
  ## Workflow
45
45
 
46
+ QMD-first (when available): when you need to locate a specific intent (to reclassify, flag, or
47
+ cluster it) rather than rebuild every section, before scanning the store with grep/Read run
48
+ `ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate or related intents, then
49
+ open the authoritative intent file for any hit you act on. The command is a no-op when QMD is
50
+ absent, so fall back to the directory scan below.
51
+
46
52
  ### Rebuild Sections
47
53
  Scan the active store's `store/` directory for intent files and rebuild each section:
48
54
 
@@ -0,0 +1,22 @@
1
+ {
2
+ "skill_name": "plastic-managing-index",
3
+ "notes": "Intent 66a. Spec for the QMD-first step when locating a specific intent to reclassify/flag/cluster before grep/Read. Runner is intent 76; spec only.",
4
+ "evals": [
5
+ {
6
+ "id": 1,
7
+ "scope": "behavior",
8
+ "set": "validation",
9
+ "prompt": "QMD is present. The user says: move the intent about the statusline into the Completed section.",
10
+ "expected_output": "When locating one specific intent rather than rebuilding every section, before scanning the store with grep/Read runs `ruby ~/.plastic/scripts/qmd-sync search \"statusline\"` to surface the candidate intent, then opens the authoritative intent file for the hit it reclassifies. No-op fallback to the directory scan when QMD is absent.",
11
+ "files": [],
12
+ "assertions": [
13
+ {
14
+ "type": "human",
15
+ "check": "qmd-sync search is run before the directory scan when locating a specific intent; authoritative file opened for the hit",
16
+ "observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
17
+ "result": "pass"
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+ }
@@ -8,8 +8,13 @@
8
8
 
9
9
  ## Three Connection Types (Ranked)
10
10
 
11
- 1. **Direct links** (strongest) — wikilinks in `## Links` section
12
- 2. **Sources/Chain** (knowledge graph) — `sources` array (backward), `chain` array (forward) in frontmatter
11
+ 1. **Direct links** (strongest): wikilinks in the `## Links` section, the projection of the
12
+ frontmatter graph. Each entry is `- [[id--slug|<target's full intent: text>]]` (cross-store:
13
+ `- [[store:id--slug|...]]`), a clickable `id--slug` target labeled with the target's full
14
+ `intent:` text. Ordering is mandatory: all `sources` first (top), then all `chain`,
15
+ frontmatter order preserved within each group. Sources never appear at the end. No
16
+ source/chain tags, no sub-grouping.
17
+ 2. **Sources/Chain** (knowledge graph): `sources` = direct ascendants this was created from (formation, acyclic, must-load); `chain` = forward continuations and related successors (may cycle, lighter context). See `docs/concepts/how-plastic-sources-and-chains-intents.md` for the full model.
13
18
  3. **Tags** (weakest) — shared tags, `project-<name>` for project membership
14
19
 
15
20
  ## When to Create a Cluster
@@ -17,6 +17,14 @@ Before proceeding, resolve the active intent:
17
17
  2. **Find active intent:** Read `INDEX.md` from the detected store. Look under `## Active`. If exactly one → use it. If multiple → ask which. If none → refuse: "No active intent. Create one first with /plastic-creating-intent"
18
18
  3. **Resolve intent directory:** `{store}/store/{id}--{slug}/`
19
19
 
20
+ ## Check Prior Work First
21
+
22
+ QMD-first (when available): before scanning the store with grep/Read or searching the web, run
23
+ `ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or related intents
24
+ and existing research, then open the authoritative intent file for any hit you act on. Reusing a
25
+ prior report beats re-deriving it. The command is a no-op when QMD is absent, so fall back to the
26
+ existing INDEX.md / file scan.
27
+
20
28
  ## Depth Decision
21
29
 
22
30
  Before starting research, assess the question against these criteria:
@@ -0,0 +1,22 @@
1
+ {
2
+ "skill_name": "plastic-research",
3
+ "notes": "Intent 66a. Spec for the QMD-first step before researching (reuse prior intents/reports before grep/Read or web search). Runner is intent 76; spec only.",
4
+ "evals": [
5
+ {
6
+ "id": 1,
7
+ "scope": "behavior",
8
+ "set": "validation",
9
+ "prompt": "QMD is present. The user asks the agent to research installer patterns for the active intent.",
10
+ "expected_output": "Before scanning the store with grep/Read or searching the web, runs `ruby ~/.plastic/scripts/qmd-sync search \"installer patterns\"` to surface candidate, prior, or related intents and existing research, then opens the authoritative intent file for any hit it reuses. No-op fallback to INDEX.md / file scan when QMD is absent.",
11
+ "files": [],
12
+ "assertions": [
13
+ {
14
+ "type": "human",
15
+ "check": "qmd-sync search is run before grep/Read and web search; authoritative file opened for any prior report reused",
16
+ "observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
17
+ "result": "pass"
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+ }