dislop 0.9.1 → 1.0.1

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 (124) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.codex-plugin/plugin.json +7 -8
  4. package/.cursor-plugin/plugin.json +2 -3
  5. package/.pre-commit-hooks.yaml +5 -12
  6. package/PRODUCT.md +19 -63
  7. package/README.md +360 -252
  8. package/README.zh-CN.md +390 -240
  9. package/action.yml +30 -39
  10. package/bin/dislop-mcp.mjs +3 -4
  11. package/bin/dislop.mjs +4 -4594
  12. package/gemini-extension.json +2 -2
  13. package/llms-install.md +68 -0
  14. package/package.json +17 -63
  15. package/packs/common/artifact-qa/pack.json +5 -0
  16. package/packs/common/artifact-qa/prompts/rules.md +11 -0
  17. package/packs/common/artifact-qa/scripts/index.mjs +173 -0
  18. package/packs/common/slide-deck/pack.json +6 -0
  19. package/packs/common/slide-deck/prompts/rules.md +11 -0
  20. package/packs/common/slide-deck/scripts/index.mjs +62 -0
  21. package/packs/common/web-ui/pack.json +6 -0
  22. package/packs/common/web-ui/prompts/rules.md +11 -0
  23. package/packs/common/web-ui/scripts/index.mjs +80 -0
  24. package/packs/en/artifact-qa/pack.json +6 -0
  25. package/packs/en/artifact-qa/prompts/rules.md +14 -0
  26. package/packs/en/artifact-qa/scripts/index.mjs +90 -0
  27. package/packs/en/prose/pack.json +7 -0
  28. package/packs/en/prose/prompts/rules.md +26 -0
  29. package/packs/en/prose/scripts/index.mjs +290 -0
  30. package/packs/en/slide-deck/pack.json +7 -0
  31. package/packs/en/slide-deck/prompts/rules.md +17 -0
  32. package/packs/en/slide-deck/scripts/index.mjs +81 -0
  33. package/packs/en/web-ui/pack.json +7 -0
  34. package/packs/en/web-ui/prompts/rules.md +20 -0
  35. package/packs/en/web-ui/scripts/index.mjs +103 -0
  36. package/packs/zh/artifact-qa/pack.json +6 -0
  37. package/packs/zh/artifact-qa/prompts/rules.md +14 -0
  38. package/packs/zh/artifact-qa/scripts/index.mjs +89 -0
  39. package/packs/zh/prose/pack.json +7 -0
  40. package/packs/zh/prose/prompts/rules.md +26 -0
  41. package/packs/zh/prose/scripts/index.mjs +305 -0
  42. package/packs/zh/slide-deck/pack.json +7 -0
  43. package/packs/zh/slide-deck/prompts/rules.md +17 -0
  44. package/packs/zh/slide-deck/scripts/index.mjs +75 -0
  45. package/packs/zh/web-ui/pack.json +7 -0
  46. package/packs/zh/web-ui/prompts/rules.md +20 -0
  47. package/packs/zh/web-ui/scripts/index.mjs +98 -0
  48. package/plugin.json +5 -6
  49. package/server.json +2 -2
  50. package/skills/deslop-docs/SKILL.md +10 -8
  51. package/skills/deslop-slides-docx/SKILL.md +7 -8
  52. package/skills/deslop-verify/SKILL.md +7 -8
  53. package/skills/deslop-web-ui/SKILL.md +7 -8
  54. package/skills/dislop/SKILL.md +16 -28
  55. package/skills/dislop/references/essay.md +1 -1
  56. package/skills/dislop/references/essay.zh-CN.md +1 -1
  57. package/skills/dislop/references/office.md +1 -1
  58. package/skills/dislop/references/office.zh-CN.md +1 -1
  59. package/skills/dislop/references/web-ui.md +1 -1
  60. package/skills/dislop/references/web-ui.zh-CN.md +1 -1
  61. package/skills/dislop/references/work-docs.md +1 -1
  62. package/skills/dislop/references/work-docs.zh-CN.md +1 -1
  63. package/src/cli-main.mjs +210 -0
  64. package/src/commands/check-fix.mjs +169 -0
  65. package/src/commands/doctor.mjs +110 -0
  66. package/src/commands/init.mjs +49 -0
  67. package/src/commands/login.mjs +82 -0
  68. package/src/commands/model.mjs +130 -0
  69. package/src/commands/packs.mjs +44 -0
  70. package/src/commands/verify.mjs +133 -0
  71. package/src/commands/voice.mjs +84 -0
  72. package/src/kernel/config.mjs +232 -0
  73. package/src/kernel/document-model.mjs +1412 -0
  74. package/src/kernel/fact-gate.mjs +615 -0
  75. package/src/kernel/file-discovery.mjs +139 -0
  76. package/src/{binary-node.mjs → kernel/ooxml-binary.mjs} +532 -893
  77. package/src/kernel/pack-loader.mjs +715 -0
  78. package/src/kernel/patcher.mjs +341 -0
  79. package/src/kernel/pipeline.mjs +267 -0
  80. package/src/kernel/prompt-assembler.mjs +307 -0
  81. package/src/kernel/voice-profile.mjs +177 -0
  82. package/src/mcp/stdio-server.mjs +372 -0
  83. package/src/runners/auto-fix.mjs +59 -0
  84. package/src/runners/interactive-tty.mjs +461 -0
  85. package/src/runners/reporters.mjs +256 -0
  86. package/src/runtime/chunker.mjs +87 -0
  87. package/src/runtime/json-extract.mjs +144 -0
  88. package/src/runtime/privacy-gate.mjs +97 -0
  89. package/src/runtime/providers/anthropic.mjs +65 -0
  90. package/src/runtime/providers/cloud.mjs +136 -0
  91. package/src/runtime/providers/gemini.mjs +91 -0
  92. package/src/runtime/providers/local-model.mjs +139 -0
  93. package/src/runtime/providers/openai-compat.mjs +130 -0
  94. package/src/runtime/router.mjs +315 -0
  95. package/src/sdk/index.mjs +137 -0
  96. package/models/manifest.json +0 -90
  97. package/models/pocket-slop-v1.json +0 -1
  98. package/packs/business-brief/pack.json +0 -937
  99. package/packs/core/pack.json +0 -209
  100. package/packs/deck-and-ui/pack.json +0 -539
  101. package/packs/engineering-spec/pack.json +0 -144
  102. package/packs/executive-deck/pack.json +0 -98
  103. package/packs/literary-essay/pack.json +0 -344
  104. package/packs/regulated-comms/pack.json +0 -99
  105. package/patterns/ai-tic-rubric.json +0 -252
  106. package/patterns/banks/composite-fusion.json +0 -48
  107. package/patterns/banks/discourse-rhythm.json +0 -95
  108. package/patterns/banks/lexical-signals.json +0 -92
  109. package/patterns/banks/syntactic-frames.json +0 -52
  110. package/patterns/banks/visual-deck.json +0 -44
  111. package/patterns/dimensions/artifacts.json +0 -121
  112. package/patterns/dimensions/discourse.json +0 -438
  113. package/patterns/dimensions/lexical.json +0 -198
  114. package/patterns/dimensions/rhythm.json +0 -258
  115. package/patterns/dimensions/syntactic.json +0 -285
  116. package/patterns/dimensions/visual-and-deck.json +0 -530
  117. package/patterns/taxonomy.json +0 -112
  118. package/src/core.mjs +0 -5497
  119. package/src/dislop/review-picker.vim +0 -114
  120. package/src/local-model.mjs +0 -997
  121. package/src/pattern-engine.mjs +0 -1003
  122. package/src/pocket-model.mjs +0 -729
  123. package/src/review-apply.mjs +0 -151
  124. package/src/review-client.mjs +0 -1073
