enigma-cli 1.42.1 → 1.44.0

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 (30) hide show
  1. package/assets/registry/primitives/registry.json +498 -8
  2. package/assets/registry/utils/registry.json +4 -2
  3. package/assets/skills/anti-overengineering-policy/skill.json +1 -1
  4. package/assets/skills/anti-overengineering-review/skill.json +1 -1
  5. package/assets/skills/backend-policy/skill.json +1 -1
  6. package/assets/skills/ciphera-style-policy/skill.json +1 -1
  7. package/assets/skills/code-review-policy/skill.json +1 -1
  8. package/assets/skills/core-engineering-policy/skill.json +1 -1
  9. package/assets/skills/database-expert/skill.json +1 -1
  10. package/assets/skills/debugging-policy/skill.json +1 -1
  11. package/assets/skills/dependency-policy/skill.json +1 -1
  12. package/assets/skills/email-policy/skill.json +1 -1
  13. package/assets/skills/frontend-design/skill.json +1 -1
  14. package/assets/skills/frontend-policy/SKILL.md +9 -1
  15. package/assets/skills/frontend-policy/skill.json +3 -3
  16. package/assets/skills/git-policy/skill.json +1 -1
  17. package/assets/skills/logo-sourcing-policy/skill.json +1 -1
  18. package/assets/skills/security-policy/SKILL.md +9 -0
  19. package/assets/skills/security-policy/skill.json +3 -3
  20. package/assets/skills/skill-creator/skill.json +1 -1
  21. package/assets/skills/task-completion-policy/skill.json +1 -1
  22. package/assets/skills/technical-writing-policy/skill.json +1 -1
  23. package/assets/skills/testing-policy/skill.json +1 -1
  24. package/assets/skills/validation-policy/skill.json +1 -1
  25. package/bin/checksums.json +4 -4
  26. package/bin/enigma.mjs +34 -0
  27. package/dist/codegraph-hook.js +2483 -0
  28. package/dist/guardrails.js +282 -1
  29. package/dist/post-edit.js +283 -2
  30. package/package.json +1 -1
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Pre-delivery self-review gate, prioritized review dimensions, and change-quality criteria.",
6
6
  "updated": "2026-08-19T12:37:59+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "6b8a924cc11b61d4b45b73384aeb095ce622229359b7cc2c6ce4bb0cf3015ed7"
9
9
  }
@@ -7,6 +7,6 @@
7
7
  "codeGraph"
8
8
  ],
9
9
  "updated": "2026-08-15T20:49:24+02:00",
10
- "cliVersion": "1.42.1",
10
+ "cliVersion": "1.44.0",
11
11
  "sha": "95b7202e5659f8d9d6f11ce29e7dc5b01575ba86c78ef948bec4753ccf430155"
12
12
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Senior database architecture policy: engine selection (PostgreSQL by default, SQLite only for local-first/embedded stores), ORM selection (Prisma in TypeScript/JavaScript), query optimization, anti-duplication/normalization, scalability, and RGPD/GDPR encryption.",
6
6
  "updated": "2026-08-04T18:33:27+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "26fddc14caf697e830448a2cc453ddc470fe83d098d50bd67b278effba63274e"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Reproduce-isolate-fix debugging methodology with root-cause discipline and regression verification.",
6
6
  "updated": "2026-08-02T04:15:47+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "968876bcac9ce6e5a20be05c89ac97191b112c9e08679a8dc506d150c375fec4"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Dependency and supply-chain security: lockfiles and reproducible installs, version pinning, vulnerability auditing, vetting/minimizing packages, vendoring, and SBOM/provenance.",
6
6
  "updated": "2026-06-01T00:45:28+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "6375d835c2aef2c9bd31ce116444dc3d796f510f9970a213aa3ac4696d7e21b9"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Transactional email: React Email templates instead of hand-written HTML tables, server-side rendering, one send module behind the provider SDK, plain-text alternatives, idempotent background sending, link safety, and deliverability (SPF/DKIM/DMARC, bounce suppression, unsubscribe).",
6
6
  "updated": "2026-07-30T19:29:19+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "c9724fdbcdbeab99573be3fd44d4cdd97c2a394d99f3c4395f118f17356b00ed"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one.",
