agentleFS
LiriRaidLiriRaid/waymark/skills/dept-security/SKILL.md

dept-security

Skill1 starsChanged 58 days agoMITView on GitHub

Waymark · Security department. Use FIRST for auth, secrets and risk: \"login\", \"permisos\", \"roles\", \"JWT\", \"proteger una ruta\", \"CORS\", \"CSRF\", \"variables de entorno\", \"API key\", \"vulnerabilidad\", \"auditoría de dependencias\", RLS, OWASP. Supports any task touching user data.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Run the *Waymark protocol → Entry* from the instructions file (already in context.

    line 15
  2. Very specific:

    Does not own (security reviews, they implement): endpoint implementation → dept-backend · schema and data policy implementation → dept-data …

    line 33
  3. Distinctive:

    MUST: use TLS for all external traffic and vetted crypto libraries.

    line 49
  4. Distinctive:

    MUST: keep dependencies audited and patched.

    line 56
  5. Distinctive:

    MUST: use proven session/token handling.

    line 57
  6. Distinctive:

    MUST: verify integrity of webhooks (signatures) and of CI artifacts (A08 · V10).

    line 58
  7. Distinctive:

    MUST NOT: commit secrets, private keys or credential files.

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill 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
SKILL.md

Security / DevSecOps

Quick ref

Mission: Prevent exploitable defects and secret leaks in every change, and make security checks part of the normal flow. Must: zero secrets in code or logs · authorize on the server for every protected resource · validate input at every boundary · run the stack's dependency audit · threat-model at L3 Skills by default: security-review · code-review · library-docs · Explore DoD: gates green · security-review clean or findings resolved · no secret in diff · authz tests for 401/403 · audit has no high/critical

Entry

Run the Waymark protocol → Entry from the instructions file (already in context; do not load the waymark skill for it). No Waymark block in context (guest) → Guest entry, ../waymark/references/coexistence.md §3. Department-specific reads:

  • Learnings: ~/.waymark/learnings/dept-security.md if it exists.
  • Stack profile: L1 Commands (audit) + Security, L2+ full.
  • Tools: the Tools table below. Open ../waymark/skill-registry.md only if a capability there has no installed provider.

Brief questions

The brief must answer before the first edit:

  1. What — which asset is protected (route, query, channel, file, secret, dependency) and which trust boundaries the change crosses.
  2. Why / for whom — which actors (anonymous, user, admin, tenant, third party) and which threat or requirement drives it.
  3. Where — where authn, authz, validation and secrets live per the architecture profile and stack profile; which existing guard/policy is reused.
  4. Identity & access — how identity is established, token/session lifetime and storage, deny-by-default rule, ownership/tenant check.
  5. Input & output — validation allowlist per entry point, output encoding context, size/rate limits.
  6. Secrets & data — which secrets are involved and where they are read from; PII touched; logging exclusions.
  7. Dependencies & config — new packages, install scripts, CORS/CSRF/CSP/header changes.
  8. How / done — procedure below, skills and MCP chosen, and the tests proving 401/403/cross-tenant, plus threat model at L3.

Scope

  • Owns: authn/authz design, secrets handling, input/output safety, CORS/CSRF/CSP, security headers, dependency and package-integrity risk, security logging, threat modeling, agent tool permissions.
  • Does not own (security reviews, they implement): endpoint implementation → dept-backend · schema and data policy implementation → dept-data · CI and infra hardening → dept-devops · UI → dept-frontend.

Procedures

Detailed steps live in procedures.md (same folder). Read only the section you need: search its heading, read that block, not the whole file. Anti-patterns and references are at the end of that file.

  • Security review of a change (L2+ with security impact)
  • New or changed auth flow
  • Secrets handling
  • Dependency audit
  • Threat model (L3, or new external surface)
  • Security bug fix

Rules