@@ -0,0 +1,90 @@
1
+ import { definePackScripts, maskInlineCode } from "dislop/sdk";
2
+
3
+ const EN_PLACEHOLDER_PATTERNS = [
4
+ /(?<![A-Za-z])(?:lorem ipsum|dolor sit amet)(?![A-Za-z])/i,
5
+ /\[(?:insert|add|your|placeholder|enter|fill in)\s+[^\][\n]{1,60}\](?!\s*\()/i,
6
+ /\[(?:Company Name|Recipient Name|Client Name|Author Name|Project Name|Date|Metric|Link)\](?!\s*\()/i,
7
+ /(?:Click to add (?:title|subtitle|text|notes))/i,
8
+ ];
9
+
10
+ const EN_CHATBOT_WRAPPER_SENTENCES = [
11
+ /^(?:Certainly!|Sure!|Of course!|Absolutely!|Great question!|Happy to help!|Glad to help!)\s*(?:(?:Here(?:'s| is)\b|Below is\b|I(?:'ve| have)\b)[\s\S]*)?$/i,
12
+ /^Here(?:'s| is) (?:a|the|your) (?:revised|updated|draft|polished|rewritten|concise|cleaned-up)\b[\s\S]*[:.]$/i,
13
+ /^As an AI(?: language model| assistant)?\b[\s\S]*$/i,
14
+ /^(?:I hope this helps!?|Hope this helps!?|(?:Please )?[Ll]et me know if you(?:'d| would) like (?:any )?(?:further |more |additional )?(?:changes|adjustments|edits|modifications|revisions)[\s\S]*)$/i,
15
+ /^Feel free to (?:ask|reach out) if you need (?:any(?:thing)? else|further assistance)[\s\S]*$/i,
16
+ /^Would you like me to (?:expand on|refine|adjust|tailor) [\s\S]*\?$/i,
17
+ ];
18
+
19
+ const EN_REFUSAL_OR_CUTOFF_RE =
20
+ /\b(?:As of my (?:last )?knowledge cutoff|I cannot fulfill this request|I'm sorry, but as an AI)\b/i;
21
+
22
+ const EN_WRAPPER_REGRESSION_RE =
23
+ /^(?:Certainly!|Sure!|Here(?:'s| is) the revised|I hope this helps)/i;
24
+
25
+ export default definePackScripts({
26
+ check(doc, ctx) {
27
+ for (const seg of doc.segments) {
28
+ const text = seg.text.trim();
29
+ const proseOnly = maskInlineCode(text);
30
+
31
+ for (const re of EN_PLACEHOLDER_PATTERNS) {
32
+ const m = proseOnly.match(re);
33
+ if (m) {
34
+ const hitQuote = text.slice(m.index, m.index + m[0].length);
35
+ ctx.reportDefect({
36
+ ruleId: "unfilled-placeholder",
37
+ severity: "error",
38
+ targetId: seg.id,
39
+ line: seg.line,
40
+ originalQuote: hitQuote,
41
+ fixSafety: "manual",
42
+ actionType: "prompt",
43
+ reason: "Unfilled English template placeholder or dummy Latin copy left in deliverable.",
44
+ rewritePrompt: `Supply the real copy in place of '${hitQuote}', or delete the unfinished sentence.`,
45
+ });
46
+ break;
47
+ }
48
+ }
49
+
50
+ if (EN_CHATBOT_WRAPPER_SENTENCES.some((re) => re.test(proseOnly))) {
51
+ ctx.reportDefect({
52
+ ruleId: "chatbot-artifact",
53
+ severity: "error",
54
+ targetId: seg.id,
55
+ line: seg.line,
56
+ originalQuote: seg.text,
57
+ fixSafety: "safe",
58
+ actionType: "delete",
59
+ suggestedReplacement: "",
60
+ reason: "Conversational English assistant wrapper left in the deliverable; safe to delete.",
61
+ });
62
+ continue;
63
+ }
64
+
65
+ if (EN_REFUSAL_OR_CUTOFF_RE.test(proseOnly)) {
66
+ ctx.reportDefect({
67
+ ruleId: "chatbot-cutoff-leak",
68
+ severity: "error",
69
+ targetId: seg.id,
70
+ line: seg.line,
71
+ originalQuote: seg.text,
72
+ fixSafety: "manual",
73
+ actionType: "prompt",
74
+ reason: "AI refusal or knowledge-cutoff disclaimer pasted into document.",
75
+ rewritePrompt: "Remove the pasted AI disclaimer and supply verified current information.",
76
+ });
77
+ }
78
+ }
79
+ },
80
+
81
+ verifyFix(_issue, candidateText) {
82
+ if (candidateText && EN_WRAPPER_REGRESSION_RE.test(candidateText.trim())) {
83
+ return {
84
+ ok: false,
85
+ reason: "Replacement still contains conversational assistant wrapper phrasing.",
86
+ };
87
+ }
88
+ return { ok: true };
89
+ },
90
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "en/prose",
3
+ "version": "1.0.0",
4
+ "description": "High-restraint English editorial anti-slop pack: zero-information scaffolding deletions and self-contained syntactic AI tic cleanups.",
5
+ "languages": ["en"],
6
+ "formats": ["md", "mdx", "txt", "html", "jsx", "tsx", "docx", "pptx", "pdf"]
7
+ }
@@ -0,0 +1,26 @@
1
+ ---
2
+ roleHint: "Scope: restrained English prose anti-slop patterns. Do not fire on ordinary domain claims merely because they use abstract verbs."
3
+ rules:
4
+ - id: unprompted-negation
5
+ priority: strong
6
+ - id: hollow-transition
7
+ priority: strong
8
+ - id: throat-clearing
9
+ priority: moderate
10
+ - id: moralizing-closer
11
+ priority: moderate
12
+ - id: rhetorical-self-qa
13
+ priority: hint
14
+ - id: stealth-vapor
15
+ priority: moderate
16
+ - id: cooccurrence-hype-cluster
17
+ priority: moderate
18
+ ---
19
+
20
+ 1. **unprompted-negation**: Fires on 'Not X, but Y' or 'This isn't about X — it's about Y' contrast shells when X was never claimed, expected, or implied in preceding context. Do not flag genuine corrections of a prior misconception established earlier in the text. Fix suggestion: drop the theatrical negation and state Y directly using existing facts.
21
+ 2. **hollow-transition**: Fires on zero-information macro preambles ('In an era defined by...', 'As technology continues to evolve...') or empty bridge sentences whose removal loses zero factual or causal content. Fix suggestion: remove the filler sentence and start directly on the concrete claim.
22
+ 3. **throat-clearing**: Fires on meta-announcements ('In this section, we will explore...', 'It is worth noting that...') when the heading or clause already establishes scope. Fix suggestion: strip the meta-announcement prefix and keep the core statement.
23
+ 4. **moralizing-closer**: Fires on preachy or promotional closing sentences ('Ultimately, this journey underscores...', 'Looking ahead, the future is bright...') that add no concrete conclusion or next step. Fix suggestion: remove the closing slogan or end on the last substantive point.
24
+ 5. **rhetorical-self-qa**: Fires on mechanical assistant self-Q&A transitions ('Why does this matter? Because...'). Do not flag genuine open research questions in specs or essays. Fix suggestion: merge the artificial question-and-answer pair into a single direct statement.
25
+ 6. **stealth-vapor**: Fires on whole paragraphs of smooth, cliché-free prose that contain zero concrete nouns, numbers, files, commands, mechanisms, or verifiable actors (e.g., generic advice about 'clear communication across cross-functional workflows'). Do not flag concrete technical explanations, personal narrative scenes, or deliberate authorial humor. Fix suggestion: ask the author to replace the paragraph with one concrete mechanism, constraint, or example, or cut it.
26
+ 7. **cooccurrence-hype-cluster**: Fires when a single sentence or paragraph chains 3 or more generic AI hype verbs/nouns ('leverage', 'streamline', 'seamlessly', 'elevate', 'harness', 'scalable telemetry', 'unlock potential') without naming a specific change or threshold. Do not flag grounded sentences mentioning a single technical verb. Fix suggestion: rewrite around the concrete input, mechanism, and measured effect.
@@ -0,0 +1,290 @@
1
+ import { definePackScripts, maskInlineCode } from "dislop/sdk";
2
+
3
+ const PURE_FILLER_SENTENCES = [
4
+ /^In today's (?:fast-paced|rapidly evolving|ever-changing|modern|digital) [^.!?\n]{2,120}[.!?]$/i,
5
+ /^In conclusion,\s+(?:this|it) (?:represents|marks|is) a (?:significant|major|pivotal|exciting) (?:step forward|milestone|leap forward)[.!?]$/i,
6
+ /^Looking ahead,\s+the possibilities are (?:truly )?(?:endless|limitless|boundless)[.!?]$/i,
7
+ ];
8
+
9
+ const THROAT_CLEARING_PREFIXES = [
10
+ {
11
+ re: /^(?:It is (?:worth noting|important to note|essential to remember|crucial to understand) that\s+)/i,
12
+ label: "throat-clearing opener",
13
+ },
14
+ {
15
+ re: /^(?:Needless to say,\s+|As you may already know,\s+|At the end of the day,\s+)/i,
16
+ label: "filler preamble",
17
+ },
18
+ ];
19
+
20
+ const STANDALONE_SELF_QA_RE =
21
+ /^(?:Why does this matter\?|What does this mean(?: in practice| for you)?\?|Here(?:'s| is) the kicker:|The (?:result|bottom line|catch)\?)$/i;
22
+
23
+ const INLINE_SELF_QA_PREFIX_RE =
24
+ /^(?:Why does this matter\?|What does this mean(?: in practice)?\?|The (?:result|bottom line|catch)\?|(?:And )?[Ss]imply put,|The answer is simple\s*[:—-])\s+/i;
25
+
26
+ const SINGLE_SEG_SELF_QA_RE =
27
+ /^Why (?:does|do|is|are) [^?\n]{4,80}\?\s+Because\s+(.+)$/i;
28
+
29
+ const MORALIZING_CLOSER_EN_RE =
30
+ /^(?:Ultimately|At the end of the day|In the final analysis),\s+(?:this|it) (?:serves as a |stands as a |is a |reminds us )?(?:powerful |quiet |timeless )?(?:reminder|testament|lesson|that )[\s\S]*[.!]$/i;
31
+
32
+ const STACCATO_SHORT_SENT_RE = /^[A-Z][a-z]{1,14}(?:\s+[a-z]{2,12}){1,2}[.!]$/;
33
+
34
+ const SECOND_ORDER_SLOGAN_RE =
35
+ /\b(?:isn't|is not) (?:just|merely|simply)\b[\s\S]{1,50}\bit(?:'s| is)\b|\b(?:game-changer|testament to)\b/i;
36
+
37
+ function capitalizeFirst(str) {
38
+ if (!str) return str;
39
+ return str[0].toUpperCase() + str.slice(1);
40
+ }
41
+
42
+ export default definePackScripts({
43
+ check(doc, ctx) {
44
+ let consecutiveBoldListItems = 0;
45
+ let boldWallAnchorSeg = null;
46
+ let staccatoRun = [];
47
+
48
+ const flushStaccatoRun = () => {
49
+ if (staccatoRun.length >= 3) {
50
+ const anchor = staccatoRun[0];
51
+ ctx.reportSuggestion({
52
+ ruleId: "staccato-slogan-run",
53
+ priority: "hint",
54
+ fixSafety: "manual",
55
+ actionType: "prompt",
56
+ targetId: anchor.id,
57
+ line: anchor.line,
58
+ originalQuote: staccatoRun.map((s) => s.text).join(" "),
59
+ reason: `${staccatoRun.length} consecutive 2-to-3-word punchy sentences create a stock AI slogan cadence.`,
60
+ rewritePrompt: "Merge or expand the staccato clauses into varied, concrete prose.",
61
+ });
62
+ }
63
+ staccatoRun = [];
64
+ };
65
+
66
+ for (const seg of doc.segments) {
67
+ const text = seg.text.trim();
68
+ const masked = maskInlineCode(text);
69
+ const isHeading = seg.blockKind === "heading";
70
+
71
+ if (!isHeading && staccatoRun.length > 0 && staccatoRun[0].paragraphId !== seg.paragraphId) {
72
+ flushStaccatoRun();
73
+ }
74
+ if (!isHeading && text.length <= 24 && STACCATO_SHORT_SENT_RE.test(masked)) {
75
+ staccatoRun.push(seg);
76
+ } else {
77
+ flushStaccatoRun();
78
+ }
79
+
80
+ if (!isHeading && PURE_FILLER_SENTENCES.some((re) => re.test(masked))) {
81
+ ctx.reportSuggestion({
82
+ ruleId: "hollow-transition",
83
+ priority: "strong",
84
+ fixSafety: "safe",
85
+ actionType: "delete",
86
+ targetId: seg.id,
87
+ line: seg.line,
88
+ originalQuote: seg.text,
89
+ suggestedReplacement: "",
90
+ reason:
91
+ "Zero-information macro filler sentence; deleting it preserves all factual claims and causal links.",
92
+ });
93
+ continue;
94
+ }
95
+
96
+ if (!isHeading) {
97
+ for (const { re, label } of THROAT_CLEARING_PREFIXES) {
98
+ const m = masked.match(re);
99
+ if (m && text.length > m[0].length + 8) {
100
+ const remainder = capitalizeFirst(text.slice(m[0].length));
101
+ ctx.reportSuggestion({
102
+ ruleId: "throat-clearing",
103
+ priority: "strong",
104
+ fixSafety: "safe",
105
+ actionType: "replace",
106
+ targetId: seg.id,
107
+ line: seg.line,
108
+ originalQuote: seg.text,
109
+ suggestedReplacement: remainder,
110
+ reason: `Removes zero-information ${label} so the sentence opens directly on the claim.`,
111
+ });
112
+ break;
113
+ }
114
+ }
115
+ }
116
+
117
+ if (!isHeading && STANDALONE_SELF_QA_RE.test(masked)) {
118
+ ctx.reportSuggestion({
119
+ ruleId: "rhetorical-self-qa",
120
+ priority: "moderate",
121
+ fixSafety: "review",
122
+ actionType: "delete",
123
+ targetId: seg.id,
124
+ line: seg.line,
125
+ originalQuote: seg.text,
126
+ suggestedReplacement: "",
127
+ reason: "Removes mechanical assistant rhetorical bridge question so the answer states the point directly.",
128
+ });
129
+ continue;
130
+ }
131
+
132
+ if (!isHeading && INLINE_SELF_QA_PREFIX_RE.test(masked)) {
133
+ ctx.reportSuggestion({
134
+ ruleId: "rhetorical-self-qa",
135
+ priority: "moderate",
136
+ fixSafety: "review",
137
+ actionType: "replace",
138
+ targetId: seg.id,
139
+ line: seg.line,
140
+ originalQuote: seg.text,
141
+ suggestedReplacement: capitalizeFirst(text.replace(INLINE_SELF_QA_PREFIX_RE, "")),
142
+ reason: "Replaces mechanical assistant self-Q&A transition with a direct statement.",
143
+ });
144
+ } else if (!isHeading) {
145
+ const singleQa = masked.match(SINGLE_SEG_SELF_QA_RE);
146
+ if (singleQa) {
147
+ const rhsStart = masked.length - singleQa[1].length;
148
+ ctx.reportSuggestion({
149
+ ruleId: "rhetorical-self-qa",
150
+ priority: "moderate",
151
+ fixSafety: "review",
152
+ actionType: "replace",
153
+ targetId: seg.id,
154
+ line: seg.line,
155
+ originalQuote: seg.text,
156
+ suggestedReplacement: capitalizeFirst(text.slice(rhsStart)),
157
+ reason: "Replaces artificial self-Q&A sentence with a direct statement.",
158
+ });
159
+ } else if (/^Why\s+(?:does|do|is|are)\b[^?\n]{4,80}\?$/i.test(masked)) {
160
+ const segIdx = doc.segments.indexOf(seg);
161
+ const nextSeg = segIdx !== -1 ? doc.segments[segIdx + 1] : null;
162
+ if (nextSeg && nextSeg.paragraphId === seg.paragraphId && /^Because\s+/i.test(nextSeg.text.trim())) {
163
+ ctx.reportSuggestion({
164
+ ruleId: "rhetorical-self-qa",
165
+ priority: "moderate",
166
+ fixSafety: "review",
167
+ actionType: "delete",
168
+ targetId: seg.id,
169
+ line: seg.line,
170
+ originalQuote: seg.text,
171
+ suggestedReplacement: "",
172
+ reason: "Removes mechanical self-Q&A prompt before 'Because...' so the claim states the answer directly.",
173
+ });
174
+ }
175
+ }
176
+ }
177
+
178
+ const pivotMatch = masked.match(
179
+ /^(?:This|It) (?:isn't|is not|wasn't|was not) (?:just|merely|simply) [^—–,;]{2,60}(?:—|–|--|,\s*(?:but(?:\s+rather)?\s+|it(?:'s| is| was)\s+))(.+)$/i,
180
+ );
181
+ if (pivotMatch) {
182
+ const rhsStart = masked.length - pivotMatch[1].length;
183
+ const rhsRaw = text.slice(rhsStart).trim();
184
+ const isPast = /\bwas(?:n't|\s+not)\b/i.test(masked.slice(0, rhsStart));
185
+ const direct = /^(?:a|an|the)\b/i.test(rhsRaw)
186
+ ? `${isPast ? "It was" : "It is"} ${rhsRaw}`
187
+ : /^it(?:'s|\u2019s)\s+/i.test(rhsRaw)
188
+ ? `It is ${rhsRaw.replace(/^it(?:'s|\u2019s)\s+/i, "")}`
189
+ : /^it\s+was\s+/i.test(rhsRaw)
190
+ ? `It was ${rhsRaw.replace(/^it\s+was\s+/i, "")}`
191
+ : capitalizeFirst(rhsRaw);
192
+ ctx.reportSuggestion({
193
+ ruleId: "unprompted-negation",
194
+ priority: "strong",
195
+ fixSafety: "review",
196
+ actionType: "replace",
197
+ targetId: seg.id,
198
+ line: seg.line,
199
+ originalQuote: seg.text,
200
+ suggestedReplacement: direct,
201
+ reason:
202
+ "Formulaic 'Not just X — it's Y' contrast shell; state the actual point directly without theatrical negation.",
203
+ });
204
+ } else {
205
+ const subjPivot = masked.match(
206
+ /^[A-Z][^.!?]{2,50}\s+(?:isn't|is not|wasn't|was not) (?:just|merely|simply) a [^—–,;]{2,40}(?:—|–|--|,\s*(?:but\s+)?)\s*it(?:'s| is| was)\s+(.+)$/i,
207
+ );
208
+ if (subjPivot) {
209
+ ctx.reportSuggestion({
210
+ ruleId: "unprompted-negation",
211
+ priority: "strong",
212
+ fixSafety: "manual",
213
+ actionType: "prompt",
214
+ targetId: seg.id,
215
+ line: seg.line,
216
+ originalQuote: seg.text,
217
+ reason:
218
+ "Formulaic 'X wasn't just A — it was B' aphorism pivot; rewrite directly around concrete details.",
219
+ rewritePrompt: "Drop the 'wasn't just' contrast shell and state what the object or event actually did.",
220
+ });
221
+ }
222
+ }
223
+
224
+ if (!isHeading && MORALIZING_CLOSER_EN_RE.test(masked)) {
225
+ ctx.reportSuggestion({
226
+ ruleId: "moralizing-closer",
227
+ priority: "moderate",
228
+ fixSafety: "review",
229
+ actionType: "delete",
230
+ targetId: seg.id,
231
+ line: seg.line,
232
+ originalQuote: seg.text,
233
+ suggestedReplacement: "",
234
+ reason: "Preachy summary closer adds no concrete takeaway or next step.",
235
+ });
236
+ }
237
+
238
+ const emDashCount = (masked.match(/\u2014/g) || []).length;
239
+ if (emDashCount >= 3) {
240
+ ctx.reportSuggestion({
241
+ ruleId: "excessive-em-dash",
242
+ priority: "hint",
243
+ fixSafety: "manual",
244
+ actionType: "prompt",
245
+ targetId: seg.id,
246
+ line: seg.line,
247
+ originalQuote: seg.text,
248
+ reason: `Single sentence packs ${emDashCount} em-dashes, fragmenting flow.`,
249
+ rewritePrompt: "Split parenthetical em-dash chains into separate direct sentences or commas.",
250
+ });
251
+ }
252
+
253
+ if (seg.id.endsWith("-S1") && (seg.blockKind === "list-item" || !seg.blockKind)) {
254
+ if (/^\*\*[^*\n]{2,40}\*\*\s*[:—-]/.test(text)) {
255
+ consecutiveBoldListItems += 1;
256
+ if (consecutiveBoldListItems === 1) boldWallAnchorSeg = seg;
257
+ if (consecutiveBoldListItems === 4 && boldWallAnchorSeg) {
258
+ ctx.reportSuggestion({
259
+ ruleId: "bold-lead-list-wall",
260
+ priority: "hint",
261
+ fixSafety: "manual",
262
+ actionType: "prompt",
263
+ targetId: boldWallAnchorSeg.id,
264
+ line: boldWallAnchorSeg.line,
265
+ originalQuote: boldWallAnchorSeg.text,
266
+ reason:
267
+ "Four or more consecutive '**Label**: description' list items create a mechanical assistant list wall.",
268
+ rewritePrompt:
269
+ "Convert uniform bold-lead bullets into direct sentences or plain list items without bold title prefixes.",
270
+ });
271
+ }
272
+ } else {
273
+ consecutiveBoldListItems = 0;
274
+ boldWallAnchorSeg = null;
275
+ }
276
+ }
277
+ }
278
+ flushStaccatoRun();
279
+ },
280
+
281
+ verifyFix(_issue, candidateText) {
282
+ if (candidateText && SECOND_ORDER_SLOGAN_RE.test(candidateText)) {
283
+ return {
284
+ ok: false,
285
+ reason: "Replacement introduced a second-order AI slogan ('not just X, it's Y' / 'game-changer').",
286
+ };
287
+ }
288
+ return { ok: true };
289
+ },
290
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "en/slide-deck",
3
+ "version": "1.0.0",
4
+ "description": "English presentation and slide-deck anti-slop pack (deterministic scripts + prompt-based audit): leaked visual/speaker-note prompts, buzzword slide titles, pasted prose dumps, and unanchored comparisons.",
5
+ "languages": ["en"],
6
+ "formats": ["pptx", "pdf"]
7
+ }
@@ -0,0 +1,17 @@
1
+ ---
2
+ roleHint: "Scope: English executive and technical presentation slides (slides detected: {{slideCount}})."
3
+ rules:
4
+ - id: vague-slide-headline
5
+ priority: strong
6
+ - id: slide-prose-dump
7
+ priority: strong
8
+ - id: bullet-stem-padding
9
+ priority: moderate
10
+ - id: unanchored-slide-multiplier
11
+ priority: moderate
12
+ ---
13
+
14
+ 1. **vague-slide-headline**: Fires when a content slide's bullets state a clear metric outcome or decision while its slide title is a generic topic bucket or slogan ('Overview', 'Charting Our Future', 'Performance Deep Dive'). Do not flag cover slides or section dividers. Fix suggestion: summarize the slide's primary factual takeaway in the headline.
15
+ 2. **slide-prose-dump**: Fires on multi-sentence narrative report paragraphs pasted verbatim onto slide canvases where conversational filler obscures scannability. Fix suggestion: condense filler clauses into concise takeaway lines while keeping all numbers, units, entities, and qualifiers intact.
16
+ 3. **bullet-stem-padding**: Fires when multiple bullets on a slide open with repetitive gerund filler stems ('Leveraging X to...', 'Empowering teams to...', 'Fostering a culture of...'). Fix suggestion: start bullets directly with the concrete action or metric.
17
+ 4. **unanchored-slide-multiplier**: Fires on bare multipliers or comparative claims on slides ('5x faster', 'dramatic cost reduction') lacking a baseline or timeframe on the slide. Fix suggestion: add the comparison baseline and measurement window.
@@ -0,0 +1,81 @@
1
+ import { definePackScripts, maskInlineCode } from "dislop/sdk";
2
+
3
+ const EN_LEAKED_SLIDE_DIRECTIVE_RE =
4
+ /^(?:\[(?:Slide\s+\d+|Visual|Image(?:\s+suggestion)?|Chart|Diagram|Speaker\s+Notes?)\s*:[^\]]*\]|Speaker Notes:\s+)/i;
5
+
6
+ const EN_BUZZWORD_SLIDE_HEADLINE_RE =
7
+ /^(?:Unlocking Synergies|Charting the Path Forward|Navigating the (?:Evolving )?Landscape|A Holistic (?:Overview|Ecosystem)|Key Pillars of (?:Success|Excellence)|Driving Impactful Transformation)$/i;
8
+
9
+ const EN_CLOSING_SLOGAN_RE =
10
+ /^(?:Together,\s*Let's Shape the Future|Let's Build Tomorrow,?\s*Today|The Future Starts Now)[.!]?$/i;
11
+
12
+ const EN_SLIDE_REGRESSION_RE =
13
+ /\b(?:synergies|game-changer|paradigm shift|holistic ecosystem|unlocking)\b/i;
14
+
15
+ export default definePackScripts({
16
+ check(doc, ctx) {
17
+ for (const seg of doc.segments) {
18
+ const text = seg.text.trim();
19
+ const masked = maskInlineCode(text);
20
+
21
+ if (EN_LEAKED_SLIDE_DIRECTIVE_RE.test(masked)) {
22
+ ctx.reportDefect({
23
+ ruleId: "leaked-slide-directive",
24
+ severity: "error",
25
+ targetId: seg.id,
26
+ line: seg.line,
27
+ originalQuote: seg.text,
28
+ fixSafety: "manual",
29
+ actionType: "prompt",
30
+ reason:
31
+ "AI slide-generator stage direction or speaker-note prefix leaked onto visible slide canvas.",
32
+ rewritePrompt:
33
+ "Move speaker notes into the presentation notes pane and replace '[Visual: ...]' directives with the actual figure.",
34
+ });
35
+ continue;
36
+ }
37
+
38
+ if (EN_BUZZWORD_SLIDE_HEADLINE_RE.test(masked)) {
39
+ ctx.reportSuggestion({
40
+ ruleId: "buzzword-slide-headline",
41
+ priority: "moderate",
42
+ fixSafety: "manual",
43
+ actionType: "prompt",
44
+ targetId: seg.id,
45
+ line: seg.line,
46
+ originalQuote: seg.text,
47
+ reason:
48
+ "Formulaic executive-deck buzzword title carries zero takeaway information.",
49
+ rewritePrompt:
50
+ "Replace with a concrete takeaway headline summarizing the slide's main finding: [metric or decision takeaway]",
51
+ });
52
+ }
53
+
54
+ if (EN_CLOSING_SLOGAN_RE.test(masked)) {
55
+ ctx.reportSuggestion({
56
+ ruleId: "closing-slide-slogan",
57
+ priority: "hint",
58
+ fixSafety: "safe",
59
+ actionType: "delete",
60
+ targetId: seg.id,
61
+ line: seg.line,
62
+ originalQuote: seg.text,
63
+ suggestedReplacement: "",
64
+ reason:
65
+ "Stock AI closing-slide slogan; safe to delete in favor of concrete next steps or Q&A contact details.",
66
+ });
67
+ }
68
+ }
69
+ },
70
+
71
+ verifyFix(_issue, candidateText) {
72
+ if (candidateText && EN_SLIDE_REGRESSION_RE.test(candidateText)) {
73
+ return {
74
+ ok: false,
75
+ reason:
76
+ "Slide edit introduced executive buzzword filler ('synergies' / 'paradigm shift' / 'unlocking').",
77
+ };
78
+ }
79
+ return { ok: true };
80
+ },
81
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "en/web-ui",
3
+ "version": "1.0.0",
4
+ "description": "English web UI and landing-page anti-slop pack (deterministic scripts + prompt-based audit): scaffold dummy strings, prompt-echo hero hype, redundant card subcopy, verbose CTAs, and synthetic social proof.",
5
+ "languages": ["en"],
6
+ "formats": ["html", "jsx", "tsx", "svg"]
7
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ roleHint: "Scope: English web UI microcopy, hero headlines, CTA labels, and landing-page social proof."
3
+ rules:
4
+ - id: prompt-echo-copy
5
+ priority: strong
6
+ - id: redundant-feature-card-echo
7
+ priority: moderate
8
+ - id: verbose-cta-label
9
+ priority: moderate
10
+ - id: synthetic-social-proof
11
+ priority: moderate
12
+ - id: emoji-feature-grid
13
+ priority: hint
14
+ ---
15
+
16
+ 1. **prompt-echo-copy**: Fires on hero headlines, badges, or subheadings built around generic AI marketing hype ('Supercharge', 'Unleash', 'Next-Gen AI', 'Effortless') rather than naming what the product actually does. Fix suggestion: state the concrete user action, input/output, or product capability directly.
17
+ 2. **redundant-feature-card-echo**: Fires when a feature card description merely paraphrases its own card heading with filler adverbs (e.g., Heading 'Instant Sync' followed by 'Seamlessly sync your data instantly across workflows'). Fix suggestion: state the specific mechanism, supported integrations, or operational limit instead of repeating the heading.
18
+ 3. **verbose-cta-label**: Fires on wordy, conversational button or link labels ('Click Here to Get Started on Your Journey Today') that overflow compact UI slots. Fix suggestion: replace with a concise 2-to-4 word verb-object label matching the destination ('Start free trial', 'Read docs').
19
+ 4. **synthetic-social-proof**: Fires on unattributed generic praise quotes or stock 'Trusted by 10,000+ forward-thinking teams' claims when no real customer name or source appears. Fix suggestion: provide an attributed customer quote or verified metric, or remove the block.
20
+ 5. **emoji-feature-grid**: Fires when feature card headings or navigation links rely on decorative leading emojis in place of clean typography or a unified icon set. Fix suggestion: remove the leading decorative emojis.
@@ -0,0 +1,103 @@
1
+ import { definePackScripts, maskInlineCode } from "dislop/sdk";
2
+
3
+ const EN_PLACEHOLDER_UI_COPY =
4
+ /^(?:Card Title|Feature (?:One|Two|Three|Title)|Short description goes here\.?|Your tagline here\.?|Button Text|Enter your text here\.?)$/i;
5
+
6
+ const EN_PROMPT_ECHO_HERO_RE =
7
+ /\b(?:AI-Powered|Next-Gen(?:eration)? AI)\b|(?:^(?:Supercharge|Unleash|Revolutionize) Your (?:Workflow|Productivity|Business)\b)/i;
8
+
9
+ const LEADING_EMOJI_RE = /^[\u{1F300}-\u{1FAFF}\u2600-\u27BF]\uFE0F?\s+[A-Z]/u;
10
+
11
+ const EN_FAKE_TESTIMONIAL_RE =
12
+ /\bcompletely transformed how our team (?:works|operates|collaborates)\b/i;
13
+
14
+ const EN_UI_SLOGAN_REGRESSION_RE =
15
+ /\b(?:supercharge|unleash|next-gen|game-changer|revolutionize|seamless(?:ly)?)\b/i;
16
+
17
+ export default definePackScripts({
18
+ check(doc, ctx) {
19
+ const emojiPrefixedSegs = [];
20
+
21
+ for (const seg of doc.segments) {
22
+ const text = seg.text.trim();
23
+ const masked = maskInlineCode(text);
24
+
25
+ if (EN_PLACEHOLDER_UI_COPY.test(masked)) {
26
+ ctx.reportDefect({
27
+ ruleId: "placeholder-ui-copy",
28
+ severity: "error",
29
+ targetId: seg.id,
30
+ line: seg.line,
31
+ originalQuote: seg.text,
32
+ fixSafety: "manual",
33
+ actionType: "prompt",
34
+ reason: "Unreplaced English UI scaffold label left inside rendered markup.",
35
+ rewritePrompt: `Replace '${seg.text}' with real product copy or remove the placeholder element.`,
36
+ });
37
+ continue;
38
+ }
39
+
40
+ if (EN_PROMPT_ECHO_HERO_RE.test(masked)) {
41
+ ctx.reportSuggestion({
42
+ ruleId: "prompt-echo-copy",
43
+ priority: "moderate",
44
+ fixSafety: "manual",
45
+ actionType: "prompt",
46
+ targetId: seg.id,
47
+ line: seg.line,
48
+ originalQuote: seg.text,
49
+ reason:
50
+ "Stock 'AI-Powered / Supercharge Your Workflow' copy echoes the generation prompt instead of stating what the product actually does.",
51
+ rewritePrompt:
52
+ "State the concrete user task, input/output, or workflow speed-up directly: [specific product capability]",
53
+ });
54
+ }
55
+
56
+ if (EN_FAKE_TESTIMONIAL_RE.test(masked)) {
57
+ ctx.reportSuggestion({
58
+ ruleId: "synthetic-testimonial-cliche",
59
+ priority: "moderate",
60
+ fixSafety: "manual",
61
+ actionType: "prompt",
62
+ targetId: seg.id,
63
+ line: seg.line,
64
+ originalQuote: seg.text,
65
+ reason: "Generic AI-generated testimonial phrasing signals synthetic social proof.",
66
+ rewritePrompt:
67
+ "Use a real attributed quote with a concrete outcome, or remove the synthetic testimonial block.",
68
+ });
69
+ }
70
+
71
+ if (LEADING_EMOJI_RE.test(text) && text.length <= 60) {
72
+ emojiPrefixedSegs.push(seg);
73
+ }
74
+ }
75
+
76
+ if (emojiPrefixedSegs.length >= 3) {
77
+ const first = emojiPrefixedSegs[0];
78
+ ctx.reportSuggestion({
79
+ ruleId: "emoji-feature-grid",
80
+ priority: "hint",
81
+ fixSafety: "manual",
82
+ actionType: "prompt",
83
+ targetId: first.id,
84
+ line: first.line,
85
+ originalQuote: first.text,
86
+ reason: `${emojiPrefixedSegs.length} UI headings/labels start with decorative emojis, a common AI component-generator pattern.`,
87
+ rewritePrompt:
88
+ "Strip leading decorative emojis from card headings or replace them with consistent SVG icons.",
89
+ });
90
+ }
91
+ },
92
+
93
+ verifyFix(_issue, candidateText) {
94
+ if (candidateText && EN_UI_SLOGAN_REGRESSION_RE.test(candidateText)) {
95
+ return {
96
+ ok: false,
97
+ reason:
98
+ "UI copy replacement introduced generic AI marketing hype ('supercharge' / 'unleash' / 'next-gen' / 'seamless').",
99
+ };
100
+ }
101
+ return { ok: true };
102
+ },
103
+ });
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "zh/artifact-qa",
3
+ "version": "1.0.0",
4
+ "description": "中文交付残留硬伤与隐性交差话术检查(确定性脚本 + 提示词语义审计):括号占位符、助手寒暄壳、伪装成正文的待办指令及未删备选稿。",
5
+ "languages": ["zh"]
6
+ }