dislop 0.0.0-stage → 0.7.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 (53) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +33 -0
  3. package/.claude-plugin/plugin.json +23 -0
  4. package/.codex-plugin/plugin.json +49 -0
  5. package/.cursor-plugin/plugin.json +27 -0
  6. package/.mcp.json +8 -0
  7. package/.pre-commit-hooks.yaml +13 -0
  8. package/LICENSE +202 -0
  9. package/PRODUCT.md +49 -0
  10. package/README.md +245 -2
  11. package/README.zh-CN.md +242 -0
  12. package/action.yml +90 -0
  13. package/assets/logo.svg +8 -0
  14. package/bin/dislop-mcp.mjs +5 -0
  15. package/bin/dislop.mjs +1967 -0
  16. package/gemini-extension.json +10 -0
  17. package/mcp.json +9 -0
  18. package/models/manifest.json +90 -0
  19. package/models/pocket-slop-v1.json +1 -0
  20. package/package.json +92 -4
  21. package/packs/business-brief/pack.json +598 -0
  22. package/packs/core/pack.json +198 -0
  23. package/packs/deck-and-ui/pack.json +290 -0
  24. package/packs/engineering-spec/pack.json +144 -0
  25. package/packs/executive-deck/pack.json +98 -0
  26. package/packs/literary-essay/pack.json +324 -0
  27. package/packs/regulated-comms/pack.json +99 -0
  28. package/patterns/README.md +39 -0
  29. package/patterns/banks/composite-fusion.json +36 -0
  30. package/patterns/banks/discourse-rhythm.json +95 -0
  31. package/patterns/banks/lexical-signals.json +74 -0
  32. package/patterns/banks/syntactic-frames.json +45 -0
  33. package/patterns/banks/visual-deck.json +37 -0
  34. package/patterns/dimensions/artifacts.json +121 -0
  35. package/patterns/dimensions/discourse.json +412 -0
  36. package/patterns/dimensions/lexical.json +172 -0
  37. package/patterns/dimensions/rhythm.json +206 -0
  38. package/patterns/dimensions/syntactic.json +285 -0
  39. package/patterns/dimensions/visual-and-deck.json +322 -0
  40. package/patterns/taxonomy.json +112 -0
  41. package/plugin.json +41 -0
  42. package/server.json +18 -0
  43. package/skills/dislop/SKILL.md +58 -0
  44. package/skills/dislop/agents/openai.yaml +6 -0
  45. package/skills/dislop/references/business-and-rfc.md +26 -0
  46. package/skills/dislop/references/editorial-and-essay.md +20 -0
  47. package/skills/dislop/references/regulated-and-precision.md +27 -0
  48. package/skills/dislop/references/web-ui-and-deck.md +26 -0
  49. package/src/binary-node.mjs +85 -0
  50. package/src/core.mjs +2500 -0
  51. package/src/local-model.mjs +977 -0
  52. package/src/pattern-engine.mjs +853 -0
  53. package/src/pocket-model.mjs +707 -0
