imMamdouhaboammar/anti-slop-engineering / skills/install-anti-slop
install-anti-slop
VerifiedInstall, configure, update, or upgrade vendored anti-slop Oxlint plugins. Use when adding anti-slop, picking up upstream rules or fixes, or migrating an existing installation while preserving local customizations.
assets/anti-slop/effect/rules/no-service-constructor-imports.ts
View on GitHubimport { defineRule } from "@oxlint/plugins";
import type { ESTree } from "@oxlint/plugins";
const SERVICE_CONSTRUCTOR_NAME = /^make[A-Z]/u;
const TEST_FILE = /\.(?:test|spec)\.[cm]?[jt]sx?$/u;
function isProjectLocalImport(source: string): boolean {
return source.startsWith("./") || source.startsWith("../");
}
function getImportedName(specifier: ESTree.ImportSpecifier): string {
if (specifier.imported.type === "Identifier") return specifier.imported.name;
return specifier.imported.value;
}
/** Keep dependency-bearing Effect service constructors local to their owning capability modules. */
export const noServiceConstructorImportsRule = defineRule({
meta: {
type: "problem",
docs: {
description:
"Disallow project-local make<CapabilityName> imports outside test and spec files.",
},
messages: {
serviceConstructorImport:
'Do not import Effect service constructor "{{name}}" into runtime code. Import the owning Layer, yield the contextual service, and allow its requirements to propagate to the composition root.',
},
},
create(context) {
const isTestFile = TEST_FILE.test(context.filename.replaceAll("\\", "/"));
return {
ImportDeclaration(node) {
if (isTestFile || !isProjectLocalImport(node.source.value)) return;
for (const specifier of node.specifiers) {
if (specifier.type !== "ImportSpecifier") continue;
const importedName = getImportedName(specifier);
if (!SERVICE_CONSTRUCTOR_NAME.test(importedName)) continue;
context.report({
node: specifier,
messageId: "serviceConstructorImport",
data: { name: importedName },
});
}
},
};
},
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |