Rules for an AI coding agent to filter out generic AI-generated UI designs, text, and code.
JavaScript accessibilityagent-skillsai-agentsai-coding-agentai-slopanti-slopclaude-codecopywritingdesign-rulesui-design
v3.2.8: repair round (Antigravity global path to ~/.gemini/config/skills, entry-file writer rebuilt, picker refuses a non-TTY run)
miqdadbadzubair-designf7130f3f7051
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex de11e13..c39f9b6 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -8,7 +8,7 @@{"name": "antislop","source": "./",- "version": "3.2.7",+ "version": "3.2.8","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills."}]diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex 6bb0b28..6b9d542 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "antislop","displayName": "antislop",- "version": "3.2.7",+ "version": "3.2.8","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills.","author": {"name": "miqdadbadjuber"diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.jsonindex 517369e..89c0543 100644--- a/.codex-plugin/plugin.json+++ b/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "antislop",- "version": "3.2.7",+ "version": "3.2.8","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills.","author": {"name": "miqdadbadjuber"diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.jsonindex 9392226..3988f68 100644--- a/.cursor-plugin/plugin.json+++ b/.cursor-plugin/plugin.json@@ -2,7 +2,7 @@"name": "antislop","displayName": "antislop","description": "Anti Slop: Rules for AI Coding Agents. Stops generic AI slop in generated UI, copy, and code. Loads as six skills.",- "version": "3.2.7",+ "version": "3.2.8","author": {"name": "miqdadbadjuber"},diff --git a/GUIDE.md b/GUIDE.mdindex a66d4de..ec1b2bb 100644--- a/GUIDE.md+++ b/GUIDE.md@@ -44,9 +44,9 @@ npx antislop-aiIt shows you what antislop has, then asks three things:-- **Which agent(s) you use.** It detects the ones present in your project. Each agent reads antislop from its own folder. On a project install the picker also writes the pointer that reloads antislop in every session; a global install writes no pointer and relies on the skills loading themselves by description. Hermes installs globally (into `~/.hermes/skills/`) because it does not read project folders.- **Which skills you want.** The core is always on. The extra skills load only for the work you do. See [What is a skill?](#what-is-a-skill).- **Where antislop should live.** This project only, or everywhere on your machine.+- **Which agent(s) you use.** It detects the ones present in your project. Each agent reads antislop from its own folder. On a project install the picker also writes the pointer that reloads antislop in every session; a global install writes no pointer and relies on the skills loading themselves by description. Hermes installs globally (into `~/.hermes/skills/`); the picker does not write a Hermes project folder yet.That is the whole install. No agent entry file to write by hand, nothing else to run.@@ -127,15 +127,17 @@ The one-command way installs into the folder your agent reads. This is what it w| Gemini CLI | `.gemini/skills/` || Hermes | `~/.hermes/skills/` (global only) |+A global install writes the same folder under your home directory, with two exceptions. OpenCode documents its global skills folder as `~/.config/opencode/skills/`, so the picker writes there rather than to `~/.opencode/skills/`, which OpenCode still reads but does not document. Antigravity reads a project's `.agents/skills/`, but under your home directory it reads `~/.gemini/config/skills/` and not `~/.agents/skills/`, so the picker writes there on a global install.+On a project install the picker also writes the pointer that reloads antislop every session: into the project's `AGENTS.md` for Codex, Antigravity, OpenCode, and Cursor, into `CLAUDE.md` for Claude Code, and into `GEMINI.md` for Gemini CLI. For OpenCode that is the whole mechanism: it loads the skill folders from `.opencode/skills/` and reads the pointer from `AGENTS.md`, which was verified against the opencode CLI.-Gemini CLI is legacy support: it was sunset on 18 June 2026 and superseded by Antigravity. The picker still installs into `.gemini/skills/` for existing Gemini CLI setups.+Gemini CLI is legacy support. Consumer access ended on 18 June 2026 and Antigravity replaced it, but it was not a total shutdown: enterprise Code Assist licences and paid API keys still work, and the repository is still maintained. The picker still installs into `.gemini/skills/` for existing Gemini CLI setups.## What is a skill?A skill is an optional folder (with a `SKILL.md` inside) that goes deeper into one concern. The core works alone; a skill adds depth for one topic. Skills reference the core rules by number and never duplicate them, so adding one does not change the core.-There are five skills. Pick the one that matches your work:+There are five skills on top of the core. Pick the one that matches your work:- **UI work** (look and feel: layout, color, components, animation) → antislop-ui- **Copy work** (headlines, buttons, tone, made-up statistics) → antislop-copywritingdiff --git a/README.md b/README.mdindex 15cde48..56b6ad3 100644--- a/README.md+++ b/README.md@@ -30,7 +30,7 @@ The core prevents slop but cannot invent direction. `DESIGN.md` (yours) suppliesantislop ships as a set of **standard agent skills** (one folder per skill, holding a `SKILL.md`). The core is always loaded; the other skills load only when the task needs them. Pick one of these six paths from this one repo.-**1. The picker (recommended).** One command, then answer the prompts. It asks where to install (this project or everywhere), which agents you use, and which extra skills you want, then copies the folders. On a project install it also writes the pointer that loads antislop every session; a global install writes no pointer and relies on the skills loading themselves by description. Path 2 does not write that pointer, so start here:+**1. The picker (recommended).** One command, then answer the prompts. It asks which extra skills you want, where to install (this project or everywhere), and which agents you use, then copies the folders. On a project install it also writes the pointer that loads antislop every session; a global install writes no pointer and relies on the skills loading themselves by description. Path 2 does not write that pointer, so start here:```bashnpx antislop-ai@@ -55,13 +55,13 @@ skills.sh reads the folders straight from this repository, so the listing needs/plugin install antislop@anti-slop```-**4. The plugin (Antigravity).** The same repo is a full Antigravity plugin: a root `plugin.json`, the six skills registered as Antigravity skills, and a `rules/antislop.md` pointer that loads antislop into every session. Install it with the Antigravity CLI:+**4. The plugin (Antigravity).** The same repo is an Antigravity plugin: a root `plugin.json` plus a `rules/antislop.md` pointer that loads antislop into every session. Install it with the Antigravity CLI:```bashagy plugin install https://github.com/miqdadbadjuber/anti-slop```-**5. The plugin (Codex).** The same repo is a Codex plugin and marketplace: a `.codex-plugin/plugin.json` manifest plus a `.agents/plugins/marketplace.json` index, both pointing at the shared `skills/` folder. Add the marketplace once, then install the plugin:+**5. The plugin (Codex).** The same repo is a Codex plugin and marketplace: a `.codex-plugin/plugin.json` manifest that points at the shared `skills/` folder, plus a `.agents/plugins/marketplace.json` index for the repo. Add the marketplace once, then install the plugin:```bashcodex plugin marketplace add miqdadbadjuber/anti-slop@@ -86,7 +86,9 @@ codex plugin add antislop@anti-slop| Gemini CLI | `.gemini/skills/` || Hermes | `~/.hermes/skills/` |-The Gemini CLI row is legacy support: Gemini CLI was sunset on 18 June 2026 and is superseded by Antigravity, which has full support. The picker still installs into `.gemini/skills/` for existing Gemini CLI setups.+The Gemini CLI row is legacy support. Consumer access ended on 18 June 2026 and Antigravity replaced it, but it was not a total shutdown: enterprise Code Assist licences and paid API keys still work, and the repository is still maintained. The picker still installs into `.gemini/skills/` for existing Gemini CLI setups.++Those are the project paths. A global install writes the same folder under your home directory, with two exceptions: OpenCode's documented global folder is `~/.config/opencode/skills/`, and Antigravity's is `~/.gemini/config/skills/`. The picker writes those instead.The plugins (paths 3 to 6) are per-agent doors: they load antislop straight from this repo, so there are no skill folders to keep in sync.@@ -139,6 +141,7 @@ What changed in each release. The full tracker, including the cross-agent plugin- **v3.2.5** opened the Cursor door: `.cursor-plugin/plugin.json` plus a `.cursor-plugin/marketplace.json` index, skills with a `.mdc` rule pointer. The Codex plugin also gains its app identity: an icon, a brand color, and a banner screenshot.- **v3.2.6** merged a five-PR community round: the contrast MCP tool gets a Python launcher that works on macOS too, pointer writes stop touching the user's entry file, the smoke test can now fail (`npm test`), and the repo gains guardrail checks, a CI workflow, and a contributors section.- **v3.2.7** is a content round plus an OpenCode door. Three slop patterns earned names: exactly two layout states (a phone stack and a desktop grid) with nothing between (`antislop-layoutmobile`), a comment that runs on for several lines around a one-line fact (`antislop-code`), and the decorative status dot beside a heading that glows and pulses while marking nothing (`antislop-ui`). Your `DESIGN.md` is no longer followed blindly: when it asks for a named slop pattern, the agent names the element and the rule and asks you to keep it or drop it (R-37). OpenCode is verified to load the skills from `.opencode/skills/` via its `AGENTS.md` pointer.+- **v3.2.8** is a repair round, after re-validating every shipped door against its vendor's current documentation. Antigravity's global install was landing in a folder Antigravity never reads, so it now writes `~/.gemini/config/skills/`; OpenCode's global install moves to the documented `~/.config/opencode/skills/`, which is a tidy-up rather than a fix, since the old path still loads. The entry-file writer was damaging entry files: it replaced text inside code fences, rewrote a CRLF file as LF, grew the file on every run when one marker was unmatched, and deleted everything below a mistyped `start` marker. All four are fixed and covered by tests. The picker also refuses to run without a terminal: with stdin closed it used to print its prompts, install nothing, and still exit 0, so a script driving it saw success.## FAQdiff --git a/ROADMAP.md b/ROADMAP.mdindex 6caa87e..1f8612f 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -4,12 +4,13 @@## Where we are-The latest release is **v3.2.7**. antislop is a **packaged system**: a lean, always-loaded core plus five additive skills, each shipped as a standard agent skill folder (`skills/<name>/SKILL.md`). There are no per-skill READMEs.+The latest release is **v3.2.8**. antislop is a **packaged system**: a lean, always-loaded core plus five additive skills, each shipped as a standard agent skill folder (`skills/<name>/SKILL.md`). There are no per-skill READMEs.-- **Core, unchanged since v2.2:** 38 rules across three tiers (Hard Gate, Purpose-Gate, Quality Locks), a Liveliness Toolkit, a mandatory Delivery Gate, and two usage modes (During / After). The single-file `antislop.md` is still a complete filter you can paste into any chat window; its First-Run Install Wizard is the manual install path.+- **The core: 38 rules** across three tiers (Hard Gate, Purpose-Gate, Quality Locks), a Liveliness Toolkit, a mandatory Delivery Gate, and two usage modes (During / After). The count has held since v2.2 and the tiers have not moved, but individual rules have been sharpened many times since, and the release history below says where. The single-file `antislop.md` is still a complete filter you can paste into any chat window; its First-Run Install Wizard is the manual install path.- **The six skills:** `antislop` (the core), plus `antislop-ui`, `antislop-copywriting`, `antislop-human`, `antislop-layoutmobile`, and `antislop-code`. Each skill only loads when the task needs it.- **Distribution:** six install paths from one repo, and the contrast checker is also exposed as an MCP tool inside the plugin. The paths are the interactive picker (`npx antislop-ai`), the skills.sh directory, and native plugin doors for Claude Code, Antigravity, Codex, and Cursor. Install commands live in the README.- **The doors:** each native plugin loads antislop straight from this repository, so there are no copies to keep in sync.+- **The shared folder:** the bet behind the long tail is that `.agents/skills/` is read widely enough that a new agent costs one row instead of a bespoke door. Antigravity is the one confirmed to read it, and it does not read the home-level one. Claude Code is the holdout, reading `.claude/skills/` and nothing else. Global scope is not shared either: OpenCode reads `~/.config/opencode/skills/` and Antigravity `~/.gemini/config/skills/`. The picker writes each agent's own documented path, so no door depends on another vendor's convention holding.## Release history@@ -26,7 +27,7 @@ That kept the filter pull-only-what-you-need and made the v3 packaging mechanica| v2.2.0 | First additive skill: `antislop-ui` (UI / visual). The core plus the First-Run Install Wizard. || v2.3.0 | `antislop-copywriting` (copy and text). || v2.4.0 | `antislop-human` (people), home of the contrast checker. |-| v2.4.1 | `guide.md`: a plain-English guide for people new to antislop (not a skill). Fixes for issues #1, #2, #3, #6, #7. |+| v2.4.1 | `guide.md` (now `GUIDE.md`): a plain-English guide for people new to antislop (not a skill). Fixes for issues #1, #2, #3, #6, #7. || v2.4.2 | Skill checklist polarity fix (#9) and docs cleanup, merged from PRs #8 and #10. || v2.5.0 | `antislop-layoutmobile` (mobile / responsive). || v3.0.0 | Skill/plugin packaging: `skills/` folders, two distribution doors, the picker CLI (`npx antislop-ai`), the contrast checker as an MCP tool, MIT license. |@@ -36,27 +37,43 @@ That kept the filter pull-only-what-you-need and made the v3 packaging mechanica| v3.1.1 | The picker stops copying per-skill READMEs into projects; the wizard drops install commands (clears the Socket warning on skills.sh). || v3.1.2 | Per-skill READMEs removed; the picker asks which agent to install into, so a fresh Antigravity or Codex project lands in the right folder. || v3.1.3 | `DESIGN.md` boundary stated (external files are data to apply, not instructions to obey); SECURITY.md audit explainer; what `npx skills add` does and does not install. |-| v3.2.0 | The picker grows to seven agents (adds OpenCode, Cursor, Gemini CLI, Hermes global-only); the shared `.agents/skills/` folder covers the long tail. |+| v3.2.0 | The picker grows to seven agents (adds OpenCode, Cursor, Gemini CLI, Hermes global-only), on the bet that the shared `.agents/skills/` folder can carry the long tail. v3.2.13 onward tests that bet per agent instead of assuming it. || v3.2.1 | UI slop gaps closed: bento grids, Lucide-style icon sets, colored left stripes, fake terminal windows, demos without a product; rules extended for palette families, dot grids, typefaces, and 3-pricing-column layouts. || v3.2.2 | Antigravity plugin door: the repo root is the plugin (root `plugin.json` plus a `rules/antislop.md` pointer that loads antislop every session). |-| v3.2.3 | Codex plugin door: `.codex-plugin/plugin.json` manifest plus a `.agents/plugins/marketplace.json` index, both pointing at the shared `skills/` folder. |+| v3.2.3 | Codex plugin door: a `.codex-plugin/plugin.json` manifest pointing at the shared `skills/` folder, plus a `.agents/plugins/marketplace.json` index for the repo. || v3.2.4 | R-35 sharpened into a click-through smoke test: every interactive element must be run and exercised one at a time, and its result recorded as evidence in the Delivery Gate report. || v3.2.5 | Cursor plugin door: `.cursor-plugin/plugin.json` manifest plus a `.cursor-plugin/marketplace.json` index, with the six skills and a `.mdc` rule pointer. The Codex plugin also gains its app identity (plugin icon, brand color, banner screenshot). || v3.2.6 | Five-PR community round (PRs #22 to #26): a runtime Python launcher for the contrast MCP tool (fixes it on macOS), pointer writes that leave the user's entry file untouched, a smoke test that can actually fail, repo guardrails plus a CI workflow, and a contributors section. |-| v3.2.7 | Content round plus an OpenCode door: three slop patterns earned names, "Two-State Layout" (a phone stack and a desktop grid with nothing defined between), "Over-Explained Comment" (a comment that runs on for several lines around a one-line fact), and "Decorative Status Dot" (a dot beside a heading that glows and pulses while marking nothing). R-37 gained the `DESIGN.md` conflict protocol: a direction that asks for a named slop pattern is surfaced and questioned, never silently followed or silently overridden. OpenCode is verified to load the skills from `.opencode/skills/` plus its `AGENTS.md` pointer. |+| v3.2.7 | Content round plus OpenCode verified as a picker target: three slop patterns earned names, "Two-State Layout" (a phone stack and a desktop grid with nothing defined between), "Over-Explained Comment" (a comment that runs on for several lines around a one-line fact), and "Decorative Status Dot" (a dot beside a heading that glows and pulses while marking nothing). R-37 gained the `DESIGN.md` conflict protocol: a direction that asks for a named slop pattern is surfaced and questioned, never silently followed or silently overridden. OpenCode is verified to load the skills from `.opencode/skills/` plus its `AGENTS.md` pointer. It is a picker target, not a plugin door: nothing loads from this repo. |+| v3.2.8 | Repair round, from a full re-validation of every shipped door against its vendor's current documentation. Antigravity's global install moves to `~/.gemini/config/skills/`: it had been writing the home-level `.agents/skills/`, which Antigravity does not read, so global installs aimed at Antigravity since v3.2.0 landed in a folder it never enumerates. The entry-file writer ignores markers that sit inside a code fence, keeps the author's line endings, no longer appends a fresh block on every run when one marker is unmatched, and no longer deletes the rest of the file when a `start` marker has no matching `end`. The picker refuses to run without a terminal, where it used to print its prompts, install nothing, and exit 0. OpenCode's global folder moves to the documented `~/.config/opencode/skills/`, where the old `~/.opencode/skills/` still loads, so nothing was broken there. Docs corrected wherever they disagreed with the code. |## What's next-The plan is one item per version. The plugin doors follow the style of the Claude Code, Antigravity, Codex, and Cursor doors already shipped.+Two rules keep the queue honest:++> **One new agent per version.** A version opens at most one new agent's door, so a door that breaks is only ever one agent's problem. Repairs ride along: a break found in a door already shipped is fixed when it is found, never queued behind a slot.++> **A maintenance round ships no new agent.** It pays down what an earlier door left behind, chosen at the time from re-validating each door against its vendor's current documentation and from what the community reports. The slot is fixed; its contents are not.++Every door is verified against the vendor's current documentation before its version ships rather than assumed, and the picker and the guide are updated in the same release.| Version | Item | What it means ||---------|------|---------------|-| v3.2.8 | The rest | Hermes, GitHub Copilot, and the `.agents/skills` long tail (Cline, Roo, Amp). The existing `.agents/plugins/marketplace.json` already points at the repo root, so any agent that reads the .agents standard can add the same marketplace. Mostly verification plus documentation per agent. |+| v3.2.9 | Hermes | Close Hermes properly. The picker writes `~/.hermes/skills/` only, on the premise that Hermes reads no project folder. It does: `<project>/.hermes/skills/` and `<project>/.agents/skills/`, and the project tier outranks the global one. Add the project scope and document the one-time `hermes skills trust` step. |+| v3.2.10 | GitHub Copilot | The picker row, the `AGENTS.md` pointer, and its plugin marketplace command. |+| v3.2.11 | Maintenance | No new agent. Re-validate every door against its vendor's current documentation and the community's reports, then repair what drifted. The slot is fixed; the list is decided at the time, from what those checks surface. |+| v3.2.12 | Kimi Code | The picker row and its pointer. Moonshot also ships a plugin system and Kimi Code reads `.agents/skills/`, so the door class is decided when its current documentation is read rather than promised here. |+| v3.2.13 | Maintenance | No new agent. The same re-validation round. |+| v3.2.14 | Cline | One `.agents/skills` reader, confirmed on its own rather than assumed from the shared folder. |+| v3.2.15 | Amp | The next one, confirmed the same way. Cline and Amp are separate versions because a door that breaks should only ever be one agent's problem. |+| v3.2.16 | Maintenance | No new agent. The same round again. |Beyond the numbered plan, with no promised version:- **OpenAI public directory listing** (deferred). Listing prep for the plugin directory shared by ChatGPT and Codex: a versioned skill bundle, a submission document, and public privacy and terms pages. The submission happens on the OpenAI Platform after identity verification, outside this repo; parked until that can proceed.-- **Gemini CLI** (deferred). Gemini CLI was sunset in June 2026 and superseded by Antigravity CLI, which already has a door (v3.2.2). A completeness close would need an extension manifest for a tool that no longer ships; parked with antislop-compact.+- **Gemini CLI** (deferred). Consumer access ended on 18 June 2026 and Antigravity CLI replaced it, which already has a door (v3.2.2). It was not a total shutdown: enterprise Code Assist licenses and paid API keys still work, and the Apache 2.0 repository is still maintained, so `.gemini/skills/` stays. A completeness close would need an extension manifest for a tool whose consumer audience is gone; parked with antislop-compact.+- **Kiro** (candidate). Kiro reads agent skills from `.kiro/skills/` per project and `~/.kiro/skills/` globally, activating them by description. It sits outside the shared `.agents` standard, so it would be a picker row and an `AGENTS.md` pointer rather than a marketplace door.+- **Roo** (candidate). Sources disagree on its skill folder: some list `.roo/skills/`, others route it to `.roo/rules/`, and its own setup guides describe `.roo/rules/*.md` discovery rather than skill directories. It is a candidate rather than a long-tail row because the path has to be settled against Roo's own documentation before it can be a version.- **More plugin doors** as other agents grow plugin systems that antislop can ride from the same repo.- **antislop-compact**, a lightweight, standalone family of the five skills, each a self-contained cheat-sheet version that runs without the core alongside. Deferred: a parallel set of files would have to track every change to the full ones, and a compact skill is only sound if it keeps the one-line why per rule and the Delivery Gate.- **Skill candidates** still open: `antislop-docs` and `antislop-identity`.diff --git a/SECURITY.md b/SECURITY.mdindex a48dee2..f4d6dbb 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -12,7 +12,7 @@ The report notes that antislop appends a pointer block to an agent entry file su- is a static markdown reference. It lists the installed skills and carries no executable content.- is written only after you approve. The picker and the manual wizard both ask first.-- is added at the end of the entry file on a first install, and replaced where it already sits on later runs. Nothing else in the file is touched, including your own blank lines and code blocks.+- is added at the end of the entry file on a first install, and replaced in place on later runs. Nothing else in the file is touched: your prose, blank lines, code blocks, and line endings are left as they are, and the only lines it ever removes are antislop's own marker comments.- lives in [cli/lib/install.mjs](cli/lib/install.mjs) for the picker, and in the wizard inside [antislop.md](antislop.md) for the manual path.Removing this behavior would remove the core promise: a filter that is always on, not one you remember to invoke. Any always-on ruleset that writes a reference to an entry file matches this pattern.diff --git a/cli/index.mjs b/cli/index.mjsindex c3f605c..73c3fa1 100644--- a/cli/index.mjs+++ b/cli/index.mjs@@ -27,17 +27,26 @@ function stop(message) {process.exit(0)}-// A global-only agent (Hermes) installs into the home dir, never into the project.-function displayDir(agent) {- return agent.globalOnly ? `~/${agent.dir}` : agent.dir+// Show the folder the chosen location actually writes, not the project one. Agents+// with their own global folder (OpenCode, Antigravity) and global-only ones differ.+function displayDir(agent, location) {+ const global = location === 'global' || agent.globalOnly+ return global ? `~/${agent.globalDir ?? agent.dir}` : agent.dir}async function main() {if (process.argv.includes('--version') || process.argv.includes('-v')) {- console.log('antislop 3.2.7')+ console.log('antislop 3.2.8')return}+ // Without a terminal the prompts read EOF at once: the run printed the banner, installed+ // nothing, and still exited 0, so a script around it saw success. Fail loudly instead.+ if (!process.stdin.isTTY) {+ console.error('antislop: this installer needs a terminal. Run `npx antislop-ai` in an interactive shell.')+ process.exit(1)+ }+console.log(banner())intro('Install antislop into your agent setup')@@ -73,7 +82,7 @@ async function main() {options: AGENTS.map((a) => ({value: a.id,label: a.label,- hint: detected.includes(a.id) ? `found here (${displayDir(a)})` : `will create ${displayDir(a)}`,+ hint: detected.includes(a.id) ? `found here (${displayDir(a, location)})` : `will create ${displayDir(a, location)}`,})),required: 'Pick at least one agent.',initialValues: detected,diff --git a/cli/lib/banner.mjs b/cli/lib/banner.mjsindex 99cf5a6..fdac60b 100644--- a/cli/lib/banner.mjs+++ b/cli/lib/banner.mjs@@ -15,7 +15,7 @@ export function banner() {...LOGO,'',' ' + pc.dim('Anti Slop: Rules for AI Coding Agents'),- ' ' + pc.dim('installer v3.2.7'),+ ' ' + pc.dim('installer v3.2.8'),'',].join('\n')}diff --git a/cli/lib/install.mjs b/cli/lib/install.mjsindex 1179971..d795513 100644--- a/cli/lib/install.mjs+++ b/cli/lib/install.mjs@@ -7,15 +7,19 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))export const CORE = 'antislop'+// Every row carries the entry file it writes, so a new agent cannot be added+// without one: `entry` is what `updatePointers` needs and nothing else supplies it.export const AGENTS = [- { id: 'claude', label: 'Claude Code', dir: '.claude/skills' },- { id: 'antigravity', label: 'Antigravity', dir: '.agents/skills' },- { id: 'codex', label: 'Codex', dir: '.codex/skills' },- { id: 'opencode', label: 'OpenCode', dir: '.opencode/skills' },- { id: 'cursor', label: 'Cursor', dir: '.cursor/skills' },- { id: 'gemini', label: 'Gemini CLI', dir: '.gemini/skills' },- // Hermes reads its skills from the home dir only, never from a project folder.- { id: 'hermes', label: 'Hermes', dir: '.hermes/skills', globalOnly: true },+ { id: 'claude', label: 'Claude Code', dir: '.claude/skills', entry: 'CLAUDE.md' },+ // Antigravity reads a project's .agents/skills, but not the one under the home dir.+ { id: 'antigravity', label: 'Antigravity', dir: '.agents/skills', globalDir: '.gemini/config/skills', entry: 'AGENTS.md' },+ { id: 'codex', label: 'Codex', dir: '.codex/skills', entry: 'AGENTS.md' },+ // OpenCode documents ~/.config/opencode for global skills; ~/.opencode is undocumented.+ { id: 'opencode', label: 'OpenCode', dir: '.opencode/skills', globalDir: '.config/opencode/skills', entry: 'AGENTS.md' },+ { id: 'cursor', label: 'Cursor', dir: '.cursor/skills', entry: 'AGENTS.md' },+ { id: 'gemini', label: 'Gemini CLI', dir: '.gemini/skills', entry: 'GEMINI.md' },+ // Hermes installs globally only; its project scope is not wired up yet.+ { id: 'hermes', label: 'Hermes', dir: '.hermes/skills', globalOnly: true, entry: 'AGENTS.md' },]export function skillSourceDir() {@@ -30,26 +34,27 @@ function resolveBase(location) {return location === 'global' ? os.homedir() : process.cwd()}+// A global-only agent always resolves to the home dir, even on a project install.+// Some agents also keep global skills outside ~/<dir>, like OpenCode's ~/.config.+function skillPath(agent, location) {+ const global = location === 'global' || agent.globalOnly+ const dir = global ? (agent.globalDir ?? agent.dir) : agent.dir+ return path.join(global ? os.homedir() : resolveBase(location), dir)+}+export function resolveTargets(location, selected = AGENTS.map((a) => a.id)) {- const base = resolveBase(location)return AGENTS.filter((a) => selected.includes(a.id)).map((agent) => {- // A global-only agent always resolves to the home dir, even on a project install.- const targetBase = agent.globalOnly ? os.homedir() : base- return {- agent,- path: path.join(targetBase, agent.dir),- exists: fs.existsSync(path.join(targetBase, agent.dir)),- }+ const target = skillPath(agent, location)+ return { agent, path: target, exists: fs.existsSync(target) }})}// Agents whose folder already exists, used to pre-check the picker. A missing// folder does not mean a missing agent, so the user can still add one.export function detectAgents(location) {- const base = resolveBase(location)return AGENTS.filter((a) => {if (a.globalOnly && location !== 'global') return false- return fs.existsSync(path.join(base, a.dir.split('/')[0]))+ return fs.existsSync(path.dirname(skillPath(a, location)))}).map((a) => a.id)}@@ -80,6 +85,8 @@ function copyDir(src, dest) {export function installSkills({ skills, targets, overwrite = false }) {const source = skillSourceDir()+ // Fail with the real reason instead of a TypeError from path.join(null, skill).+ if (!source) throw new Error('Could not find the antislop skills. Reinstall the antislop package.')const written = []for (const t of targets) {for (const skill of skills) {@@ -97,17 +104,6 @@ export function installSkills({ skills, targets, overwrite = false }) {const POINTER_START = '<!-- antislop:start -->'const POINTER_END = '<!-- antislop:end -->'-// The entry file each agent reads at session start.-const ENTRY_FILE = {- claude: 'CLAUDE.md',- codex: 'AGENTS.md',- antigravity: 'AGENTS.md',- opencode: 'AGENTS.md',- cursor: 'AGENTS.md',- gemini: 'GEMINI.md',- hermes: 'AGENTS.md',-}-const SKILL_LINES = {[CORE]: 'Core filter, always on: `antislop`','antislop-ui': 'UI / visual: `antislop-ui`',@@ -130,14 +126,62 @@ function pointerBlock(skills) {]}+// A marker inside a code fence is someone's example, not our block. Fence runs are matched+// by length, and a fence left open at EOF is a typo rather than a boundary.+function scanMarkers(lines) {+ const fenced = new Array(lines.length).fill(false)+ let mark = null+ let len = 0+ let from = -1+ lines.forEach((line, i) => {+ const m = /^\s*(`{3,}|~{3,})/.exec(line)+ if (m) {+ if (!mark) {+ mark = m[1][0]+ len = m[1].length+ from = i+ } else if (m[1][0] === mark && m[1].length >= len) {+ mark = null+ from = -1+ }+ fenced[i] = true+ return+ }+ fenced[i] = Boolean(mark)+ })+ if (mark) for (let i = from; i < lines.length; i++) fenced[i] = false++ const starts = []+ const ends = []+ lines.forEach((line, i) => {+ if (fenced[i]) return+ const t = line.trim()+ if (t === POINTER_START) starts.push(i)+ else if (t === POINTER_END) ends.push(i)+ })+ return { starts, ends }+}+function writeBlock(entry, block) {const existing = fs.existsSync(entry) ? fs.readFileSync(entry, 'utf8') : ''+ // Follow the file's dominant ending. Keying on "contains any CRLF" would flip a+ // mostly-LF file, which is the damage this is here to avoid.+ const crlf = (existing.match(/\r\n/g) || []).length+ const eol = crlf > (existing.match(/\n/g) || []).length - crlf ? '\r\n' : '\n'const lines = existing.split(/\r?\n/)- const start = lines.findIndex((l) => l.trim() === POINTER_START)- const end = lines.findIndex((l) => l.trim() === POINTER_END)- const replacing = start !== -1 && end !== -1 && start < end- const head = replacing ? lines.slice(0, start) : lines.slice()- const tail = replacing ? lines.slice(end + 1) : []+ const { starts, ends } = scanMarkers(lines)+ const start = starts.length ? starts[0] : -1+ const end = start === -1 ? -1 : ends.find((i) => i > start) ?? -1+ const paired = start !== -1 && end !== -1++ // Only marker lines are ever removed. Reading a lone start as "the block runs to EOF"+ // would delete everything the author wrote after a marker they mistyped.+ const removed = new Set([...starts, ...ends])+ if (paired) for (let i = start; i <= end; i++) removed.add(i)++ const insertAt = paired ? start : lines.length+ const head = lines.slice(0, insertAt).filter((_, i) => !removed.has(i))+ const tail = lines.slice(insertAt).filter((_, i) => !removed.has(insertAt + i))// Tidy the two seams only: a /\n{3,}/g sweep over the whole document would also// collapse blank lines the author wrote inside their code fences.@@ -145,17 +189,20 @@ function writeBlock(entry, block) {while (tail.length && tail[0].trim() === '') tail.shift()const body = [...head, '', ...block, ...(tail.length ? ['', ...tail] : [])]- .join('\n')- .replace(/^\n+/, '')+ .join(eol)+ .replace(/^\r?\n+/, '').trimEnd()- fs.writeFileSync(entry, body + '\n')+ fs.writeFileSync(entry, body + eol)}export function updatePointers({ targets, skills }) {const entries = new Set()for (const t of targets) {- if (fs.existsSync(path.join(t.path, CORE))) entries.add(ENTRY_FILE[t.agent.id])+ // A global-only agent installs under the home dir even on a project install, so a+ // pointer here would name a skill this project does not have.+ if (t.agent.globalOnly) continue+ if (fs.existsSync(path.join(t.path, CORE))) entries.add(t.agent.entry)}const block = pointerBlock(skills)diff --git a/cli/package-lock.json b/cli/package-lock.jsonindex aab95ee..540ff96 100644--- a/cli/package-lock.json+++ b/cli/package-lock.json@@ -1,12 +1,12 @@{"name": "antislop-ai",- "version": "3.2.7",+ "version": "3.2.8","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "antislop-ai",- "version": "3.2.7",+ "version": "3.2.8","license": "MIT","dependencies": {"@clack/prompts": "^1.7.0",diff --git a/cli/package.json b/cli/package.jsonindex dfd02da..3209ce1 100644--- a/cli/package.json+++ b/cli/package.json@@ -1,6 +1,6 @@{"name": "antislop-ai",- "version": "3.2.7",+ "version": "3.2.8","description": "Interactive installer for the antislop skills. Anti Slop: Rules for AI Coding Agents.","type": "module","bin": {diff --git a/cli/scripts/smoke-test.mjs b/cli/scripts/smoke-test.mjsindex 35455f4..091bd78 100644--- a/cli/scripts/smoke-test.mjs+++ b/cli/scripts/smoke-test.mjs@@ -42,6 +42,17 @@ const coreSkill = path.join(tmp, '.claude', 'skills', 'antislop', 'SKILL.md')const coreInstalled = fs.existsSync(coreSkill)console.log('\ncore SKILL.md exists:', coreInstalled)+// The wizard needs a terminal. With stdin closed it used to print its prompts, install+// nothing, and still exit 0, so callers saw success. It has to refuse and say why.+const noTty = spawnSync(process.execPath, [path.join(__dirname, '..', 'index.mjs')], {+ cwd: tmp,+ encoding: 'utf8',+ stdio: ['ignore', 'pipe', 'pipe'],+})+const refused = noTty.status === 1 && /needs a terminal/.test(noTty.stderr)+console.log('no-terminal run: exit', noTty.status, '| refused:', refused)+if (!refused) reasons.push(`a no-terminal run should exit 1 and say why, got exit ${noTty.status}`)+// Decide before cleaning up, so a failure still leaves a tidy temp dir behind.const reasons = []if (result.status !== 0) reasons.push(`worker exited ${result.status}`)diff --git a/cli/scripts/smoke-worker.mjs b/cli/scripts/smoke-worker.mjsindex 88bdaa4..c19fe3f 100644--- a/cli/scripts/smoke-worker.mjs+++ b/cli/scripts/smoke-worker.mjs@@ -2,6 +2,7 @@ import fs from 'node:fs'import os from 'node:os'import path from 'node:path'import {+ AGENTS,skillSourceDir,resolveTargets,detectAgents,@@ -70,6 +71,24 @@ check('D3 hermes project target', hermesProject[0].path, path.join(os.homedir(),check('D3 hermes global target', hermesGlobal[0].path, path.join(os.homedir(), '.hermes', 'skills'))check('D3 hermes detected in project', detectAgents('project').includes('hermes'), false)+// OpenCode splits its scopes: project folder for a project install, ~/.config for global.+const ocProject = resolveTargets('project', ['opencode'])+const ocGlobal = resolveTargets('global', ['opencode'])+check('D4 opencode project target', ocProject[0].path, path.join(process.cwd(), '.opencode', 'skills'))+check('D4 opencode global target', ocGlobal[0].path, path.join(os.homedir(), '.config', 'opencode', 'skills'))++// Antigravity reads a project's .agents/skills but not the one under the home dir.+const agGlobal = resolveTargets('global', ['antigravity'])+check('D5 antigravity project target', resolveTargets('project', ['antigravity'])[0].path, path.join(process.cwd(), '.agents', 'skills'))+check('D5 antigravity global target', agGlobal[0].path, path.join(os.homedir(), '.gemini', 'config', 'skills'))++// updatePointers has no other source for the entry file, so no row may omit it.+check('D6 every agent names an entry file', AGENTS.filter((a) => !a.entry).map((a) => a.id), [])++// A global-only agent installs under the home dir, so a project install of it alone+// must not drop a pointer naming a skill this project does not have.+check('D6 hermes writes no project pointer', updatePointers({ targets: resolveTargets('project', ['hermes']), skills }), [])+// Detection now sees the agents that were installed.const after = detectAgents('project')check('E detected after installs', [...after].sort(), ['antigravity', 'claude', 'cursor', 'gemini', 'opencode'])@@ -86,6 +105,67 @@ updatePointers({ targets, skills })const entry = fs.readFileSync(path.join(process.cwd(), 'CLAUDE.md'), 'utf8')check('H blocks after a second run', (entry.match(/antislop:start/g) || []).length, 1)+// The entry file belongs to the author. Each fixture below used to be damaged.+const entryPath = path.join(process.cwd(), 'CLAUDE.md')+const write = (text) => fs.writeFileSync(entryPath, text)+const read = () => fs.readFileSync(entryPath, 'utf8')++write('# Mine\r\n\r\nNotes.\r\n')+updatePointers({ targets, skills })+check('I CRLF kept', read().includes('\r\n<!-- antislop:start -->'), true)+check('I bare LF count', (read().match(/(?<!\r)\n/g) || []).length, 0)++write('# Mine\n\n```md\n<!-- antislop:start -->\n<!-- antislop:end -->\n```\n')+updatePointers({ targets, skills })+check('I fenced example untouched', read().includes('```md\n<!-- antislop:start -->\n<!-- antislop:end -->\n```'), true)+check('I real block added beside it', (read().match(/antislop:start/g) || []).length, 2)++write('# Mine\n<!-- antislop:end -->\n')+updatePointers({ targets, skills })+const stable = read()+updatePointers({ targets, skills })+check('I orphan marker does not grow', read() === stable, true)+check('I orphan marker is gone', (read().match(/antislop:end/g) || []).length, 1)++// A fence left open at EOF is a typo, not a boundary: the block lands inside it and has+// to be found again, or every run appends another copy.+write('# Mine\n\nNotes:\n\n```bash\nnpm i\n')+updatePointers({ targets, skills })+const fenced = read()+updatePointers({ targets, skills })+updatePointers({ targets, skills })+check('J unclosed fence stable', read() === fenced, true)+check('J unclosed fence keeps code', read().includes('npm i'), true)+check('J unclosed fence one block', (read().match(/antislop:start/g) || []).length, 1)++// A mistyped end marker is the author's text, so the block is appended, not swapped in.+write('# Mine\n\n<!-- antislop:start -->\nold\n<!-- antislop:End -->\n\n## Notes\nKeep this line.\n')+updatePointers({ targets, skills })+check('J mistyped end keeps the tail', read().includes('Keep this line.'), true)+check('J mistyped end one block', (read().match(/antislop:start/g) || []).length, 1)++// A longer fence run is not closed by a shorter one inside the example.+write('# Mine\n\n````md\n```md\n<!-- antislop:start -->\n<!-- antislop:end -->\n```\n````\n')+updatePointers({ targets, skills })+check('J four-backtick example untouched', read().includes('````md\n```md\n<!-- antislop:start -->'), true)++// A stray end marker below the block is ours too, and must not survive.+write('# Mine\n<!-- antislop:start -->\nold\n<!-- antislop:end -->\nTail text\n<!-- antislop:end -->\n')+updatePointers({ targets, skills })+check('J stray end below cleared', (read().match(/antislop:end/g) || []).length, 1)+check('J text below the block kept', read().includes('Tail text'), true)++// Dominant line ending wins, so two CRLF lines do not flip a mostly-LF file.+write('# Mine\n' + 'line\n'.repeat(10) + 'a\r\nb\r\n')+updatePointers({ targets, skills })+check('J mostly-LF stays LF', (read().match(/\r\n/g) || []).length, 0)++// A second marker pair leaves a stray start behind unless every marker line is cleared.+write('# Mine\n<!-- antislop:start -->\nX\n<!-- antislop:end -->\nKeep this too.\n<!-- antislop:start -->\nY\n<!-- antislop:end -->\n')+updatePointers({ targets, skills })+check('J duplicate pair settles to one', (read().match(/antislop:start/g) || []).length, 1)+check('J duplicate pair keeps text', read().includes('Keep this too.'), true)+if (failures.length > 0) {console.error(`\n${failures.length} check(s) failed: ${failures.join(', ')}`)process.exit(1)diff --git a/skills/antislop-human/contrast-mcp.py b/skills/antislop-human/contrast-mcp.pyindex 26d5a36..56be9a4 100644--- a/skills/antislop-human/contrast-mcp.py+++ b/skills/antislop-human/contrast-mcp.py@@ -8,7 +8,7 @@ import sysPROTOCOL_VERSION = "2024-11-05"SERVER_NAME = "antislop-contrast"-SERVER_VERSION = "3.2.7"+SERVER_VERSION = "3.2.8"TOOLS = [{