6
6
  "updated": "2026-07-29T01:18:36+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "9e30ee7d8a1a1e8c6e7f4e043857cd01841c68a427752e45bc0cad9ec5cfa279"
9
9
  }
@@ -26,7 +26,15 @@ description: Frontend architecture - reusable components, abstraction thresholds
26
26
  - Interaction logic - looping/draggable rows, momentum, focus traps, virtualized lists, dismiss timers, read caches - is BEHAVIOR, and behavior that has already been measured and tested is a dependency, not a snippet to rewrite. Check the catalogue before writing it: `enigma add` lists it and `enigma add <name>` adds it as a DEPENDENCY, which is how you use these - the package keeps getting fixes and a dependency is how they reach the project. `--copy` vendors the source and freezes it at that version; reach for it to EDIT a component, never as the normal way to add one.
27
27
  - These primitives ship NO visual styles. They apply only what the behavior requires (overflow, touch-action, user-select, will-change, transform) and publish their state as `data-*` attributes, so the look stays entirely yours.
28
28
  - Do not hand-roll one of them "just for this page". The hand-rolled version is where the measured bugs come back: a duration-driven marquee that accelerates as items are added, a `setPointerCapture` drag that silently stops every link in the row from opening, a hover slowdown that sticks forever after the first tap because touch never fires `pointerleave`.
29
- - Two of them are worth naming because their hand-rolled versions are near-misses of behavior everyone already knows, and the `fe-context-menu-hand-rolled` and `fe-selection-hand-rolled` guardrails block both. A RIGHT-CLICK MENU (`enigma add context-menu`) is never the panel: it is the release of the opening press choosing whatever row it landed on, a submenu that closes while the pointer crosses a sibling to reach it (the way out goes over them, so closing on the first crossing makes a nested menu unreachable), a panel that opens off the edge of the window instead of flipping, no Escape, no arrows, no Shift+F10, and a menu left behind when the page scrolls - plus shortcuts printed for the reader's platform and a menu that refuses to open when it has nothing to show. A LIST SELECTION (`enigma add selection`) is Explorer's model: Shift+click measures from the ANCHOR every time (measuring from the last click leaves a trail of rows as it is dragged), Ctrl toggles instead of replacing, Ctrl+Shift adds the range, a range steps over a row it may not select, and Ctrl+A, Escape and the arrow keys exist at all - with every shortcut rebindable or removable, and delete/rename/open reported as commands rather than performed.
29
+ - THE CATALOGUE, so you never have to guess whether one exists. `enigma add <name>` adds it as a dependency:
30
+ - `input` - one field for every `type`: password (reveal, generator, strength meter, breach check), search (debounce, ranking, clear), color (swatch, saturation square, hue and alpha rails, presets, eyedropper), and everything else as a plain field with native props.
31
+ - `select` - a listbox that replaces the native one: typeahead, disabled rows the arrows walk past, one highlight shared by pointer and keyboard, a panel that measures before it opens, multi-select tags, a hidden input so the form can submit it.
32
+ - `palette` - the Ctrl/Cmd+K panel: one flat keyboard sequence across groups, a highlight that wraps and that a shorter list pulls back, `aria-activedescendant` so the caret never leaves the field, recents guarded against a storage that throws.
33
+ - `toast` - notifications whose timer pauses on hover, on focus and on a hidden tab, with promise toasts and actions.
34
+ - `context-menu` - the right-click menu with the desktop's behaviour: submenus on a beat, a panel that flips at the window edge, Escape, arrows, Shift+F10, shortcuts printed for the reader's platform.
35
+ - `selection` - Explorer's selection model: anchor and cursor, Shift, Ctrl, Ctrl+Shift, a rubber band, arrow keys, and delete/rename/open reported as commands.
36
+ - `button` - press states, async pending, cooldowns, and a shortcut badge; `marquee` and `logo-marquee` - a looping row that takes px/s and measures its own lap; `search` - the engine behind a field or a page; `flags` - a country flag as an image, never an emoji; `relative-time` - "3 minutes ago" that updates itself; `network` - online/offline and connection quality; `notifications` - the queue under the toast, for a renderer of your own.
37
+ - Five of them are already deterministic: `fe-select-hand-rolled`, `fe-toast-hand-rolled`, `fe-palette-hand-rolled`, `fe-context-menu-hand-rolled` and `fe-selection-hand-rolled` block the hand-rolled version at the moment it is written, and each message names the defects the primitive fixed. Reading the message is faster than rediscovering them.
30
38
  - If the catalogue has no primitive for what you need, write it as one (core + adapter + registry entry + test) rather than inline in a page, so the next screen reuses it instead of rewriting it.
31
39
 
32
40
  ## Component Reuse (Mandatory)
@@ -3,7 +3,7 @@
3
3
  "version": "1.31.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Frontend architecture: reusable components, abstraction thresholds, state management, real-time form validation where an emptied or not-yet-filled field is incomplete rather than invalid (a `*` on the label and an aria-disabled submit, never \"email is not valid\" over an empty input), no-op detection (skip any operation whose result equals current state, not just form saves; dirty means different from the loaded snapshot, not touched), instant first paint (render the shell, load data async, skeletons), perceived performance (prefetch on intent, debounce/throttle, cancel stale requests, avoid waterfalls, lazy widgets), large-list rendering (infinite scroll is the preferred default, pagination the deliberate exception when the design or the user calls for it, virtualization, skeletons, progressive loading), data views that ship their own affordances by default (a log, expense, transaction or history table is not done when the rows render: fuse.js search, the filters its column kinds imply, a date range, sort, filter state in the URL, and an export of the filtered set), every reference to an entity being a way into it (a name, id, project or path in a row links to that record, reveals it in a hover card, or at minimum copies and filters by it, never inert text; machine codes get human labels and raw payloads are never dumped into a cell), optimistic UI with rollback, visual restraint (one card level, spacing before borders, one elevation scale), icon actions (repeated row/card actions are icon-only buttons with aria-label plus title, not text labels), responsive/adaptive layout (fluid units, breakpoints, no overlap/overflow, viewport meta, touch targets), form fields that declare their keyboard and casing (autocapitalize/autocomplete/inputmode per field kind, set once in the shared Input, normalized on blur), variable-length text (min-width:0 in flex/grid, wrap vs truncate, long unbroken strings, worst-case content checks), auth screens (breached-password feedback, strength meter, cookie consent before login/register), and AI chat/agent interfaces via Vercel's AI Elements registry instead of hand-rolled message threads.",
6
- "updated": "2026-09-01T21:30:38+02:00",
7
- "cliVersion": "1.42.1",
8
- "sha": "c18c746f8c29c591685b81cabbaada43996640bc830181c28b8560e904934bc2"
6
+ "updated": "2026-09-05T02:46:46+02:00",
7
+ "cliVersion": "1.44.0",
8
+ "sha": "d0085206565523d2a54d3c74ccb670fe5c9c43a64cef2b31c15b22156d1b8131"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Git & contribution policy (senior engineering standards).",
6
6
  "updated": "2026-08-22T09:25:34+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "cb320a6a5fd3279604ad7920b877c1a36e48f4f39aeead1a4c4daa89901d9ce0"
9
9
  }
@@ -7,6 +7,6 @@
7
7
  "logoColorPolicy"
8
8
  ],
9
9
  "updated": "2026-07-17T00:17:02+02:00",
10
- "cliVersion": "1.42.1",
10
+ "cliVersion": "1.44.0",
11
11
  "sha": "09cdbefd98625b02a7d03685e5deed128238ff8454a83fe22279610fe3ef8ddf"
12
12
  }
@@ -54,6 +54,15 @@ These four screens are one system: an attacker who cannot guess a password will
54
54
  - Keep email verification asynchronous. Let them in unverified, ask for confirmation, and gate only the actions that genuinely need a verified address (billing, invites, outbound mail).
55
55
  - The exception is an account created by someone else (admin provisioning, an approval queue). Then say so in the code, because the redirect looks like the defect.
56
56
 
