dislop 0.9.1 → 1.1.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.
- package/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +7 -8
- package/.cursor-plugin/plugin.json +2 -3
- package/.pre-commit-hooks.yaml +5 -12
- package/PRODUCT.md +19 -63
- package/README.md +358 -249
- package/README.zh-CN.md +391 -237
- package/action.yml +30 -39
- package/bin/dislop-mcp.mjs +3 -4
- package/bin/dislop.mjs +4 -4594
- package/gemini-extension.json +2 -2
- package/llms-install.md +68 -0
- package/package.json +17 -63
- package/packs/common/artifact-qa/pack.json +5 -0
- package/packs/common/artifact-qa/prompts/rules.md +11 -0
- package/packs/common/artifact-qa/scripts/index.mjs +235 -0
- package/packs/common/slide-deck/pack.json +6 -0
- package/packs/common/slide-deck/prompts/rules.md +11 -0
- package/packs/common/slide-deck/scripts/index.mjs +62 -0
- package/packs/common/web-ui/pack.json +6 -0
- package/packs/common/web-ui/prompts/rules.md +11 -0
- package/packs/common/web-ui/scripts/index.mjs +80 -0
- package/packs/en/artifact-qa/pack.json +6 -0
- package/packs/en/artifact-qa/prompts/rules.md +14 -0
- package/packs/en/artifact-qa/scripts/index.mjs +90 -0
- package/packs/en/prose/pack.json +7 -0
- package/packs/en/prose/prompts/rules.md +26 -0
- package/packs/en/prose/scripts/index.mjs +293 -0
- package/packs/en/slide-deck/pack.json +7 -0
- package/packs/en/slide-deck/prompts/rules.md +17 -0
- package/packs/en/slide-deck/scripts/index.mjs +81 -0
- package/packs/en/web-ui/pack.json +7 -0
- package/packs/en/web-ui/prompts/rules.md +20 -0
- package/packs/en/web-ui/scripts/index.mjs +103 -0
- package/packs/zh/artifact-qa/pack.json +6 -0
- package/packs/zh/artifact-qa/prompts/rules.md +14 -0
- package/packs/zh/artifact-qa/scripts/index.mjs +89 -0
- package/packs/zh/prose/pack.json +7 -0
- package/packs/zh/prose/prompts/rules.md +26 -0
- package/packs/zh/prose/scripts/index.mjs +305 -0
- package/packs/zh/slide-deck/pack.json +7 -0
- package/packs/zh/slide-deck/prompts/rules.md +17 -0
- package/packs/zh/slide-deck/scripts/index.mjs +75 -0
- package/packs/zh/web-ui/pack.json +7 -0
- package/packs/zh/web-ui/prompts/rules.md +20 -0
- package/packs/zh/web-ui/scripts/index.mjs +98 -0
- package/plugin.json +5 -6
- package/server.json +2 -2
- package/skills/deslop-docs/SKILL.md +10 -8
- package/skills/deslop-slides-docx/SKILL.md +7 -8
- package/skills/deslop-verify/SKILL.md +7 -8
- package/skills/deslop-web-ui/SKILL.md +7 -8
- package/skills/dislop/SKILL.md +16 -28
- package/skills/dislop/agents/openai.yaml +1 -1
- package/skills/dislop/references/essay.md +6 -6
- package/skills/dislop/references/essay.zh-CN.md +6 -6
- package/skills/dislop/references/office.md +5 -5
- package/skills/dislop/references/office.zh-CN.md +5 -5
- package/skills/dislop/references/web-ui.md +4 -4
- package/skills/dislop/references/web-ui.zh-CN.md +4 -4
- package/skills/dislop/references/work-docs.md +7 -7
- package/skills/dislop/references/work-docs.zh-CN.md +7 -7
- package/src/cli-main.mjs +292 -0
- package/src/commands/check-fix.mjs +324 -0
- package/src/commands/doctor.mjs +132 -0
- package/src/commands/init.mjs +55 -0
- package/src/commands/login.mjs +82 -0
- package/src/commands/model.mjs +130 -0
- package/src/commands/packs.mjs +81 -0
- package/src/commands/verify.mjs +165 -0
- package/src/commands/voice.mjs +84 -0
- package/src/commands/worklog.mjs +424 -0
- package/src/kernel/config.mjs +759 -0
- package/src/kernel/document-model.mjs +1432 -0
- package/src/kernel/fact-gate.mjs +775 -0
- package/src/kernel/file-discovery.mjs +296 -0
- package/src/{binary-node.mjs → kernel/ooxml-binary.mjs} +615 -890
- package/src/kernel/pack-loader.mjs +801 -0
- package/src/kernel/pack-validator.mjs +491 -0
- package/src/kernel/patcher.mjs +471 -0
- package/src/kernel/pipeline.mjs +530 -0
- package/src/kernel/prompt-assembler.mjs +336 -0
- package/src/kernel/version.mjs +7 -0
- package/src/kernel/voice-profile.mjs +180 -0
- package/src/mcp/stdio-server.mjs +442 -0
- package/src/runners/auto-fix.mjs +74 -0
- package/src/runners/interactive-tty.mjs +488 -0
- package/src/runners/reporters.mjs +272 -0
- package/src/runtime/chunker.mjs +87 -0
- package/src/runtime/json-extract.mjs +144 -0
- package/src/runtime/privacy-gate.mjs +97 -0
- package/src/runtime/providers/anthropic.mjs +65 -0
- package/src/runtime/providers/cloud.mjs +138 -0
- package/src/runtime/providers/gemini.mjs +91 -0
- package/src/runtime/providers/local-model.mjs +147 -0
- package/src/runtime/providers/openai-compat.mjs +130 -0
- package/src/runtime/router.mjs +324 -0
- package/src/runtime/worklog.mjs +904 -0
- package/src/sdk/index.mjs +137 -0
- package/models/manifest.json +0 -90
- package/models/pocket-slop-v1.json +0 -1
- package/packs/business-brief/pack.json +0 -937
- package/packs/core/pack.json +0 -209
- package/packs/deck-and-ui/pack.json +0 -539
- package/packs/engineering-spec/pack.json +0 -144
- package/packs/executive-deck/pack.json +0 -98
- package/packs/literary-essay/pack.json +0 -344
- package/packs/regulated-comms/pack.json +0 -99
- package/patterns/ai-tic-rubric.json +0 -252
- package/patterns/banks/composite-fusion.json +0 -48
- package/patterns/banks/discourse-rhythm.json +0 -95
- package/patterns/banks/lexical-signals.json +0 -92
- package/patterns/banks/syntactic-frames.json +0 -52
- package/patterns/banks/visual-deck.json +0 -44
- package/patterns/dimensions/artifacts.json +0 -121
- package/patterns/dimensions/discourse.json +0 -438
- package/patterns/dimensions/lexical.json +0 -198
- package/patterns/dimensions/rhythm.json +0 -258
- package/patterns/dimensions/syntactic.json +0 -285
- package/patterns/dimensions/visual-and-deck.json +0 -530
- package/patterns/taxonomy.json +0 -112
- package/src/core.mjs +0 -5497
- package/src/dislop/review-picker.vim +0 -114
- package/src/local-model.mjs +0 -997
- package/src/pattern-engine.mjs +0 -1003
- package/src/pocket-model.mjs +0 -729
- package/src/review-apply.mjs +0 -151
- package/src/review-client.mjs +0 -1073
package/gemini-extension.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dislop",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Cutting AI slop is real productivity.
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Cutting AI slop is real productivity. Pluggable editorial and artifact linter (11 modular Packs across docs, web UI, slides, and Office) via pure-doc Skill, offline CLI, local stdio MCP, and Official Cloud MCP.",
|
|
5
5
|
"mcpServers": {
|
|
6
6
|
"dislop": {
|
|
7
7
|
"httpUrl": "https://dislop.com/mcp"
|
package/llms-install.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Installing dislop for AI Coding Agents
|
|
2
|
+
|
|
3
|
+
Use this specification to install and verify `dislop` in Cline, Roo Code, Cursor, Claude Code, Codex, Antigravity, or Gemini CLI.
|
|
4
|
+
|
|
5
|
+
## 1. Remote Streamable HTTP MCP (No Local Dependencies)
|
|
6
|
+
|
|
7
|
+
Connect directly to the hosted MCP endpoint at `https://dislop.com/mcp` using OAuth 2.1 discovery at `https://dislop.com/.well-known/oauth-authorization-server`.
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"dislop": {
|
|
13
|
+
"type": "http",
|
|
14
|
+
"url": "https://dislop.com/mcp"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 2. Local Offline stdio MCP (Zero Network Uploads, Node.js 20+)
|
|
21
|
+
|
|
22
|
+
Run the micro-kernel locally over stdio when drafts cannot leave the machine (`dislop_check`, `dislop_fix_safe`, `dislop_verify`, and `dislop_packs`):
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"dislop": {
|
|
28
|
+
"command": "npx",
|
|
29
|
+
"args": ["--yes", "dislop-mcp"]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 3. Pure-Markdown Agent Skills
|
|
36
|
+
|
|
37
|
+
Install the router skill or individual workflow skills directly into agent skill directories:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx --yes skills add dislop-ai/dislop --skill dislop
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Focused workflow skills in `dislop-ai/dislop`:
|
|
44
|
+
|
|
45
|
+
- `deslop-docs`: Markdown docs, READMEs, RFCs, and release notes
|
|
46
|
+
- `deslop-slides-docx`: PowerPoint (`.pptx`), Word (`.docx`), PDF, and image deliverables
|
|
47
|
+
- `deslop-web-ui`: HTML, CSS, JSX, TSX, and SVG web interfaces
|
|
48
|
+
- `deslop-verify`: Fact preservation, direction-reversal, polarity, and anti-degradation checks against original text or git `HEAD`
|
|
49
|
+
|
|
50
|
+
## 4. Verify Installation
|
|
51
|
+
|
|
52
|
+
Run a local CLI check against any Markdown file:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx --yes dislop check README.md --no-llm --format agent
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Exit codes:
|
|
59
|
+
|
|
60
|
+
- `0`: Pass (zero unresolved `Defect: error` items; prose `Suggestion`s never fail CI)
|
|
61
|
+
- `1`: Unresolved `Defect: error` found (or Fact Gate failure in `dislop verify`)
|
|
62
|
+
- `2`: Invalid CLI arguments, configuration error, or unreadable file
|
|
63
|
+
|
|
64
|
+
For edits to an existing tracked file, verify that all numbers, units, URLs, code spans, proper nouns, and polarities survived:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx --yes dislop verify --git HEAD README.md
|
|
68
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dislop",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Pluggable Editorial & Artifact Linter (Node.js Micro-Kernel) — Dual-track Defect & Suggestion engine with local-first 3-Tier LLM routing, Fact Gate, interactive hunk review, and MCP.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://dislop.com",
|
|
7
7
|
"repository": {
|
|
@@ -16,38 +16,19 @@
|
|
|
16
16
|
"node": ">=20.0.0"
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
19
|
-
".": "./src/
|
|
20
|
-
"./
|
|
21
|
-
"./pattern-engine": "./src/pattern-engine.mjs",
|
|
22
|
-
"./pocket-model": "./src/pocket-model.mjs",
|
|
23
|
-
"./local-model": "./src/local-model.mjs",
|
|
24
|
-
"./binary-node": "./src/binary-node.mjs"
|
|
19
|
+
".": "./src/sdk/index.mjs",
|
|
20
|
+
"./sdk": "./src/sdk/index.mjs"
|
|
25
21
|
},
|
|
26
22
|
"bin": {
|
|
27
|
-
"dislop": "bin/dislop.mjs",
|
|
28
|
-
"dislop-mcp": "bin/dislop-mcp.mjs"
|
|
23
|
+
"dislop": "./bin/dislop.mjs",
|
|
24
|
+
"dislop-mcp": "./bin/dislop-mcp.mjs"
|
|
29
25
|
},
|
|
30
26
|
"scripts": {
|
|
31
|
-
"test": "node
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"bench": "node scripts/
|
|
35
|
-
"
|
|
36
|
-
"bench:skill": "node scripts/run_skill_benchmark.mjs --assert",
|
|
37
|
-
"bench:patterns": "node scripts/pattern_lab.mjs ablation",
|
|
38
|
-
"bench:visual": "node scripts/run_visual_benchmark.mjs",
|
|
39
|
-
"bench:visual:vlm": "node scripts/run_visual_vlm_bench.mjs",
|
|
40
|
-
"build:site": "node scripts/build_site.mjs",
|
|
41
|
-
"sync:manifests": "node scripts/sync_manifests.mjs",
|
|
42
|
-
"check:manifests": "node scripts/sync_manifests.mjs --check",
|
|
43
|
-
"release:check": "node scripts/release.mjs --check",
|
|
44
|
-
"release:status": "node scripts/release.mjs --status",
|
|
45
|
-
"release": "node scripts/release.mjs",
|
|
46
|
-
"dogfood": "node bin/dislop.mjs check . --fail-on warning && node bin/dislop.mjs check site/ --fail-on info && node scripts/media/audit_visual_assets.mjs --assert",
|
|
47
|
-
"media:render": "python3 scripts/media/render_gifs.py",
|
|
48
|
-
"media:verify": "python3 scripts/media/verify_demos.py",
|
|
49
|
-
"media:bench": "python3 scripts/media/bench_encoders.py",
|
|
50
|
-
"media:audit": "node scripts/media/audit_visual_assets.mjs --assert"
|
|
27
|
+
"test": "node --test tests/*.test.mjs",
|
|
28
|
+
"check:security": "node ./scripts/verify-packs-security.mjs",
|
|
29
|
+
"bench": "node ./scripts/run-benchmark.mjs",
|
|
30
|
+
"bench:assert": "node ./scripts/run-benchmark.mjs --assert",
|
|
31
|
+
"dogfood": "node ./bin/dislop.mjs check README.md README.zh-CN.md CONTRIBUTING.md PRODUCT.md AGENTS.md SECURITY.md CHANGELOG.md llms-install.md docs/architecture.md docs/brand-and-voice-guide.md docs/brand-and-voice-guide.zh-CN.md docs/MIGRATION-TODO.md benchmarks/README.md benchmarks/REPORT.md skills/ assets/*.svg .github/PULL_REQUEST_TEMPLATE.md --no-llm"
|
|
51
32
|
},
|
|
52
33
|
"files": [
|
|
53
34
|
".agents/plugins/marketplace.json",
|
|
@@ -61,21 +42,10 @@
|
|
|
61
42
|
"mcp.json",
|
|
62
43
|
"plugin.json",
|
|
63
44
|
"server.json",
|
|
45
|
+
"llms-install.md",
|
|
64
46
|
"bin/",
|
|
65
|
-
"src/
|
|
66
|
-
"src/review-client.mjs",
|
|
67
|
-
"src/review-apply.mjs",
|
|
68
|
-
"src/dislop/review-picker.vim",
|
|
69
|
-
"src/pattern-engine.mjs",
|
|
70
|
-
"src/pocket-model.mjs",
|
|
71
|
-
"src/local-model.mjs",
|
|
72
|
-
"src/binary-node.mjs",
|
|
73
|
-
"models/",
|
|
47
|
+
"src/",
|
|
74
48
|
"packs/",
|
|
75
|
-
"patterns/taxonomy.json",
|
|
76
|
-
"patterns/ai-tic-rubric.json",
|
|
77
|
-
"patterns/dimensions/",
|
|
78
|
-
"patterns/banks/",
|
|
79
49
|
"skills/",
|
|
80
50
|
"assets/logo.svg",
|
|
81
51
|
"README.md",
|
|
@@ -83,36 +53,20 @@
|
|
|
83
53
|
"PRODUCT.md",
|
|
84
54
|
"LICENSE"
|
|
85
55
|
],
|
|
56
|
+
"mcpName": "io.github.dislop-ai/dislop",
|
|
86
57
|
"keywords": [
|
|
87
58
|
"anti-slop",
|
|
88
59
|
"de-slop",
|
|
89
|
-
"deslop",
|
|
90
60
|
"ai-slop",
|
|
91
|
-
"ai-writing",
|
|
92
|
-
"humanizer",
|
|
93
61
|
"linter",
|
|
62
|
+
"editorial",
|
|
94
63
|
"proofreading",
|
|
95
|
-
"agent-skill",
|
|
96
|
-
"claude",
|
|
97
|
-
"claude-code",
|
|
98
|
-
"cline",
|
|
99
|
-
"codex",
|
|
100
|
-
"cursor",
|
|
101
|
-
"windsurf",
|
|
102
|
-
"llms-txt",
|
|
103
|
-
"mcp",
|
|
104
|
-
"mcp-server",
|
|
105
|
-
"model-context-protocol",
|
|
106
64
|
"markdown",
|
|
107
65
|
"docx",
|
|
108
66
|
"pptx",
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"editorial",
|
|
112
|
-
"typography",
|
|
113
|
-
"quality-gate"
|
|
67
|
+
"mcp",
|
|
68
|
+
"agent-skill"
|
|
114
69
|
],
|
|
115
|
-
"mcpName": "io.github.dislop-ai/dislop",
|
|
116
70
|
"publishConfig": {
|
|
117
71
|
"registry": "https://registry.npmjs.org/",
|
|
118
72
|
"access": "public"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
roleHint: "Scope: language-neutral pre-publication delivery residue."
|
|
3
|
+
rules:
|
|
4
|
+
- id: unchosen-draft-options
|
|
5
|
+
priority: strong
|
|
6
|
+
- id: meta-editing-note
|
|
7
|
+
priority: strong
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
1. **unchosen-draft-options**: Fires when inline text retains multiple mutually exclusive draft phrasings generated during brainstorming (e.g., 'Option A: ... / Option B: ...') where the author forgot to pick one. Do not flag genuine product comparison tables or documented user options. Fix suggestion: keep the single intended option and remove the remaining draft alternatives.
|
|
11
|
+
2. **meta-editing-note**: Fires on stray editorial commentary explaining how a passage was revised in response to a prompt (e.g., 'Note: I shortened paragraph two for clarity') that does not belong in the published document. Do not flag legitimate document footnotes or reader-facing caveats. Fix suggestion: remove the stray editorial meta-note.
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { definePackScripts, maskInlineCode } from "dislop/sdk";
|
|
4
|
+
|
|
5
|
+
const UNIVERSAL_PLACEHOLDER_PATTERNS = [
|
|
6
|
+
/\[(?:TODO|TBD|FIXME|XXX)(?:[:\s][^\][\n]{0,60})?\](?!\s*\()/i,
|
|
7
|
+
/\{\{\s*[A-Za-z_][A-Za-z0-9_.-]{0,40}\s*\}\}/,
|
|
8
|
+
/<INSERT_[A-Z0-9_]{1,40}>/,
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const CITATION_ARTIFACT_RE =
|
|
12
|
+
/(?::contentReference\[oaicite:\d+\](?:\{[^}]*\})?|\[(?:oaicite|turn\d+search\d+|citation):\s*[^\]]+\])/i;
|
|
13
|
+
|
|
14
|
+
const LOCAL_HOME_PATH_RE =
|
|
15
|
+
/(?:file:\/\/\/(?:Users|home|private\/var|[A-Za-z]:)[^\s)"'<>]*|\/(?:Users|home)\/[A-Za-z0-9._-]+\/[^\s)"'<>]*|[A-Za-z]:\\+Users\\[A-Za-z0-9._-]+\\+[^\s)"'<>]*)/;
|
|
16
|
+
|
|
17
|
+
function safeDecodeUriComponent(raw) {
|
|
18
|
+
try {
|
|
19
|
+
return decodeURIComponent(raw);
|
|
20
|
+
} catch {
|
|
21
|
+
return raw;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function isExternalOrSpecialScheme(url) {
|
|
26
|
+
return /^(?:[a-zA-Z][a-zA-Z0-9+.-]*:|\/\/)/.test(url);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function localTargetExists(docDir, cleanRel) {
|
|
30
|
+
const resolvedTarget = path.resolve(docDir, cleanRel);
|
|
31
|
+
const candidates = [
|
|
32
|
+
resolvedTarget,
|
|
33
|
+
`${resolvedTarget}.html`,
|
|
34
|
+
`${resolvedTarget}.md`,
|
|
35
|
+
path.join(resolvedTarget, "index.html"),
|
|
36
|
+
path.join(resolvedTarget, "index.md"),
|
|
37
|
+
];
|
|
38
|
+
if (candidates.some((c) => fs.existsSync(c))) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
for (const staticSubdir of ["site", "dist", "public"]) {
|
|
42
|
+
const altBase = path.resolve(docDir, "..", staticSubdir, cleanRel);
|
|
43
|
+
if (
|
|
44
|
+
fs.existsSync(altBase) ||
|
|
45
|
+
fs.existsSync(`${altBase}.html`) ||
|
|
46
|
+
fs.existsSync(path.join(altBase, "index.html"))
|
|
47
|
+
) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default definePackScripts({
|
|
55
|
+
check(doc, ctx) {
|
|
56
|
+
const isRenderedArtifact = ["html", "jsx", "tsx", "svg", "docx", "pptx", "pdf"].includes(
|
|
57
|
+
doc.format,
|
|
58
|
+
);
|
|
59
|
+
const reportedLeaks = new Set();
|
|
60
|
+
|
|
61
|
+
for (const seg of doc.segments) {
|
|
62
|
+
const proseOnly = maskInlineCode(seg.text);
|
|
63
|
+
|
|
64
|
+
for (const re of UNIVERSAL_PLACEHOLDER_PATTERNS) {
|
|
65
|
+
const m = proseOnly.match(re);
|
|
66
|
+
if (m) {
|
|
67
|
+
const hitQuote = seg.text.slice(m.index, m.index + m[0].length);
|
|
68
|
+
ctx.reportDefect({
|
|
69
|
+
ruleId: "unfilled-placeholder",
|
|
70
|
+
severity: "error",
|
|
71
|
+
targetId: seg.id,
|
|
72
|
+
line: seg.line,
|
|
73
|
+
originalQuote: hitQuote,
|
|
74
|
+
fixSafety: "manual",
|
|
75
|
+
actionType: "prompt",
|
|
76
|
+
reason: "Unfilled developer or template token left in deliverable.",
|
|
77
|
+
rewritePrompt: `Replace '${hitQuote}' with the real value before publishing, or remove the unfinished sentence.`,
|
|
78
|
+
});
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const citeMatch = proseOnly.match(CITATION_ARTIFACT_RE);
|
|
84
|
+
if (citeMatch) {
|
|
85
|
+
const hitQuote = seg.text.slice(citeMatch.index, citeMatch.index + citeMatch[0].length);
|
|
86
|
+
ctx.reportDefect({
|
|
87
|
+
ruleId: "chatbot-citation-leak",
|
|
88
|
+
severity: "error",
|
|
89
|
+
targetId: seg.id,
|
|
90
|
+
line: seg.line,
|
|
91
|
+
originalQuote: hitQuote,
|
|
92
|
+
fixSafety: "safe",
|
|
93
|
+
actionType: "delete",
|
|
94
|
+
suggestedReplacement: "",
|
|
95
|
+
reason: "Internal AI search/citation token leaked into output text.",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const docDir = doc.filePath ? path.dirname(path.resolve(ctx.cwd, doc.filePath)) : ctx.cwd;
|
|
101
|
+
for (const link of doc.artifacts.links || []) {
|
|
102
|
+
const url = String(link.url || "").trim();
|
|
103
|
+
|
|
104
|
+
if (url === "") {
|
|
105
|
+
ctx.reportDefect({
|
|
106
|
+
ruleId: "empty-link-target",
|
|
107
|
+
severity: "error",
|
|
108
|
+
targetId: link.segmentId || null,
|
|
109
|
+
line: link.line,
|
|
110
|
+
originalQuote: link.raw || link.url,
|
|
111
|
+
fixSafety: "manual",
|
|
112
|
+
actionType: "prompt",
|
|
113
|
+
reason: "Link has an empty destination URL.",
|
|
114
|
+
rewritePrompt: "Provide a valid destination URL or unwrap the link.",
|
|
115
|
+
locator: link.locator,
|
|
116
|
+
});
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (url === "#" || /^javascript:\s*(?:void\(0\)|;)?$/i.test(url)) {
|
|
121
|
+
ctx.reportDefect({
|
|
122
|
+
ruleId: "placeholder-dead-link",
|
|
123
|
+
severity: doc.modality === "markup" ? "error" : "warning",
|
|
124
|
+
targetId: link.segmentId || null,
|
|
125
|
+
line: link.line,
|
|
126
|
+
originalQuote: link.raw || url,
|
|
127
|
+
fixSafety: "manual",
|
|
128
|
+
actionType: "prompt",
|
|
129
|
+
reason: `Placeholder non-navigating link target '${url}'.`,
|
|
130
|
+
rewritePrompt: "Wire a real destination URL or use a <button type=\"button\"> control.",
|
|
131
|
+
locator: link.locator,
|
|
132
|
+
});
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (
|
|
137
|
+
!url.startsWith("#") &&
|
|
138
|
+
!url.startsWith("/") &&
|
|
139
|
+
!url.startsWith("~/") &&
|
|
140
|
+
!isExternalOrSpecialScheme(url)
|
|
141
|
+
) {
|
|
142
|
+
const cleanRel = safeDecodeUriComponent(url.split("#")[0].split("?")[0]);
|
|
143
|
+
if (cleanRel && doc.filePath && fs.existsSync(doc.filePath)) {
|
|
144
|
+
const isExtensionlessRoute =
|
|
145
|
+
doc.modality === "markup" && cleanRel.endsWith("/") && !path.extname(cleanRel.replace(/\/+$/, ""));
|
|
146
|
+
if (!isExtensionlessRoute && !localTargetExists(docDir, cleanRel)) {
|
|
147
|
+
ctx.reportDefect({
|
|
148
|
+
ruleId: "broken-local-link",
|
|
149
|
+
severity: "error",
|
|
150
|
+
targetId: link.segmentId || null,
|
|
151
|
+
line: link.line,
|
|
152
|
+
originalQuote: link.raw || url,
|
|
153
|
+
fixSafety: "manual",
|
|
154
|
+
actionType: "prompt",
|
|
155
|
+
reason: `Broken relative link: target '${cleanRel}' does not exist on disk.`,
|
|
156
|
+
rewritePrompt: `Fix path '${cleanRel}' to point to an existing file.`,
|
|
157
|
+
locator: link.locator,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (LOCAL_HOME_PATH_RE.test(url)) {
|
|
164
|
+
const leakKey = `${link.segmentId || "doc"}:${url}`;
|
|
165
|
+
if (!reportedLeaks.has(leakKey)) {
|
|
166
|
+
reportedLeaks.add(leakKey);
|
|
167
|
+
ctx.reportDefect({
|
|
168
|
+
ruleId: "local-path-leak",
|
|
169
|
+
severity: isRenderedArtifact ? "error" : "warning",
|
|
170
|
+
targetId: link.segmentId || null,
|
|
171
|
+
line: link.line,
|
|
172
|
+
originalQuote: link.raw || url,
|
|
173
|
+
fixSafety: "manual",
|
|
174
|
+
actionType: "prompt",
|
|
175
|
+
reason: `Personal or local machine filesystem path leaked in deliverable link ('${url}').`,
|
|
176
|
+
rewritePrompt: "Replace local machine path with a portable relative path or public URL.",
|
|
177
|
+
locator: link.locator,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
for (const seg of doc.segments || []) {
|
|
184
|
+
const m = seg.text.match(LOCAL_HOME_PATH_RE);
|
|
185
|
+
if (!m) continue;
|
|
186
|
+
const leakKey = `${seg.id}:${m[0]}`;
|
|
187
|
+
const alreadyFromLink = Array.from(reportedLeaks).some(
|
|
188
|
+
(k) => k.startsWith(`${seg.id}:`) || k.includes(m[0]),
|
|
189
|
+
);
|
|
190
|
+
if (alreadyFromLink || reportedLeaks.has(leakKey)) continue;
|
|
191
|
+
reportedLeaks.add(leakKey);
|
|
192
|
+
ctx.reportDefect({
|
|
193
|
+
ruleId: "local-path-leak",
|
|
194
|
+
severity: isRenderedArtifact ? "error" : "warning",
|
|
195
|
+
targetId: seg.id,
|
|
196
|
+
line: seg.line,
|
|
197
|
+
originalQuote: m[0],
|
|
198
|
+
fixSafety: "manual",
|
|
199
|
+
actionType: "prompt",
|
|
200
|
+
reason: `Personal or local machine filesystem path leaked in content ('${m[0]}').`,
|
|
201
|
+
rewritePrompt: "Replace concrete local user path with a relative path, env placeholder, or public URL.",
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
for (const leak of doc.artifacts.rawFormattingLeaks || []) {
|
|
206
|
+
let safeCleanup = "";
|
|
207
|
+
let fixSafety = "manual";
|
|
208
|
+
if (leak.pattern === "bold-asterisks" && /^\*\*([^*]+)\*\*$/.test(leak.text)) {
|
|
209
|
+
const seg = doc.segments.find((s) => s.id === leak.segmentId);
|
|
210
|
+
if (seg) {
|
|
211
|
+
safeCleanup = seg.text.replace(/\*\*([^*\n]+)\*\*/g, "$1");
|
|
212
|
+
fixSafety = "safe";
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
ctx.reportDefect({
|
|
217
|
+
ruleId: "raw-markdown-leak",
|
|
218
|
+
severity: "error",
|
|
219
|
+
targetId: leak.segmentId,
|
|
220
|
+
line: leak.line,
|
|
221
|
+
originalQuote:
|
|
222
|
+
fixSafety === "safe"
|
|
223
|
+
? doc.segments.find((s) => s.id === leak.segmentId)?.text || leak.text
|
|
224
|
+
: leak.text,
|
|
225
|
+
fixSafety,
|
|
226
|
+
actionType: fixSafety === "safe" ? "replace" : "prompt",
|
|
227
|
+
suggestedReplacement: safeCleanup,
|
|
228
|
+
reason: `Unrendered raw Markdown syntax (${leak.pattern}) leaked into ${doc.format.toUpperCase()} content.`,
|
|
229
|
+
...(fixSafety === "manual"
|
|
230
|
+
? { rewritePrompt: "Convert raw Markdown syntax into native document formatting." }
|
|
231
|
+
: {}),
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "common/slide-deck",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Multi-modal PowerPoint (.pptx), PDF, and raster image layout, cadence & metadata hygiene checks (deterministic scripts + prompt-based slide structure review).",
|
|
5
|
+
"formats": ["pptx", "pdf", "png", "jpg", "jpeg", "webp", "gif"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
roleHint: "Scope: cross-slide narrative cadence and scannability. {{deckSummary}}"
|
|
3
|
+
rules:
|
|
4
|
+
- id: repetitive-slide-skeleton
|
|
5
|
+
priority: moderate
|
|
6
|
+
- id: cross-slide-recap-padding
|
|
7
|
+
priority: hint
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
1. **repetitive-slide-skeleton**: Fires when 3 or more consecutive slides repeat an identical mechanical bullet skeleton (such as three symmetrical 'Noun: abstract clause' bullets per slide) regardless of content type. Fix suggestion: vary layout to match the content (direct takeaway line, metric comparison, or concise fact bullets).
|
|
11
|
+
2. **cross-slide-recap-padding**: Fires on transitional sentences on a slide that only restate the previous slide's topic without introducing new facts or decisions. Fix suggestion: remove the recap sentence so the slide opens directly on its own point.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { definePackScripts } from "dislop/sdk";
|
|
2
|
+
|
|
3
|
+
export default definePackScripts({
|
|
4
|
+
check(doc, ctx) {
|
|
5
|
+
const deck = doc.artifacts.deckSignals;
|
|
6
|
+
if (deck?.slides) {
|
|
7
|
+
for (const slide of deck.slides) {
|
|
8
|
+
if (slide.autofitFontScale < 80) {
|
|
9
|
+
ctx.reportDefect({
|
|
10
|
+
ruleId: "slide-autofit-shrink",
|
|
11
|
+
severity: "warning",
|
|
12
|
+
targetId: slide.firstSegmentId,
|
|
13
|
+
originalQuote: slide.title || `Slide ${slide.index}`,
|
|
14
|
+
fixSafety: "manual",
|
|
15
|
+
actionType: "prompt",
|
|
16
|
+
reason: `Slide ${slide.index} shrinks body text to ${slide.autofitFontScale}% via normAutofit to force overflowing copy onto one slide.`,
|
|
17
|
+
rewritePrompt: `Trim copy on Slide ${slide.index} or split across two slides so text renders at 100% scale.`,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (slide.wordCount > 120 || slide.cjkCount > 280) {
|
|
22
|
+
ctx.reportSuggestion({
|
|
23
|
+
ruleId: "slide-word-wall",
|
|
24
|
+
priority: "strong",
|
|
25
|
+
fixSafety: "manual",
|
|
26
|
+
actionType: "prompt",
|
|
27
|
+
targetId: slide.firstSegmentId,
|
|
28
|
+
originalQuote: slide.title || `Slide ${slide.index}`,
|
|
29
|
+
reason: `Slide ${slide.index} packs ${slide.wordCount} words (${slide.cjkCount} CJK chars), creating an unreadable slide wall.`,
|
|
30
|
+
rewritePrompt: `Distill Slide ${slide.index} to key takeaways and move dense prose to speaker notes.`,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (slide.bulletCount > 6) {
|
|
35
|
+
ctx.reportSuggestion({
|
|
36
|
+
ruleId: "slide-bullet-overload",
|
|
37
|
+
priority: "moderate",
|
|
38
|
+
fixSafety: "manual",
|
|
39
|
+
actionType: "prompt",
|
|
40
|
+
targetId: slide.firstSegmentId,
|
|
41
|
+
originalQuote: slide.title || `Slide ${slide.index}`,
|
|
42
|
+
reason: `Slide ${slide.index} stacks ${slide.bulletCount} bullet items (> 6 recommended maximum).`,
|
|
43
|
+
rewritePrompt: `Group or trim bullets on Slide ${slide.index} to at most 4-5 distinct points.`,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const media = doc.artifacts.mediaSignals;
|
|
50
|
+
if (media?.aiWorkflowResidue) {
|
|
51
|
+
ctx.reportDefect({
|
|
52
|
+
ruleId: "image-ai-workflow-residue",
|
|
53
|
+
severity: "warning",
|
|
54
|
+
originalQuote: doc.filePath,
|
|
55
|
+
fixSafety: "manual",
|
|
56
|
+
actionType: "prompt",
|
|
57
|
+
reason: "Image contains unstripped ComfyUI / Automatic1111 generation prompt parameters in metadata.",
|
|
58
|
+
rewritePrompt: "Strip embedded generation workflow chunks from the image before publishing.",
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
roleHint: "Scope: UI component hierarchy and stock layout-copy patterns. {{uiSummary}}"
|
|
3
|
+
rules:
|
|
4
|
+
- id: redundant-heading-subcopy
|
|
5
|
+
priority: moderate
|
|
6
|
+
- id: fabricated-stat-tile
|
|
7
|
+
priority: strong
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
1. **redundant-heading-subcopy**: Fires when a card or section subcopy merely restates its immediately preceding heading in rearranged words without adding concrete detail, constraints, or examples. Fix suggestion: remove the redundant subcopy or replace it with a specific capability or boundary.
|
|
11
|
+
2. **fabricated-stat-tile**: Fires on suspiciously generic round hero stat tiles (e.g., '10,000+ Happy Users', '99.99% Uptime', '500+ Integrations') surrounded by template traits with no verifiable product context. Do not flag attributed or product-specific operational metrics. Fix suggestion: supply a verified production figure or remove the stock stat tile.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { definePackScripts } from "dislop/sdk";
|
|
2
|
+
|
|
3
|
+
export default definePackScripts({
|
|
4
|
+
check(doc, ctx) {
|
|
5
|
+
const ui = doc.artifacts.uiSignals;
|
|
6
|
+
if (!ui) return;
|
|
7
|
+
|
|
8
|
+
if (ui.missingSvgViewBox) {
|
|
9
|
+
ctx.reportDefect({
|
|
10
|
+
ruleId: "svg-missing-viewbox",
|
|
11
|
+
severity: "warning",
|
|
12
|
+
originalQuote: "<svg>",
|
|
13
|
+
fixSafety: "manual",
|
|
14
|
+
actionType: "prompt",
|
|
15
|
+
reason: "SVG root element omits a 'viewBox' attribute, breaking responsive scaling.",
|
|
16
|
+
rewritePrompt: "Add an explicit viewBox=\"0 0 <width> <height>\" on the root <svg> element.",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
for (const btn of ui.disabledButtonsWithoutTitle || []) {
|
|
21
|
+
ctx.reportDefect({
|
|
22
|
+
ruleId: "unexplained-disabled-button",
|
|
23
|
+
severity: "warning",
|
|
24
|
+
originalQuote: btn.text.slice(0, 100),
|
|
25
|
+
fixSafety: "manual",
|
|
26
|
+
actionType: "prompt",
|
|
27
|
+
reason: "Disabled <button> has no title or aria-label explaining why it is inactive.",
|
|
28
|
+
rewritePrompt: "Wire the button handler, remove the dead control, or add an explanatory title/aria-label.",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if ((ui.purplePinkGradients || []).length > 0) {
|
|
33
|
+
ctx.reportSuggestion({
|
|
34
|
+
ruleId: "neon-ai-gradient",
|
|
35
|
+
priority: "moderate",
|
|
36
|
+
fixSafety: "manual",
|
|
37
|
+
actionType: "prompt",
|
|
38
|
+
originalQuote: ui.purplePinkGradients[0].text.slice(0, 100),
|
|
39
|
+
reason: "Stock purple-to-pink gradient strongly signals default AI-generated landing page chrome.",
|
|
40
|
+
rewritePrompt: "Replace stock purple-pink gradients with a restrained brand neutral or single accent token.",
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if ((ui.glowBlobs || []).length > 0) {
|
|
45
|
+
ctx.reportSuggestion({
|
|
46
|
+
ruleId: "glow-blob-backdrop",
|
|
47
|
+
priority: "hint",
|
|
48
|
+
fixSafety: "manual",
|
|
49
|
+
actionType: "prompt",
|
|
50
|
+
originalQuote: ui.glowBlobs[0].text.slice(0, 100),
|
|
51
|
+
reason: "Blurred floating glow-orb backdrop is a recognizable stock AI UI trope.",
|
|
52
|
+
rewritePrompt: "Remove decorative blur-3xl orbs unless required by an established brand system.",
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if ((ui.pillBadges || []).length >= 4) {
|
|
57
|
+
ctx.reportSuggestion({
|
|
58
|
+
ruleId: "pill-badge-soup",
|
|
59
|
+
priority: "moderate",
|
|
60
|
+
fixSafety: "manual",
|
|
61
|
+
actionType: "prompt",
|
|
62
|
+
originalQuote: ui.pillBadges[0].text.slice(0, 100),
|
|
63
|
+
reason: `Dense cluster of ${ui.pillBadges.length} rounded-full pill badges creates visual clutter.`,
|
|
64
|
+
rewritePrompt: "Consolidate decorative pill kickers into plain typographic labels or metadata rows.",
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if ((ui.backdropBlurCount || 0) >= 3) {
|
|
69
|
+
ctx.reportSuggestion({
|
|
70
|
+
ruleId: "glassmorphism-overuse",
|
|
71
|
+
priority: "hint",
|
|
72
|
+
fixSafety: "manual",
|
|
73
|
+
actionType: "prompt",
|
|
74
|
+
originalQuote: `backdrop-blur (${ui.backdropBlurCount} regions)`,
|
|
75
|
+
reason: `Page stacks ${ui.backdropBlurCount} frosted-glass backdrop-blur panels, a common AI UI template default.`,
|
|
76
|
+
rewritePrompt: "Use crisp solid surfaces with 1px borders and reserve backdrop-blur for transient overlays.",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "en/artifact-qa",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "English delivery artifact QA (deterministic scripts + prompt-based audit): unreplaced copy placeholders, explicit & implicit assistant wrappers, disguised writer instructions, and pasted refusals.",
|
|
5
|
+
"languages": ["en"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
roleHint: "Scope: English AI-chat handoff residue, author-facing instructions, and unreplaced placeholder entities."
|
|
3
|
+
rules:
|
|
4
|
+
- id: implicit-assistant-framing
|
|
5
|
+
priority: strong
|
|
6
|
+
- id: disguised-placeholder-prose
|
|
7
|
+
priority: strong
|
|
8
|
+
- id: synthetic-example-entity
|
|
9
|
+
priority: moderate
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
1. **implicit-assistant-framing**: Fires on conversational openers or sign-offs that address the prompt author rather than the document's intended reader (e.g., 'Based on the notes you shared, I have organized...', 'Below is a breakdown tailored to your audience.', 'Let me know if you want a shorter version.'). Do not flag genuine first-person author introductions addressed to readers. Fix suggestion: remove the assistant handoff sentence.
|
|
13
|
+
2. **disguised-placeholder-prose**: Fires on prose sentences written as reminders to the writer rather than finished reader-facing copy (e.g., 'Mention the Q3 churn rate once finance confirms.', 'Include a link to the staging dashboard here.'). Fix suggestion: supply the confirmed figure or link before publishing, or omit the unfinished line.
|
|
14
|
+
3. **synthetic-example-entity**: Fires on unreplaced stock dummy names, companies, or addresses ('Acme Corp', 'WidgetCo', 'john.doe@example.com', '123 Main St') inside real deliverables. Do not flag API documentation, test tutorials, or RFC examples where placeholder domains are intentional. Fix suggestion: replace with the real organization or contact details.
|