@albinocrabs/feynman 0.2.2 → 0.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@albinocrabs/feynman",
3
- "version": "0.2.2",
3
+ "version": "0.2.5",
4
4
  "description": "Claude Code and Codex plugin that auto-injects ASCII diagram rules into every AI request via UserPromptSubmit hook",
5
5
  "license": "MIT",
6
6
  "author": "apolenkov",
@@ -52,14 +52,16 @@
52
52
  "test": "node --test tests/*.test.js",
53
53
  "coverage": "c8 --reporter=text --reporter=lcov node --test tests/*.test.js",
54
54
  "lint": "node bin/feynman-lint.js",
55
+ "audit": "npm audit --audit-level=moderate",
55
56
  "test:docs": "node scripts/check-docs.js",
56
57
  "test:release": "node scripts/release-smoke.js",
58
+ "test:published": "node scripts/verify-published-package.js",
57
59
  "build": "node scripts/build-package.js",
58
60
  "changelog": "node scripts/generate-changelog.js",
59
- "ci": "npm run coverage && npm run test:docs && npm run test:release && npm run build",
61
+ "ci": "npm run audit && npm run coverage && npm run test:docs && npm run test:release && npm run build",
60
62
  "prepublishOnly": "npm run ci"
61
63
  },
62
64
  "devDependencies": {
63
- "c8": "^10"
65
+ "c8": "^11.0.0"
64
66
  }
65
67
  }
@@ -1,8 +1,6 @@
1
1
  <!-- feynman diagram rules — feynman-activate.md -->
2
2
  <!-- Hook reads only the section matching the active intensity. -->
3
3
  <!-- Variants: lite (flow+trees), full (all types, default), ultra (force diagrams). -->
4
- <!-- Each section must stay under 8,000 chars. Measure with: -->
5
- <!-- node -e "const f=require('fs').readFileSync('rules/feynman-activate.md','utf8');['lite','full','ultra'].forEach(v=>{const s=f.indexOf('<!-- '+v+' -->');const e=f.indexOf('<!-- /'+v+' -->',s);console.log(v,f.slice(s,e+('<!-- /'+v+' -->').length).length,'chars');})" -->
6
4
 
7
5
  <!-- lite -->
8
6
  ## Feynman Diagram Rules — Lite
@@ -95,11 +93,11 @@ no persistence | full persistence | optional
95
93
 
96
94
  Syntax:
97
95
  ```
98
- ┌─ Status ─┐
99
- item-a done
100
- item-b in progress
101
- item-c blocked
102
- └─────────┘
96
+ +---- Status ----+
97
+ |item-a: done |
98
+ |item-b: in prog |
99
+ |item-c: blocked |
100
+ +----------------+
103
101
  ```
104
102
 
105
103
  **Priority orderings** — A response that orders three or more items by priority, importance, severity, or rank includes an ▲▼ priority scale.
@@ -3,7 +3,8 @@ name: feynman
3
3
  disable-model-invocation: true
4
4
  description: >
5
5
  Toggle ASCII diagram injection on/off or set intensity level (lite/full/ultra).
6
- Use when user says /feynman, /feynman on, /feynman off, /feynman lite/full/ultra, /feynman status.
6
+ Use when user says /feynman, /feynman on/start, /feynman off/stop,
7
+ /feynman lite/full/ultra, /feynman status.
7
8
  ---
8
9
 
9
10
  Manage feynman diagram injection. Read current state, apply requested change, report result.
@@ -11,8 +12,8 @@ Manage feynman diagram injection. Read current state, apply requested change, re
11
12
  ## When invoked
12
13
 
13
14
  Parse `$ARGUMENTS`:
14
- - `on` — enable feynman, keep current intensity
15
- - `off` — disable feynman
15
+ - `on`, `start` — enable feynman, keep current intensity
16
+ - `off`, `stop` — disable feynman
16
17
  - `lite` — enable at lite intensity (flows + trees only)
17
18
  - `full` — enable at full intensity (all diagram types)
18
19
  - `ultra` — enable at ultra intensity (force diagram always)
@@ -27,7 +28,7 @@ node -e "
27
28
  const fs = require('fs'), os = require('os'), path = require('path');
28
29
  const stateFile = path.join(os.homedir(), '.claude', '.feynman', 'state.json');
29
30
  const flagFile = path.join(os.homedir(), '.claude', '.feynman-active');
30
- let st = {enabled: false, intensity: 'full', injections: 0};
31
+ let st = {enabled: true, intensity: 'full', injections: 0};
31
32
  try { st = JSON.parse(fs.readFileSync(stateFile, 'utf8')); } catch(e) {}
32
33
  console.log('enabled:', st.enabled, '| intensity:', st.intensity, '| injections:', (st.injections ?? st.count ?? 0), '| flag:', fs.existsSync(flagFile));
33
34
  "
@@ -40,12 +41,13 @@ node -e "
40
41
  const fs = require('fs'), os = require('os'), path = require('path');
41
42
  const stateFile = path.join(os.homedir(), '.claude', '.feynman', 'state.json');
42
43
  const flagFile = path.join(os.homedir(), '.claude', '.feynman-active');
43
- const arg = process.argv[1] || '';
44
- let st = {enabled: true, intensity: 'full', injections: 0};
44
+ const arg = (process.argv[1] || '').trim().toLowerCase();
45
+ const normalized = arg === 'start' ? 'on' : arg === 'stop' ? 'off' : arg;
46
+ let st = {enabled: false, intensity: 'full', injections: 0};
45
47
  try { st = JSON.parse(fs.readFileSync(stateFile, 'utf8')); } catch(e) {}
46
- if (arg === 'on') { st.enabled = true; fs.writeFileSync(flagFile, st.intensity); }
47
- if (arg === 'off') { st.enabled = false; try { fs.unlinkSync(flagFile); } catch(e) {} }
48
- if (['lite','full','ultra'].includes(arg)) { st.intensity = arg; st.enabled = true; fs.writeFileSync(flagFile, arg); }
48
+ if (normalized === 'on') { st.enabled = true; fs.writeFileSync(flagFile, st.intensity); }
49
+ if (normalized === 'off') { st.enabled = false; try { fs.unlinkSync(flagFile); } catch(e) {} }
50
+ if (['lite','full','ultra'].includes(normalized)) { st.intensity = normalized; st.enabled = true; fs.writeFileSync(flagFile, normalized); }
49
51
  fs.mkdirSync(path.dirname(stateFile), {recursive: true});
50
52
  fs.writeFileSync(stateFile, JSON.stringify(st, null, 2));
51
53
  console.log(JSON.stringify(st));