@whamp/pi-pstack 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/agents/comment-sicko.md +34 -0
- package/agents/poteto-agent.md +13 -0
- package/extensions/pstack/ask-user-question.ts +137 -0
- package/extensions/pstack/config.ts +55 -0
- package/extensions/pstack/index.ts +330 -0
- package/extensions/pstack/pstack-config-status.ts +72 -0
- package/extensions/pstack/pstack-role-config-store.ts +287 -0
- package/extensions/pstack/pstack-role-config.ts +496 -0
- package/extensions/pstack/pstack-role-prompt.ts +33 -0
- package/extensions/pstack/pstack-roles.ts +252 -0
- package/extensions/pstack/pstack-setup-plan.ts +223 -0
- package/extensions/pstack/skill-strip.ts +62 -0
- package/package.json +60 -0
- package/skills/architect/SKILL.md +83 -0
- package/skills/architect/references/design-red-flags.md +33 -0
- package/skills/architect/references/rationale-template.md +35 -0
- package/skills/architect/references/runner-prompt.md +20 -0
- package/skills/arena/SKILL.md +71 -0
- package/skills/automate-me/SKILL.md +104 -0
- package/skills/blast-radius/SKILL.md +50 -0
- package/skills/bro/SKILL.md +7 -0
- package/skills/create-verification-skill/SKILL.md +44 -0
- package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/skills/deslop/SKILL.md +23 -0
- package/skills/figure-it-out/SKILL.md +53 -0
- package/skills/how/SKILL.md +52 -0
- package/skills/how/references/explainer-prompt.md +55 -0
- package/skills/how/references/explorer-prompt.md +52 -0
- package/skills/interrogate/SKILL.md +111 -0
- package/skills/interrogate/references/code-quality-review.md +47 -0
- package/skills/interrogate/references/lead-judgment.md +58 -0
- package/skills/interrogate/references/reviewer-prompt.md +72 -0
- package/skills/interrogate/references/rubric.md +77 -0
- package/skills/maintain-verification-skill/SKILL.md +39 -0
- package/skills/no-comments/SKILL.md +24 -0
- package/skills/poteto-mode/SKILL.md +147 -0
- package/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/skills/poteto-mode/playbooks/autopilot-full.md +13 -0
- package/skills/poteto-mode/playbooks/autopilot-stack.md +16 -0
- package/skills/poteto-mode/playbooks/babysit.md +27 -0
- package/skills/poteto-mode/playbooks/bug-fix.md +17 -0
- package/skills/poteto-mode/playbooks/eval.md +25 -0
- package/skills/poteto-mode/playbooks/feature.md +21 -0
- package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/skills/poteto-mode/playbooks/multi-phase-plan.md +156 -0
- package/skills/poteto-mode/playbooks/opening-a-pr.md +33 -0
- package/skills/poteto-mode/playbooks/orchestrate.md +199 -0
- package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
- package/skills/poteto-mode/playbooks/perf-issue.md +24 -0
- package/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/skills/poteto-mode/playbooks/shipping.md +17 -0
- package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/skills/poteto-mode/playbooks/worktree-cleanup.md +14 -0
- package/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/skills/poteto-mode/scripts/bootstrap.ts +62 -0
- package/skills/poteto-mode/scripts/bun.lock +67 -0
- package/skills/poteto-mode/scripts/check-plan.mjs +186 -0
- package/skills/poteto-mode/scripts/check-plan.test.mjs +25 -0
- package/skills/poteto-mode/scripts/orch/orch.test.ts +634 -0
- package/skills/poteto-mode/scripts/orch/orch.ts +578 -0
- package/skills/poteto-mode/scripts/orch/store.ts +1607 -0
- package/skills/poteto-mode/scripts/package.json +16 -0
- package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
- package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
- package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +118 -0
- package/skills/poteto-mode/scripts/watch-pr/github.test.ts +306 -0
- package/skills/poteto-mode/scripts/watch-pr/github.ts +699 -0
- package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +420 -0
- package/skills/poteto-mode/scripts/watch-pr/policy.ts +832 -0
- package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
- package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
- package/skills/poteto-mode/scripts/watch-pr/types.ts +401 -0
- package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/skills/poteto-mode/scripts/worktree-audit.sh +85 -0
- package/skills/principle-attack-the-premise/SKILL.md +23 -0
- package/skills/principle-boundary-discipline/SKILL.md +34 -0
- package/skills/principle-build-the-lever/SKILL.md +23 -0
- package/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
- package/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
- package/skills/principle-experience-first/SKILL.md +19 -0
- package/skills/principle-fix-root-causes/SKILL.md +23 -0
- package/skills/principle-foundational-thinking/SKILL.md +21 -0
- package/skills/principle-guard-the-context-window/SKILL.md +17 -0
- package/skills/principle-laziness-protocol/SKILL.md +18 -0
- package/skills/principle-make-operations-idempotent/SKILL.md +24 -0
- package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
- package/skills/principle-minimize-reader-load/SKILL.md +23 -0
- package/skills/principle-model-the-domain/SKILL.md +26 -0
- package/skills/principle-never-block-on-the-human/SKILL.md +22 -0
- package/skills/principle-outcome-oriented-execution/SKILL.md +22 -0
- package/skills/principle-prove-it-works/SKILL.md +33 -0
- package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
- package/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
- package/skills/principle-subtract-before-you-add/SKILL.md +21 -0
- package/skills/principle-test-behavior-not-implementation/SKILL.md +25 -0
- package/skills/principle-type-system-discipline/SKILL.md +31 -0
- package/skills/recall/SKILL.md +35 -0
- package/skills/reflect/SKILL.md +73 -0
- package/skills/reflect/references/divergent-reviewer.md +43 -0
- package/skills/reflect/references/judgment-reviewer.md +42 -0
- package/skills/reflect/references/synthesizer.md +56 -0
- package/skills/reflect/references/tooling-reviewer.md +55 -0
- package/skills/setup-pstack/SKILL.md +38 -0
- package/skills/setup-pstack/references/MODEL-ROLES.md +35 -0
- package/skills/show-me-your-work/SKILL.md +82 -0
- package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/skills/show-me-your-work/scripts/log.sh +40 -0
- package/skills/swarm/SKILL.md +46 -0
- package/skills/tdd/SKILL.md +44 -0
- package/skills/teach/SKILL.md +21 -0
- package/skills/technical-writing/SKILL.md +127 -0
- package/skills/typescript-best-practices/SKILL.md +29 -0
- package/skills/typescript-best-practices/references/patterns.md +313 -0
- package/skills/unslop/SKILL.md +67 -0
- package/skills/why/SKILL.md +154 -0
- package/skills/why/references/epistemics.md +144 -0
- package/skills/why/references/investigator-prompt.md +103 -0
- package/skills/why/references/source-playbook.md +17 -0
- package/skills/why/references/sources/code-archaeology.md +88 -0
- package/skills/why/references/sources/databricks.md +70 -0
- package/skills/why/references/sources/datadog.md +99 -0
- package/skills/why/references/sources/incident-postmortem.md +15 -0
- package/skills/why/references/sources/linear.md +48 -0
- package/skills/why/references/sources/notion.md +55 -0
- package/skills/why/references/sources/sentry.md +100 -0
- package/skills/why/references/sources/slack.md +54 -0
- package/skills/why/references/synthesizer-prompt.md +135 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
description: "Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TDD Bug Fix
|
|
8
|
+
|
|
9
|
+
When fixing a bug with a clear, cheap test path, make the broken behavior executable before changing production code. The goal is a focused regression test that fails before the fix and passes after it.
|
|
10
|
+
|
|
11
|
+
Do not force a test when it would be impractical. If the available test would require broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, vague reproduction steps, or large unrelated fixture churn, skip adding a new test and use the closest useful verification instead.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. **Understand the bug.** Identify the intended behavior, current behavior, affected path, and smallest observable reproduction.
|
|
16
|
+
2. **Choose the narrowest executable check.** Prefer the closest unit, component, integration, or regression test already used for that codepath. If no practical test path is obvious, do not create one from scratch just to satisfy the workflow.
|
|
17
|
+
3. **Write the failing test first.** Add the smallest focused test that would have caught the bug. The test should encode intended behavior, not mirror the current implementation.
|
|
18
|
+
4. **Run the new test before fixing.** Confirm it fails for the intended reason. If it passes or fails for an unrelated reason, correct the test or reproduction before editing the implementation.
|
|
19
|
+
5. **Fix the bug.** Make the smallest production change that satisfies the intended behavior while preserving nearby contracts.
|
|
20
|
+
6. **Rerun the regression test.** Confirm the test now passes.
|
|
21
|
+
7. **Run nearby validation.** Run relevant adjacent tests, type checks, lint, or scenario checks when the change has broader risk.
|
|
22
|
+
|
|
23
|
+
## If a Failing Test Is Impractical
|
|
24
|
+
|
|
25
|
+
Do not silently skip the regression step. Before fixing, explicitly explain why a failing test is impossible or not worth the cost, then choose the closest executable regression check available. Examples include a targeted script, manual reproduction command, browser automation, snapshot comparison, log assertion, or focused integration check.
|
|
26
|
+
|
|
27
|
+
Prefer no new test over a bad test. A bad test is one that mostly tests mocks, encodes current implementation details, depends on timing or unrelated global state, needs expensive infrastructure for a small fix, or would be deleted immediately after proving the fix.
|
|
28
|
+
|
|
29
|
+
## Guardrails
|
|
30
|
+
|
|
31
|
+
- Do not change tests merely to match a wrong implementation.
|
|
32
|
+
- Do not weaken existing assertions unless the expected behavior has genuinely changed and the reason is clear.
|
|
33
|
+
- Keep the regression test focused on the bug. Avoid broad fixture churn or unrelated coverage expansion.
|
|
34
|
+
- Do not add tests when the practical signal is weak. Use manual or scripted verification and say why.
|
|
35
|
+
- If the bug is flaky, make the test deterministic where possible and document the signal being locked down.
|
|
36
|
+
- If the bug exposes a broader class of failures, first land the focused regression path, then consider additional sibling coverage.
|
|
37
|
+
|
|
38
|
+
## Final Response
|
|
39
|
+
|
|
40
|
+
Report the evidence, not just the outcome:
|
|
41
|
+
|
|
42
|
+
- Name the failing-before test or executable check and the failure it produced.
|
|
43
|
+
- Name the passing-after test run and any nearby validation performed.
|
|
44
|
+
- If failing-before evidence could not be demonstrated, state why and describe the closest regression check used instead.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teach
|
|
3
|
+
description: "Explain a body of work plainly so a person actually understands it. Runs the `how` and `why` skills and weaves what they find into one clear explanation. Use for 'teach me this', 'help me really understand X', 'explain this change or subsystem to me'."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teach
|
|
8
|
+
|
|
9
|
+
**You explain what a thing is, how it works, and why it's built that way, in one plain account at the person's pace. The goal is that they understand it, not that you change anything.**
|
|
10
|
+
|
|
11
|
+
Teach sits on top of `how` and `why`. Get your bearings on what the work is and what it touches, then run `how` for how it works and `why` for why it's that way. Those are real skill invocations that do their own digging. Blend what they find into one plain explanation, lead with what matters to the person, and go deeper when they ask. Reword freely for teaching, with one exception. Keep `why`'s confidence language intact (its hedges are findings, not style).
|
|
12
|
+
|
|
13
|
+
1. Decide the few things they should walk away understanding. Choose them from why they're asking (about to change it, reviewing it, debugging it, new to it) and what they already know, both read from the conversation, not quizzed out of them. Skip what they plainly already know. Put the depth where their question is.
|
|
14
|
+
2. Let `how` and `why` do the work, don't redo it. Read the code yourself to get oriented, then run `how` for how it works and `why` for why. Run them in parallel and combine the results. Match the size to the question. Run both for a subsystem, maybe one is enough for a small change. Keep `why` narrow by default since its full sweep is slow. Put the narrowing in the ask itself (a scoped question, git plus a source or two) so `why` records the skipped categories per its own contract, and widen it only when the reasons are the point.
|
|
15
|
+
3. Start with a plain definition. Name the thing and say what it is in general terms, the way a senior engineer would say it out loud, with its common name if it has one. Then tie it to the case in front of you ("in X, we use this to ...") and build from there: how it works, the deeper reasons, the edge cases. For each part, explain the idea so it clicks: the problem it solves and how it actually works. Walk through what happens as the person does the thing (opens a long chat, scrolls up) when that is what makes it land. Listing functions and constants is reference, not teaching. Don't print framing labels ("the one idea to hold onto", "the thing to walk away with", "the key insight", "at its core", "TL;DR"). Give the smallest complete answer first, a sentence or two, not a dense paragraph, then stop. Add layers when they ask. Never a wall of text.
|
|
16
|
+
4. Keep it a conversation, not a lecture or a performance. Offer to go deeper or move on, and follow their lead. No quizzes. No pacing theater. Don't print "Pause", don't ask them to say it back, don't announce "the sentence to nail", and don't flag a part as important or hard ("here is the part worth slowing down on", "this is the tricky part", "here is where it gets interesting"). Just say it. When you would pause, stop and let them respond. Running one-shot with no live human, deliver it cleanly and put any offer to go deeper at the end.
|
|
17
|
+
5. Show, don't only tell, and build the picture up diagram by diagram. Open the diff, the code, or the debugger when that is the fastest way to land it. Draw when a picture lands faster than words. For anything with three or more moving parts, do not draw one diagram with all of them at once. Draw a short series instead, where each diagram redraws the last and adds a single part, so the reader watches the system assemble. A single all-at-once diagram, especially one saved for the end, is a reference, not teaching. Concretely, to teach a flow from A to B to C, draw it three times. First A to B. Then redraw and add C. Then redraw and add the return edge or the next piece. Match the medium to the idea, and use both kinds when both help. A mermaid diagram fits a flow or structure where the labels carry the meaning. When the idea is spatial, like layout, overlap, scroll position, or a before and after, reach for the image-generation tool and draw it marker-on-whiteboard style with a few short labels, since image models garble long text. Generate that picture, don't settle for describing it in words. The build-up rule holds for generated images too. A single simple point needs no figure.
|
|
18
|
+
|
|
19
|
+
Write every response through the **unslop** skill, in plain spoken English, the way you'd explain it to a colleague. Be tight, not terse. Cut filler and hedging, keep the part that makes it click. State the concrete mechanism, not a metaphor, a framing, or a preview of what is coming. This is the target density: "Virtualization runs in two parts, one for rendering and one for loading from disk. When an item scrolls out past the buffer, both its DOM node and its in-memory data are evicted." Normal sentence case, not all-lowercase. No em dashes. Prefer periods over commas. Keep each sentence to one or two commas. If clauses pile up, split them into separate sentences. Give each concept one name and keep it. Avoid mirror sentences ("A without B, or B without A") and tidy closers ("the rest follows", "it all falls out"). The words in these steps are directions to you, not labels to print. Don't echo the structure as headers or stock phrases.
|
|
20
|
+
|
|
21
|
+
**Reply:** the explanation itself, never a report about what you did or delivered. Lead with the main point, then the plain account of what it is, how it works, and why, and the threads worth chasing with `how` or `why`.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-writing
|
|
3
|
+
description: "Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for /skill:technical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Technical writing
|
|
8
|
+
|
|
9
|
+
The goal is writing a tired engineer understands on the first read. Four layers get you there, one question each: what kind of document is this, how do sentences address the reader, how much does each sentence carry, and can any sentence be read two ways. Apply all four.
|
|
10
|
+
|
|
11
|
+
Three rules sit above the layers:
|
|
12
|
+
|
|
13
|
+
- **Cut every word that does no work.** If the sentence survives without a word, the word goes. "In order to" is "to". "It is important to note that" is nothing.
|
|
14
|
+
- **Use the short, everyday word.** "Use", not "utilize". "Help", not "facilitate". "Do", not "perform". A long word has to buy its length with precision.
|
|
15
|
+
- **When a rule makes a sentence worse, fix the sentence another way or leave it alone.** The rules serve the reader. A sentence that follows every rule and sounds like a machine wrote it has failed.
|
|
16
|
+
|
|
17
|
+
The codebase is the word list. Write the real symbol, file, flag, or command name, not a synonym or a description of it.
|
|
18
|
+
|
|
19
|
+
Don't invent jargon. Use the words a developer would say out loud: "move", "delete", "a budget that only decreases", not "evacuate", "ratchet", or "endgame". A named pattern is fine when the doc says what it means the first time. Propose a new offender and its replacement as an addition to `unslop`'s abstract-metaphor rule in your reply, with the diff. Don't edit that skill.
|
|
20
|
+
|
|
21
|
+
## Vary the rhythm
|
|
22
|
+
|
|
23
|
+
The layers decide what a document says and how much each sentence carries. A doc can obey all of them and still read machine-written: every sentence clipped short, no view anywhere, nothing specific.
|
|
24
|
+
|
|
25
|
+
- Mix sentence lengths on purpose. Short sentences land a point. Longer ones that take their time carry a fact with its condition or consequence.
|
|
26
|
+
- One thought per sentence does not mean one length per sentence. Split the sentence that carries two thoughts. Keep the long sentence that carries one.
|
|
27
|
+
- Have a view where the mode allows it. Explanation weighs trade-offs, so say what you make of them instead of listing pros and cons. Reference stays dry.
|
|
28
|
+
- Be specific over sterile. Not "schema changes can cause issues" but "a column rename fails the build".
|
|
29
|
+
|
|
30
|
+
## Pick the mode first (Diátaxis)
|
|
31
|
+
|
|
32
|
+
One document, one mode. Two questions pick it: does the content inform action (doing) or understanding (thinking), and does it serve learning or work?
|
|
33
|
+
|
|
34
|
+
- Action + learning: **tutorial**.
|
|
35
|
+
- Action + work: **how-to**.
|
|
36
|
+
- Understanding + work: **reference**.
|
|
37
|
+
- Understanding + learning: **explanation**.
|
|
38
|
+
|
|
39
|
+
Use the compass on a whole document or on one sentence.
|
|
40
|
+
|
|
41
|
+
**Tutorial: learning by doing.** You are the teacher. The learner's success is your job, not theirs. Open by saying what the learner will build, not what they will "learn". Every step produces a visible result, early and often. Tell them what they should see: the expected output, the prompt change, the log line. Cut explanation to one clause and a link. Teaching pauses break the lesson. Stay concrete. Write as "we", in commands: "First, do x. Now, do y."
|
|
42
|
+
|
|
43
|
+
**How-to: steps to a goal.** Solve a problem a person has, not an operation the machine can perform. Assume competence. Skip teaching. Action only: no digressions, no background, no completeness for its own sake. Link those instead. Allow forks and judgment: "If you want x, do y." Name the guide by the task: "How to calibrate the radar array", not "Radar array calibration".
|
|
44
|
+
|
|
45
|
+
**Reference: facts for lookup.** Describe. Only describe. No instruction, no persuasion, no opinion. Be dry, complete, and sure. State facts, options, limits, and errors with no hedging. Mirror the structure of the thing described, so code and docs can be navigated together. Put material where readers expect it. Generate from code where possible, so it stays true.
|
|
46
|
+
|
|
47
|
+
**Explanation: understanding and why.** One bounded topic, readable away from the product. Each title should tolerate an implicit "About..." in front. Anchor on a real why question. Give context: design decisions, history, constraints, alternatives. Opinion is allowed here and nowhere else.
|
|
48
|
+
|
|
49
|
+
Don't mix modes: no reference tables inside a tutorial, no tutorial hand-holding inside reference, no arguing inside a how-to. Split and link instead.
|
|
50
|
+
|
|
51
|
+
Source: diataxis.fr, fetched 2026-07-18.
|
|
52
|
+
|
|
53
|
+
## Write sentences to the reader (Google developer style)
|
|
54
|
+
|
|
55
|
+
- Talk to the reader as "you", in the present tense. "Will" only for things that genuinely happen later.
|
|
56
|
+
- Say who does what: "the compiler checks", not "is checked". Passive is fine only when the actor is unknown or beside the point.
|
|
57
|
+
- Write instructions as commands: "Click Submit." State facts plainly. Never "should be done".
|
|
58
|
+
- Put the condition before the instruction: "To delete the document, click Delete." The reader skips what does not apply.
|
|
59
|
+
- Put the common case first. Exceptions after.
|
|
60
|
+
- Sound like a knowledgeable friend. No buzzwords, no figurative language, no "please" in instructions, and never "simply", "easy", or "quickly" in a procedure. If it were simple, the reader would not be here.
|
|
61
|
+
- Don't pre-announce ("we will soon support...") and don't start consecutive sentences with the same phrase.
|
|
62
|
+
- Link with words that say where the link goes: the page title or a short description. Never "click here". Prefer a sentence of context on the page over a link off it.
|
|
63
|
+
- Headings carry the point, not just the topic ("Pick the mode first", not "Modes"). Sentence case. A task heading is a bare verb phrase ("Create an instance"). A concept heading is a noun phrase. One h1 per page, no skipped levels.
|
|
64
|
+
- Numbered lists for sequences, bullets for everything else. Introduce a list with a complete sentence. Keep items parallel.
|
|
65
|
+
- Code goes in code font. UI elements go in bold. Use serial commas. Drop "etc." and say up front that a list is partial.
|
|
66
|
+
|
|
67
|
+
Source: developers.google.com/style, fetched 2026-07-18.
|
|
68
|
+
|
|
69
|
+
## Make statements load one at a time (STE rules)
|
|
70
|
+
|
|
71
|
+
- One instruction per sentence. One thought per sentence everywhere else.
|
|
72
|
+
- Split instructions longer than about 20 words and other sentences longer than about 25.
|
|
73
|
+
- Put the warning or condition before the step it guards: "If hot oil touches your skin, injuries can occur."
|
|
74
|
+
- Keep "the" and "a": "Remove backup file" reads two ways. "Remove the backup file" reads one.
|
|
75
|
+
- Give each word one meaning and one job, then keep it. If "check" means inspect, don't also use it for restrain.
|
|
76
|
+
- Pick one word per action and stick to it: "start", not "start" here and "initiate" there.
|
|
77
|
+
- Write procedures as direct commands, never as narration and never in the passive: "Install the component", not "the component must be installed".
|
|
78
|
+
- Avoid "-ing" words where you can. They take too many grammatical jobs and breed misreadings.
|
|
79
|
+
|
|
80
|
+
Source: asd-ste100.org (Issue 9, 2025), fetched 2026-07-18. The numbered rules and dictionary live in the spec PDF. The principles above are the transferable core.
|
|
81
|
+
|
|
82
|
+
## Leave no sentence open to two readings (Global English)
|
|
83
|
+
|
|
84
|
+
- Keep words like "only" and "not" next to the word they change: "only fails on growth" and "fails only on growth" say different things.
|
|
85
|
+
- Break up long noun strings: "the proto import budget check script" becomes "the script that checks the proto-import budget".
|
|
86
|
+
- Make every "it", "they", and "this" point at one obvious thing. Repeat the noun when in doubt. Never use "this" or "which" to point at a whole clause.
|
|
87
|
+
- Don't drop verbs: "Phase 1 moves the converters and Phase 2 the runtime" leaves Phase 2 without one. Give it one.
|
|
88
|
+
- Keep the small words that show structure. "Ensure that the switch is off" keeps "that" because it makes the sentence parse one way. Never trade clarity for word count.
|
|
89
|
+
- Repeat the article in a series when it prevents a misread: "the client and the host", not "the client and host", when they are two things.
|
|
90
|
+
- Say which parts "and" or "or" joins when a sentence can group two ways. "Both...and", "either...or", and "if...then" are free disambiguators.
|
|
91
|
+
- Use periods, not semicolons. Replace an em dash with a new sentence.
|
|
92
|
+
- Make text in parentheses a full grammatical unit or its own sentence. Never form plurals with "(s)".
|
|
93
|
+
- No slashes: write "a, b, or both" instead of "a/b" or "and/or".
|
|
94
|
+
- Call each thing by one name, everywhere. A doc that says "the gate", "the ratchet", and "the budget check" for one thing teaches three things. Rewording an unchanged sentence between edits costs the same way. Don't churn what didn't change.
|
|
95
|
+
- Skip idioms, colloquialisms, Latin abbreviations, and metaphors. A non-native reader, a translator, and an agent all parse plain constructions best.
|
|
96
|
+
|
|
97
|
+
Source: Kohl, The Global English Style Guide (SAS Press). Guideline text fetched from the Internet Archive and the SAS sample chapter, 2026-07-18.
|
|
98
|
+
|
|
99
|
+
## Voice and repo specifics
|
|
100
|
+
|
|
101
|
+
- Apply the **unslop** skill to every doc this skill touches. That skill owns the slop-pattern catalog: AI vocabulary, filler, hedging, formatting tells.
|
|
102
|
+
- PR descriptions and commit messages are writing too. Every layer except Diátaxis applies to them. A PR body is a briefing that a reviewer can read in under a minute. Do not paste swarm logs, SHA lists, or metric tables. Link them.
|
|
103
|
+
- Product UI strings are not documentation. Use your product's copy guidelines for those.
|
|
104
|
+
- Indent code snippets with tabs. Write real paths and real symbols. Make every count or tree claim true at the commit that lands it, and include the command that regenerates it.
|
|
105
|
+
|
|
106
|
+
## Worked example
|
|
107
|
+
|
|
108
|
+
Before:
|
|
109
|
+
|
|
110
|
+
> Configuration of the proto import ratchet budget script parameters is performed via budget.json. Note that it's important to remember that running with --write, which updates the committed budget to reflect the current count, should only be done when lowering it. If exceeded, CI fails.
|
|
111
|
+
|
|
112
|
+
After:
|
|
113
|
+
|
|
114
|
+
> `budget.mjs` reads the committed budget from `budget.json` and counts the files that import protos. If the count exceeds the budget, CI fails. Run `budget.mjs --write` only to lower the budget.
|
|
115
|
+
|
|
116
|
+
## Review checklist
|
|
117
|
+
|
|
118
|
+
Apply to any prose this skill covers. Item 1 applies only to document sets:
|
|
119
|
+
|
|
120
|
+
1. Is each file one Diátaxis mode, with links where modes meet?
|
|
121
|
+
2. Is every instruction written as a command, with its condition in front?
|
|
122
|
+
3. Does any sentence carry two instructions or two thoughts? Split it.
|
|
123
|
+
4. Can any word be cut without losing meaning? Cut it.
|
|
124
|
+
5. Is "only" next to the word it changes? Does every "it" point at one thing? Does every clause keep its verb?
|
|
125
|
+
6. Does each thing have exactly one name across the docs?
|
|
126
|
+
7. Would a developer say these words out loud? Replace invented metaphors and fancy synonyms with the plain word or the real symbol name.
|
|
127
|
+
8. Are all symbols, paths, and counts real at this commit, with the commands that regenerate the counts?
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typescript-best-practices
|
|
3
|
+
description: TypeScript best practices. Use when reading or editing any .ts or .tsx file.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TypeScript best practices
|
|
7
|
+
|
|
8
|
+
Apply the **type-system-discipline** principle skill first.
|
|
9
|
+
|
|
10
|
+
| Rule | Summary |
|
|
11
|
+
|------|---------|
|
|
12
|
+
| Discriminated unions | Model variants with a `kind` literal discriminant so impossible states can't be represented. No optional-field bags. |
|
|
13
|
+
| Branded types | Brand primitives with `& { readonly __brand: "X" }` so they can't be mixed up. Validate once at the boundary. |
|
|
14
|
+
| Constructive modeling | Build the shape so the illegal value can't be constructed. `[T, ...T[]]` for non-empty, `[T, T][]` for even length, `start` plus `duration` for a range. Not a runtime guard, not a wish for refinement types. |
|
|
15
|
+
| Simplest total type | Keep `T[]` while every operation on it stays total. Strengthen to `NonEmpty<T>` only where the loose type forces `!`, a cast, or a "should never happen" throw. |
|
|
16
|
+
| `unknown` over `any` | External data is `unknown`. |
|
|
17
|
+
| Schemas before guards | Before hand-writing a property-by-property type guard, use the repository's runtime schema library and infer the type from the schema, such as `z.infer`. |
|
|
18
|
+
| No `as` casts | Every `as` is a runtime crash waiting. Cast only after validation. |
|
|
19
|
+
| Narrowing hierarchy | Discriminant switch > `in` operator > `typeof`/`instanceof` > user-defined type guard > `as`. |
|
|
20
|
+
| Type guards | Must verify the claim. A lying guard is worse than `as` because the bug hides behind a name that says it's safe. Name them `isX` or `hasX`. |
|
|
21
|
+
| Exhaustiveness | Inline `const _exhaustive: never = x;` in default arms so the compiler errors when a new variant is added. |
|
|
22
|
+
| `satisfies` over `as` | Validates the value without widening literal types. |
|
|
23
|
+
| Boundary validation | Parse where data crosses in, into a named domain type. `Record<string, unknown>` (however spelled) stops at that parse. Trust types inside. See the **boundary-discipline** principle skill. |
|
|
24
|
+
| Schema-derived types | Reach for `Pick`/`Omit`/`Parameters`/`ReturnType`/`Awaited`/`typeof` before declaring a new interface. |
|
|
25
|
+
| Object args | Pass objects, not positional, so argument order is self-documenting. Skip on hot paths (per-frame render, tokenizers, parsers). |
|
|
26
|
+
| Real tests | Don't mock what you can run. Prefer the framework's real test primitives with leak/disposable checks, and verify UI in a running build. Mock only what you can't run locally. |
|
|
27
|
+
| Structured telemetry | Prefer structured logger diagnostics with enough context to debug from an id. No `console.log` in shipped code. |
|
|
28
|
+
|
|
29
|
+
Examples: `references/patterns.md`.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# TypeScript patterns
|
|
2
|
+
|
|
3
|
+
Code examples for each rule in `SKILL.md`. The underlying principles are language-agnostic. See the **type-system-discipline** and **boundary-discipline** principle skills.
|
|
4
|
+
|
|
5
|
+
## Branded types
|
|
6
|
+
|
|
7
|
+
Brand primitives so they can't be mixed up. Validate once at the boundary. Downstream code trusts the type.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
type AgentId = string & { readonly __brand: "AgentId" };
|
|
11
|
+
|
|
12
|
+
function parseAgentId(input: string): AgentId {
|
|
13
|
+
if (!isUUID(input)) throw new Error(`Invalid agent id: ${input}`);
|
|
14
|
+
return input as AgentId;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function focusAgent(id: AgentId): void {
|
|
18
|
+
/* input is trusted */
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Match the `readonly __brand: 'X'` shape. Don't invent a new convention.
|
|
23
|
+
|
|
24
|
+
## Discriminated unions
|
|
25
|
+
|
|
26
|
+
Model variants with a literal discriminant. Every variant shares the field name and each variant's value is unique, so impossible combos can't be represented.
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
// Don't. Boolean + optionals lets contradictory states exist.
|
|
30
|
+
type DiffState = { loading: boolean; diff?: GitDiff; error?: string };
|
|
31
|
+
|
|
32
|
+
// Do. Only valid states exist.
|
|
33
|
+
type DiffState =
|
|
34
|
+
| { kind: "loading" }
|
|
35
|
+
| { kind: "ready"; diff: GitDiff }
|
|
36
|
+
| { kind: "error"; error: string };
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Pick one discriminant name (`kind`, `type`, `tag`) and stick to it.
|
|
40
|
+
|
|
41
|
+
## Constructive modeling
|
|
42
|
+
|
|
43
|
+
Build the type from parts that are all legal instead of restricting a loose type with runtime checks.
|
|
44
|
+
|
|
45
|
+
Non-empty, via a variadic tuple:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
type NonEmpty<T> = [T, ...T[]];
|
|
49
|
+
|
|
50
|
+
// Don't: T[] plus a length check every caller must repeat
|
|
51
|
+
function pickWinner(entries: string[]): string {
|
|
52
|
+
if (entries.length === 0) throw new Error("no entries");
|
|
53
|
+
return entries[Math.floor(Math.random() * entries.length)];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Do: an empty value of the type can't exist
|
|
57
|
+
function pickWinner(entries: NonEmpty<string>): string {
|
|
58
|
+
return entries[Math.floor(Math.random() * entries.length)];
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Where a plain `T[]` arrives, narrow once with a guard. The fact then travels in the type:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const isNonEmpty = <T>(arr: T[]): arr is NonEmpty<T> => arr.length > 0;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Even length, as pairs:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
type Pairs<T> = [T, T][];
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A time range, as start plus duration:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
// Don't: a comment holds the invariant
|
|
78
|
+
type TimeRange = { start: Date; end: Date }; // start <= end
|
|
79
|
+
|
|
80
|
+
// Do: a negative range can't be written; derive end when needed
|
|
81
|
+
type TimeRange = { start: Date; durationMs: number };
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Keep `durationMs` a plain number. Brand it (per Branded types) only if a raw number could be passed where a duration is expected, not by reflex. Pick the representation that makes the bad state unconstructable, then expose the reading you need on top (`pairs.flat()`, a `rangeEnd()` helper).
|
|
85
|
+
|
|
86
|
+
## Simplest total type
|
|
87
|
+
|
|
88
|
+
Don't strengthen everything. Keep `T[]` when every operation on it is total:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
const sum = (xs: number[]) => xs.reduce((a, b) => a + b, 0); // [] is 0, fine
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Strengthen when the loose type forces a lie at a use site. The tells are `!`, `arr[0] as T`, and a "should never happen" throw:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
// Don't: partiality smuggled past the compiler
|
|
98
|
+
function newestSession(sessions: Session[]): Session {
|
|
99
|
+
return sessions.at(0)!;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Do: strengthen the input; the assertion disappears
|
|
103
|
+
function newestSession(sessions: NonEmpty<Session>): Session {
|
|
104
|
+
return sessions[0];
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Weakening the result to `Session | undefined` is the other total signature.
|
|
109
|
+
|
|
110
|
+
## `unknown` over `any`
|
|
111
|
+
|
|
112
|
+
External data is always `unknown`. Narrow before use.
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
// Don't
|
|
116
|
+
function handle(input: any) {
|
|
117
|
+
return input.foo.bar;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Do
|
|
121
|
+
function handle(input: unknown) {
|
|
122
|
+
if (typeof input === "object" && input !== null && "foo" in input) {
|
|
123
|
+
// narrowed; compiler verifies access
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
External sources include RPC payloads, `JSON.parse`, `postMessage`, IPC, file contents, environment variables, database results.
|
|
129
|
+
|
|
130
|
+
## Schemas before hand-rolled guards
|
|
131
|
+
|
|
132
|
+
Before writing a property-by-property type guard for external data, look for the repository's runtime schema library and existing schemas. Let one schema own validation and derive the TypeScript type from it. Do not maintain a schema, a duplicate interface, and a guard that can drift apart.
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import { z } from "zod";
|
|
136
|
+
|
|
137
|
+
const UserSchema = z.object({
|
|
138
|
+
id: z.string().uuid(),
|
|
139
|
+
role: z.enum(["admin", "member"]),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
type User = z.infer<typeof UserSchema>;
|
|
143
|
+
|
|
144
|
+
function parseUser(input: unknown): User {
|
|
145
|
+
return UserSchema.parse(input);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Use `safeParse` when failure is an expected branch. Use the equivalent inference helper when the repository uses another schema library. Do not add a new schema dependency for one guard. This rule prefers the schema system the codebase already trusts.
|
|
150
|
+
|
|
151
|
+
## No `as` casts
|
|
152
|
+
|
|
153
|
+
Every `as` is a potential runtime crash. Cast only after the type system has verified the claim.
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
// Don't
|
|
157
|
+
const user = data as User;
|
|
158
|
+
|
|
159
|
+
// Do. Earn the cast at the boundary.
|
|
160
|
+
function parseUser(data: unknown): User {
|
|
161
|
+
if (typeof data !== "object" || data === null) {
|
|
162
|
+
throw new Error("expected object");
|
|
163
|
+
}
|
|
164
|
+
if (!("id" in data) || typeof (data as Record<string, unknown>).id !== "string") {
|
|
165
|
+
throw new Error("expected id");
|
|
166
|
+
}
|
|
167
|
+
// ... validate all fields
|
|
168
|
+
return data as User; // OK, earned cast after full validation
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
When refactoring an `as` out of existing code, identify why TypeScript can't infer:
|
|
173
|
+
|
|
174
|
+
- Missing discriminant: add one, switch to a discriminated union.
|
|
175
|
+
- Overly wide source type (e.g. `Record<string, unknown>`): narrow it.
|
|
176
|
+
- Untyped boundary: add a parse function or schema.
|
|
177
|
+
- Genuinely inexpressible: use a branded type or `satisfies`.
|
|
178
|
+
|
|
179
|
+
## Narrowing hierarchy
|
|
180
|
+
|
|
181
|
+
From best to last-resort:
|
|
182
|
+
|
|
183
|
+
1. **Discriminated union switch / if.** Compiler narrows automatically.
|
|
184
|
+
2. **`in` operator.** `"key" in obj` narrows to variants containing that key.
|
|
185
|
+
3. **`typeof` / `instanceof`.** For primitives and class instances.
|
|
186
|
+
4. **User-defined type guard.** When the above aren't enough.
|
|
187
|
+
5. **`as` cast.** Only after validation.
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
function area(s: Shape): number {
|
|
191
|
+
if ("radius" in s) return Math.PI * s.radius ** 2; // narrowed to circle
|
|
192
|
+
return s.width * s.height; // narrowed to rect
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Type guards
|
|
197
|
+
|
|
198
|
+
A guard must actually verify the claim. A lying guard is worse than `as`.
|
|
199
|
+
|
|
200
|
+
```ts
|
|
201
|
+
function isCircle(s: Shape): s is Shape & { kind: "circle" } {
|
|
202
|
+
return s.kind === "circle";
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Prefer discriminant narrowing when possible.
|
|
207
|
+
|
|
208
|
+
## Exhaustiveness
|
|
209
|
+
|
|
210
|
+
In default arms, assign the discriminant to a `never`-typed local.
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
// Value-returning switch
|
|
214
|
+
function area(s: Shape): number {
|
|
215
|
+
switch (s.kind) {
|
|
216
|
+
case "circle":
|
|
217
|
+
return Math.PI * s.radius ** 2;
|
|
218
|
+
case "rect":
|
|
219
|
+
return s.width * s.height;
|
|
220
|
+
default: {
|
|
221
|
+
const _exhaustive: never = s;
|
|
222
|
+
return _exhaustive;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Void switch
|
|
228
|
+
function handle(s: Shape): void {
|
|
229
|
+
switch (s.kind) {
|
|
230
|
+
case "circle":
|
|
231
|
+
drawCircle(s);
|
|
232
|
+
break;
|
|
233
|
+
case "rect":
|
|
234
|
+
drawRect(s);
|
|
235
|
+
break;
|
|
236
|
+
default: {
|
|
237
|
+
const _exhaustive: never = s;
|
|
238
|
+
void _exhaustive;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Return-style in value-returning switches, void-style in statement switches.
|
|
245
|
+
|
|
246
|
+
## `satisfies` over `as`
|
|
247
|
+
|
|
248
|
+
`satisfies` validates without widening literal types.
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
// Don't. Widens, loses literal types.
|
|
252
|
+
const config = { theme: "dark", cols: 3 } as Config;
|
|
253
|
+
|
|
254
|
+
// Do. Validates AND preserves literal types.
|
|
255
|
+
const config = { theme: "dark", cols: 3 } satisfies Config;
|
|
256
|
+
// config.theme is "dark" (literal), not string
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Boundary validation
|
|
260
|
+
|
|
261
|
+
Validate once where data crosses in. Trust types inside. See the **boundary-discipline** principle skill.
|
|
262
|
+
|
|
263
|
+
- **Wire formats** (proto, JSON-RPC): parse with `ignoreUnknownFields` so forward-compatible changes don't break old clients.
|
|
264
|
+
- **Persisted JSON:** versioned blob with a try/catch around the parse.
|
|
265
|
+
- **Don't re-validate** deep in call chains.
|
|
266
|
+
|
|
267
|
+
## Schema-derived types
|
|
268
|
+
|
|
269
|
+
When a `.proto`, OpenAPI spec, GraphQL schema, or database migration already defines a shape, derive from the generated types instead of duplicating them.
|
|
270
|
+
|
|
271
|
+
```ts
|
|
272
|
+
// Don't. Duplicate shape, drifts when the schema changes.
|
|
273
|
+
type CheckSummary = {
|
|
274
|
+
totalCount: number;
|
|
275
|
+
checks: { name: string; status: string }[];
|
|
276
|
+
};
|
|
277
|
+
function renderChecks(s: CheckSummary) {
|
|
278
|
+
/* ... */
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Do. Derive from the generated schema type.
|
|
282
|
+
import type { ChecksMessage } from "<generated module>";
|
|
283
|
+
function renderChecks(s: Pick<ChecksMessage, "totalCount" | "checks">) {
|
|
284
|
+
/* ... */
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Reach for `Pick`, `Omit`, `Parameters`, `ReturnType`, `Awaited`, `typeof` before writing a new interface.
|
|
289
|
+
|
|
290
|
+
## Object args
|
|
291
|
+
|
|
292
|
+
```ts
|
|
293
|
+
// Don't. Swap two args, still compiles.
|
|
294
|
+
openFile(uri, {
|
|
295
|
+
startLineNumber: 10,
|
|
296
|
+
startColumn: 1,
|
|
297
|
+
endLineNumber: 10,
|
|
298
|
+
endColumn: 1,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// Do. Order-independent, self-documenting.
|
|
302
|
+
openFile({
|
|
303
|
+
uri,
|
|
304
|
+
selection: {
|
|
305
|
+
startLineNumber: 10,
|
|
306
|
+
startColumn: 1,
|
|
307
|
+
endLineNumber: 10,
|
|
308
|
+
endColumn: 1,
|
|
309
|
+
},
|
|
310
|
+
});
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Skip on hot paths: per-frame render, tokenizers, parsers, anything in a tight loop where the allocation cost matters.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unslop
|
|
3
|
+
description: Cut AI tells from any writing. Must always apply.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unslop
|
|
7
|
+
|
|
8
|
+
Edit text to remove AI patterns.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. Scan for the patterns below.
|
|
13
|
+
2. Rewrite. Preserve meaning, match intended tone.
|
|
14
|
+
3. Self-audit: "What makes this obviously AI generated?" Fix remaining tells.
|
|
15
|
+
|
|
16
|
+
## Patterns to detect and fix
|
|
17
|
+
|
|
18
|
+
Rule numbers are stable ids that other skills cite. A removed rule leaves a gap.
|
|
19
|
+
|
|
20
|
+
### Content
|
|
21
|
+
|
|
22
|
+
3. **Superficial -ing phrases.** "highlighting...", "ensuring...", "reflecting...", "showcasing...", "fostering...". Delete or expand with real sources.
|
|
23
|
+
5. **Vague attributions.** "Experts believe", "Industry reports suggest", "Some critics argue". Name the source or delete.
|
|
24
|
+
|
|
25
|
+
### Language
|
|
26
|
+
|
|
27
|
+
7. **AI vocabulary.** Additionally, crucial, delve, enduring, enhance, fostering, garner, interplay, intricate, landscape (abstract), pivotal, showcase, tapestry (abstract), testament, underscore, vibrant. Replace with plain words.
|
|
28
|
+
8. **Fancy ways to say "is".** "serves as", "stands as", "boasts", "features". Just say "is" or "has".
|
|
29
|
+
9. **"Not just X, but Y."** State the point directly instead.
|
|
30
|
+
10. **Rule of three.** Forcing ideas into groups of three. Use the natural number.
|
|
31
|
+
11. **Synonym cycling.** Protagonist, main character, central figure, hero all in one paragraph. Pick one, repeat it.
|
|
32
|
+
12. **False ranges.** "from X to Y" where X and Y aren't on a meaningful scale. List topics directly.
|
|
33
|
+
|
|
34
|
+
### Style
|
|
35
|
+
|
|
36
|
+
13. **Em dash overuse.** Avoid em dashes entirely. Use periods or commas only (no parentheses, no en dashes, no hyphen-as-dash substitutes). If a thought needs separation, end the sentence or use a comma.
|
|
37
|
+
14. **Colon overuse.** Colons are fine before a list or example. Not as mid-sentence connectors. "If you're coming from traditional automation: instead of registering event handlers, you describe conditions" adds nothing with the colon. Rewrite to let the point stand on its own without comparison framing. "Describing when the scheduler should fire works best as plain English." Same meaning, no crutch punctuation.
|
|
38
|
+
15. **Boldface overuse.** Don't bold every proper noun or acronym.
|
|
39
|
+
16. **Inline-header lists.** The tell is a bold label and colon that restates the line: "**Performance:** Performance improved...". Convert those to prose. A bold lead-in that ends in a period, names the item, and is followed by genuinely new detail ("**Schema in TypeScript.** Tables live in one file.") is fine, not a tell.
|
|
40
|
+
17. **Title case headings.** Use sentence case.
|
|
41
|
+
18. **Decorative emojis.** Remove from headings and bullets.
|
|
42
|
+
19. **Curly quotes.** Replace with straight quotes.
|
|
43
|
+
|
|
44
|
+
### Communication artifacts
|
|
45
|
+
|
|
46
|
+
20. **Chatbot phrases.** "I hope this helps!", "Let me know if...", "Of course!", "Certainly!", "Found the smoking gun!" Remove.
|
|
47
|
+
22. **Sycophantic tone.** "Great question! You're absolutely right!" Respond directly.
|
|
48
|
+
|
|
49
|
+
### Filler
|
|
50
|
+
|
|
51
|
+
23. **Filler phrases.** "In order to" becomes "To". "Due to the fact that" becomes "Because". "It is important to note that" gets deleted.
|
|
52
|
+
24. **Excessive hedging.** "could potentially possibly be argued that it might" becomes "may".
|
|
53
|
+
25. **Generic conclusions.** "The future looks bright." State specific plans or facts.
|
|
54
|
+
|
|
55
|
+
### Jargon
|
|
56
|
+
|
|
57
|
+
26. **Abstract metaphor nouns.** Substrate, wedge, vector, locus, vantage, nexus, primitive (as noun), harness (as metaphor), surface (as in "API surface"), bedrock, scaffolding (as metaphor), modality, paradigm, gold-plating, ratchet (as metaphor), evacuate (for moving code), endgame, north star, flywheel. These read as technical but usually have a plainer concrete word. "Substrate" becomes "base". "Wedge in" becomes "add". "Vector" becomes "way" or "method". "Gold-plating" becomes "more than the job needs". "Ratchet" becomes the mechanism's real name or "a limit that only tightens". "Evacuate" becomes "move out". "Endgame" becomes "the last phase". Pick the concrete word.
|
|
58
|
+
|
|
59
|
+
### Plain speech
|
|
60
|
+
|
|
61
|
+
27. **Say what it does, not how it feels.** "the database stays close at hand", "SQL you can read", "types that follow your schema" name a feeling. The fix names the mechanism or a number: "`.toSQL()` returns the exact string sent to the database", "a column rename fails the build". Ask what the sentence tells the reader to do or know, then write that. If you can't restate it as a concrete instruction, fact, or number, cut it. One more check: if the sentence could appear unchanged in another project's docs, it says nothing about this one. Cut it.
|
|
62
|
+
28. **Shorten or split dense sentences.** If the reader has to backtrack to parse a sentence, break it in two or drop clauses. One idea per sentence.
|
|
63
|
+
29. **Active voice.** Prefer it. Catch "is/are/was/were + past participle" and name the actor: "queries are validated" becomes "the compiler validates queries", "the file is parsed by the loader" becomes "the loader parses the file". Passive is fine only when the actor is unknown or genuinely doesn't matter.
|
|
64
|
+
30. **Cut adverbs, or use a stronger verb.** "runs quickly" becomes "is fast" or the number. "significantly improves" becomes the measured delta. An adverb propping up a weak verb means the verb is wrong.
|
|
65
|
+
31. **Prefer the plain word.** "utilize" becomes "use", "leverage" becomes "use", "facilitate" becomes "help", "numerous" becomes "many", "in the event that" becomes "if". The fancier synonym is rarely clearer.
|
|
66
|
+
32. **Mannered prose.** Metaphor or flourish where a literal phrase exists: aphorisms ("wire it or delete it"), rhetorical fragments for effect, personified code ("the plan holds it"), figurative verbs ("rides along", "stands on"), stock framing phrases. "A dial worth turning" becomes "a parameter worth varying". Say what you mean. Rule 26 covers the metaphor nouns.
|
|
67
|
+
33. **Over-compression.** Dropped articles, verbless fragments, symbol-speak, and abbreviations that make the reader decode instead of read. "Parser rejects bad date → exit 2, no write" becomes "The parser rejects a bad date, exits with code 2, and writes nothing." Write whole sentences with their articles and verbs, and spell out arrows and abbreviations.
|