agentleFS
crowdsecuritycrowdsecurity/crowdsec-skill/CLAUDE.md

crowdsec-skill

CLAUDE.md25 starsChanged 2 months agoMITView on GitHub

Conventions for authoring this skill. This governs how skill content is written and validated. Never open responses with filler phrases like "Great question!", "Of course!", "Certainly!", or similar warmups. Start every response with the actual answer. No preamble, no acknowledgment of the question. Match response length to task complexity. Simple questions get direct, short answers. Complex tasks get full, detailed responses. Never pad responses with restatements of the question or closing sentences that repeat what you just said. Before any…

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never open responses with filler phrases like "Great question!", "Of course!", "Certainly!", or similar warmups.

    line 8
  2. Distinctive:

    Before any significant task, show me 2-3 ways you could approach this work.

    line 12
  3. Distinctive:

    If you are uncertain about any fact, statistic, date, or piece of technical information: say so explicitly before including it.

    line 14
  4. Distinctive:

    Write only the final, correct information: Never record self-corrections, dead ends, or "actually, it turned out…" narration discovered …

    line 21
  5. Very specific:

    All depth lives in references/<area>/, organized by the axis that fits the area:

    line 48
  6. Distinctive:

    Split files vs inline the prefix: When deciding whether a platform variant gets its own file:

    line 61
  7. Very specific:

    Split into separate files: only when the *content itself* diverges — package managers, file paths, install/upgrade mechanics.

    line 63
  8. Very specific:

    Keep one file with inline command-prefix notes: when the task is identical and only the invocation differs (sudo cscli … → docker exec …

    line 65
  9. Very specific:

    Keep this current: When you add, move, or remove a references/ directory — or change an area's organizing axis — update the table above in …

    line 72
  10. Distinctive:

    Nothing ships unverified: Every command and every expected outcome must have been run against a real, current CrowdSec environment and …

    line 103
  11. Very specific:

    Stamp it when you verify it: When you run a doc's commands against the real test environment (see Testing) and observe them work, add or …

    line 136
  12. Distinctive:

    Use ISO 8601 dates so the checker can sort and age them.

    line 140
  13. Distinctive:

    Don't pre-seed unverified docs with empty blocks.

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Conventions for authoring this skill. This governs how skill content is written and validated.

General rules

Never open responses with filler phrases like "Great question!", "Of course!", "Certainly!", or similar warmups. Start every response with the actual answer. No preamble, no acknowledgment of the question.

Match response length to task complexity. Simple questions get direct, short answers. Complex tasks get full, detailed responses. Never pad responses with restatements of the question or closing sentences that repeat what you just said.

Before any significant task, show me 2-3 ways you could approach this work. Wait for me to choose before proceeding.

If you are uncertain about any fact, statistic, date, or piece of technical information: say so explicitly before including it. Never fill gaps in your knowledge with plausible-sounding information. When in doubt, say so.

Writing style

  • Be concise. Technical documentation, not an essay. Favor tables, command recipes, and short imperative sentences. Cut throat-clearing, restated context, and filler.
  • Write only the final, correct information. Never record self-corrections, dead ends, or "actually, it turned out…" narration discovered while authoring. The reader gets the conclusion, not the journey. This applies equally to inline expected-output hints: state the correct outcome, never the wrong-then-fixed version. Do not annotate verification inline in prose (no "(verified)", "Verified on…", "verified gotcha"). Record verification in the per-file verified: frontmatter block instead — see Verification tracking below.
  • Keep SKILL.md a router. It is an index and decision layer that points to references/. Depth and recipes belong in the reference docs, not in SKILL.md.
  • Cover every environment. Each command or recipe carries its systemd / docker / k8s variant, matching the existing convention. If some command or recipe is irrelevant to some variant it should be noted.
  • Version-gate in one place. Minimum engine versions and feature prerequisites live in SKILL.md § Step 1.6 — Feature compatibility, one row per feature. Reference docs describe behavior and point there; they do not sprinkle "1.8+" through the prose. Adding a version-gated feature means adding a row in the same change.
  • Anchor to canonical docs. Each reference doc cites the upstream CrowdSec docs URL it derives from. Claims trace to canonical documentation, not to memory.

Content structure

The plugin ships two skills under skills/: crowdsec (operational — local engine/cscli/bouncers/WAF) and crowdsec-service-api (the premium Console cloud REST API). Each has its own router SKILL.md and references/. The layout below describes the crowdsec skill; the crowdsec-service-api layout follows in its own subsection.

crowdsec skill layout

SKILL.md is the router — a symptom/intent-indexed table that points into references/. All depth lives in references/<area>/, organized by the axis that fits the area:

DirOrganized byNotes
install/platform (one file each)bare-metal.md (apt/dnf + systemd), docker.md, kubernetes.md, pfsense.md, console.md (enrollment) — install mechanics genuinely diverge per platform.
configure/config domainacquisition, hub, profiles, notifications, allowlists; platforms merged inline. configure/bouncers/ nests one level by service type (firewall, web-servers).
operate/taskhealth-check, upgrades, multi-server.
appsec/lifecycleoverview → deploy → configure → troubleshoot (the WAF/AppSec feature silo).
appsec/bot-detection/lifecycleoverview → deploy → configure → customize → troubleshoot. Bot detection (challenge mode) ships inside the AppSec component but is its own feature with its own install, config and failure modes, so it gets its own silo and its own routing rows — not a section of the WAF docs. customize is the extra step: authoring exemptions and scoring rules is the bulk of the work.
debug/kindcommon/ (triage, errors, platform-gotchas) + symptoms/ (parsing, no-alerts, not-blocked). Feature troubleshooting is routed to the feature's own dir (e.g. AppSec → appsec/troubleshoot.md), not duplicated under debug/.
migrate/source productfrom-fail2ban.
scripts/—helper scripts (diagnose.sh, check-verification.py); stdlib/bash only, runnable in static checks.

Split files vs inline the prefix. When deciding whether a platform variant gets its own file:

  • Split into separate files only when the content itself diverges — package managers, file paths, install/upgrade mechanics. install/ is the canonical case.
  • Keep one file with inline command-prefix notes when the task is identical and only the invocation differs (sudo cscli … → docker exec <name> … → kubectl exec -n <ns> <pod> -- …). This is the default across configure/, operate/, appsec/, and debug/.
  • Genuinely platform-specific failure modes (not just prefixes — e.g. container mounts, SELinux/AppArmor, k8s RBAC) collect in one place (debug/common/platform-gotchas.md) rather than fragmenting a single symptom across per-platform files.

Keep this current. When you add, move, or remove a references/ directory — or change an area's organizing axis — update the table above in the same change. This section is the authoritative map of the layout; let it drift and it stops being trustworthy.

crowdsec-service-api skill layout

SKILL.md is the router plus the "acting on the user's behalf" operating contract (key resolution, /info validation, read-vs-mutate confirm gate). references/ is organized by API resource group — the axis that fits a REST API — one file each:

FileCovers
authentication.mdKey creation, x-api-key, key resolution (env → ~/.config/crowdsec/sapi_key), /info, Python SDK pointer.
blocklists.mdCRUD, add/remove/bulk IPs + expiration, download, subscribers, shares, search.
allowlists.mdCRUD, items + expiration, subscribers (cross-links the crowdsec skill's local allowlists).
integrations.mdFirewall/appliance feeds: create (entity_type/output_format), Basic-auth content pull + pagination, decisions stream, vendor table.
decisions.mdOrg-level decisions + aggregated (short; prefer blocklists).
metrics.md/metrics/remediation ROI (raw vs computed).

CTI (the tracker surface — cves/vendors/fingerprints/tags/products/tracker-*) is deferred to a future iteration: it needs a CTI-scoped key (a blocklist/decision key gets 403). When added, restore a cti.md row here.

Conventions differ from the crowdsec skill in two ways: no platform axis (the "environment" is HTTPS, not systemd/docker/k8s — so no per-platform prefixes), and recipes are curl the skill runs on the user's behalf, every mutating one gated behind explicit confirmation. Verification uses env: sapi in the verified: block. When you add/rename a resource file here, update this table in the same change.

Testing

  • Nothing ships unverified. Every command and every expected outcome must have been run against a real, current CrowdSec environment and observed first-hand — not inferred, not recalled, not invented.
  • Use a dedicated test environment. Behavioral validation requires a real environment where the agent can run commands and observe results. Each contributor supplies their own.
  • The local working copy is for static checks only — lint, claude plugin validate ., and structural review. Run commands that change or inspect a CrowdSec install on the test environment, never against the authoring machine.
  • If you cannot verify something, mark it untested or leave it out. Never present unconfirmed behavior as confirmed.
  • Avoid duplicates by checking in the existing skill documentation if the information is already present. If it is, ensure it's properly linked/routed, but don't duplicate instruction, code blocks or configurations.

Verification tracking

Verification is recorded per reference doc, in a verified: YAML frontmatter block, so freshness is queryable and drift is visible. A doc with no verified: block has never been confirmed against a real environment.

---
verified:
  - date: 2026-05-22      # ISO 8601 (YYYY-MM-DD); the day the recipes were run
    version: "1.6.5"      # CrowdSec engine version, from `cscli version`
    env: docker           # systemd | docker | k8s (free-form allowed, e.g. opnsense)
    notes: "deploy + reload path only"   # optional, short scope note
---

Rules:

  • One entry per env. Re-verifying the same env updates that entry in place (bump date and version); verifying a new env appends a new entry. This keeps "cover every environment" auditable.
  • Stamp it when you verify it. When you run a doc's commands against the real test environment (see Testing) and observe them work, add or update that doc's verified: entry in the same change: date = today, version = the output of cscli version, env = the detected environment. The record and the verification happen together — never stamp from memory or inference.
  • Use ISO 8601 dates so the checker can sort and age them.
  • Don't pre-seed unverified docs with empty blocks; absence is the "never verified" signal.

skills/crowdsec/scripts/check-verification.py (stdlib-only, safe to run locally) reports coverage, lists docs with no block, flags entries older than 180 days, and fails on a malformed block.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.