57
+ ### A credential just proven is not asked for again
58
+
59
+ - Enrolling the first second factor right after sign-up or sign-in must NOT ask for the password. It was verified seconds ago and it established the session that is rendering the page: asking verifies nothing, and it teaches the visitor that a password box can appear at any moment for no stated reason, which is the habit every phishing page depends on. `sec-2fa-reauth-prompt` blocks it.
60
+ - What proves the enrollment is the CODE from the authenticator app, not the password. Show the secret and its QR once, require one valid code before the factor counts as active, then issue single-use recovery codes and show them once.
61
+ - Re-authentication is a real control, and it is a question about FRESHNESS rather than about the action. Record `authenticatedAt` when the session is created, treat it as fresh for 5 to 15 minutes, and ask again only past that window - GitHub's sudo mode, and Google's reauth, are exactly this.
62
+ - Guard these with a fresh session, and only these: changing the password or the email, disabling 2FA or removing a factor, viewing or regenerating recovery codes, issuing an API token, changing payout or billing details, and deleting the account.
63
+ - When the window has passed, prefer stepping up with the SECOND factor or a passkey over the password: it is the stronger proof, and it is the one an attacker holding a stolen password does not have.
64
+ - The same rule applies to every other credential in a flow. Do not ask for the email again on the screen that just verified it, and do not ask a user to retype a password they entered on the previous step of the same wizard. A form that re-asks for what the flow already holds is a bug in the flow, not a security control.
65
+
57
66
  ### Password recovery is part of every password login
58
67
 
59
68
  - Every sign-in form with a password field needs a visible recovery entry point. A login screen with no way out of a forgotten password is an incomplete flow, not a simpler one.
@@ -3,7 +3,7 @@
3
3
  "version": "1.4.0",
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Application and AI-agent security: secrets, authn/authz (least privilege), credential flows with breach-checked passwords (Have I Been Pwned), OWASP Top 10, transport/crypto baseline, cookies and consent, secure logging, and agent/MCP/tool-use safety.",
6
- "updated": "2026-08-19T12:37:59+02:00",
7
- "cliVersion": "1.42.1",
8
- "sha": "0270c33d2b4559e831aec794c188d293d26fc17e2a8064a967d716ceb3a7bab6"
6
+ "updated": "2026-09-05T02:46:46+02:00",
7
+ "cliVersion": "1.44.0",
8
+ "sha": "d64fe3a4a54f27a71e3066875ee949500f170d04da5c548ef605268a12102afb"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Create new skills, modify and improve existing skills, and measure skill performance with evals and benchmarks.",
6
6
  "updated": "2026-08-03T00:16:54+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "a49f6166f57d734e0f13487332da37903e925f32257447856af0fbd6a5f1dc84"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Exhaustive completion discipline for long/multi-item tasks - inventory, coverage ledger, verified done.",
6
6
  "updated": "2026-08-02T04:15:47+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "4c2197954135dd3375f32d839238b82a95c0e93e976ddf5a9cbc4a0cf0146e97"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Concise, realistic technical copy - UI microcopy, descriptions, hints, empty/error states, and README/doc prose that informs without over-explaining or restating the obvious, and never uses a typographic dash.",
6
6
  "updated": "2026-08-19T12:37:59+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "a5a228a302f50d975a947b9d84676b4c2a4780f2b222f819388cc98d6a12f207"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Test strategy, coverage gates, deterministic tests, mocking discipline, regression-first bug fixing, and test-suite organization (layout by type/domain, mirrored paths, file naming, fixture/helper placement).",
6
6
  "updated": "2026-06-16T17:11:49+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "3bdf591057b760f674fb2b1425f63acb426cda2c4f042e1a74c5a5d3807df664"
9
9
  }
@@ -4,6 +4,6 @@
4
4
  "provider": "FJRG2007/enigma",
5
5
  "description": "Strict frontend + backend schema validation, normalization before validation (shared normalizers: trim, lowercase email, capitalize names, canonicalize links and handles), real-time error timing (an emptied or not-yet-filled field is incomplete, not invalid: a `*` and an aria-disabled submit instead of \"not valid\" over an empty input), schema consistency, and safe client-facing error handling.",
