@ericrisco/rsc 4.0.5 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +4 -4
  2. package/manifest.json +78 -84
  3. package/package.json +1 -1
  4. package/scripts/lib/default-skill-floor.js +5 -1
  5. package/scripts/lib/domains.js +1 -1
  6. package/scripts/lib/recommend.js +1 -1
  7. package/scripts/lib/retired-skills.js +4 -0
  8. package/scripts/skill-migration-brief.md +1 -1
  9. package/skills/accessibility/evals/README.md +1 -1
  10. package/skills/accessibility/evals/cases.yaml +1 -1
  11. package/skills/agent-safety/SKILL.md +2 -2
  12. package/skills/agent-safety/evals/README.md +1 -1
  13. package/skills/agent-safety/evals/cases.yaml +1 -1
  14. package/skills/analyze/evals/README.md +1 -1
  15. package/skills/analyze/evals/cases.yaml +2 -2
  16. package/skills/angular/SKILL.md +1 -1
  17. package/skills/api-connector-builder/SKILL.md +1 -1
  18. package/skills/api-design/SKILL.md +3 -3
  19. package/skills/api-design/evals/cases.yaml +1 -1
  20. package/skills/automation-strategy/SKILL.md +1 -1
  21. package/skills/automation-strategy/evals/README.md +1 -1
  22. package/skills/automation-strategy/evals/cases.yaml +2 -2
  23. package/skills/automation-strategy/references/orchestration-and-antipatterns.md +1 -1
  24. package/skills/aws-essentials/SKILL.md +3 -3
  25. package/skills/aws-essentials/evals/cases.yaml +2 -2
  26. package/skills/backups/SKILL.md +2 -2
  27. package/skills/backups/evals/cases.yaml +2 -2
  28. package/skills/bash-scripting/SKILL.md +1 -1
  29. package/skills/building-agents/SKILL.md +2 -2
  30. package/skills/building-agents/evals/cases.yaml +2 -2
  31. package/skills/chrome-extension/SKILL.md +1 -1
  32. package/skills/cloudflare/SKILL.md +1 -1
  33. package/skills/code-review/SKILL.md +2 -2
  34. package/skills/code-review/evals/cases.yaml +2 -2
  35. package/skills/compliance/SKILL.md +3 -3
  36. package/skills/compliance/evals/cases.yaml +1 -1
  37. package/skills/constitution/SKILL.md +2 -2
  38. package/skills/constitution/evals/README.md +2 -2
  39. package/skills/constitution/evals/cases.yaml +2 -2
  40. package/skills/constitution/references/constitution-template.md +1 -1
  41. package/skills/cpp/SKILL.md +2 -2
  42. package/skills/cpp/evals/README.md +1 -1
  43. package/skills/cpp/evals/cases.yaml +2 -2
  44. package/skills/csharp-dotnet/SKILL.md +3 -3
  45. package/skills/csharp-dotnet/evals/cases.yaml +1 -1
  46. package/skills/csharp-dotnet/references/aspnetcore.md +1 -1
  47. package/skills/data-policy/SKILL.md +2 -2
  48. package/skills/data-policy/evals/README.md +1 -1
  49. package/skills/data-policy/evals/cases.yaml +1 -1
  50. package/skills/debug/SKILL.md +1 -1
  51. package/skills/debug/evals/README.md +1 -1
  52. package/skills/decision-challenge/SKILL.md +2 -2
  53. package/skills/decision-challenge/evals/cases.yaml +1 -1
  54. package/skills/deployment/SKILL.md +2 -2
  55. package/skills/deployment/evals/README.md +1 -1
  56. package/skills/deployment/evals/cases.yaml +2 -2
  57. package/skills/django/SKILL.md +2 -2
  58. package/skills/django/evals/README.md +1 -1
  59. package/skills/django/evals/cases.yaml +1 -1
  60. package/skills/django/references/security.md +1 -1
  61. package/skills/docker/SKILL.md +3 -3
  62. package/skills/docker/evals/cases.yaml +1 -1
  63. package/skills/dynamodb/SKILL.md +2 -2
  64. package/skills/electron/SKILL.md +1 -1
  65. package/skills/electron/references/packaging-and-updates.md +1 -1
  66. package/skills/email-connector/SKILL.md +2 -2
  67. package/skills/email-deliverability/SKILL.md +1 -1
  68. package/skills/error-handling/SKILL.md +1 -1
  69. package/skills/expo/SKILL.md +2 -2
  70. package/skills/fastapi/SKILL.md +4 -4
  71. package/skills/fastapi/evals/README.md +2 -2
  72. package/skills/fastapi/evals/cases.yaml +2 -2
  73. package/skills/fastapi/references/security.md +2 -2
  74. package/skills/firebase/SKILL.md +1 -1
  75. package/skills/flutter/SKILL.md +1 -1
  76. package/skills/flutter/evals/cases.yaml +2 -2
  77. package/skills/fly-io/SKILL.md +1 -1
  78. package/skills/gamedev-multiplayer/SKILL.md +1 -1
  79. package/skills/gamedev-multiplayer/evals/README.md +1 -1
  80. package/skills/gamedev-multiplayer/evals/cases.yaml +2 -2
  81. package/skills/gamedev-shipping/SKILL.md +1 -1
  82. package/skills/gcp-essentials/SKILL.md +2 -2
  83. package/skills/gcp-essentials/evals/README.md +1 -1
  84. package/skills/gcp-essentials/evals/cases.yaml +2 -2
  85. package/skills/gdpr-privacy/SKILL.md +2 -2
  86. package/skills/gdpr-privacy/evals/cases.yaml +1 -1
  87. package/skills/github-actions/SKILL.md +2 -2
  88. package/skills/go/SKILL.md +4 -4
  89. package/skills/go/evals/README.md +1 -1
  90. package/skills/go/evals/cases.yaml +2 -2
  91. package/skills/google-workspace/SKILL.md +2 -2
  92. package/skills/hetzner/SKILL.md +1 -1
  93. package/skills/htmx/SKILL.md +4 -4
  94. package/skills/htmx/evals/cases.yaml +2 -2
  95. package/skills/implement/SKILL.md +1 -1
  96. package/skills/init/SKILL.md +2 -2
  97. package/skills/init/evals/cases.yaml +2 -2
  98. package/skills/init/references/discovery.md +1 -1
  99. package/skills/init/references/recommend-skills.md +5 -5
  100. package/skills/java/SKILL.md +3 -3
  101. package/skills/java/evals/README.md +1 -1
  102. package/skills/java/evals/cases.yaml +2 -2
  103. package/skills/laravel/SKILL.md +3 -3
  104. package/skills/laravel/evals/README.md +1 -1
  105. package/skills/laravel/evals/cases.yaml +1 -1
  106. package/skills/marketing/evals/README.md +1 -1
  107. package/skills/marketing/evals/cases.yaml +1 -1
  108. package/skills/mongodb/SKILL.md +2 -2
  109. package/skills/mongodb/evals/README.md +1 -1
  110. package/skills/mongodb/evals/cases.yaml +2 -2
  111. package/skills/nextjs/SKILL.md +3 -3
  112. package/skills/nextjs/evals/cases.yaml +2 -2
  113. package/skills/nextjs/references/security.md +2 -2
  114. package/skills/notion-connector/SKILL.md +3 -3
  115. package/skills/notion-connector/evals/README.md +1 -1
  116. package/skills/notion-connector/evals/cases.yaml +2 -2
  117. package/skills/php/SKILL.md +4 -4
  118. package/skills/php/evals/README.md +1 -1
  119. package/skills/php/evals/cases.yaml +1 -1
  120. package/skills/plan/evals/README.md +1 -1
  121. package/skills/postgresdb/SKILL.md +1 -1
  122. package/skills/postgresdb/evals/README.md +1 -1
  123. package/skills/postgresdb/evals/cases.yaml +2 -2
  124. package/skills/presentations/evals/README.md +1 -1
  125. package/skills/python/SKILL.md +3 -3
  126. package/skills/python/evals/README.md +1 -1
  127. package/skills/python/evals/cases.yaml +2 -2
  128. package/skills/rag/scripts/verify.sh +1 -1
  129. package/skills/review/SKILL.md +2 -2
  130. package/skills/review/evals/cases.yaml +3 -3
  131. package/skills/ruby/SKILL.md +1 -1
  132. package/skills/rust/SKILL.md +2 -2
  133. package/skills/rust/evals/README.md +1 -1
  134. package/skills/rust/evals/cases.yaml +2 -2
  135. package/skills/security-audit/SKILL.md +186 -0
  136. package/skills/security-audit/evals/cases.yaml +95 -0
  137. package/skills/security-audit/references/auditor-safety.md +69 -0
  138. package/skills/security-audit/references/classes/README.md +225 -0
  139. package/skills/security-audit/references/classes/ai-and-llm.md +247 -0
  140. package/skills/security-audit/references/classes/client-side.md +181 -0
  141. package/skills/security-audit/references/classes/cloud-and-deployment.md +167 -0
  142. package/skills/security-audit/references/classes/data-isolation.md +161 -0
  143. package/skills/security-audit/references/classes/desktop-mobile-ipc.md +167 -0
  144. package/skills/security-audit/references/classes/memory-and-binary.md +230 -0
  145. package/skills/security-audit/references/classes/protocols-and-messaging.md +151 -0
  146. package/skills/security-audit/references/classes/resource-exhaustion.md +141 -0
  147. package/skills/security-audit/references/classes/supply-chain.md +147 -0
  148. package/skills/security-audit/references/classes/web-and-auth.md +238 -0
  149. package/skills/security-audit/references/coverage-ledger.md +172 -0
  150. package/skills/security-audit/references/fixes-by-stack.md +972 -0
  151. package/skills/security-audit/references/fixing.md +200 -0
  152. package/skills/security-audit/references/hunting.md +146 -0
  153. package/skills/security-audit/references/isolated-execution.md +85 -0
  154. package/skills/security-audit/references/platforms.md +650 -0
  155. package/skills/security-audit/references/reconnaissance.md +73 -0
  156. package/skills/security-audit/references/resuming.md +55 -0
  157. package/skills/security-audit/references/scanners.md +347 -0
  158. package/skills/{secure-coding → security-audit}/references/secrets-and-supply-chain.md +78 -34
  159. package/skills/security-audit/references/secrets-discipline.md +173 -0
  160. package/skills/{secure-coding → security-audit}/references/threat-modeling.md +80 -32
  161. package/skills/security-audit/references/verification.md +118 -0
  162. package/skills/security-audit/schema/findings.schema.json +178 -0
  163. package/skills/security-audit/scripts/render-report.mjs +311 -0
  164. package/skills/security-audit/scripts/validate-findings.mjs +508 -0
  165. package/skills/skill-scout/scripts/verify.sh +1 -1
  166. package/skills/source-grounded-development/evals/cases.yaml +1 -1
  167. package/skills/specify/evals/README.md +1 -1
  168. package/skills/spring-boot/SKILL.md +3 -3
  169. package/skills/spring-boot/evals/README.md +1 -1
  170. package/skills/spring-boot/evals/cases.yaml +1 -1
  171. package/skills/spring-boot/references/security.md +1 -1
  172. package/skills/stripe/SKILL.md +2 -2
  173. package/skills/suggest/evals/cases.yaml +2 -2
  174. package/skills/supabase/SKILL.md +1 -1
  175. package/skills/tauri/SKILL.md +2 -2
  176. package/skills/testing-go/SKILL.md +1 -1
  177. package/skills/typescript/SKILL.md +2 -2
  178. package/skills/verify/SKILL.md +3 -3
  179. package/skills/verify/evals/README.md +2 -2
  180. package/skills/verify/evals/cases.yaml +2 -2
  181. package/skills/vue-nuxt/SKILL.md +2 -2
  182. package/skills/webhooks/SKILL.md +2 -2
  183. package/skills/wordpress/SKILL.md +2 -2
  184. package/skills/wordpress/evals/README.md +1 -1
  185. package/skills/wordpress/evals/cases.yaml +1 -1
  186. package/skills/worktrees/evals/README.md +1 -1
  187. package/targets/clone-bootstrap.mjs +1 -1
  188. package/targets/commands.js +1 -1
  189. package/skills/secure-coding/SKILL.md +0 -336
  190. package/skills/secure-coding/evals/README.md +0 -68
  191. package/skills/secure-coding/evals/cases.yaml +0 -55
  192. package/skills/secure-coding/references/authn-authz.md +0 -249
  193. package/skills/secure-coding/references/owasp-by-stack.md +0 -574
  194. package/skills/secure-coding/scripts/verify.sh +0 -208
  195. package/skills/security-scan/SKILL.md +0 -219
  196. package/skills/security-scan/evals/README.md +0 -14
  197. package/skills/security-scan/evals/cases.yaml +0 -50
  198. package/skills/security-scan/references/tools.md +0 -97
  199. package/skills/security-scan/references/triage.md +0 -92
  200. package/skills/security-scan/scripts/verify.sh +0 -108
