ds-compliance
Skill1 starsChanged 4 months agoMITView on GitHub
Security and regulatory compliance — OWASP, privacy laws, data protection, web security, i18n. Use when auditing for security/privacy compliance, GDPR/KVKK, or pre-release legal review.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ds-backendSkill
- ds-benchmarkSkill
- ds-blueprintSkill
- ds-briefSkill
- ds-buildSkill
- ds-commitSkill
- ds-debugSkill
- ds-deploySkill
- ds-depsSkill
- ds-devopsSkill
- ds-docsSkill
- ds-fixSkill
- ds-freezeSkill
- ds-frontendSkill
- ds-initSkill
- ds-issueSkill
- ds-launchSkill
- ds-mobileSkill
- ds-pipelineSkill
- ds-productizeSkill
- ds-prSkill
- ds-qualitySkill
- ds-releaseSkill
- ds-repoSkill
- ds-researchSkill
- ds-reviewSkill
- ds-rigSkill
- ds-shipSkill
- ds-simplifySkill
- ds-testSkill
- ds-tuneSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 7 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Every finding cites file:line — never infer.
- Very specific: line 50
Default: no disambiguating flag runs the full scan-and-fix pass, recorded in the summary.
- Distinctive: line 103
Project detection: Search for config to identify type:
- Very specific: line 111
Scope selection: Default: all applicable domains, and regulatory frameworks detected from codebase patterns (GDPR, KVKK, CCPA, etc.) apply …
- Very specific: line 125
Default: proceed directly on the auto-detected architecture.
- Very specific: line 129
Default: none of the enhancement opportunities are included.
- Very specific: line 148
Gate: All reference files for in-scope domains loaded.
- Distinctive: line 154
Search for relevant files.
- Distinctive: line 155
Search contents for violation patterns.
- Distinctive: line 156
Read files to verify findings in context.
- Very specific: line 162
False-positive prevention: check surrounding context.
- Distinctive: line 166
Gate: Every in-scope domain scanned.
- Very specific: line 199
Default: apply all, summary only.
- Very specific: line 202
Gate: All standard fixes attempted.
- Very specific: line 208
Gate: All items resolved (applied → fixed/failed, declined → skipped).
- Very specific: line 214
After each Phase 6/7 fix batch: run {check-cmd} on the touched scope.
- Very specific: line 222
Never report OK while {check-cmd} shows a new red.
- Distinctive: line 243
No cascading breakage after fixes
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
/ds-compliance
Single missing privacy policy or unpatched XSS can mean fines, data breaches, or store rejection. Skill audits 158 rules across 9 compliance domains with file:line precision.
Security & Regulatory Compliance — OWASP security, privacy laws, data protection, web security, and internationalization.
Completion Evidence — applies to every phase: Report
done/OKonly with the machine-checkable evidence the gates name — the exact command run and its observed output (orfile:linediff). Missing evidence → reportINCOMPLETEplus what is missing. Self-assessment is never evidence. (This band repeats at file end by design — both copies are normative.)
Triggers
- User runs
/ds-compliance, or asks about GDPR/KVKK/CCPA/HIPAA or other regulatory compliance, security vulnerabilities/secrets/injection risks, privacy/data-protection/consent, CSP/CORS/XSS/CSRF, or internationalization compliance
Triggers — INVOKE / DON'T INVOKE
| INVOKE | DON'T INVOKE |
| "GDPR/KVKK/CCPA/HIPAA audit", "regulatory compliance check" | "audit code quality" (→ ds-review) |
| "OWASP Top 10 security scan" | "fix lint errors / format" (→ ds-fix) |
| "privacy compliance audit (consent, retention, DSR)" | "design event taxonomy" (→ external / manual) |
| "CSP/CORS/XSS/CSRF audit" | "mobile app store privacy labels" (→ ds-mobile / ds-launch) |
| "a11y regulatory framing (ADA / EN301549 mapping)" | "implement a11y fixes (keyboard nav, contrast, ARIA)" (→ ds-frontend) |
Contract
Dimensions: C1 (canonical), C2 (canonical, conditional messaging), C3 (regulatory), A7 (regulatory), A8 (rules), A9 (conditional ecosystem rules), A11 (portability crosscheck) Framework alignment (advisory): OWASP ASVS 5.0.0 (C1), OWASP SAMM (C2). Tool-derived findings carry the tool's own ASVS version tag (OSS DAST tools still emit 4.0.3 — never claim ASVS 5.0 coverage from them).
- Every finding cites file:line — never infer. Unverifiable rules skipped, not guessed. Only audits compliance; code fixes are CAT-1 (auto) or CAT-2 (approval).
- Standalone. Uses blueprint profile when available;
ds/audit/findings.mdonly when fresh (git_hash == HEADAND current run-cycle); own analysis otherwise. - State-exempt: single regenerable report/audit.
- Full accounting enforced: every finding and planned check ends in an explicit disposition (fixed / skipped + reason / only you can do); summary totals balance.
- Pre-existing / out-of-scope errors detected during work are NOT skipped — fixed inline or escalated with concrete blocker.
<!-- portable-only --> - Mobile-project overlap: mobile signals (
pubspec.yamlflutter /react-nativedep /*.xcodeproj/android {}) route security/privacy/regulatory per Phase 1 step 6 —/ds-mobilepresent → delegated (mobile-authoritative, default-skip locally); absent → audited inline. Override either path with--scope=security,privacy,regulatory.
Arguments
| Flag | Effect |
--scope={list} | security, privacy, regulatory, web, network, arch, perf, a11y, i18n, or all |
--type={t} | Override auto-detection: web, api, cli, library |
--preview | Analyze and report only — no file is written |
--secrets-migrate | Rotation / vault migration walkthrough for hardcoded secrets — always asks per secret (Secrets Migrate Mode), --ask or not |
--ask | Interactive run — menus, approval batches and confirmations at every decision point. Without it every decision resolves by best judgment from the evidence gathered and is recorded in the summary; only the publish/irreversible exception list is skipped and recorded only you can do. |
Default: no disambiguating flag runs the full scan-and-fix pass, recorded in the summary. --preview: scan and report only, no fixes applied. --ask: present scope selection and per-phase confirmations.
Secrets Migrate Mode (--secrets-migrate)
Full walkthrough (per-secret surface/rotate/vault/apply/git-history steps): references/scopes-conditional.md § Secrets Migrate Mode. Every secret is its own needs-approval item and matches the publish/irreversible exception list (rotating/transmitting a real credential) — never decided automatically, default or --ask; each stays skipped (only you can do) until the human acts.
Scopes
| Scope | What It Covers |
| security | OWASP Top 10, secrets, TLS, input validation |
| privacy | Data collection, consent, retention, PII handling |
| regulatory | GDPR, CCPA, KVKK, LGPD, PIPL, UK GDPR (+DUAA), HIPAA, COPPA, EU AI Act, EU Data Act, EU CRA, PCI DSS, framework-specific |
| web | CSP, CORS, XSS, CSRF prevention |
| network | TLS/transport security, API protection, DoS resilience |
| arch | Audit logging, boundary/input validation, dependency security |
| perf | Resource exhaustion prevention, query safety, resource cleanup (compliance-relevant subset) |
| a11y | WCAG 2.2 AA, semantic labels, contrast, keyboard nav |
| i18n | Locale support, RTL, number/date formatting |
| Scope | Runs when (signal) | Otherwise |
| security | any source — every codebase has a security surface | — |
| privacy | pii=yes, auth ≠ none, or integrations includes an analytics SDK | N/A — no personal-data path detected |
| regulatory | pii=yes, jurisdiction resolved, or audience=public | N/A — no regulated-data or public-market signal |
| web | ui=web | N/A — no web frontend |
| network | api ≠ none or deploy ≠ none | N/A — no network-facing surface |
| arch | any source — audit logging, input validation, and dependency hygiene apply broadly | — |
| perf | db ≠ none or api ≠ none | N/A — no query/service surface to exhaust |
| a11y | ui ≠ none | N/A — no UI surface |
| i18n | audience ≠ developers | N/A — developer-facing surface, locale support not expected |
Delegation
Owns: regulatory, privacy (canonical — GDPR / KVKK / CCPA / etc.), a11y-regulatory-framing (ADA / EN301549 mapping), security-regulatory, i18n, secrets-migrate (--secrets-migrate) | Delegates: ds-mobile → security/privacy/regulatory when mobile detected (pubspec.yaml / Info.plist / AndroidManifest.xml); ds-frontend → a11y implementation + fixes | Receives: ds-launch → canonical privacy for store labels; ds-ship → Phase 2 regulatory pass; ds-productize → subscription-law + privacy canonical audit
Conditional scopes
| Scope | Reference | Loaded when |
| transactional-messaging | references/scopes-conditional.md § Transactional Messaging | messaging SDK/provider dependency, a consent field in the schema, or reminder-scheduling code detected |
| ecosystem-rules (A9) | references/scopes-conditional.md § A9 — Google / Apple Ecosystem Rules | blueprint profile Integrations = google-workspace or apple-ecosystem |
Zero-cost when absent.
Execution Flow
Detect → Configure → Scan → Report → [Fix] → [Needs-Approval] → Summary
Phase 1: Detect
- Upstream artifacts: Profile →
Regulations:,Data:,Audience:, Type+Stack. Findings(compliance scopes) → verify + use. Absent → own analysis. - Project detection. Search for config to identify type:
- Web frontend:
package.jsonwith react/next/vue/nuxt/angular/svelte/astro - API/backend: express/fastify/nestjs, fastapi/django/flask, go.mod with gin/echo, Cargo.toml with actix/axum, spring-boot
- CLI/library: bin field, commander/yargs/click/cobra/clap, or library exports without bin
- Override with
--typeif auto-detection wrong
- Web frontend:
- Stack detection. Framework, language, architecture pattern, auth, DB, ORM, API style, testing, CI/CD, i18n, deployment.
- Scope selection. Default: all applicable domains, and regulatory frameworks detected from codebase patterns (GDPR, KVKK, CCPA, etc.) apply without confirmation.
--ask, no--scope: ask which domains; confirm the detected regulatory frameworks. - Overlap routing (runtime enforcement of the overlap rules):
- Mobile project detected (
pubspec.yamlwithflutter:ORInfo.plistORAndroidManifest.xml) →/ds-mobilepresent → invoke/ds-mobile --scope=security,privacy,regulatory, wait for completion, read itsds/audit/findings.mdupdates, removesecurity/privacy/regulatoryfrom active scope; keep only non-mobile-covered scopes (a11y, i18n, web, network, perf, arch) locally (ds-mobile authoritative; running both duplicates findings)./ds-mobileabsent → keepsecurity/privacy/regulatoryactive; load rules-compliance.md as usual plus references/scopes-conditional.md § Mobile-Fallback Checks; gap-note "deeper mobile-specific coverage (13-domain release audit) requires /ds-mobile" so the reduced depth is visible, never silent. - a11y scope active + project has frontend (framework detected in
package.json/ equivalent) →/ds-frontendpresent → announce "a11y delegated to /ds-frontend; this run keeps regulatory framing only (ADA/EN301549)." Mark a11yframing-only; emit only regulatory-mapping findings./ds-frontendabsent → audit and CAT-1-fix the full a11y scope directly from rules-a11y.md (A11Y-01–08) plus the regulatory-mapping findings; gap-note "deeper design-system a11y coverage requires /ds-frontend". - Privacy scope active → canonical owner. Announce: "/ds-launch --privacy narrows to store-label-correctness. This run emits canonical privacy findings, including event-property PII scanning."
- Mobile project detected (
Gate: Project type identified; scope confirmed; regulatory frameworks resolved; overlap routing applied. If fails → type undetected + no --type response → default web, announce, proceed; regulatory ambiguous after detection → default: apply the best-guess framework(s) from detected signals (audience, data locality, stack) and record the assumption in the summary; --ask: present detected signals, require explicit framework selection before proceeding.
Phase 2: Architecture Discovery
When: scope includes 3+ domains or all. Skip for narrow scans.
- Analyze architecture (pattern, auth, DB, ORM, API style, testing, CI/CD, i18n, deployment).
- Default: proceed directly on the auto-detected architecture.
--ask: present detected architecture for confirmation. - Classify rules:
- CAT-1 Conformance: universal best practice, existing pattern misused, bug, security flaw — auto-fixable
- CAT-2 Enhancement: new layers/patterns not in current architecture — needs approval
- Default: none of the enhancement opportunities are included.
--ask: present enhancement opportunities, ask which to include.
Gate: Architecture confirmed; every rule classified CAT-1 / CAT-2; approved enhancements finalized. If fails → user unconfirmed (no response or rejection) → re-present detected architecture with brief explanation, ask once more; still unconfirmed → proceed with auto-detected, add WARN: "Architecture unconfirmed — CAT-2 classifications may be inaccurate" to the report.
Phase 3: Rule Loading
Load reference files matching scope:
| Scope | Reference File |
| security, privacy, regulatory | rules-compliance.md |
| web (frontend only) | rules-web.md |
| security (CLI/library only) | rules-security.md |
| network | rules-network.md |
| arch | rules-arch.md |
| perf | rules-perf.md |
| a11y | rules-a11y.md |
| i18n | rules-i18n.md |
Gate: All reference files for in-scope domains loaded; unloadable marked N/A. If fails → file missing → mark domain N/A, continue with available, surface missing path in report.
Phase 4: Scan
Per in-scope domain:
- Search for relevant files.
- Search contents for violation patterns.
- Read files to verify findings in context.
- Skip rules that cannot be verified.
- Defense-in-depth check (../core/principles.md §5): flag a sensitive operation backed by only one control layer (e.g. input validation with no output encoding and no auth layer) — single-control reliance is itself a finding regardless of that control's strength.
Confidence: HIGH = match + context verified. MEDIUM = pattern, ambiguous. LOW = heuristic.
False-positive prevention: check surrounding context. Never flag // noqa, // intentional, // safe:, _ prefix, TYPE_CHECKING, test fixtures.
Large scope (3+ domains): numbered progress checklist + append findings to ds/audit/findings.md (add to .gitignore) — file exists with git_hash equal to git rev-parse HEAD output → preserve findings from other scopes, append only your own. After each domain scan, append. Enables recovery on context loss.
Gate: Every in-scope domain scanned; findings recorded with severity + confidence. If fails → domain(s) un-scan-able (no scannable source, access denied, reference N/A) → mark inconclusive, continue with successful ones, list skipped domains in Phase 5 report.
Phase 5: Report
## Audit Report — {project-name}
Stack: {stack} | Scanned: {domains} | Date: {today}
Architecture: {detected-summary}
### Conformance Issues (CAT-1)
| # | Rule | Sev | File:Line | Issue | Impact | Fix | Conf |
### Enhancement Opportunities (CAT-2) — pre-approved
| # | Rule | Sev | File:Line | Issue | Impact | Fix | Conf |
### Potential Issues (LOW confidence)
| # | Rule | File:Line | Issue | Suggested Fix |
### Summary
| Category | BLOCKER | CRITICAL | HIGH | MEDIUM | LOW | Total |Severity: BLOCKER > CRITICAL > HIGH > MEDIUM > LOW. BLOCKER = legally mandated gap with a citable source (regulation article / store policy) — feeds ds-ship's mandated-blocker test; ADVISORY findings never block and never count toward blockers. Uncertain → choose lower.
Gate: Report with findings + severities + summary. If fails → findings list empty because all domains inconclusive or N/A → print report with single section "No verifiable findings — all domains inconclusive or reference files missing", list domains + skip reason, exit with status WARN.
Phase 6: Fix [SKIP if --preview]
Checkpoint pre-step (before the first fix is written, core checkpoint protocol): git status --porcelain → empty → proceed. Non-empty and disjoint from this run's planned writes → proceed, list the dirty paths as untouched. Non-empty and a planned fix touches a dirty path → default: mark that fix skipped (only you can do), continue with disjoint fixes. --ask: show the dirty files, ask Commit first (recommended) / Stash / Proceed anyway (the mechanical-gate revert path git checkout -- {file} also discards pre-existing edits in that file). Never run a bulk fix over uncommitted unrelated changes silently.
Overwrite prevention: before generating/modifying any compliance document (Privacy Policy, DPIA, Breach Plan, Processor Registry), check if target exists. Default: Keep existing when it already has non-trivial content, otherwise update; the decision and diff are recorded in the summary. --ask: show diff between existing + proposed, ask "Update existing / Keep existing / Show diff".
- Present fix plan — one line per fix (
[severity] title — file:line) grouped by category/severity with counts; state the question (Apply these N fixes?). "All" = exactly the displayed set. - Default: apply all, summary only.
--ask: show plan, offer Apply all / per-severity bulk (Apply all HIGH… alongside the total, CRITICAL bulk still confirms per item) / proceed / cancel. - Apply fixes grouped by file. Different files in parallel, same file sequential.
Gate: All standard fixes attempted; each recorded. If fails → CAT-1 fix unappliable (file write error, merge conflict, generated doc exists + user chose "Keep existing") → record failed with specific error, continue with remaining, surface all failed IDs in Phase 8 summary.
Phase 7: Needs-Approval Review [needs_approval > 0]
Default: every item, including CRITICAL, resolves via the same impact/effort/risk reasoning an approval block would show, applied and recorded fixed/failed; items matching the publish/irreversible exception list (e.g. secret rotation, per the Secrets Migrate section) resolve skipped (only you can do) instead. --ask: present each item compactly (one line [severity] title — file:line) grouped by severity with counts, and state the question (Approve these N items?); ask Apply all / per-severity bulk (Apply all HIGH … alongside the total, CRITICAL bulk still confirms per item) / Review Each / Skip All. approve-all excludes CRITICAL; "all" = exactly the displayed set.
Gate: All items resolved (applied → fixed/failed, declined → skipped). If fails → unresolved → re-present each with forced binary prompt (Apply / Skip); user declines → mark skipped (no response), proceed.
Mechanical Done Gate [any fix applied]
Resolve {check-cmd} in Phase 1: ds-quality enforcement arm installed (stop-hook / pre-commit hook / auto-lint) → use its gate command; else detect stack-native format/lint/type/test commands; none detectable → Verification-Infrastructure Gap — report it, offer /ds-quality, record the decision, never silently skip. Run {check-cmd} once at baseline; baseline red → record red-at-baseline — done condition becomes "no new red", baseline reds reported as findings, never inherited as green.
After each Phase 6/7 fix batch: run {check-cmd} on the touched scope. Before Phase 8: run the full {check-cmd} once — aggregate result gates the summary.
| Result | Action |
| Green (no new red) | Proceed; quote the exact command + observed output as Completion Evidence |
| New red, ≤3 attempts on the fix | Repair, re-run the same command — same command string, same scope |
| New red after 3 attempts | Revert the offending fix via git checkout -- {file}, disposition reverted (mechanical gate) with captured error, continue with remaining |
Never report OK while {check-cmd} shows a new red.
Phase 8: Summary
ds-compliance: {OK|WARN|FAIL} | Scopes: ran {a,b} · N/A — {c}={reason} | Fixed: {n} | Skipped: {n} | Failed: {n} | Total: {n}Disposition accounting — totals balance. fixed + failed + skipped + needs_approval + not_applicable = total.
Gate: Summary balances; every modified file re-read. If fails → identify findings without disposition, assign disposition: skipped (accounting-fix), recompute summary, add WARN: "{n} finding(s) auto-skipped to balance accounting".
Effect: 1-5 concrete bullets, real changes only — each states what got better and why it matters, in plain language a non-technical reader understands (quantified when measurable), never the mechanical activity; they are the closing block's Effect line. Example shapes (placeholders, not literal output):
{n} CRITICAL secrets in source intercepted — credentials no longer leak into git history (rotation guidance attached){regulation} compliance: {n} consent gaps, {n} retention policy gaps closed — exposure window before {audit-date} eliminated
Zero-finding run: Compliance scope clean — no regulatory or security findings.
Quality Gates
- No cascading breakage after fixes
- Format preservation (indentation, code style)
- Scope boundary (only touch required lines)
- Stack consistency (use correct framework APIs)
- W10: defer detection to fresh
ds/audit/findings.md— own scan only for uncovered scopes. - W1: cite file:line, never assume. W2: check consumers after modify. W3: only task-required lines. W4: re-read after gap. W5: uncertain → lower severity. W6: verify all phases output. W7: dedup file:line. W8: no raw shell interpolation.
<!-- portable-only -->
Error Recovery
| Situation | Action |
| Rule references external policy that changed | Flag as needs-verification, use last known version |
| Fix requires architectural change | Classify as needs-approval, present to user |
| Compliance doc template generation fails | Generate partial template, list missing sections |
Edge Cases
| Scenario | Behavior |
| No source code files | Report empty scan, suggest checking path |
| Mixed project types | Detect all types, apply union of applicable rules |
| Generated code only | Skip generated files, warn if no scannable code remains |
Completion Evidence — final gate (duplicate of the opening band by design): Before the summary line, show the evidence for every gate that ran — command plus observed output; a phase with no visible output was not executed — execute it now. Report
done/OKonly with this evidence present; otherwise reportINCOMPLETEplus what is missing.<!-- portable-only -->
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
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.