6
6
  "updated": "2026-08-11T17:10:56+02:00",
7
- "cliVersion": "1.42.1",
7
+ "cliVersion": "1.44.0",
8
8
  "sha": "24928a4c9eed28ebede9f23f746b09a9d3d8176f8fcca61a7780a853fa5bed4e"
9
9
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "enigma-darwin-arm64": "e752828ca366564c83e52a22075a64001ca99762e57581e0b7a29c33bbb8deba",
3
- "enigma-linux-arm64": "862123cad074c2163b598e8a832e0bb22a3f8009f21d175bde815eb15df61f42",
4
- "enigma-linux-x64": "3942429c8a18b1150536723607a7106bc07904fc91fd59ef13d6c4f04b7265e3",
5
- "enigma-win32-x64.exe": "e7cecdead77a3752c3469a79e156acb9d75a0adae177b04c1af6debd94891d12"
2
+ "enigma-darwin-arm64": "9d77f2f48a3b09655b5c0387dc2434308842af579dbe7c4c35ccf354981736ea",
3
+ "enigma-linux-arm64": "b791c070374b50f1eee59ce1d6f924d882915534bf0986e616cb35fb9647f9a5",
4
+ "enigma-linux-x64": "eda9a4c6a66a3f2c220f5b4d47eb61711513c49aabffb901f894c8207469f983",
5
+ "enigma-win32-x64.exe": "8b3426ebb8acb03cfec9f988db0e090995c0c40218e1cd19873c1f21a8e43627"
6
6
  }
package/bin/enigma.mjs CHANGED
@@ -71,6 +71,40 @@ if (process.argv[2] === "__post-edit-hook" && existsSync(postEditBundle)) {
71
71
  }
72
72
  }
73
73
 
74
+ /**
75
+ * Fast path: the code graph's session hooks, for the same reason as the one above and with more
76
+ * at stake.
77
+ *
78
+ * `UserPromptSubmit` runs BEFORE the message reaches the model and blocks it, so whatever this
79
+ * costs is time the user spends staring at their own prompt - on every single turn, whether the
80
+ * hook finds anything to say or not. Spawning the binary for it measured ~21 s here (Windows 11,
81
+ * Defender real-time on, a ~96 MB unsigned executable rescanned on each launch) against a 25 s
82
+ * host budget, so it alternated between a twenty-second stall and a timeout whose output was
83
+ * discarded - the worst of both. The hook's own work is milliseconds.
84
+ *
85
+ * Every path in it is already Node-compatible: `dist/post-edit.js` has been calling
86
+ * `runCodeGraphHook` under Node since the post-edit hook was merged into one process. So it is
87
+ * answered HERE and the binary is never started.
88
+ *
89
+ * Bundle missing (an install from before it shipped) -> fall through untouched, stdin included,
90
+ * and let the binary answer as it always did.
91
+ */
92
+ const codeGraphBundle = join(pkgRoot, "dist", "codegraph-hook.js");
93
+ if (process.argv[2] === "__codegraph-hook" && existsSync(codeGraphBundle)) {
94
+ // Read SYNCHRONOUSLY, before any await: an await lets Node drain the pipe and the hook then
95
+ // sees an empty payload - the same lesson cli.ts records for this command.
96
+ let payload = "";
97
+ try { payload = readFileSync(0, "utf8"); } catch { /* no stdin; the hook no-ops on it */ }
98
+ try {
99
+ const { runCodeGraphHook } = await import(pathToFileURL(codeGraphBundle).href);
100
+ process.exit(await runCodeGraphHook(process.argv[3] ?? "", payload));
101
+ } catch {
102
+ // Silent, unlike post-edit: this hook has nothing to enforce. It rides along inside
103
+ // somebody's turn, and a session must never be interrupted by the thing decorating it.
104
+ process.exit(0);
105
+ }
106
+ }
107
+
74
108
  /** Resolve the binary, downloading it on first run if the postinstall was skipped. */
75
109
  async function resolveBinary() {
76
110
  if (process.env.ENIGMA_BIN_PATH && existsSync(process.env.ENIGMA_BIN_PATH)) return process.env.ENIGMA_BIN_PATH;