@@ -0,0 +1,26 @@
1
+ # Web UI, Front-End Components & Executive Slide Decks
2
+
3
+ Local progressive-disclosure reference bundled with `skills/dislop/` (0 network calls required).
4
+
5
+ ## Recommended Built-in Packs
6
+
7
+ - Web pages, CSS, JSX/TSX components, and general slides: `--pack deck-and-ui`
8
+ - Board readouts, consulting decks, and strategy `.pptx` files: `--pack executive-deck`
9
+
10
+ ```bash
11
+ dislop check <deck.pptx-or-dir> --pack executive-deck --fail-on warning
12
+ ```
13
+
14
+ ## Web UI Anti-Slop Rules
15
+
16
+ 1. **Zero dead controls (`ui-dead-control`, severity `error`)**: Never ship `<a href="#">`, empty `href=""`, or unexplained `<button disabled>`. Wire real routes, add `title` or `aria-describedby` explaining why a control is disabled, or remove unbuilt mockup buttons.
17
+ 2. **Skip both generations of default AI templates**:
18
+ - Generation 1: indigo-purple-pink neon gradients (`ui-ai-gradient`), `bg-clip-text text-transparent` hero titles, `> 6` `rounded-full` pill badges per view (`ui-pill-soup`), triple nested bordered boxes (`ui-box-in-box`), and `"AI-Powered"` or `"Zero Hallucination"` eyebrow badges (`ui-prompt-echo-badge`).
19
+ - Generation 2: generic warm-beige `#F7F5F0` cards with identical 3-column icon boxes.
20
+ 3. **Positive layout grammar**: Favor explicit structural `1px` rules or clear typographic hierarchy, `tabular-nums` on aligned metrics, monotonic dark-mode surface lightness (`stage < sheet < raised`), and system or deliberate editorial type stacks.
21
+
22
+ ## Slide Deck & `.pptx` Rules
23
+
24
+ 1. **Conclusion-first headlines (`slide-weak-topic-title`, `slide-process-not-finding-title`)**: Replace `"Overview"`, `"Analysis of Q3 Churn"`, or `"Review of Deployment Pipeline"` with the one-sentence takeaway and measured delta (`"Simplified KYC Cut Week-1 Drop-off from 34% to 19%"`).
25
+ 2. **Readable slide density**: Keep each visible slide `<= 120` words, `<= 5–6` bullets, and `100%` text scale (`normAutofit >= 80%`).
26
+ 3. **Break cross-slide layout monotony (`pptx-layout-monotony`)**: Do not repeat identical plain-bullet skeletons across 4+ consecutive slides; convert comparisons into tables and trends into charts.
@@ -0,0 +1,85 @@
1
+ import { inflateRawSync } from "node:zlib";
2
+
3
+ const MAX_ZIP_ENTRIES = 3000;
4
+ const MAX_UNCOMPRESSED_BYTES = 120 * 1024 * 1024; // 120 MB zip-bomb ceiling
5
+
6
+ /**
7
+ * Pure Node.js standard-library ZIP reader for OOXML (`.docx`, `.pptx`).
8
+ * Parses the End of Central Directory (EOCD) and Central Directory entries.
9
+ */
10
+ export function readZipXmlEntries(buffer) {
11
+ if (buffer.length < 22 || buffer[0] !== 0x50 || buffer[1] !== 0x4b) {
12
+ throw new Error("Invalid OOXML ZIP header");
13
+ }
14
+
15
+ // Locate EOCD signature 0x06054b50 within last 65 KB
16
+ const minOffset = Math.max(0, buffer.length - 65557);
17
+ let eocdOffset = -1;
18
+ for (let i = buffer.length - 22; i >= minOffset; i -= 1) {
19
+ if (buffer.readUInt32LE(i) === 0x06054b50) {
20
+ eocdOffset = i;
21
+ break;
22
+ }
23
+ }
24
+ if (eocdOffset === -1) {
25
+ throw new Error("Could not locate ZIP End-of-Central-Directory record");
26
+ }
27
+
28
+ const totalEntries = buffer.readUInt16LE(eocdOffset + 10);
29
+ if (totalEntries > MAX_ZIP_ENTRIES) {
30
+ throw new Error(`Archive exceeds maximum entry cap (${totalEntries} > ${MAX_ZIP_ENTRIES})`);
31
+ }
32
+
33
+ const cdSize = buffer.readUInt32LE(eocdOffset + 12);
34
+ const cdOffset = buffer.readUInt32LE(eocdOffset + 16);
35
+ if (cdOffset + cdSize > buffer.length) {
36
+ throw new Error("Truncated ZIP central directory");
37
+ }
38
+
39
+ const entries = {};
40
+ let totalUncompressed = 0;
41
+ let ptr = cdOffset;
42
+
43
+ for (let i = 0; i < totalEntries && ptr + 46 <= cdOffset + cdSize; i += 1) {
44
+ if (buffer.readUInt32LE(ptr) !== 0x02014b50) break;
45
+ const method = buffer.readUInt16LE(ptr + 10);
46
+ const compSize = buffer.readUInt32LE(ptr + 20);
47
+ const uncompSize = buffer.readUInt32LE(ptr + 24);
48
+ const nameLen = buffer.readUInt16LE(ptr + 28);
49
+ const extraLen = buffer.readUInt16LE(ptr + 30);
50
+ const commentLen = buffer.readUInt16LE(ptr + 32);
51
+ const localHeaderOffset = buffer.readUInt32LE(ptr + 42);
52
+
53
+ const name = buffer.subarray(ptr + 46, ptr + 46 + nameLen).toString("utf8");
54
+ ptr += 46 + nameLen + extraLen + commentLen;
55
+
56
+ if (!/\.(?:xml|rels)$/i.test(name)) continue;
57
+
58
+ totalUncompressed += uncompSize;
59
+ if (totalUncompressed > MAX_UNCOMPRESSED_BYTES) {
60
+ throw new Error("OOXML uncompressed XML payload exceeds 120 MB safety ceiling");
61
+ }
62
+
63
+ if (localHeaderOffset + 30 > buffer.length || buffer.readUInt32LE(localHeaderOffset) !== 0x04034b50) {
64
+ continue;
65
+ }
66
+ const localNameLen = buffer.readUInt16LE(localHeaderOffset + 26);
67
+ const localExtraLen = buffer.readUInt16LE(localHeaderOffset + 28);
68
+ const dataStart = localHeaderOffset + 30 + localNameLen + localExtraLen;
69
+ const dataEnd = dataStart + compSize;
70
+ if (dataEnd > buffer.length) continue;
71
+
72
+ const rawSlice = buffer.subarray(dataStart, dataEnd);
73
+ let outBuf;
74
+ if (method === 0) {
75
+ outBuf = rawSlice;
76
+ } else if (method === 8) {
77
+ outBuf = inflateRawSync(rawSlice, { maxOutputLength: MAX_UNCOMPRESSED_BYTES });
78
+ } else {
79
+ continue;
80
+ }
81
+ entries[name] = outBuf.toString("utf8");
82
+ }
83
+
84
+ return entries;
85
+ }