@mrclrchtr/supi-flow 0.6.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.
- package/README.md +175 -0
- package/package.json +32 -0
- package/prompts/supi-coding-retro.md +18 -0
- package/skills/supi-flow-apply/SKILL.md +119 -0
- package/skills/supi-flow-archive/SKILL.md +101 -0
- package/skills/supi-flow-brainstorm/SKILL.md +117 -0
- package/skills/supi-flow-debug/SKILL.md +151 -0
- package/skills/supi-flow-plan/SKILL.md +117 -0
- package/skills/supi-flow-slop-detect/SKILL.md +393 -0
- package/skills/supi-flow-slop-detect/references/vocabulary.json +161 -0
- package/skills/supi-flow-slop-detect/scripts/slop-helpers.ts +301 -0
- package/skills/supi-flow-slop-detect/scripts/slop-scan-structural.ts +269 -0
- package/skills/supi-flow-slop-detect/scripts/slop-scan-vocab.ts +161 -0
- package/skills/supi-flow-slop-detect/scripts/slop-scan.ts +209 -0
- package/src/cli.ts +80 -0
- package/src/index.ts +167 -0
- package/src/tools/flow-tools.ts +337 -0
- package/src/tools/tndm-cli.ts +246 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: supi-flow-debug
|
|
3
|
+
description: Systematic debugging protocol — find the root cause before proposing fixes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Systematic Debugging
|
|
7
|
+
|
|
8
|
+
Random fixes waste time and often create new bugs. Debug by understanding the cause first.
|
|
9
|
+
|
|
10
|
+
## The Iron Law
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
If you have not completed Phase 1, you are not ready to propose a fix.
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
Use this when:
|
|
21
|
+
|
|
22
|
+
- a test fails during `/supi-flow-apply` and the cause is not obvious
|
|
23
|
+
- a build error blocks progress
|
|
24
|
+
- behavior does not match expectations
|
|
25
|
+
- a previous fix did not work
|
|
26
|
+
- you are tempted to "just try something"
|
|
27
|
+
|
|
28
|
+
Use it especially when you are under pressure, already tried multiple fixes, or do not fully understand the issue.
|
|
29
|
+
|
|
30
|
+
## Phase 1: Root cause investigation
|
|
31
|
+
|
|
32
|
+
Before changing anything:
|
|
33
|
+
|
|
34
|
+
### 1.1 Read the evidence carefully
|
|
35
|
+
|
|
36
|
+
- Read error messages, warnings, and stack traces fully.
|
|
37
|
+
- Note exact file paths, line numbers, inputs, and error codes.
|
|
38
|
+
- Do not summarize before you understand what the tools actually said.
|
|
39
|
+
|
|
40
|
+
### 1.2 Reproduce consistently
|
|
41
|
+
|
|
42
|
+
- Can you trigger it on demand?
|
|
43
|
+
- What exact steps produce it?
|
|
44
|
+
- Does it always happen, or only sometimes?
|
|
45
|
+
|
|
46
|
+
If you cannot reproduce it reliably, gather more data before guessing.
|
|
47
|
+
|
|
48
|
+
### 1.3 Check recent changes
|
|
49
|
+
|
|
50
|
+
- What changed just before the problem appeared?
|
|
51
|
+
- Review `git diff`, recent edits, config changes, environment changes, and dependency changes.
|
|
52
|
+
|
|
53
|
+
### 1.4 Trace data flow
|
|
54
|
+
|
|
55
|
+
When the symptom appears deep in the stack, trace backward:
|
|
56
|
+
|
|
57
|
+
- where did the bad value or bad state come from?
|
|
58
|
+
- what called this layer?
|
|
59
|
+
- what assumptions were already broken before the visible error?
|
|
60
|
+
|
|
61
|
+
Fix the source, not the symptom.
|
|
62
|
+
|
|
63
|
+
### 1.5 Isolate multi-component failures
|
|
64
|
+
|
|
65
|
+
For issues that cross boundaries like CLI to tool to service or UI to handler to storage:
|
|
66
|
+
|
|
67
|
+
- inspect inputs at each boundary
|
|
68
|
+
- inspect outputs at each boundary
|
|
69
|
+
- verify config and environment propagation
|
|
70
|
+
- narrow down which layer first becomes wrong
|
|
71
|
+
|
|
72
|
+
Add minimal diagnostic logging or instrumentation if needed to find the failing layer.
|
|
73
|
+
|
|
74
|
+
## Phase 2: Pattern analysis
|
|
75
|
+
|
|
76
|
+
Before fixing, understand what "correct" looks like:
|
|
77
|
+
|
|
78
|
+
1. Find similar working code in the same codebase.
|
|
79
|
+
2. Compare against the reference pattern completely.
|
|
80
|
+
3. List every meaningful difference.
|
|
81
|
+
4. Check dependencies, assumptions, settings, and required context.
|
|
82
|
+
|
|
83
|
+
Do not assume a small difference is irrelevant.
|
|
84
|
+
|
|
85
|
+
## Phase 3: Hypothesis and testing
|
|
86
|
+
|
|
87
|
+
Use one hypothesis at a time:
|
|
88
|
+
|
|
89
|
+
1. State the hypothesis clearly: `I think X is the root cause because Y.`
|
|
90
|
+
2. Make the smallest change or probe that tests that idea.
|
|
91
|
+
3. Verify the result.
|
|
92
|
+
4. If it failed, form a new hypothesis instead of stacking more guesses on top.
|
|
93
|
+
|
|
94
|
+
If you still do not understand the issue after investigation, say so and ask the user.
|
|
95
|
+
|
|
96
|
+
## Phase 4: Implementation
|
|
97
|
+
|
|
98
|
+
Once the cause is understood:
|
|
99
|
+
|
|
100
|
+
1. Create the smallest failing reproduction you reasonably can.
|
|
101
|
+
2. Implement one fix aimed at the root cause.
|
|
102
|
+
3. Verify that the issue is fixed.
|
|
103
|
+
4. Check for regressions.
|
|
104
|
+
|
|
105
|
+
## The 3-fix rule
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
If 3 fixes have failed, stop and question the architecture.
|
|
109
|
+
Do not attempt fix #4 without discussing it with the user.
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Signs this may be an architectural issue:
|
|
113
|
+
|
|
114
|
+
- each fix reveals a new problem elsewhere
|
|
115
|
+
- the fix requires unexpectedly large restructuring
|
|
116
|
+
- the same class of bug keeps appearing in different places
|
|
117
|
+
|
|
118
|
+
## Red flags
|
|
119
|
+
|
|
120
|
+
If you catch yourself thinking any of these, stop and go back to Phase 1:
|
|
121
|
+
|
|
122
|
+
- "Quick fix for now, investigate later"
|
|
123
|
+
- "Let me try changing X"
|
|
124
|
+
- "I probably know what this is"
|
|
125
|
+
- "I'll fix several things at once"
|
|
126
|
+
- "I'll skip the failing test"
|
|
127
|
+
- "One more fix attempt" after multiple failed tries
|
|
128
|
+
|
|
129
|
+
## When to hand off to the user
|
|
130
|
+
|
|
131
|
+
Ask the user when:
|
|
132
|
+
|
|
133
|
+
- the root cause is still unclear after real investigation
|
|
134
|
+
- the likely fix expands beyond the approved scope
|
|
135
|
+
- a required dependency or environment is missing
|
|
136
|
+
- 3 fixes have already failed
|
|
137
|
+
- you need a judgment call about trade-offs, risk, or test strategy
|
|
138
|
+
|
|
139
|
+
## Quick reference
|
|
140
|
+
|
|
141
|
+
| Phase | Focus | Success criteria |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| 1. Root cause | Evidence, reproduction, recent changes, data flow | You understand what failed and why |
|
|
144
|
+
| 2. Pattern | Working examples and differences | You know what "correct" looks like |
|
|
145
|
+
| 3. Hypothesis | One theory at a time | Hypothesis confirmed or replaced |
|
|
146
|
+
| 4. Implementation | Minimal root-cause fix | Issue resolved without regressions |
|
|
147
|
+
|
|
148
|
+
## Related skills
|
|
149
|
+
|
|
150
|
+
- Return to `/supi-flow-apply` after debugging.
|
|
151
|
+
- Use the plan's TDD or verification steps when implementing the fix.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: supi-flow-plan
|
|
3
|
+
description: Create an implementation plan for an approved design with exact file paths, ordered tasks, concrete verification, and no placeholders.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Create implementation plan
|
|
7
|
+
|
|
8
|
+
## Step 1: Find the design
|
|
9
|
+
|
|
10
|
+
- If a TNDM-ID was given as argument: `supi_tndm_cli { action: "show", id: "<ID>" }` — inspect `content_path`, then read the approved design from `content.md`.
|
|
11
|
+
- If no TNDM-ID was given and no active ticket exists: ask the user to run `/skill:supi-flow-brainstorm` first, or provide an existing ticket ID.
|
|
12
|
+
- If no design is available: ask which change to plan.
|
|
13
|
+
|
|
14
|
+
## Step 2: Scope check
|
|
15
|
+
|
|
16
|
+
If the design covers multiple independent subsystems, suggest splitting it into separate plans. Each plan should produce a coherent, testable result.
|
|
17
|
+
|
|
18
|
+
## Step 3: Choose the right detail level
|
|
19
|
+
|
|
20
|
+
Use **adaptive detail by complexity**:
|
|
21
|
+
|
|
22
|
+
- **Light plan** for small or familiar changes: clear tasks, files, verification, and constraints.
|
|
23
|
+
- **Fuller executable plan** for risky, unfamiliar, multi-file, or high-impact changes: more explicit steps, commands, and snippets when they reduce ambiguity.
|
|
24
|
+
|
|
25
|
+
Do not add ceremony for its own sake.
|
|
26
|
+
|
|
27
|
+
## Step 4: Map file structure
|
|
28
|
+
|
|
29
|
+
Before writing tasks, list which files will be created or modified and what each is responsible for.
|
|
30
|
+
|
|
31
|
+
- Use exact file paths.
|
|
32
|
+
- Prefer focused units with clear responsibilities.
|
|
33
|
+
- Follow existing codebase patterns.
|
|
34
|
+
- Include doc targets when the change affects user-facing or maintainer-facing behavior.
|
|
35
|
+
|
|
36
|
+
## Step 5: Write ordered tasks
|
|
37
|
+
|
|
38
|
+
A good plan is broken into small, verifiable tasks. For each task, include:
|
|
39
|
+
|
|
40
|
+
- the goal
|
|
41
|
+
- exact file paths
|
|
42
|
+
- the change to make
|
|
43
|
+
- how to verify it
|
|
44
|
+
- whether it is test-driven or explicitly test-exempt
|
|
45
|
+
|
|
46
|
+
Use enough detail that an agent can execute without guessing, but do not force huge code blocks into every step.
|
|
47
|
+
|
|
48
|
+
**Task numbering convention**: Tasks must be numbered sequentially starting at 1:
|
|
49
|
+
|
|
50
|
+
```markdown
|
|
51
|
+
- [ ] **Task 1**: Create the CLI helper module
|
|
52
|
+
- File: `src/cli.ts`
|
|
53
|
+
- Verification: `pnpm exec tsc --noEmit`
|
|
54
|
+
- [ ] **Task 2**: Register the tools
|
|
55
|
+
- File: `src/tools/tndm-cli.ts`
|
|
56
|
+
- Verification: `pnpm exec vitest run`
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The task number must be in the `**Task N**` format so `supi_flow_complete_task` can find and check it off.
|
|
60
|
+
|
|
61
|
+
## TDD by default
|
|
62
|
+
|
|
63
|
+
For testable code changes, prefer red-green-refactor:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
RED → write the failing test → verify it fails for the right reason
|
|
67
|
+
GREEN → write the minimal code to pass → verify it passes
|
|
68
|
+
REFACTOR → clean up while staying green
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Critical rule: if you did not watch the test fail, you do not know whether it proves the behavior.
|
|
72
|
+
|
|
73
|
+
### Test exemptions
|
|
74
|
+
|
|
75
|
+
TDD is the default, not an absolute rule.
|
|
76
|
+
|
|
77
|
+
A task may be marked **test-exempt** when TDD is not practical, such as:
|
|
78
|
+
|
|
79
|
+
- docs-only changes
|
|
80
|
+
- config-only changes
|
|
81
|
+
- trivial edits
|
|
82
|
+
- shell or integration work with no reasonable harness
|
|
83
|
+
|
|
84
|
+
Every test-exempt task MUST include:
|
|
85
|
+
|
|
86
|
+
- a brief rationale
|
|
87
|
+
- a concrete manual verification step
|
|
88
|
+
- the exact command and expected result when possible
|
|
89
|
+
|
|
90
|
+
Do not use test exemptions to avoid testing logic that could reasonably be tested.
|
|
91
|
+
|
|
92
|
+
## Rules
|
|
93
|
+
|
|
94
|
+
- **No placeholders.** Never write `TBD`, `TODO`, `implement later`, or vague instructions like `add error handling`.
|
|
95
|
+
- **Exact file paths** always.
|
|
96
|
+
- **Verification is mandatory.** Every task needs a concrete check.
|
|
97
|
+
- **No code before test or verification.** Testable code starts with a failing test. Test-exempt work starts with manual verification.
|
|
98
|
+
- **Include doc updates** when the change affects docs, help text, architecture notes, or workflow guidance.
|
|
99
|
+
|
|
100
|
+
## Self-review
|
|
101
|
+
|
|
102
|
+
After writing the plan, check it against the approved design:
|
|
103
|
+
|
|
104
|
+
1. **Coverage:** does every important requirement map to a task?
|
|
105
|
+
2. **Placeholder scan:** remove vague or incomplete instructions.
|
|
106
|
+
3. **Consistency:** do names, types, files, and steps line up across tasks?
|
|
107
|
+
4. **Right-sized detail:** is the plan clear without being bloated?
|
|
108
|
+
|
|
109
|
+
Fix issues inline before handing off.
|
|
110
|
+
|
|
111
|
+
## Output and persistence
|
|
112
|
+
|
|
113
|
+
Write the plan in the lightest form that will still survive execution:
|
|
114
|
+
|
|
115
|
+
- **If a ticket exists:** use `supi_flow_plan { ticket_id: "<ID>", plan_content: "..." }` to store the executable checklist in `plan.md` while leaving `content.md` as the approved design summary.
|
|
116
|
+
- **If no ticket exists:** default to conversation-first. Offer saving to a ticket or file if the work is larger or likely multi-session.
|
|
117
|
+
- Close with: `Plan ready. Review it and approve before we start. Then run /supi-flow-apply TNDM-XXXXXX.`
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: supi-flow-slop-detect
|
|
3
|
+
description: Detect and fix AI-generated prose markers ("slop") in documentation. Use this whenever the user wants to check, review, or improve docs for AI-sounding language — slop detection, prose quality, writing review, AI text cleanup, documentation polish. Automatically loaded during /supi-flow-archive when updating docs.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Slop Detection
|
|
7
|
+
|
|
8
|
+
Scan documentation for AI-prose markers and fix them. Use during the archive phase after doc edits.
|
|
9
|
+
|
|
10
|
+
## Scan workflow
|
|
11
|
+
|
|
12
|
+
1. Read the edited documentation files
|
|
13
|
+
2. Classify each file by profile: skill, technical, or prose
|
|
14
|
+
3. Scan for vocabulary markers (Tiers 1-4) and structural patterns (below)
|
|
15
|
+
4. For each hit: substitute with specific, grounded language
|
|
16
|
+
5. Re-read the fixed text — does it still say the same thing with better words?
|
|
17
|
+
6. Re-scan to confirm score dropped below threshold
|
|
18
|
+
|
|
19
|
+
**Principles:**
|
|
20
|
+
- Preserve meaning — change how it's said, not what's said
|
|
21
|
+
- Match context — skill docs and technical docs need different thresholds than narrative prose
|
|
22
|
+
- Be specific — replace abstract adjectives with concrete claims (version numbers, file paths, measurements)
|
|
23
|
+
- Prefer active voice — "it validates input" not "input is validated"
|
|
24
|
+
- Keep useful technical shorthand when it improves clarity
|
|
25
|
+
- Never change code — only edit prose/docstrings/comments
|
|
26
|
+
|
|
27
|
+
## Document profiles
|
|
28
|
+
|
|
29
|
+
The scanner should not treat every Markdown file the same.
|
|
30
|
+
|
|
31
|
+
- **skill** — `**/skills/**/SKILL.md`; instructional, operational, list-heavy
|
|
32
|
+
- **technical** — READMEs, architecture docs, setup docs, reference material
|
|
33
|
+
- **prose** — narrative or essay-like documents
|
|
34
|
+
|
|
35
|
+
Profiles mostly affect structural scoring:
|
|
36
|
+
|
|
37
|
+
- **skill:** allow compact workflow notation, higher bullet density, and occasional clarifying em dashes
|
|
38
|
+
- **technical:** allow architecture and data-flow notation, but keep tighter structure checks
|
|
39
|
+
- **prose:** use the strictest structural thresholds
|
|
40
|
+
|
|
41
|
+
Vocabulary, hype, and sycophantic phrasing stay strict across all profiles.
|
|
42
|
+
|
|
43
|
+
## Vocabulary markers
|
|
44
|
+
|
|
45
|
+
### Tier 1: High-confidence markers (score 3 each)
|
|
46
|
+
|
|
47
|
+
| AI Word | Context | Replace with |
|
|
48
|
+
|---------|---------|-------------|
|
|
49
|
+
| delve | "delve into" | explore, examine, look at |
|
|
50
|
+
| tapestry | "rich tapestry" | mix, combination, variety |
|
|
51
|
+
| realm | "in the realm of" | in, within, regarding |
|
|
52
|
+
| embark | "embark on a journey" | start, begin |
|
|
53
|
+
| beacon | "a beacon of" | example, model |
|
|
54
|
+
| spearheaded | formal attribution | led, started |
|
|
55
|
+
| leverage | business jargon | use, apply |
|
|
56
|
+
| robust | quality signal | solid, strong, reliable |
|
|
57
|
+
| seamless | integration claim | smooth, easy, simple |
|
|
58
|
+
| pivotal | importance marker | key, important |
|
|
59
|
+
| multifaceted | complexity signal | complex, varied |
|
|
60
|
+
| comprehensive | scope claim | thorough, complete |
|
|
61
|
+
| nuanced | sophistication signal | subtle, detailed |
|
|
62
|
+
| meticulous | care signal | careful, detailed |
|
|
63
|
+
| intricate | complexity marker | detailed, complex |
|
|
64
|
+
| showcasing | display verb | showing, displaying |
|
|
65
|
+
| streamline | optimization verb | simplify, improve |
|
|
66
|
+
| facilitate | enablement verb | enable, help, allow |
|
|
67
|
+
| utilize | formal "use" | use |
|
|
68
|
+
|
|
69
|
+
### Tier 2: Context-dependent markers (score 2 each)
|
|
70
|
+
|
|
71
|
+
| Category | Words |
|
|
72
|
+
|----------|-------|
|
|
73
|
+
| Transition overuse | moreover, furthermore, indeed, notably, subsequently |
|
|
74
|
+
| Intensity clustering | significantly, substantially, fundamentally, profoundly |
|
|
75
|
+
| Hedging stacks | potentially, typically, often, might, perhaps |
|
|
76
|
+
| Action inflation | revolutionize, transform, unlock, unleash, elevate |
|
|
77
|
+
| Empty emphasis | crucial, vital, essential, paramount |
|
|
78
|
+
|
|
79
|
+
### Tier 3: Phrase patterns (score 2-4)
|
|
80
|
+
|
|
81
|
+
| Phrase | Score | Replacement |
|
|
82
|
+
|--------|-------|-------------|
|
|
83
|
+
| "In today's fast-paced world" | 4 | Delete — start with the point |
|
|
84
|
+
| "It's worth noting that" | 3 | Delete — just state the thing |
|
|
85
|
+
| "At its core" | 2 | "Fundamentally" or delete |
|
|
86
|
+
| "Cannot be overstated" | 3 | "is important because [reason]" |
|
|
87
|
+
| "Navigate the complexities" | 4 | "handle", "work through" |
|
|
88
|
+
| "Unlock the potential" | 4 | "enable", "make possible" |
|
|
89
|
+
| "A testament to" | 3 | "shows", "demonstrates" |
|
|
90
|
+
| "Treasure trove of" | 3 | "collection", "set" |
|
|
91
|
+
| "Game changer" | 3 | Delete — be specific |
|
|
92
|
+
| "Ever-evolving landscape" | 4 | Delete — be specific |
|
|
93
|
+
| "Look no further" | 4 | Delete — state the answer |
|
|
94
|
+
| "Hustle and bustle" | 3 | Delete — filler |
|
|
95
|
+
|
|
96
|
+
### Tier 4: Sycophantic markers (score 2 each)
|
|
97
|
+
|
|
98
|
+
Especially relevant in conversational or instructional content.
|
|
99
|
+
|
|
100
|
+
| Phrase | Issue |
|
|
101
|
+
|--------|-------|
|
|
102
|
+
| "I'd be happy to" | Servile opener |
|
|
103
|
+
| "Great question!" | Empty validation |
|
|
104
|
+
| "Absolutely!" | Over-agreement |
|
|
105
|
+
| "That's a wonderful point" | Flattery |
|
|
106
|
+
| "I'm glad you asked" | Filler |
|
|
107
|
+
| "You're absolutely right" | Sycophancy |
|
|
108
|
+
|
|
109
|
+
These phrases add no information and signal generated content.
|
|
110
|
+
|
|
111
|
+
## Structural patterns
|
|
112
|
+
|
|
113
|
+
### Em dash density
|
|
114
|
+
|
|
115
|
+
Em dashes are a weak signal by themselves. What matters is repetitive, decorative use.
|
|
116
|
+
|
|
117
|
+
Baseline guidance:
|
|
118
|
+
|
|
119
|
+
| Density | Signal |
|
|
120
|
+
|---------|--------|
|
|
121
|
+
| 0-2 | Normal |
|
|
122
|
+
| 3-5 | Elevated — review |
|
|
123
|
+
| 6+ | Strong AI signal in most docs |
|
|
124
|
+
|
|
125
|
+
Profile adjustments:
|
|
126
|
+
- **skill:** higher tolerance for compact instructional labels
|
|
127
|
+
- **technical/prose:** stricter review once density gets high
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Count em dashes in a file
|
|
131
|
+
grep -o '—' file.md | wc -l
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
_Also detected by `scripts/slop-scan-structural.ts` with profile-aware thresholds._
|
|
135
|
+
|
|
136
|
+
### Tricolon detection
|
|
137
|
+
|
|
138
|
+
AI loves groups of three adjectives with alliteration or similar sounds:
|
|
139
|
+
- "fast, efficient, and reliable" → pick the most accurate one
|
|
140
|
+
- "clear, concise, and compelling" → "clear and concise"
|
|
141
|
+
- "robust, reliable, and resilient" → "reliable"
|
|
142
|
+
|
|
143
|
+
Pattern: `adjective, adjective, and adjective` with similar sounds. Flag when >1 per 500 words.
|
|
144
|
+
|
|
145
|
+
### Sentence length clustering
|
|
146
|
+
|
|
147
|
+
AI clusters sentences in the 15-25 word range. Human writing varies from 3-word fragments to 40+ word complex sentences. AI avoids both extremes.
|
|
148
|
+
|
|
149
|
+
Check: if >70% of sentences fall in 15-25 word range → strong AI signal. Vary rhythm by adding short punchy sentences and occasional long ones.
|
|
150
|
+
|
|
151
|
+
### Paragraph symmetry
|
|
152
|
+
|
|
153
|
+
AI produces "blocky" text with uniform paragraph lengths. If most paragraphs cluster around the same word count (e.g., 40-60 words each) → flag. Break symmetry: vary paragraph length, use single-sentence paragraphs for emphasis.
|
|
154
|
+
|
|
155
|
+
_Detected by `scripts/slop-scan-structural.ts` as `paragraphUniformity` score (threshold: > 0.7)._
|
|
156
|
+
|
|
157
|
+
### Bullet-to-prose ratio
|
|
158
|
+
|
|
159
|
+
| Ratio | Signal |
|
|
160
|
+
|-------|--------|
|
|
161
|
+
| 0-30% | Normal |
|
|
162
|
+
| 30-50% | Elevated |
|
|
163
|
+
| 50-70% | High in technical/prose docs |
|
|
164
|
+
| 70%+ | Very high AI signal in most docs |
|
|
165
|
+
|
|
166
|
+
Profile adjustments:
|
|
167
|
+
- **skill:** allow a higher bullet ratio for checklists, procedures, and operator guidance
|
|
168
|
+
- **technical:** medium threshold
|
|
169
|
+
- **prose:** lowest threshold
|
|
170
|
+
|
|
171
|
+
Emoji-led bullets (e.g., `✅`, `❌`, `🔴`) in technical documentation are still a strong AI tell.
|
|
172
|
+
|
|
173
|
+
### Intro-body-conclusion structure
|
|
174
|
+
|
|
175
|
+
AI defaults to: intro paragraph + three body sections + conclusion that restates intro. Check for:
|
|
176
|
+
1. Opening paragraph that restates the question
|
|
177
|
+
2. Three distinct middle sections
|
|
178
|
+
3. Closing paragraph that summarizes without adding new information
|
|
179
|
+
|
|
180
|
+
If detected: cut the intro and conclusion. Start at the first paragraph with actual content.
|
|
181
|
+
|
|
182
|
+
_Detected by `scripts/slop-scan-structural.ts` as `introBodyConclusion`._
|
|
183
|
+
|
|
184
|
+
### Participial phrase tail-loading
|
|
185
|
+
|
|
186
|
+
AI appends present participial (-ing) phrases to sentence ends at 2-5x the human rate.
|
|
187
|
+
|
|
188
|
+
Pattern: `[Main clause], [present participle] [detail].`
|
|
189
|
+
|
|
190
|
+
Examples (all AI signals):
|
|
191
|
+
- "The framework processes requests, **enabling** developers to scale."
|
|
192
|
+
- "The policy was implemented, **marking** a shift in approach."
|
|
193
|
+
- "She published findings, **contributing** to the body of research."
|
|
194
|
+
|
|
195
|
+
Fix: split into two sentences or restructure. 3+ in a paragraph → rewrite.
|
|
196
|
+
|
|
197
|
+
### "From X to Y" range construction
|
|
198
|
+
|
|
199
|
+
AI uses this template to express scope at much higher rates:
|
|
200
|
+
- "From beginners to experts"
|
|
201
|
+
- "From simple scripts to complex applications"
|
|
202
|
+
|
|
203
|
+
Flag when >1 per 500 words. Replace with direct statement: "works for all skill levels."
|
|
204
|
+
|
|
205
|
+
_Detected by `scripts/slop-scan-structural.ts`._
|
|
206
|
+
|
|
207
|
+
### Correlative conjunction overuse
|
|
208
|
+
|
|
209
|
+
AI over-relies on correlative pairs in close proximity:
|
|
210
|
+
|
|
211
|
+
| Pattern | Example |
|
|
212
|
+
|---------|---------|
|
|
213
|
+
| "not only...but also" | "not only improves X, but also Y" |
|
|
214
|
+
| "whether...or" | "whether you're a beginner or expert" |
|
|
215
|
+
| "not just...but" | "not just a tool, but a platform" |
|
|
216
|
+
|
|
217
|
+
2+ correlative pairs in the same paragraph → flag.
|
|
218
|
+
|
|
219
|
+
### Colon addiction and semicolon avoidance
|
|
220
|
+
|
|
221
|
+
AI uses colons to introduce explanations at 3-5x the human rate. Meanwhile, AI rarely uses semicolons. The ratio of em dashes to semicolons is skewed compared to human writing.
|
|
222
|
+
|
|
223
|
+
Check: if em dashes > 5 and semicolons = 0 → strong AI signal.
|
|
224
|
+
|
|
225
|
+
### Arrow connectors
|
|
226
|
+
|
|
227
|
+
Arrow notation is context-sensitive.
|
|
228
|
+
|
|
229
|
+
**Allowed when used as compact technical notation:**
|
|
230
|
+
- workflow chains: `brainstorm → plan → apply`
|
|
231
|
+
- architecture or boundary descriptions: `CLI → tool → service`
|
|
232
|
+
- single-step technical transitions: `request → response`, `parser → AST`, `draft → published`
|
|
233
|
+
- data-flow or state-flow summaries
|
|
234
|
+
- diagrams, breadcrumbs, and type signatures
|
|
235
|
+
|
|
236
|
+
**Flag when used as vague prose shorthand:**
|
|
237
|
+
- "this change -> improves productivity"
|
|
238
|
+
- "the tool → makes things easier"
|
|
239
|
+
|
|
240
|
+
Rule of thumb: keep arrows when they connect short technical phrases. Replace them when they stand in for normal sentence prose.
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Detect arrows in prose (exclude code blocks)
|
|
244
|
+
awk '/^```/{c=!c}!c' file.md | rg -o '\s->\s|→' | wc -l
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
_Also detected by `scripts/slop-scan-structural.ts`, which separates technical chains from prose shorthand._
|
|
248
|
+
|
|
249
|
+
### Plus-sign conjunction
|
|
250
|
+
|
|
251
|
+
AI uses `+` as a conjunction ("X + Y") in prose instead of "and" or "with". Fine in code, math, and labels.
|
|
252
|
+
|
|
253
|
+
- "hooks + skills" (slop) → "hooks and skills" (human)
|
|
254
|
+
- "1 + 1 = 2" (fine, math)
|
|
255
|
+
|
|
256
|
+
Flag when >1 prose plus-sign appears outside code blocks.
|
|
257
|
+
|
|
258
|
+
_Also detected by `scripts/slop-scan-structural.ts` (included in structural score)._
|
|
259
|
+
|
|
260
|
+
### Conclusion mirroring
|
|
261
|
+
|
|
262
|
+
AI introductions and conclusions are near-paraphrases of each other. If the first and last paragraphs express the same idea using different words → cut the conclusion. Human writing ends with specifics, callbacks, questions, or simply stops.
|
|
263
|
+
|
|
264
|
+
### Perfect grammar signals
|
|
265
|
+
|
|
266
|
+
| Pattern | Human Range | AI Signal |
|
|
267
|
+
|---------|-------------|-----------|
|
|
268
|
+
| Contractions (don't, can't, it's) | Common | Rare/absent |
|
|
269
|
+
| Oxford commas | Variable | Always present |
|
|
270
|
+
| Typos | Occasional | None |
|
|
271
|
+
| Sentence fragments | Present | Rare |
|
|
272
|
+
| Starting sentences with "And" or "But" | Common | Rare |
|
|
273
|
+
| Register shifts (formal ↔ casual) | Present | Uniform |
|
|
274
|
+
|
|
275
|
+
Too-perfect grammar with no contractions, no fragments, uniform register → suspicious.
|
|
276
|
+
|
|
277
|
+
## Density scoring
|
|
278
|
+
|
|
279
|
+
```
|
|
280
|
+
vocab_score = (tier1_count × 3 + tier2_count × 2 + tier4_count × 2 + phrase_count × avg_phrase_score) / word_count × 100
|
|
281
|
+
|
|
282
|
+
structural_score:
|
|
283
|
+
+2 if em_dash_density exceeds the profile threshold
|
|
284
|
+
+2 if sentence_cluster_ratio > 0.7
|
|
285
|
+
+2 if bullet_ratio exceeds the profile threshold
|
|
286
|
+
+2 if paragraph_uniformity > 0.7
|
|
287
|
+
+1 if emoji_bullets present
|
|
288
|
+
+2 if participial_tail_count > 3 per 500 words
|
|
289
|
+
+2 if intro-body-conclusion structure detected (except relaxed skill profile)
|
|
290
|
+
+1 if correlative_pairs > 2
|
|
291
|
+
+1 if prose_arrow_connectors > 0
|
|
292
|
+
+1 if plus_conjunctions exceed the profile threshold
|
|
293
|
+
+1 if em_dashes exceed the profile threshold AND semicolons = 0
|
|
294
|
+
+1 if conclusion_mirroring detected
|
|
295
|
+
|
|
296
|
+
final_score = vocab_score + structural_score (cap at 10)
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
| Score | Rating | Action |
|
|
300
|
+
|-------|--------|--------|
|
|
301
|
+
| 0-1.0 | Clean | No action needed |
|
|
302
|
+
| 1.0-2.5 | Light | Spot remediation — fix individual markers |
|
|
303
|
+
| 2.5-5.0 | Moderate | Section rewrite recommended |
|
|
304
|
+
| 5.0+ | Heavy | Full document review — do not commit |
|
|
305
|
+
|
|
306
|
+
Target: score < 1.5 before committing documentation.
|
|
307
|
+
|
|
308
|
+
## Automated scripts
|
|
309
|
+
|
|
310
|
+
Cross-platform Node.js/TypeScript scripts in `scripts/` automate the detection. They run anywhere pi runs (macOS, Linux, Windows).
|
|
311
|
+
|
|
312
|
+
### Prerequisites
|
|
313
|
+
|
|
314
|
+
The scripts use `pnpm exec jiti` (already available in the SuPi workspace).
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
# From repo root
|
|
318
|
+
pnpm exec jiti packages/supi-flow/skills/supi-flow-slop-detect/scripts/slop-scan.ts <file>
|
|
319
|
+
|
|
320
|
+
# Or from anywhere via relative path
|
|
321
|
+
pnpm exec jiti path/to/scripts/slop-scan.ts <file>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Available scripts
|
|
325
|
+
|
|
326
|
+
#### `slop-scan.ts` — Combined scanner
|
|
327
|
+
|
|
328
|
+
Runs vocabulary + structural detection, computes final density score (capped at 10).
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Human-readable summary
|
|
332
|
+
pnpm exec jiti scripts/slop-scan.ts README.md
|
|
333
|
+
|
|
334
|
+
# Machine-readable JSON (for agent post-processing)
|
|
335
|
+
pnpm exec jiti scripts/slop-scan.ts README.md --json-only
|
|
336
|
+
|
|
337
|
+
# Multiple files
|
|
338
|
+
pnpm exec jiti scripts/slop-scan.ts docs/*.md --json-only
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
Output fields consumed by the agent:
|
|
342
|
+
|
|
343
|
+
```json
|
|
344
|
+
{
|
|
345
|
+
"file": "README.md",
|
|
346
|
+
"profile": "technical",
|
|
347
|
+
"adjustments": ["technical-doc thresholds", "workflow arrow chains relaxed"],
|
|
348
|
+
"wordCount": 1612,
|
|
349
|
+
"vocabScore": 11.10,
|
|
350
|
+
"structuralScore": 7,
|
|
351
|
+
"finalScore": 10.00,
|
|
352
|
+
"rating": "heavy",
|
|
353
|
+
"recommendation": "Full document review — do not commit without fixing.",
|
|
354
|
+
"vocab": { "hits": [...] },
|
|
355
|
+
"structural": { "flags": [...], "metrics": {...} }
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### `slop-scan-vocab.ts` — Vocabulary-only scan
|
|
360
|
+
|
|
361
|
+
Scans for Tier 1-4 vocabulary markers (AI-prose vocabulary, phrases, and sycophantic language).
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
pnpm exec jiti scripts/slop-scan-vocab.ts README.md
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
#### `slop-scan-structural.ts` — Structural-only scan
|
|
368
|
+
|
|
369
|
+
Analyzes structural patterns with profile-aware thresholds: em dash density, bullet ratios, sentence clustering, participial tails, arrow usage, correlative pairs, plus-sign conjunctions, five-paragraph essay structure, conclusion mirroring, and more.
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
pnpm exec jiti scripts/slop-scan-structural.ts README.md
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Script location
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
skills/supi-flow-slop-detect/
|
|
379
|
+
├── SKILL.md
|
|
380
|
+
├── references/
|
|
381
|
+
│ └── vocabulary.json # Single source of truth for vocabulary markers
|
|
382
|
+
└── scripts/
|
|
383
|
+
├── slop-helpers.ts # Shared detection utilities
|
|
384
|
+
├── slop-scan-vocab.ts # Vocabulary marker detection (reads vocabulary.json)
|
|
385
|
+
├── slop-scan-structural.ts # Structural pattern detection
|
|
386
|
+
└── slop-scan.ts # Combined scanner + density scoring
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Tips
|
|
390
|
+
|
|
391
|
+
- **For agents**: Pipe `--json-only` output into `jq` or parse directly from the tool call.
|
|
392
|
+
- **For manual use**: Omit `--json-only` for the human-readable summary with score bar and metrics table.
|
|
393
|
+
- The SKILL.md itself scores high because it documents all slop patterns in its tables. Normal docs should score < 1.5.
|