Mapped to OWASP Top 10 (2021) and ASVS chapters.

  • MUST enforce authorization server-side on every protected route, query and realtime subscription; deny by default (A01 · V4/V8).
  • MUST scope user/tenant data by row-level authorization: database policies or a mandatory query scope (A01).
  • MUST use TLS for all external traffic and vetted crypto libraries; no custom crypto, no weak password hashes (A02 · V6/V9).
  • MUST validate input at every boundary with allowlists and parameterized queries; never pass input to eval, shell or template compilation (A03 · V5).
  • MUST encode output for its context; no raw HTML injection APIs or sanitizer bypasses with untrusted data (A03 · V5).
  • MUST rate-limit authentication and expensive endpoints and cap request/upload sizes (A04 · V11).
  • MUST configure CORS with an explicit origin allowlist in production; no wildcard with credentials (A05 · V14).
  • MUST enable CSRF protection on cookie-authenticated state-changing requests (A05 · V13).
  • SHOULD set a Content-Security-Policy and security headers (HSTS, X-Content-Type-Options, frame-ancestors) in production (A05 · V14).
  • MUST keep dependencies audited and patched; no high/critical with an available fix at release (A06 · V14).
  • MUST use proven session/token handling; tokens in HttpOnly cookies; rotate on privilege change; enforce expiry (A07 · V2/V3).
  • MUST verify integrity of webhooks (signatures) and of CI artifacts (A08 · V10).
  • MUST log security events (login, failed authz, admin actions) with request IDs; never log secrets, tokens, passwords or PII (A09 · V7).
  • MUST restrict outbound requests built from user input (allowlist hosts, block internal ranges) (A10 · V12).
  • MUST return generic error messages to clients; stack traces only in server logs.
  • MUST NOT commit secrets, private keys or credential files.
  • MUST NOT rely on client-side checks for security decisions.
  • MUST NOT widen agent tool permissions to destructive commands (force push, hard reset, recursive delete, privilege escalation); confirm destructive actions with the user.

Tools

CapabilitySkill / MCP / AgentWhenLevel
docs.librarylibrary-docs (→ the docs MCP servers the user has)Framework security APIs (auth, CSRF, CSP, sanitization) not verified this sessionQ
memoryengram (MCP)mem_save security decisions and vulnerability root causesL1
search.codebaseExplore (agent)Find every instance of a vulnerable patternL1
config.claudeupdate-configAdjust agent permissions (allow/deny lists)L1
review.securitysecurity-reviewChanges touch auth, input, secrets, config, dependencies, uploads, webhooks (L3 always)L2
review.diffcode-reviewCorrectness bugs that are also security bugsL2
plan.implementationPlan (agent)Threat model and mitigation planL3
secret.scan / dependency.audit toolingnone yet → waymark references/skills.mdAutomated secret scanning or SCA beyond the stack audit commandL2

Definition of Done

  • Exit protocol of waymark (instructions file → Exit; L2+ full: ../waymark/references/protocol.md) (gates, architecture conformance, review, learnings)
  • security-review run; findings fixed or accepted with reason
  • No secret, token, key or PII in the diff, fixtures or logs
  • Authz tests cover 401, 403 and cross-tenant access for new protected resources
  • Stack audit command shows no high/critical with an available fix
  • CORS/CSRF/CSP config reviewed if touched
  • Threat model table present (L3)

Hand-offs

  • To dept-backend: implement validation, authz checks, rate limits, webhook verification.
  • To dept-data: row-level policies, PII columns, encryption, retention.
  • To dept-frontend: output encoding, token storage, CSP compatibility.
  • To dept-devops: secret store, CI secret scanning, security headers at the edge, dependency update automation.
  • To dept-devex: agent permission changes.
  • To dept-qa: security regression tests.
  • To dept-architecture: trust boundary changes from the threat model.

Learned rules

Grows with use (waymark references/learning.md). Only rules that are general for this department and not already stated above. Format: - [YYYY-MM-DD] <rule> — <why> (source: <project>).

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.