@@ -0,0 +1,508 @@
1
+ #!/usr/bin/env node
2
+ // Validates an audit directory written by the `security-audit` skill:
3
+ //
4
+ // node validate-findings.mjs <audit-dir>
5
+ //
6
+ // The audit dir holds `findings.json` plus the evidence files it cites. This is the deterministic half
7
+ // of the skill: the model writes findings.json, and this script refuses any claim the files on disk do
8
+ // not support — a confirmed finding citing a file that is not there, a line past the end of it, an
9
+ // evidence path that escapes the audit dir, a run called complete while a platform was never looked
10
+ // at, a live secret pasted into the report. The contract is documented in
11
+ // ../schema/findings.schema.json; this file does not read that schema (no ajv, node: built-ins only),
12
+ // it enforces the same rules by hand plus the disk checks no schema can express.
13
+ //
14
+ // Every error is `<json path>: <message>`. Messages never echo a value that could be a secret: the
15
+ // JSON path says where to look.
16
+ import { lstatSync, readdirSync, readFileSync, realpathSync, statSync } from 'node:fs';
17
+ import { isAbsolute, join, resolve, sep } from 'node:path';
18
+ import { fileURLToPath } from 'node:url';
19
+
20
+ export const MAX_BYTES = 5 * 1024 * 1024;
21
+ // Every other file in the audit dir is scanned for secrets; above this it is refused, not scanned.
22
+ export const MAX_SCAN_BYTES = 2 * 1024 * 1024;
23
+ const MAX_SCAN_FILES = 5000;
24
+ export const MAX_DEPTH = 32;
25
+
26
+ const VERDICTS = ['confirmed', 'needs_validation', 'rejected'];
27
+ const SEVERITIES = ['critical', 'high', 'medium', 'low'];
28
+ const SURFACES = ['code', 'platform'];
29
+ const PROFILES = ['quick', 'standard', 'deep'];
30
+ const RUN_STATUS = ['complete', 'partial'];
31
+ const EVIDENCE_KINDS = ['artifact', 'command_output', 'source'];
32
+ const FIX_STATUS = ['proposed', 'approved', 'applied', 'declined', 'rolled_back', 'manual'];
33
+ const RECHECK_RESULTS = ['pass', 'fail', 'not_run'];
34
+ const UNIT_STATUS = ['done', 'blocked', 'not_reviewed'];
35
+ const ACCESS = ['read_only', 'write_for_fix', 'none'];
36
+ const PLATFORM_STATUS = ['reviewed', 'not_reviewed'];
37
+ const TOOL_PATH = /^01-TOOLS\/security\/[a-z0-9][a-z0-9._-]{0,63}\/?$/;
38
+
39
+ // Likely live secrets. Each pattern is deliberately narrow: a validator that cries wolf on every
40
+ // base64 blob gets switched off. Redacted forms (`sk_live_****`, `[REDACTED]`) do not match because
41
+ // the character classes exclude `*`, `[` and `]`.
42
+ //
43
+ // Every pattern is linear: it starts with a literal, every quantifier has an upper bound, and no two
44
+ // optional parts can match the same text. On top of that, text is scanned in bounded chunks
45
+ // (scanText), so even a pathological line costs at most CHUNK × bound per chunk.
46
+ const SECRET_PATTERNS = [
47
+ ['PEM private key', /-----BEGIN [A-Z0-9 ]{0,40}PRIVATE KEY-----/],
48
+ ['AWS access key id', /\b(?:AKIA|ASIA)[A-Z0-9]{16}\b/],
49
+ ['GitHub token', /\b(?:gh[posu]_[A-Za-z0-9]{20,255}|github_pat_[A-Za-z0-9_]{20,255})/],
50
+ ['Slack token', /\bxox[abpr]-[A-Za-z0-9-]{10,255}/],
51
+ ['Stripe key', /\b(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{8,255}/],
52
+ ['Stripe webhook secret', /\bwhsec_[A-Za-z0-9+/=]{16,255}/],
53
+ ['Supabase secret key', /\bsb_secret_[A-Za-z0-9_-]{16,255}/],
54
+ ['Anthropic key', /\bsk-ant-[A-Za-z0-9_-]{20,255}/],
55
+ ['OpenAI key', /\bsk-(?:proj|svcacct|admin)-[A-Za-z0-9_-]{20,255}|\bsk-[A-Za-z0-9]{40,255}/],
56
+ ['Google API key', /\bAIza[0-9A-Za-z_-]{35}/],
57
+ ['Bearer token', /\bBearer[ \t]{1,8}[A-Za-z0-9\-._~+/]{24,1024}/],
58
+ ['Basic credentials', /\bAuthorization["']?[ \t]{0,4}[:=][ \t]{0,4}["']?Basic[ \t]{1,8}[A-Za-z0-9+/]{8,1024}/i],
59
+ // A JWT is recognised by its start: header and payload both begin `eyJ` (base64 of `{"`), so a plain
60
+ // `a.b.c` hostname never matches. Matching only the start keeps the match short (well inside the
61
+ // chunk overlap) however long the payload is: tokens with group claims run to several KB.
62
+ ['JWT', /\beyJ[A-Za-z0-9_-]{8,512}\.eyJ[A-Za-z0-9_-]{8}/],
63
+ ];
64
+ // A credential NAME ends in the keyword: `password`, `client_secret`, `GITHUB_TOKEN`, `accessToken`.
65
+ // `token_endpoint`, `tokenUrl`, `tokenizer` or `passwordResetLink` only start with it and are not names
66
+ // of a credential.
67
+ const KEYWORD = '(?<![A-Za-z0-9])(?:[A-Za-z0-9]{1,32}[_-]?)?(?:password|passwd|secret|token|api[_-]?key)s?(?![A-Za-z0-9_-])';
68
+ // `scheme://user:pass@host`. The password is tested separately so `:<password>@`, `:****@` pass.
69
+ const URL_CREDENTIALS = /\b[A-Za-z][A-Za-z0-9+.-]{0,19}:\/\/[^\s:/@'"<>]{1,128}:([^\s/@'"]{1,256})@[A-Za-z0-9[]/g;
70
+ // A quoted literal assigned to a credential name: `password: "…"`, `"api_key": "…"`, `token = '…'`.
71
+ const QUOTED_ASSIGNMENT = new RegExp(`${KEYWORD}["']?[ \\t]{0,8}[:=][ \\t]{0,8}(["'\`])([A-Za-z0-9+/=_.~!@#$%^&*:-]{16,256})\\1`, 'gi');
72
+ // An unquoted `.env`-style line: `NAME=value` at the start of the line, the whole rest of the line
73
+ // being one token with no call, no member access, no space.
74
+ const ENV_ASSIGNMENT = /^[ \t]{0,8}(?:export[ \t]{1,4})?([A-Za-z_][A-Za-z0-9_]{0,63})=([A-Za-z0-9+/=_.~!@#$%^&*:-]{16,256})[ \t]{0,8}\r?$/;
75
+ const ENV_NAME = /(?:password|passwd|secret|token|api[_-]?key)s?$/i;
76
+ const REDACTED_VALUE = /\*{3,}|redacted|^<.*>$|^\$\{|^\$[A-Z_]|^(?:process\.env|os\.environ|env\.|getenv)|^x{6,}$/i;
77
+ const PLACEHOLDER_PASSWORD = /^(?:pass(?:word)?|pwd|secret|changeme|\*+|x+|\.{3}|<[^>]*>|\$\{[^}]*\}|\$[A-Za-z_][A-Za-z0-9_]*|\[[^\]]*\]|%[A-Za-z0-9_]+%?)$/i;
78
+ // `a.b.c`: a member access, not a value.
79
+ const MEMBER_ACCESS = /^[A-Za-z_$][\w$]{0,63}(?:\.[A-Za-z_$][\w$]{0,63}){1,8}$/;
80
+ // A random-looking literal has a digit or mixes upper and lower case; `my-app-name` does not.
81
+ const looksRandom = (v) => /[0-9]/.test(v) || (/[a-z]/.test(v) && /[A-Z]/.test(v));
82
+
83
+ export const CHUNK = 4096;
84
+ const OVERLAP = 1100; // longer than any single pattern can match, so a secret across a chunk edge is still seen
85
+
86
+ function chunkKinds(text, kinds) {
87
+ for (const [kind, re] of SECRET_PATTERNS) if (!kinds.has(kind) && re.test(text)) kinds.add(kind);
88
+ if (!kinds.has('URL credentials')) {
89
+ for (const m of text.matchAll(URL_CREDENTIALS)) {
90
+ if (!PLACEHOLDER_PASSWORD.test(m[1]) && !REDACTED_VALUE.test(m[1])) { kinds.add('URL credentials'); break; }
91
+ }
92
+ }
93
+ if (!kinds.has('credential assignment')) {
94
+ for (const m of text.matchAll(QUOTED_ASSIGNMENT)) {
95
+ if (!REDACTED_VALUE.test(m[2]) && !m[2].includes('://') && looksRandom(m[2])) { kinds.add('credential assignment'); break; }
96
+ }
97
+ }
98
+ }
99
+
100
+ /** Returns the kinds of likely live secret found in `text` (never the values). */
101
+ export function secretKinds(text) {
102
+ const kinds = new Set();
103
+ let start = 0;
104
+ for (const line of String(text).split('\n')) {
105
+ // The `.env` rule only looks at the start of a line.
106
+ const m = ENV_ASSIGNMENT.exec(line.length > 512 ? line.slice(0, 512) : line);
107
+ if (m && ENV_NAME.test(m[1]) && !REDACTED_VALUE.test(m[2]) && !MEMBER_ACCESS.test(m[2])) kinds.add('credential assignment');
108
+ for (start = 0; start < line.length; start += CHUNK - OVERLAP) {
109
+ chunkKinds(line.slice(start, start + CHUNK), kinds);
110
+ if (start + CHUNK >= line.length) break;
111
+ }
112
+ }
113
+ return [...kinds];
114
+ }
115
+
116
+ // Shows a value in an error only when it is short, boring and secret-free (ids, enum values).
117
+ function show(v) {
118
+ return typeof v === 'string' && /^[A-Za-z0-9_.:/-]{1,64}$/.test(v) && secretKinds(v).length === 0
119
+ ? JSON.stringify(v) : '(value not shown)';
120
+ }
121
+
122
+ const isObj = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
123
+ const isStr = (v) => typeof v === 'string' && v.trim() !== '';
124
+
125
+ // Nesting depth of raw JSON text, counted before parsing so a hostile file never reaches a recursive
126
+ // walk. Brackets inside strings do not count.
127
+ function rawDepth(text) {
128
+ let depth = 0;
129
+ let max = 0;
130
+ let inStr = false;
131
+ for (let i = 0; i < text.length; i++) {
132
+ const c = text[i];
133
+ if (inStr) {
134
+ if (c === '\\') i++;
135
+ else if (c === '"') inStr = false;
136
+ } else if (c === '"') inStr = true;
137
+ else if (c === '{' || c === '[') { if (++depth > max) max = depth; }
138
+ else if (c === '}' || c === ']') depth--;
139
+ }
140
+ return max;
141
+ }
142
+
143
+ // Resolves `rel` inside `baseReal` (an already-realpath'd directory) under the escape rules shared by
144
+ // code locations and evidence: relative only, no `..`, no symlink anywhere on the way, a regular file
145
+ // at the end, and its realpath still inside the base. Returns { abs, size } or { error }.
146
+ function resolveInside(baseReal, rel, baseName, { dir = false } = {}) {
147
+ if (!isStr(rel)) return { error: 'must be a non-empty relative path' };
148
+ if (rel.includes('\0') || isAbsolute(rel) || /^[A-Za-z]:/.test(rel) || rel.startsWith('\\')) {
149
+ return { error: `absolute paths escape ${baseName}; use a path relative to it` };
150
+ }
151
+ const segments = rel.split(/[\\/]+/).filter((s) => s !== '' && s !== '.');
152
+ if (segments.includes('..')) return { error: `path would escape ${baseName}: ".." segments are refused` };
153
+ let cur = baseReal;
154
+ for (let i = 0; i < segments.length; i++) {
155
+ cur = join(cur, segments[i]);
156
+ let st;
157
+ try { st = lstatSync(cur); } catch { return { error: `does not exist under ${baseName}` }; }
158
+ if (st.isSymbolicLink()) return { error: `goes through a symlink; symlinks are refused (they can escape ${baseName})` };
159
+ const last = i === segments.length - 1;
160
+ if (last && !dir && !st.isFile()) return { error: 'is not a regular file' };
161
+ if (last && dir && !st.isDirectory()) return { error: 'is not a directory' };
162
+ if (!last && !st.isDirectory()) return { error: `does not exist under ${baseName}` };
163
+ }
164
+ if (segments.length === 0) return { error: dir ? 'must name a directory' : 'must name a file' };
165
+ let real;
166
+ try { real = realpathSync(cur); } catch { return { error: `does not exist under ${baseName}` }; }
167
+ if (!real.startsWith(baseReal + sep)) return { error: `path would escape ${baseName}` };
168
+ return { abs: real, size: statSync(real).size, rel: real.slice(baseReal.length + 1) };
169
+ }
170
+
171
+ function lineCount(text) {
172
+ if (text.length === 0) return 0;
173
+ const n = text.split('\n').length;
174
+ return text.endsWith('\n') ? n - 1 : n;
175
+ }
176
+
177
+ /**
178
+ * Validates `<auditDir>/findings.json` against the contract and the disk.
179
+ * @returns {{ok: boolean, errors: string[], data: object|null}}
180
+ */
181
+ export function validate(auditDir) {
182
+ const errors = [];
183
+ const err = (path, msg) => errors.push(`${path}: ${msg}`);
184
+ const done = (data = null) => ({ ok: errors.length === 0, errors, data });
185
+
186
+ // ---- the file itself: hardening before anything is parsed ----
187
+ let auditReal;
188
+ try {
189
+ if (!lstatSync(auditDir).isDirectory()) throw new Error();
190
+ auditReal = realpathSync(auditDir);
191
+ } catch {
192
+ err('audit-dir', 'must be an existing directory (not a symlink)');
193
+ return done();
194
+ }
195
+ const file = join(auditReal, 'findings.json');
196
+ let st;
197
+ try { st = lstatSync(file); } catch { err('findings.json', 'does not exist in the audit dir'); return done(); }
198
+ if (!st.isFile()) { err('findings.json', 'must be a regular file (not a directory or symlink)'); return done(); }
199
+ if (st.size > MAX_BYTES) { err('findings.json', `is ${st.size} bytes; larger than 5 MB is refused`); return done(); }
200
+ const text = readFileSync(file, 'utf8');
201
+ if (rawDepth(text) > MAX_DEPTH) { err('findings.json', `nesting deeper than ${MAX_DEPTH} levels is refused`); return done(); }
202
+ let doc;
203
+ // The parser's own message can quote file content (a secret, even), so it is not repeated.
204
+ try { doc = JSON.parse(text); } catch { err('findings.json', 'is not valid JSON'); return done(); }
205
+ if (!isObj(doc)) { err('findings.json', 'top level must be an object'); return done(); }
206
+
207
+ // ---- small shape helpers; each records `<path>: <why>` ----
208
+ const reqStr = (o, k, p) => { if (!isStr(o[k])) err(`${p}.${k}`, 'is required (non-empty string)'); };
209
+ const optStr = (o, k, p) => { if (k in o && typeof o[k] !== 'string') err(`${p}.${k}`, 'must be a string'); };
210
+ const oneOf = (o, k, p, values) => {
211
+ if (!(k in o)) err(`${p}.${k}`, `is required; must be one of ${values.join(', ')}`);
212
+ else if (!values.includes(o[k])) err(`${p}.${k}`, `must be one of ${values.join(', ')}`);
213
+ };
214
+ const reqArr = (o, k, p) => {
215
+ if (!Array.isArray(o[k])) { err(`${p}.${k}`, 'is required (array)'); return []; }
216
+ return o[k];
217
+ };
218
+ const optArr = (o, k, p) => {
219
+ if (!(k in o)) return [];
220
+ if (!Array.isArray(o[k])) { err(`${p}.${k}`, 'must be an array'); return []; }
221
+ return o[k];
222
+ };
223
+ const strList = (o, k, p) => optArr(o, k, p).forEach((s, i) => { if (!isStr(s)) err(`${p}.${k}[${i}]`, 'must be a non-empty string'); });
224
+
225
+ // ---- run ----
226
+ const run = isObj(doc.run) ? doc.run : (err('run', 'is required (object)'), {});
227
+ reqStr(run, 'id', 'run');
228
+ if (!isStr(run.started_at) || !/^\d{4}-\d{2}-\d{2}T/.test(run.started_at) || Number.isNaN(Date.parse(run.started_at))) {
229
+ err('run.started_at', 'is required (ISO 8601 date-time)');
230
+ }
231
+ let projectReal = null;
232
+ if (!isStr(run.project_root) || !isAbsolute(run.project_root)) err('run.project_root', 'is required (absolute path)');
233
+ else {
234
+ try {
235
+ if (!statSync(run.project_root).isDirectory()) throw new Error();
236
+ projectReal = realpathSync(run.project_root);
237
+ } catch { err('run.project_root', 'is not an existing directory'); }
238
+ }
239
+ if (!isObj(run.scope)) err('run.scope', 'is required (object)');
240
+ oneOf(run, 'profile', 'run', PROFILES);
241
+ oneOf(run, 'status', 'run', RUN_STATUS);
242
+ if (run.status === 'partial') reqStr(run, 'partial_reason', 'run');
243
+
244
+ // Evidence files are checked once each, then scanned for secrets once each.
245
+ const evidenceSeen = new Map(); // abs path -> json path of the first reference
246
+ const checkEvidencePath = (rel, p) => {
247
+ const r = resolveInside(auditReal, rel, 'the audit dir');
248
+ if (r.error) { err(p, r.error); return; }
249
+ const top = r.rel.split(sep);
250
+ if (top.length < 2 || (top[0] !== 'evidence' && top[0] !== 'fixes')) {
251
+ err(p, 'must be under evidence/ or fixes/ of the audit dir; the audit records cannot be their own evidence');
252
+ return;
253
+ }
254
+ if (r.size === 0) { err(p, 'is empty; evidence must hold the observed output'); return; }
255
+ if (!evidenceSeen.has(r.abs)) evidenceSeen.set(r.abs, p);
256
+ };
257
+
258
+ // ---- findings ----
259
+ const findings = reqArr(doc, 'findings', 'findings');
260
+ const ids = new Map(); // id -> index
261
+ findings.forEach((f, i) => {
262
+ const p = `findings[${i}]`;
263
+ if (!isObj(f)) { err(p, 'must be an object'); return; }
264
+ if (!isStr(f.id) || !/^F-\d{3,}$/.test(f.id)) err(`${p}.id`, 'is required, in the form F-001');
265
+ else if (ids.has(f.id)) err(`${p}.id`, `duplicate id ${show(f.id)} (also findings[${ids.get(f.id)}])`);
266
+ else ids.set(f.id, i);
267
+ reqStr(f, 'title', p);
268
+ oneOf(f, 'verdict', p, VERDICTS);
269
+ oneOf(f, 'surface', p, SURFACES);
270
+ reqStr(f, 'class', p);
271
+ const open = f.verdict === 'confirmed' || f.verdict === 'needs_validation';
272
+ // Who, across what, to what end: the three facts that make a finding a finding. A rejected
273
+ // finding may leave them out — its rejection_reason is the point.
274
+ for (const k of ['principal', 'boundary', 'impact']) open ? reqStr(f, k, p) : optStr(f, k, p);
275
+
276
+ if (f.verdict === 'confirmed') {
277
+ if (!('severity' in f)) err(`${p}.severity`, 'is required when verdict is confirmed');
278
+ else if (!SEVERITIES.includes(f.severity)) err(`${p}.severity`, `must be one of ${SEVERITIES.join(', ')}`);
279
+ } else if ('severity' in f) {
280
+ err(`${p}.severity`, 'is only allowed when verdict is confirmed; an unproven finding has no severity');
281
+ }
282
+ if (f.surface === 'platform') reqStr(f, 'platform', p);
283
+ if (f.verdict === 'needs_validation') reqStr(f, 'missing_evidence', p);
284
+ if (f.verdict === 'rejected') reqStr(f, 'rejection_reason', p);
285
+
286
+ // Locations: relative to project_root, real files, real lines.
287
+ const locations = optArr(f, 'locations', p);
288
+ if (f.surface === 'code' && open && locations.length === 0) {
289
+ err(`${p}.locations`, `a ${f.verdict} code finding needs at least one location`);
290
+ }
291
+ locations.forEach((loc, j) => {
292
+ const lp = `${p}.locations[${j}]`;
293
+ if (!isObj(loc)) { err(lp, 'must be an object'); return; }
294
+ // A platform finding lives in a setting, not in the repo: it names the resource it was read from.
295
+ if (f.surface === 'platform') { reqStr(loc, 'resource', lp); return; }
296
+ const okStart = Number.isInteger(loc.line_start) && loc.line_start >= 1;
297
+ const okEnd = Number.isInteger(loc.line_end) && loc.line_end >= 1;
298
+ if (!okStart) err(`${lp}.line_start`, 'is required (integer >= 1)');
299
+ if (!okEnd) err(`${lp}.line_end`, 'is required (integer >= 1)');
300
+ if (okStart && okEnd && loc.line_start > loc.line_end) err(`${lp}.line_start`, 'is after line_end');
301
+ if (!projectReal) return; // already reported on run.project_root
302
+ const r = resolveInside(projectReal, loc.path, 'project_root');
303
+ if (r.error) { err(`${lp}.path`, r.error); return; }
304
+ if (r.size > MAX_BYTES) { err(`${lp}.path`, `is ${r.size} bytes; a cited file larger than 5 MB is refused`); return; }
305
+ const lines = lineCount(readFileSync(r.abs, 'utf8'));
306
+ if (okEnd && loc.line_end > lines) err(`${lp}.line_end`, `${loc.line_end} is beyond the end of the file (${lines} lines)`);
307
+ else if (okStart && loc.line_start > lines) err(`${lp}.line_start`, `${loc.line_start} is beyond the end of the file (${lines} lines)`);
308
+ });
309
+
310
+ // Evidence: files inside the audit dir. Confirmed means something was observed, not just read.
311
+ const evidence = optArr(f, 'evidence', p);
312
+ evidence.forEach((ev, j) => {
313
+ const ep = `${p}.evidence[${j}]`;
314
+ if (!isObj(ev)) { err(ep, 'must be an object'); return; }
315
+ oneOf(ev, 'kind', ep, EVIDENCE_KINDS);
316
+ reqStr(ev, 'summary', ep);
317
+ checkEvidencePath(ev.path, `${ep}.path`);
318
+ });
319
+ if (f.verdict === 'confirmed' && !evidence.some((ev) => isObj(ev) && (ev.kind === 'artifact' || ev.kind === 'command_output'))) {
320
+ err(`${p}.evidence`, 'a confirmed finding needs at least one evidence item of kind artifact or command_output');
321
+ }
322
+
323
+ // Fix and its recheck.
324
+ if ('fix' in f) {
325
+ const fp = `${p}.fix`;
326
+ if (!isObj(f.fix)) err(fp, 'must be an object');
327
+ else {
328
+ reqStr(f.fix, 'proposal', fp);
329
+ oneOf(f.fix, 'status', fp, FIX_STATUS);
330
+ if (f.fix.status === 'applied' || f.fix.status === 'rolled_back') {
331
+ if (!isStr(f.fix.rollback)) err(`${fp}.rollback`, `is required when fix status is ${f.fix.status}`);
332
+ } else optStr(f.fix, 'rollback', fp);
333
+ if ('recheck' in f.fix) {
334
+ const rp = `${fp}.recheck`;
335
+ const rc = f.fix.recheck;
336
+ if (!isObj(rc)) err(rp, 'must be an object');
337
+ else {
338
+ reqStr(rc, 'command', rp);
339
+ oneOf(rc, 'result', rp, RECHECK_RESULTS);
340
+ if (rc.result === 'pass' || rc.result === 'fail') {
341
+ if (!('artifact' in rc)) err(`${rp}.artifact`, `is required when the recheck result is ${rc.result}`);
342
+ else checkEvidencePath(rc.artifact, `${rp}.artifact`);
343
+ } else if ('artifact' in rc) checkEvidencePath(rc.artifact, `${rp}.artifact`);
344
+ }
345
+ }
346
+ }
347
+ }
348
+ strList(f, 'manual_steps', p);
349
+ });
350
+
351
+ // ---- coverage ----
352
+ const coverage = isObj(doc.coverage) ? doc.coverage : (err('coverage', 'is required (object)'), {});
353
+ const units = reqArr(coverage, 'units', 'coverage');
354
+ const unitIds = new Set();
355
+ const referenced = new Set();
356
+ units.forEach((u, i) => {
357
+ const p = `coverage.units[${i}]`;
358
+ if (!isObj(u)) { err(p, 'must be an object'); return; }
359
+ if (!isStr(u.id)) err(`${p}.id`, 'is required (non-empty string)');
360
+ else if (unitIds.has(u.id)) err(`${p}.id`, `duplicate id ${show(u.id)}`);
361
+ else unitIds.add(u.id);
362
+ oneOf(u, 'surface', p, SURFACES);
363
+ for (const k of ['area', 'boundary', 'class']) reqStr(u, k, p);
364
+ oneOf(u, 'status', p, UNIT_STATUS);
365
+ if (u.status !== 'done') reqStr(u, 'reason', p);
366
+ reqArr(u, 'findings', p).forEach((id, j) => {
367
+ if (!ids.has(id)) err(`${p}.findings[${j}]`, `unknown finding ${show(id)}`);
368
+ else referenced.add(id);
369
+ });
370
+ });
371
+ findings.forEach((f, i) => {
372
+ if (isObj(f) && (f.verdict === 'confirmed' || f.verdict === 'needs_validation') && ids.get(f.id) === i && !referenced.has(f.id)) {
373
+ err(`findings[${i}]`, `${f.verdict} finding ${show(f.id)} is not referenced by any coverage unit`);
374
+ }
375
+ });
376
+
377
+ // ---- platforms ----
378
+ const platforms = reqArr(doc, 'platforms', 'platforms');
379
+ platforms.forEach((pl, i) => {
380
+ const p = `platforms[${i}]`;
381
+ if (!isObj(pl)) { err(p, 'must be an object'); return; }
382
+ reqStr(pl, 'name', p);
383
+ reqStr(pl, 'detected_by', p);
384
+ oneOf(pl, 'access', p, ACCESS);
385
+ oneOf(pl, 'status', p, PLATFORM_STATUS);
386
+ if (pl.status === 'not_reviewed') reqStr(pl, 'reason', p);
387
+ if (pl.status === 'reviewed') {
388
+ // A platform is only "reviewed" through a tool the user can rerun: it must exist in 01-TOOLS/.
389
+ if (!isStr(pl.tool_path)) err(`${p}.tool_path`, 'is required when status is reviewed');
390
+ else if (!TOOL_PATH.test(pl.tool_path)) err(`${p}.tool_path`, 'must be 01-TOOLS/security/<platform>/ (one lowercase platform slug, relative to project_root)');
391
+ else if (projectReal) {
392
+ const r = resolveInside(projectReal, pl.tool_path, 'project_root', { dir: true });
393
+ if (r.error) err(`${p}.tool_path`, r.error);
394
+ else {
395
+ const entries = readdirSync(r.abs, { withFileTypes: true });
396
+ const readme = entries.some((e) => e.name === 'README.md' && e.isFile());
397
+ const other = entries.some((e) => e.name !== 'README.md' && e.isFile());
398
+ if (!readme) err(`${p}.tool_path`, 'has no README.md; the tool must say what it checks and how to rerun it');
399
+ else if (!other) err(`${p}.tool_path`, 'holds only a README.md; it needs the check itself (at least one other file)');
400
+ }
401
+ }
402
+ }
403
+ });
404
+
405
+ // ---- complete means complete ----
406
+ if (run.status === 'complete') {
407
+ if (units.length === 0 && platforms.length === 0) err('run.status', 'complete is refused: nothing was reviewed (no coverage units and no platforms)');
408
+ units.forEach((u, i) => {
409
+ if (isObj(u) && u.status !== 'done') err('run.status', `complete is refused while coverage.units[${i}] is ${show(u.status)}; set status to partial with a partial_reason`);
410
+ });
411
+ platforms.forEach((pl, i) => {
412
+ if (isObj(pl) && pl.status !== 'reviewed') err('run.status', `complete is refused while platforms[${i}] is ${show(pl.status)}; set status to partial with a partial_reason`);
413
+ });
414
+ }
415
+
416
+ // ---- user actions ----
417
+ optArr(doc, 'user_actions', 'user_actions').forEach((a, i) => {
418
+ const p = `user_actions[${i}]`;
419
+ if (!isObj(a)) { err(p, 'must be an object'); return; }
420
+ reqStr(a, 'title', p);
421
+ reqArr(a, 'steps', p);
422
+ strList(a, 'steps', p);
423
+ });
424
+
425
+ // ---- secrets: every key and string in findings.json, then every other file in the audit dir ----
426
+ // A key is shown in a path only when it is a short plain identifier with no secret shape; anything
427
+ // else is `[key#N]` (its position), so an error path can never carry the secret it reports.
428
+ const walk = (v, p) => {
429
+ if (typeof v === 'string') {
430
+ const kinds = secretKinds(v);
431
+ if (kinds.length) err(p || '(root)', `contains a likely live secret (${kinds.join(', ')}); redact it (e.g. sk_live_****) — value not shown`);
432
+ } else if (Array.isArray(v)) v.forEach((x, i) => walk(x, `${p}[${i}]`));
433
+ else if (isObj(v)) {
434
+ Object.entries(v).forEach(([k, x], n) => {
435
+ const keyKinds = secretKinds(k);
436
+ const plain = keyKinds.length === 0 && /^[A-Za-z_][A-Za-z0-9_]{0,63}$/.test(k);
437
+ const kp = plain ? (p ? `${p}.${k}` : k) : `${p}[key#${n}]`;
438
+ if (keyKinds.length) err(kp, `key contains a likely live secret (${keyKinds.join(', ')}); redact it — value not shown`);
439
+ walk(x, kp);
440
+ });
441
+ }
442
+ };
443
+ walk(doc, '');
444
+
445
+ // Every regular file in the audit dir except findings.json (walked above), report.html (rendered
446
+ // from validated data) and scratch/ (hunters' raw working files, deleted at the end of the run).
447
+ // A symlink could point anywhere, so it is refused rather than followed or skipped.
448
+ const files = [];
449
+ const scanDir = (dirAbs, relDir, depth) => {
450
+ if (depth > MAX_DEPTH) { err('audit-dir', `${show(relDir)} is nested deeper than ${MAX_DEPTH} levels`); return; }
451
+ let entries;
452
+ try { entries = readdirSync(dirAbs, { withFileTypes: true }); } catch { err('audit-dir', `${show(relDir)} cannot be read`); return; }
453
+ entries.sort((x, y) => (x.name < y.name ? -1 : x.name > y.name ? 1 : 0));
454
+ for (const e of entries) {
455
+ const rel = relDir ? `${relDir}/${e.name}` : e.name;
456
+ if (!relDir && (e.name === 'findings.json' || e.name === 'report.html' || e.name === 'scratch')) continue;
457
+ // A name can carry a secret too (`evidence/ghp_….txt`); report it without echoing the name.
458
+ const nameKinds = secretKinds(e.name);
459
+ if (nameKinds.length) err('audit-dir', `a file or directory name under ${show(relDir || '.')} contains a likely live secret (${nameKinds.join(', ')})`);
460
+ if (e.isSymbolicLink()) err('audit-dir', `${show(rel)} is a symlink; symlinks inside the audit dir are refused`);
461
+ else if (e.isDirectory()) scanDir(join(dirAbs, e.name), rel, depth + 1);
462
+ else if (e.isFile()) {
463
+ if (files.length >= MAX_SCAN_FILES) { err('audit-dir', `more than ${MAX_SCAN_FILES} files; not all were scanned`); return; }
464
+ files.push([join(dirAbs, e.name), rel]);
465
+ } else err('audit-dir', `${show(rel)} is not a regular file or directory`);
466
+ }
467
+ };
468
+ scanDir(auditReal, '', 0);
469
+ for (const [abs, rel] of files) {
470
+ const p = evidenceSeen.get(abs) ?? 'audit-dir';
471
+ const size = statSync(abs).size;
472
+ if (size > MAX_SCAN_BYTES) { err(p, `${show(rel)} is ${size} bytes: too large to scan; redact or trim it below 2 MB`); continue; }
473
+ const lines = readFileSync(abs, 'utf8').split('\n');
474
+ let reported = 0;
475
+ for (let n = 0; n < lines.length; n++) {
476
+ const kinds = secretKinds(lines[n]);
477
+ if (!kinds.length) continue;
478
+ if (++reported > 20) { err(p, `${show(rel)}: more lines with likely secrets not listed`); break; }
479
+ err(p, `${show(rel)} line ${n + 1} contains a likely live secret (${kinds.join(', ')}); redact the file — value not shown`);
480
+ }
481
+ }
482
+
483
+ return done(doc);
484
+ }
485
+
486
+ // ---- CLI ----
487
+ function main(argv) {
488
+ const dir = argv[0];
489
+ if (!dir || dir === '-h' || dir === '--help') {
490
+ console.error('usage: validate-findings.mjs <audit-dir>');
491
+ return 2;
492
+ }
493
+ const r = validate(resolve(dir));
494
+ if (!r.ok) {
495
+ console.error(`FAIL ${r.errors.length} error(s) in ${resolve(dir)}/findings.json`);
496
+ for (const e of r.errors) console.error(` ${e}`);
497
+ return 1;
498
+ }
499
+ const f = r.data.findings;
500
+ const count = (v) => f.filter((x) => x.verdict === v).length;
501
+ console.log(`OK ${f.length} finding(s): ${count('confirmed')} confirmed, ${count('needs_validation')} needs_validation, ${count('rejected')} rejected; ${r.data.coverage.units.length} coverage unit(s); ${r.data.platforms.length} platform(s); run ${r.data.run.status}`);
502
+ return 0;
503
+ }
504
+
505
+ const self = realpathSync(fileURLToPath(import.meta.url));
506
+ let invoked = '';
507
+ try { invoked = realpathSync(process.argv[1] || ''); } catch { /* imported, not run */ }
508
+ if (invoked === self) process.exitCode = main(process.argv.slice(2));
@@ -38,7 +38,7 @@ ok() { printf '%s[ ok ]%s %s\n' "$GREEN" "$NC" "$*"; }
38
38
  fail() { printf '%s[fail]%s %s\n' "$RED" "$NC" "$*"; }
39
39
 
40
40
  # --- known catalog id set (keep in sync with the catalog manifest) ------------
41
- KNOWN_IDS="analyze author-skill building-agents clarify constitution course-storytelling debug deployment design fastapi flutter go harness implement init marketing nextjs parallel plan postgresdb presentations review sdd secure-coding ship specify suggest tasks verify worktrees finance-ops invoicing bookkeeping pricing sales-pipeline lead-gen cold-outreach proposals contracts customer-support client-onboarding retention hiring people-ops inventory logistics-ops procurement meeting-notes sop-builder project-ops seo-geo content-engine social-publisher brand-voice brand-identity newsletter landing-copy ads article-writing case-studies video-shorts podcast market-research competitor-watch press-kit community webinar review-management pitch-deck investor-materials financial-model fundraising unit-economics grants gdpr-privacy terms-conditions compliance data-policy ip-trademark stripe email-connector google-workspace notion-connector whatsapp-telegram automation-flows api-connector-builder webhooks data-scraper spreadsheet-ops calendar-scheduling document-processing e-signature analytics dashboard kpi-framework reporting ab-testing forecasting data-cleaning business-intelligence rag embeddings-search prompt-engineering llm-pipeline agent-eval chatbot ai-media replicate-images structured-extraction agent-safety cost-tracking react react-native vue-nuxt nodejs django laravel rails swift-ios kotlin-android rust api-design wordpress shopify no-code-app chrome-extension mysql redis prisma-orm db-migrations backups clickhouse-analytics code-review security-scan testing-py testing-web testing-go e2e-testing accessibility performance error-handling observability docker github-actions git-workflow domains-dns monitoring email-deliverability scaling knowledge-ops codebase-onboarding research-ops decision-records continuous-learning skill-scout context-budget course-builder technical-writing translation-l10n youtube-api youtube-strategy youtube-ideation youtube-thumbnails youtube-packaging remotion-video tiktok-api instagram-api shortform-strategy shortform-ideation shortform-packaging shortform-editing linkedin-api linkedin-strategy linkedin-content linkedin-carousels linkedin-outreach medium-writing medium-publishing medium-strategy typescript python java csharp-dotnet php ruby cpp elixir bash-scripting sql angular svelte astro solid-js htmx nestjs spring-boot phoenix tauri electron expo compose-multiplatform mongodb supabase neon planetscale sqlite-turso drizzle-orm firebase dynamodb vector-db duckdb vercel netlify cloudflare railway render fly-io coolify hetzner digitalocean aws-essentials gcp-essentials replicate runpod modal huggingface ollama together-fireworks fal"
41
+ KNOWN_IDS="analyze author-skill building-agents clarify constitution course-storytelling debug deployment design fastapi flutter go harness implement init marketing nextjs parallel plan postgresdb presentations review sdd security-audit ship specify suggest tasks verify worktrees finance-ops invoicing bookkeeping pricing sales-pipeline lead-gen cold-outreach proposals contracts customer-support client-onboarding retention hiring people-ops inventory logistics-ops procurement meeting-notes sop-builder project-ops seo-geo content-engine social-publisher brand-voice brand-identity newsletter landing-copy ads article-writing case-studies video-shorts podcast market-research competitor-watch press-kit community webinar review-management pitch-deck investor-materials financial-model fundraising unit-economics grants gdpr-privacy terms-conditions compliance data-policy ip-trademark stripe email-connector google-workspace notion-connector whatsapp-telegram automation-flows api-connector-builder webhooks data-scraper spreadsheet-ops calendar-scheduling document-processing e-signature analytics dashboard kpi-framework reporting ab-testing forecasting data-cleaning business-intelligence rag embeddings-search prompt-engineering llm-pipeline agent-eval chatbot ai-media replicate-images structured-extraction agent-safety cost-tracking react react-native vue-nuxt nodejs django laravel rails swift-ios kotlin-android rust api-design wordpress shopify no-code-app chrome-extension mysql redis prisma-orm db-migrations backups clickhouse-analytics code-review testing-py testing-web testing-go e2e-testing accessibility performance error-handling observability docker github-actions git-workflow domains-dns monitoring email-deliverability scaling knowledge-ops codebase-onboarding research-ops decision-records continuous-learning skill-scout context-budget course-builder technical-writing translation-l10n youtube-api youtube-strategy youtube-ideation youtube-thumbnails youtube-packaging remotion-video tiktok-api instagram-api shortform-strategy shortform-ideation shortform-packaging shortform-editing linkedin-api linkedin-strategy linkedin-content linkedin-carousels linkedin-outreach medium-writing medium-publishing medium-strategy typescript python java csharp-dotnet php ruby cpp elixir bash-scripting sql angular svelte astro solid-js htmx nestjs spring-boot phoenix tauri electron expo compose-multiplatform mongodb supabase neon planetscale sqlite-turso drizzle-orm firebase dynamodb vector-db duckdb vercel netlify cloudflare railway render fly-io coolify hetzner digitalocean aws-essentials gcp-essentials replicate runpod modal huggingface ollama together-fireworks fal"
42
42
 
43
43
  is_known() {
44
44
  # whole-word membership test against the space-delimited set
@@ -28,7 +28,7 @@ should_not_trigger:
28
28
  route_to: technical-writing
29
29
  why: "The deliverable is documentation, not source-grounded implementation."
30
30
  - prompt: "Audit this webhook handler for SSRF and secret leakage."
31
- route_to: secure-coding
31
+ route_to: security-audit
32
32
  why: "Security threat/control review owns the task."
33
33
 
34
34
  capability:
@@ -27,7 +27,7 @@ ambiguity sweep, or project-wide principles.
27
27
  (the SDD phases — constitution, specify, clarify, plan, tasks, analyze,
28
28
  implement, verify, review, ship — plus the stack/process skills: fastapi,
29
29
  nextjs, go, postgresdb, flutter, design, marketing, presentations,
30
- course-storytelling, building-agents, secure-coding, deployment, harness,
30
+ course-storytelling, building-agents, security-audit, deployment, harness,
31
31
  init) so routing competes realistically.
32
32
  2. For each `should_trigger` prompt: feed it cold, record whether `specify` is
33
33
  the skill the agent loads. Run **3-5 trials** per prompt (fresh context).
@@ -2,7 +2,7 @@
2
2
  name: spring-boot
3
3
  description: "Use when building, reviewing, testing, securing or configuring a Spring Boot 4 / Framework 7 backend — controllers, services, Spring Data JPA, application.yml, SecurityFilterChain, slice tests. NOT plain modern-Java language work like records or virtual threads (that is `java`); NOT engine-level SQL schema/index/EXPLAIN (that is `postgresdb`)."
4
4
  tags: [java, spring, jpa, security, backend]
5
- recommends: [java, postgresdb, secure-coding, deployment]
5
+ recommends: [java, postgresdb, security-audit, deployment]
6
6
  origin: risco
7
7
  ---
8
8
 
@@ -32,7 +32,7 @@ The modern idioms below replace every one of them.
32
32
  - Engine-level SQL: schema/index design, `EXPLAIN`, partitioning, zero-downtime DDL ->
33
33
  [`../postgresdb/SKILL.md`](../postgresdb/SKILL.md) (this skill drives the JPA layer above it).
34
34
  - Language-agnostic injection/authz/secret theory ->
35
- [`../secure-coding/SKILL.md`](../secure-coding/SKILL.md).
35
+ [`../security-audit/SKILL.md`](../security-audit/SKILL.md).
36
36
  - Dockerfile/Compose/CI/CD mechanics -> [`../deployment/SKILL.md`](../deployment/SKILL.md)
37
37
  (keep only a build note here).
38
38
 
@@ -242,7 +242,7 @@ Order `requestMatchers` from most specific to least — the first match wins, so
242
242
  `permitAll` placed early opens routes you meant to lock. Full JWT/OAuth2 client, method
243
243
  security, CORS, and CSRF posture (token vs cookie apps) live in
244
244
  [`references/security.md`](references/security.md). For the language-agnostic authz/secret
245
- principles behind these rules, see [`../secure-coding/SKILL.md`](../secure-coding/SKILL.md).
245
+ principles behind these rules, see [`../security-audit/SKILL.md`](../security-audit/SKILL.md).
246
246
 
247
247
  ## Testing
248
248
 
@@ -5,7 +5,7 @@ through the repo's eval runner against this skill's `description` + body. `shoul
5
5
  asserts the router selects `spring-boot` (including the non-obvious symptom prompts like the
6
6
  `@Transactional` rollback and `LazyInitializationException` cases and the Spanish/Catalan
7
7
  phrasings); `should_not_trigger` asserts it prefers the named sibling instead (`java`,
8
- `fastapi`, `postgresdb`, `deployment`, `secure-coding`). The `capability` case is graded by
8
+ `fastapi`, `postgresdb`, `deployment`, `security-audit`). The `capability` case is graded by
9
9
  checking the produced solution against the `must_include` rubric — each bullet is a modern
10
10
  Boot 4 idiom that must appear (and the corresponding legacy idiom must be absent). There is no
11
11
  compilation step here; `scripts/verify.sh` is the static lint that complements these grades.
@@ -30,7 +30,7 @@ should_not_trigger:
30
30
  route_to: deployment
31
31
  why: "Container/CI mechanics, not Spring framework code."
32
32
  - prompt: "Explain how SQL injection defenses work in general."
33
- route_to: secure-coding
33
+ route_to: security-audit
34
34
  why: "Language-agnostic security theory, not the Spring security surface."
35
35
 
36
36
  capability:
@@ -2,7 +2,7 @@
2
2
 
3
3
  SKILL.md has the headline: one `SecurityFilterChain` bean, lambda DSL,
4
4
  `authorizeHttpRequests` + `requestMatchers`, stateless for token APIs. This is the depth.
5
- The language-agnostic authz/secret reasoning is `../secure-coding/SKILL.md`; this file is the
5
+ The language-agnostic authz/secret reasoning is `../security-audit/SKILL.md`; this file is the
6
6
  Spring wiring.
7
7
 
8
8
  ## JWT resource server (validate tokens minted elsewhere)
@@ -2,7 +2,7 @@
2
2
  name: stripe
3
3
  description: "Use when wiring an app to Stripe for payments, subscriptions, Checkout, webhooks or the billing portal — adding a paywall or paid plan, charging recurring fees, and debugging why a completion event never fires, why signature verification fails, or why a webhook fires twice and duplicates the order. NOT a generic non-Stripe inbound event receiver (that is `webhooks`), NOT the invoice document's legal form (that is `invoicing`), NOT deciding what to charge (that is `pricing`)."
4
4
  tags: [stripe, payments, subscriptions, checkout, webhooks, billing, saas]
5
- recommends: [webhooks, invoicing, pricing, secure-coding, nodejs]
5
+ recommends: [webhooks, invoicing, pricing, security-audit, nodejs]
6
6
  profiles: []
7
7
  origin: risco
8
8
  ---
@@ -266,4 +266,4 @@ Compact checklist; depth in [`references/going-live.md`](references/going-live.m
266
266
  - `webhooks` — generic, non-Stripe inbound event receivers.
267
267
  - [invoicing](../invoicing/SKILL.md) — the invoice document and its legal form.
268
268
  - [pricing](../pricing/SKILL.md) — deciding tiers and amounts before you wire them.
269
- - [secure-coding](../secure-coding/SKILL.md) — secret handling, key restriction.
269
+ - [security-audit](../security-audit/SKILL.md) — secret handling, key restriction.
@@ -39,8 +39,8 @@ should_not_trigger:
39
39
  why: "Trivial mechanical edit — nothing to install; the detector must stay silent and not interrupt the flow."
40
40
 
41
41
  - prompt: "Revisa este código de login por inyección y control de acceso."
42
- route_to: "secure-coding"
43
- why: "A security review is squarely owned by the secure-coding skill; if it is installed the detector defers to it rather than proposing anything."
42
+ route_to: "security-audit"
43
+ why: "A security review is squarely owned by the security-audit skill; if it is installed the detector defers to it rather than proposing anything."
44
44
 
45
45
  - prompt: "Optimiza esta query de Postgres que va lenta."
46
46
  route_to: "postgresdb"
@@ -2,7 +2,7 @@
2
2
  name: supabase
3
3
  description: "Use when building on Supabase as a backend over managed Postgres — wiring the supabase-js or SSR client, writing or debugging Row Level Security, cookie-based Auth, Storage buckets, Realtime, and Edge Functions, including local versus server JWT verification and the service-role key. NOT raw Postgres tuning (that is `postgresdb`)."
4
4
  tags: [supabase, postgres, rls, auth, edge-functions, realtime, storage, baas]
5
- recommends: [postgresdb, nextjs, db-migrations, secure-coding, drizzle-orm]
5
+ recommends: [postgresdb, nextjs, db-migrations, security-audit, drizzle-orm]
6
6
  origin: risco
7
7
  ---
8
8