@vantagesec/socc 0.1.11 → 0.1.13

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 (117) hide show
  1. package/.claude/agents/socc.md +47 -107
  2. package/.claude/references/evidence-rules.md +30 -0
  3. package/.claude/references/intelligence-source-registry.md +32 -0
  4. package/.claude/references/ioc-extraction.md +25 -0
  5. package/.claude/references/knowledge-ingestion-policy.md +34 -0
  6. package/.claude/references/mitre-guidance.md +21 -0
  7. package/.claude/references/output-contract.md +31 -0
  8. package/.claude/references/security-json-patterns.md +129 -0
  9. package/.claude/references/telemetry-investigation-patterns.md +39 -0
  10. package/.claude/rules/socc-business-rules.md +328 -0
  11. package/.claude/skills/code-review-excellence/SKILL.md +538 -0
  12. package/.claude/skills/cybersecurity-analyst/QUICK_REFERENCE.md +263 -0
  13. package/.claude/skills/cybersecurity-analyst/README.md +243 -0
  14. package/.claude/skills/cybersecurity-analyst/SKILL.md +1707 -0
  15. package/.claude/skills/cybersecurity-analyst/tests/quiz.md +472 -0
  16. package/.claude/skills/data-visualization/SKILL.md +304 -0
  17. package/.claude/skills/deep-research/SKILL.md +192 -0
  18. package/.claude/skills/excel-analysis/SKILL.md +247 -0
  19. package/.claude/skills/find-skills/SKILL.md +133 -0
  20. package/.claude/skills/humanizer/README.md +120 -0
  21. package/.claude/skills/humanizer/SKILL.md +439 -0
  22. package/.claude/skills/malware-behavior/SKILL.md +54 -0
  23. package/.claude/skills/mitre/SKILL.md +200 -0
  24. package/.claude/skills/observability-logs-search/SKILL.md +237 -0
  25. package/.claude/skills/observability-logs-search/references/log-search-reference.md +76 -0
  26. package/.claude/skills/payload-triage/SKILL.md +53 -0
  27. package/.claude/skills/phishing-analysis/SKILL.md +51 -0
  28. package/.claude/skills/prd/SKILL.md +143 -0
  29. package/.claude/skills/remembering-conversations/MCP-TOOLS.md +137 -0
  30. package/.claude/skills/remembering-conversations/SKILL.md +65 -0
  31. package/.claude/skills/sequential-thinking/README.md +118 -0
  32. package/.claude/skills/sequential-thinking/SKILL.md +93 -0
  33. package/.claude/skills/sequential-thinking/references/advanced.md +122 -0
  34. package/.claude/skills/sequential-thinking/references/examples.md +274 -0
  35. package/.claude/skills/soc-generalist/SKILL.md +53 -0
  36. package/.claude/skills/suspicious-url/SKILL.md +51 -0
  37. package/.claude/skills/systematic-debugging/CREATION-LOG.md +119 -0
  38. package/.claude/skills/systematic-debugging/SKILL.md +296 -0
  39. package/.claude/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  40. package/.claude/skills/systematic-debugging/condition-based-waiting.md +115 -0
  41. package/.claude/skills/systematic-debugging/defense-in-depth.md +122 -0
  42. package/.claude/skills/systematic-debugging/find-polluter.sh +63 -0
  43. package/.claude/skills/systematic-debugging/root-cause-tracing.md +169 -0
  44. package/.claude/skills/systematic-debugging/test-academic.md +14 -0
  45. package/.claude/skills/systematic-debugging/test-pressure-1.md +58 -0
  46. package/.claude/skills/systematic-debugging/test-pressure-2.md +68 -0
  47. package/.claude/skills/systematic-debugging/test-pressure-3.md +69 -0
  48. package/.claude/skills/translation-expertise/SKILL.md +284 -0
  49. package/.claude/skills/translation-expertise/chinese-traditional.md +535 -0
  50. package/.claude/skills/translation-expertise/english.md +372 -0
  51. package/.claude/skills/translation-expertise/japanese.md +515 -0
  52. package/.claude/skills/translation-expertise/tools-resources.md +527 -0
  53. package/.claude/skills/translation-expertise/translation-challenges.md +603 -0
  54. package/.claude/skills/web-search/SKILL.md +322 -0
  55. package/dist/cli.mjs +31 -31
  56. package/package.json +4 -1
  57. package/scripts/bootstrap-socc-soul.mjs +347 -26
  58. package/socc-canonical/.agents/generated/socc-agent-manifest.json +218 -3
  59. package/socc-canonical/.agents/generated/socc-agent.md +47 -107
  60. package/socc-canonical/.agents/rules/AGENT.md +109 -0
  61. package/socc-canonical/.agents/rules/AQL_REFERENCE.md +40 -0
  62. package/socc-canonical/.agents/rules/MEMORY.md +19 -0
  63. package/socc-canonical/.agents/rules/TOOLS.md +48 -0
  64. package/socc-canonical/.agents/soc-copilot/AGENTS.md +0 -5
  65. package/socc-canonical/.agents/soc-copilot/MEMORY.md +0 -6
  66. package/socc-canonical/.agents/soc-copilot/SKILL.md +10 -14
  67. package/socc-canonical/.agents/soc-copilot/SOUL.md +1 -18
  68. package/socc-canonical/.agents/soc-copilot/TOOLS.md +16 -30
  69. package/socc-canonical/.agents/soc-copilot/USER.md +6 -7
  70. package/socc-canonical/.agents/soc-copilot/identity.md +3 -9
  71. package/socc-canonical/.agents/soc-copilot/skills/code-review-excellence/SKILL.md +538 -0
  72. package/socc-canonical/.agents/soc-copilot/skills/cybersecurity-analyst/QUICK_REFERENCE.md +263 -0
  73. package/socc-canonical/.agents/soc-copilot/skills/cybersecurity-analyst/README.md +243 -0
  74. package/socc-canonical/.agents/soc-copilot/skills/cybersecurity-analyst/SKILL.md +1707 -0
  75. package/socc-canonical/.agents/soc-copilot/skills/cybersecurity-analyst/tests/quiz.md +472 -0
  76. package/socc-canonical/.agents/soc-copilot/skills/data-visualization/SKILL.md +304 -0
  77. package/socc-canonical/.agents/soc-copilot/skills/deep-research/SKILL.md +192 -0
  78. package/socc-canonical/.agents/soc-copilot/skills/excel-analysis/SKILL.md +247 -0
  79. package/socc-canonical/.agents/soc-copilot/skills/find-skills/SKILL.md +133 -0
  80. package/socc-canonical/.agents/soc-copilot/skills/humanizer/README.md +120 -0
  81. package/socc-canonical/.agents/soc-copilot/skills/humanizer/SKILL.md +439 -0
  82. package/socc-canonical/.agents/soc-copilot/skills/malware-behavior/SKILL.md +54 -0
  83. package/socc-canonical/.agents/soc-copilot/skills/mitre/SKILL.md +200 -0
  84. package/socc-canonical/.agents/soc-copilot/skills/observability-logs-search/SKILL.md +237 -0
  85. package/socc-canonical/.agents/soc-copilot/skills/observability-logs-search/references/log-search-reference.md +76 -0
  86. package/socc-canonical/.agents/soc-copilot/skills/payload-triage/SKILL.md +53 -0
  87. package/socc-canonical/.agents/soc-copilot/skills/phishing-analysis/SKILL.md +51 -0
  88. package/socc-canonical/.agents/soc-copilot/skills/prd/SKILL.md +143 -0
  89. package/socc-canonical/.agents/soc-copilot/skills/remembering-conversations/MCP-TOOLS.md +137 -0
  90. package/socc-canonical/.agents/soc-copilot/skills/remembering-conversations/SKILL.md +65 -0
  91. package/socc-canonical/.agents/soc-copilot/skills/sequential-thinking/README.md +118 -0
  92. package/socc-canonical/.agents/soc-copilot/skills/sequential-thinking/SKILL.md +93 -0
  93. package/socc-canonical/.agents/soc-copilot/skills/sequential-thinking/references/advanced.md +122 -0
  94. package/socc-canonical/.agents/soc-copilot/skills/sequential-thinking/references/examples.md +274 -0
  95. package/socc-canonical/.agents/soc-copilot/skills/soc-generalist/SKILL.md +53 -0
  96. package/socc-canonical/.agents/soc-copilot/skills/suspicious-url/SKILL.md +51 -0
  97. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/CREATION-LOG.md +119 -0
  98. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/SKILL.md +296 -0
  99. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  100. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/condition-based-waiting.md +115 -0
  101. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/defense-in-depth.md +122 -0
  102. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/find-polluter.sh +63 -0
  103. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/root-cause-tracing.md +169 -0
  104. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/test-academic.md +14 -0
  105. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/test-pressure-1.md +58 -0
  106. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/test-pressure-2.md +68 -0
  107. package/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/test-pressure-3.md +69 -0
  108. package/socc-canonical/.agents/soc-copilot/skills/translation-expertise/SKILL.md +284 -0
  109. package/socc-canonical/.agents/soc-copilot/skills/translation-expertise/chinese-traditional.md +535 -0
  110. package/socc-canonical/.agents/soc-copilot/skills/translation-expertise/english.md +372 -0
  111. package/socc-canonical/.agents/soc-copilot/skills/translation-expertise/japanese.md +515 -0
  112. package/socc-canonical/.agents/soc-copilot/skills/translation-expertise/tools-resources.md +527 -0
  113. package/socc-canonical/.agents/soc-copilot/skills/translation-expertise/translation-challenges.md +603 -0
  114. package/socc-canonical/.agents/soc-copilot/skills/web-search/SKILL.md +322 -0
  115. package/socc-canonical/.agents/soc-copilot/skills.md +11 -18
  116. package/socc-canonical/.agents/workflows/SOP.md +137 -0
  117. package/socc-canonical/README.md +2 -0
@@ -1,12 +1,36 @@
1
1
  import assert from 'node:assert/strict'
2
+ import { createHash } from 'node:crypto'
2
3
  import { existsSync } from 'node:fs'
3
- import { mkdir, readFile, writeFile } from 'node:fs/promises'
4
+ import {
5
+ cp,
6
+ mkdir,
7
+ readFile,
8
+ readdir,
9
+ rm,
10
+ stat,
11
+ writeFile,
12
+ } from 'node:fs/promises'
4
13
  import { dirname, join, resolve } from 'node:path'
5
14
  import { fileURLToPath } from 'node:url'
6
15
 
7
- const SOC_COPILOT_DIR = ['socc-canonical', '.agents', 'soc-copilot']
8
- const GENERATED_DIR = ['socc-canonical', '.agents', 'generated']
9
- const RUNTIME_AGENT_PATH = ['.claude', 'agents', 'socc.md']
16
+ const SOC_CANONICAL_ROOT = ['socc-canonical', '.agents']
17
+ const SOC_COPILOT_DIR = [...SOC_CANONICAL_ROOT, 'soc-copilot']
18
+ const RULES_DIR = [...SOC_CANONICAL_ROOT, 'rules']
19
+ const WORKFLOWS_DIR = [...SOC_CANONICAL_ROOT, 'workflows']
20
+ const GENERATED_DIR = [...SOC_CANONICAL_ROOT, 'generated']
21
+
22
+ const RUNTIME_ROOT = ['.claude']
23
+ const RUNTIME_AGENT_PATH = [...RUNTIME_ROOT, 'agents', 'socc.md']
24
+ const RUNTIME_RULES_DIR = [...RUNTIME_ROOT, 'rules']
25
+ const RUNTIME_SKILLS_DIR = [...RUNTIME_ROOT, 'skills']
26
+ const RUNTIME_REFERENCES_DIR = [...RUNTIME_ROOT, 'references']
27
+
28
+ const RULE_RUNTIME_FILES = [
29
+ { source: RULES_DIR, file: 'AGENT.md', title: 'Global Behavior Rules' },
30
+ { source: RULES_DIR, file: 'TOOLS.md', title: 'Global Tooling Rules' },
31
+ { source: RULES_DIR, file: 'MEMORY.md', title: 'Persistent Conventions' },
32
+ { source: WORKFLOWS_DIR, file: 'SOP.md', title: 'IOC Handling SOP' },
33
+ ]
10
34
 
11
35
  function findPackageRoot(startDir) {
12
36
  let current = resolve(startDir)
@@ -28,6 +52,77 @@ async function readRequiredFile(path) {
28
52
  return readFile(path, 'utf8')
29
53
  }
30
54
 
55
+ async function readOptionalFile(path) {
56
+ if (!existsSync(path)) {
57
+ return ''
58
+ }
59
+ return readFile(path, 'utf8')
60
+ }
61
+
62
+ function sha256(content) {
63
+ return createHash('sha256').update(content).digest('hex')
64
+ }
65
+
66
+ async function fileMetadata(path) {
67
+ const content = await readFile(path, 'utf8')
68
+ const stats = await stat(path)
69
+ return {
70
+ path,
71
+ sha256: sha256(content),
72
+ mtimeMs: stats.mtimeMs,
73
+ }
74
+ }
75
+
76
+ async function collectFileList(rootDir) {
77
+ if (!existsSync(rootDir)) {
78
+ return []
79
+ }
80
+
81
+ const results = []
82
+
83
+ async function walk(currentDir) {
84
+ const entries = await readdir(currentDir, { withFileTypes: true })
85
+ entries.sort((a, b) => a.name.localeCompare(b.name))
86
+
87
+ for (const entry of entries) {
88
+ const fullPath = join(currentDir, entry.name)
89
+ if (entry.isDirectory()) {
90
+ await walk(fullPath)
91
+ } else if (entry.isFile()) {
92
+ results.push(fullPath)
93
+ }
94
+ }
95
+ }
96
+
97
+ await walk(rootDir)
98
+ return results
99
+ }
100
+
101
+ async function replaceDirectory(sourceDir, targetDir) {
102
+ if (!existsSync(sourceDir)) {
103
+ throw new Error(`Required source directory not found: ${sourceDir}`)
104
+ }
105
+
106
+ await rm(targetDir, { recursive: true, force: true })
107
+ await mkdir(dirname(targetDir), { recursive: true })
108
+ await cp(sourceDir, targetDir, { recursive: true })
109
+ }
110
+
111
+ function composeRuleBundle(sections) {
112
+ return [
113
+ '# SOCC Business Rules',
114
+ '',
115
+ '<!-- Generated from socc-canonical/.agents/rules and workflows. -->',
116
+ '',
117
+ ...sections.flatMap(section => [
118
+ `## ${section.title}`,
119
+ '',
120
+ section.content.trim(),
121
+ '',
122
+ ]),
123
+ ].join('\n')
124
+ }
125
+
31
126
  export function composeSoccAgentPrompt(parts) {
32
127
  return `---
33
128
  name: socc
@@ -74,7 +169,200 @@ ${parts.skill.trim()}
74
169
  `
75
170
  }
76
171
 
77
- export async function syncSoccSoul(packageRoot) {
172
+ async function buildRuntimeRules(packageRoot) {
173
+ const sections = []
174
+ for (const section of RULE_RUNTIME_FILES) {
175
+ const sourcePath = join(packageRoot, ...section.source, section.file)
176
+ const content = await readOptionalFile(sourcePath)
177
+ if (!content.trim()) {
178
+ continue
179
+ }
180
+ sections.push({
181
+ title: section.title,
182
+ sourcePath,
183
+ content,
184
+ })
185
+ }
186
+
187
+ const runtimeRulesDir = join(packageRoot, ...RUNTIME_RULES_DIR)
188
+ const runtimeRulesPath = join(runtimeRulesDir, 'socc-business-rules.md')
189
+
190
+ await rm(runtimeRulesDir, { recursive: true, force: true })
191
+ await mkdir(runtimeRulesDir, { recursive: true })
192
+ await writeFile(runtimeRulesPath, composeRuleBundle(sections), 'utf8')
193
+
194
+ return {
195
+ runtimeRulesDir,
196
+ runtimeRulesPath,
197
+ sections: await Promise.all(
198
+ sections.map(async section => ({
199
+ title: section.title,
200
+ ...(await fileMetadata(section.sourcePath)),
201
+ })),
202
+ ),
203
+ }
204
+ }
205
+
206
+ async function buildRuntimeReferences(packageRoot) {
207
+ const sourceDir = join(packageRoot, ...SOC_COPILOT_DIR, 'references')
208
+ const targetDir = join(packageRoot, ...RUNTIME_REFERENCES_DIR)
209
+
210
+ await rm(targetDir, { recursive: true, force: true })
211
+ if (existsSync(sourceDir)) {
212
+ await mkdir(dirname(targetDir), { recursive: true })
213
+ await cp(sourceDir, targetDir, { recursive: true })
214
+ }
215
+
216
+ return {
217
+ runtimeReferencesDir: targetDir,
218
+ referenceFiles: await Promise.all(
219
+ (await collectFileList(targetDir)).map(fileMetadata),
220
+ ),
221
+ }
222
+ }
223
+
224
+ async function discoverSkillNames(skillsRoot) {
225
+ if (!existsSync(skillsRoot)) {
226
+ return []
227
+ }
228
+
229
+ const entries = await readdir(skillsRoot, { withFileTypes: true })
230
+ const names = []
231
+
232
+ for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
233
+ if (!entry.isDirectory()) {
234
+ continue
235
+ }
236
+ if (existsSync(join(skillsRoot, entry.name, 'SKILL.md'))) {
237
+ names.push(entry.name)
238
+ }
239
+ }
240
+
241
+ return names
242
+ }
243
+
244
+ async function buildRuntimeSkills(packageRoot, skillNames = null) {
245
+ const sourceSkillsRoot = join(packageRoot, ...SOC_COPILOT_DIR, 'skills')
246
+ const runtimeSkillsDir = join(packageRoot, ...RUNTIME_SKILLS_DIR)
247
+ const namesToSync = skillNames ?? (await discoverSkillNames(sourceSkillsRoot))
248
+
249
+ await rm(runtimeSkillsDir, { recursive: true, force: true })
250
+ await mkdir(runtimeSkillsDir, { recursive: true })
251
+
252
+ const copied = []
253
+ for (const skillName of namesToSync) {
254
+ const sourceDir = join(sourceSkillsRoot, skillName)
255
+ if (!existsSync(sourceDir)) {
256
+ throw new Error(`Skill not found in canonical source: ${skillName}`)
257
+ }
258
+ const targetDir = join(runtimeSkillsDir, skillName)
259
+ await cp(sourceDir, targetDir, { recursive: true })
260
+ copied.push({
261
+ name: skillName,
262
+ path: targetDir,
263
+ ...(await fileMetadata(join(sourceDir, 'SKILL.md'))),
264
+ })
265
+ }
266
+
267
+ return {
268
+ runtimeSkillsDir,
269
+ runtimeSkills: copied,
270
+ }
271
+ }
272
+
273
+ async function buildManifest({
274
+ packageRoot,
275
+ upstreamRoot,
276
+ generatedAgentPath,
277
+ generatedManifestPath,
278
+ runtimeAgentPath,
279
+ runtimeRulesPath,
280
+ runtimeSkillsDir,
281
+ runtimeReferencesDir,
282
+ runtimeSkills,
283
+ }) {
284
+ const canonicalRoot = join(packageRoot, ...SOC_COPILOT_DIR)
285
+ const sourceFiles = {
286
+ identity: join(canonicalRoot, 'identity.md'),
287
+ soul: join(canonicalRoot, 'SOUL.md'),
288
+ user: join(canonicalRoot, 'USER.md'),
289
+ agents: join(canonicalRoot, 'AGENTS.md'),
290
+ tools: join(canonicalRoot, 'TOOLS.md'),
291
+ memory: join(canonicalRoot, 'MEMORY.md'),
292
+ skills: join(canonicalRoot, 'skills.md'),
293
+ skill: join(canonicalRoot, 'SKILL.md'),
294
+ rulesAgent: join(packageRoot, ...RULES_DIR, 'AGENT.md'),
295
+ rulesTools: join(packageRoot, ...RULES_DIR, 'TOOLS.md'),
296
+ rulesMemory: join(packageRoot, ...RULES_DIR, 'MEMORY.md'),
297
+ workflowSop: join(packageRoot, ...WORKFLOWS_DIR, 'SOP.md'),
298
+ }
299
+
300
+ const sourceBlocks = {}
301
+ for (const [name, path] of Object.entries(sourceFiles)) {
302
+ if (existsSync(path)) {
303
+ sourceBlocks[name] = await fileMetadata(path)
304
+ }
305
+ }
306
+
307
+ return {
308
+ generatedAt: new Date().toISOString(),
309
+ sourceRoot: canonicalRoot,
310
+ upstreamRoot: upstreamRoot || null,
311
+ generatedAgentPath,
312
+ generatedManifestPath,
313
+ runtimeAgentPath,
314
+ runtimeRulesPath,
315
+ runtimeSkillsDir,
316
+ runtimeReferencesDir,
317
+ runtimeSkillNames: runtimeSkills.map(skill => skill.name),
318
+ sourceFiles,
319
+ sourceBlocks,
320
+ runtimeSkills,
321
+ }
322
+ }
323
+
324
+ export async function syncSoccCanonicalFromUpstream(packageRoot, upstreamRoot) {
325
+ if (!upstreamRoot) {
326
+ throw new Error('upstreamRoot is required for canonical sync')
327
+ }
328
+
329
+ const canonicalRoot = join(packageRoot, ...SOC_CANONICAL_ROOT)
330
+ const syncTargets = [
331
+ { source: join(upstreamRoot, 'rules'), target: join(canonicalRoot, 'rules') },
332
+ {
333
+ source: join(upstreamRoot, 'soc-copilot'),
334
+ target: join(canonicalRoot, 'soc-copilot'),
335
+ },
336
+ {
337
+ source: join(upstreamRoot, 'workflows'),
338
+ target: join(canonicalRoot, 'workflows'),
339
+ },
340
+ ]
341
+
342
+ await mkdir(canonicalRoot, { recursive: true })
343
+ await Promise.all(syncTargets.map(target => replaceDirectory(target.source, target.target)))
344
+
345
+ return {
346
+ upstreamRoot,
347
+ canonicalRoot,
348
+ syncedPaths: syncTargets.map(target => ({
349
+ source: target.source,
350
+ target: target.target,
351
+ })),
352
+ }
353
+ }
354
+
355
+ export async function syncSoccSoul(
356
+ packageRoot,
357
+ {
358
+ upstreamRoot = null,
359
+ skillNames = null,
360
+ } = {},
361
+ ) {
362
+ if (upstreamRoot) {
363
+ await syncSoccCanonicalFromUpstream(packageRoot, upstreamRoot)
364
+ }
365
+
78
366
  const canonicalRoot = join(packageRoot, ...SOC_COPILOT_DIR)
79
367
  const generatedDir = join(packageRoot, ...GENERATED_DIR)
80
368
  const runtimeAgentPath = join(packageRoot, ...RUNTIME_AGENT_PATH)
@@ -112,52 +400,85 @@ export async function syncSoccSoul(packageRoot) {
112
400
  skill,
113
401
  })
114
402
 
115
- const manifest = {
116
- generatedAt: new Date().toISOString(),
117
- sourceRoot: canonicalRoot,
118
- generatedAgentPath,
119
- runtimeAgentPath,
120
- sourceFiles: {
121
- identity: join(canonicalRoot, 'identity.md'),
122
- soul: join(canonicalRoot, 'SOUL.md'),
123
- user: join(canonicalRoot, 'USER.md'),
124
- agents: join(canonicalRoot, 'AGENTS.md'),
125
- tools: join(canonicalRoot, 'TOOLS.md'),
126
- memory: join(canonicalRoot, 'MEMORY.md'),
127
- skills: join(canonicalRoot, 'skills.md'),
128
- skill: join(canonicalRoot, 'SKILL.md'),
129
- },
130
- }
131
-
132
403
  await mkdir(dirname(runtimeAgentPath), { recursive: true })
133
404
  await mkdir(generatedDir, { recursive: true })
134
405
 
135
406
  await Promise.all([
136
407
  writeFile(generatedAgentPath, prompt, 'utf8'),
137
- writeFile(generatedManifestPath, JSON.stringify(manifest, null, 2), 'utf8'),
138
408
  writeFile(runtimeAgentPath, prompt, 'utf8'),
139
409
  ])
140
410
 
411
+ const runtimeRules = await buildRuntimeRules(packageRoot)
412
+ const runtimeReferences = await buildRuntimeReferences(packageRoot)
413
+ const runtimeSkills = await buildRuntimeSkills(packageRoot, skillNames)
414
+
415
+ const manifest = await buildManifest({
416
+ packageRoot,
417
+ upstreamRoot,
418
+ generatedAgentPath,
419
+ generatedManifestPath,
420
+ runtimeAgentPath,
421
+ runtimeRulesPath: runtimeRules.runtimeRulesPath,
422
+ runtimeSkillsDir: runtimeSkills.runtimeSkillsDir,
423
+ runtimeReferencesDir: runtimeReferences.runtimeReferencesDir,
424
+ runtimeSkills: runtimeSkills.runtimeSkills,
425
+ })
426
+
427
+ await writeFile(
428
+ generatedManifestPath,
429
+ JSON.stringify(manifest, null, 2),
430
+ 'utf8',
431
+ )
432
+
141
433
  return {
142
434
  generatedAgentPath,
143
435
  generatedManifestPath,
144
436
  runtimeAgentPath,
437
+ runtimeRulesPath: runtimeRules.runtimeRulesPath,
438
+ runtimeSkillsDir: runtimeSkills.runtimeSkillsDir,
439
+ runtimeReferencesDir: runtimeReferences.runtimeReferencesDir,
440
+ upstreamRoot,
441
+ runtimeSkillNames: runtimeSkills.runtimeSkills.map(skill => skill.name),
145
442
  }
146
443
  }
147
444
 
445
+ function parseArgs(argv) {
446
+ const args = [...argv]
447
+ let upstreamRoot =
448
+ process.env.SOCC_AGENTS_UPSTREAM?.trim() || null
449
+
450
+ for (let index = 0; index < args.length; index += 1) {
451
+ const arg = args[index]
452
+ if (arg === '--upstream') {
453
+ upstreamRoot = args[index + 1] ? resolve(args[index + 1]) : null
454
+ index += 1
455
+ }
456
+ }
457
+
458
+ return { upstreamRoot }
459
+ }
460
+
148
461
  async function main() {
149
462
  const scriptDir = dirname(fileURLToPath(import.meta.url))
150
463
  const packageRoot = findPackageRoot(scriptDir)
151
- const result = await syncSoccSoul(packageRoot)
464
+ const { upstreamRoot } = parseArgs(process.argv.slice(2))
465
+ const result = await syncSoccSoul(packageRoot, { upstreamRoot })
152
466
 
153
467
  assert.ok(result.generatedAgentPath)
154
468
  assert.ok(result.generatedManifestPath)
155
469
  assert.ok(result.runtimeAgentPath)
470
+ assert.ok(result.runtimeRulesPath)
471
+ assert.ok(result.runtimeSkillsDir)
156
472
 
157
- console.log(`SOCC soul synced from canonical source.`)
158
- console.log(`Generated: ${result.generatedAgentPath}`)
473
+ console.log('SOCC soul synced from canonical source.')
474
+ if (result.upstreamRoot) {
475
+ console.log(`Upstream synced: ${result.upstreamRoot}`)
476
+ }
477
+ console.log(`Generated agent: ${result.generatedAgentPath}`)
159
478
  console.log(`Manifest: ${result.generatedManifestPath}`)
160
479
  console.log(`Runtime agent: ${result.runtimeAgentPath}`)
480
+ console.log(`Runtime rules: ${result.runtimeRulesPath}`)
481
+ console.log(`Runtime skills: ${result.runtimeSkillsDir}`)
161
482
  }
162
483
 
163
484
  const isDirectExecution =
@@ -1,8 +1,35 @@
1
1
  {
2
- "generatedAt": "2026-04-11T20:09:04.252Z",
2
+ "generatedAt": "2026-04-12T18:33:01.785Z",
3
3
  "sourceRoot": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot",
4
+ "upstreamRoot": "/home/nilsonpmjr/Modelos/socc/.agents",
4
5
  "generatedAgentPath": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/generated/socc-agent.md",
6
+ "generatedManifestPath": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/generated/socc-agent-manifest.json",
5
7
  "runtimeAgentPath": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/.claude/agents/socc.md",
8
+ "runtimeRulesPath": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/.claude/rules/socc-business-rules.md",
9
+ "runtimeSkillsDir": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/.claude/skills",
10
+ "runtimeReferencesDir": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/.claude/references",
11
+ "runtimeSkillNames": [
12
+ "code-review-excellence",
13
+ "cybersecurity-analyst",
14
+ "data-visualization",
15
+ "deep-research",
16
+ "excel-analysis",
17
+ "find-skills",
18
+ "humanizer",
19
+ "malware-behavior",
20
+ "mitre",
21
+ "observability-logs-search",
22
+ "payload-triage",
23
+ "phishing-analysis",
24
+ "prd",
25
+ "remembering-conversations",
26
+ "sequential-thinking",
27
+ "soc-generalist",
28
+ "suspicious-url",
29
+ "systematic-debugging",
30
+ "translation-expertise",
31
+ "web-search"
32
+ ],
6
33
  "sourceFiles": {
7
34
  "identity": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/identity.md",
8
35
  "soul": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/SOUL.md",
@@ -11,6 +38,194 @@
11
38
  "tools": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/TOOLS.md",
12
39
  "memory": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/MEMORY.md",
13
40
  "skills": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills.md",
14
- "skill": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/SKILL.md"
15
- }
41
+ "skill": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/SKILL.md",
42
+ "rulesAgent": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/rules/AGENT.md",
43
+ "rulesTools": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/rules/TOOLS.md",
44
+ "rulesMemory": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/rules/MEMORY.md",
45
+ "workflowSop": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/workflows/SOP.md"
46
+ },
47
+ "sourceBlocks": {
48
+ "identity": {
49
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/identity.md",
50
+ "sha256": "7f4e655bcab4cf2d3f662d76687b616e9e5da461aed80b669e38233272b6d433",
51
+ "mtimeMs": 1776018781684.7075
52
+ },
53
+ "soul": {
54
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/SOUL.md",
55
+ "sha256": "d337ef58227c7eb3ec4638b4a56edf12283f2521b19e03583ce22e5d3d84afd8",
56
+ "mtimeMs": 1776018781683.391
57
+ },
58
+ "user": {
59
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/USER.md",
60
+ "sha256": "44af3a21476a83abd9a9aed93d201573f4729d63ef2be87d1fa84e2073b47690",
61
+ "mtimeMs": 1776018781683.9214
62
+ },
63
+ "agents": {
64
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/AGENTS.md",
65
+ "sha256": "055615392fb01fa08118d35ae53dcdace9bc1c2596a7f16678224bf165f664d1",
66
+ "mtimeMs": 1776018781681.4995
67
+ },
68
+ "tools": {
69
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/TOOLS.md",
70
+ "sha256": "dbbf7bf495c4f23baa0a0fc92bba4635bfb89c3ca53279700c4967ae2d72f0cb",
71
+ "mtimeMs": 1776018781683.6643
72
+ },
73
+ "memory": {
74
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/MEMORY.md",
75
+ "sha256": "1507bbae85098cf81c83b399bff0c4d316d187a1a4e3bb0df3029ed7a22861b2",
76
+ "mtimeMs": 1776018781682.1475
77
+ },
78
+ "skills": {
79
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills.md",
80
+ "sha256": "0f8a8c0fd0af23751c083fe8b84866dba35784b2ea590b94c5b298a35108b6d3",
81
+ "mtimeMs": 1776018781688.3726
82
+ },
83
+ "skill": {
84
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/SKILL.md",
85
+ "sha256": "97f59e20347142fb39bcedc1e1455c9755c34cdbc9af08fd1903fc596aeca1f3",
86
+ "mtimeMs": 1776018781683.0076
87
+ },
88
+ "rulesAgent": {
89
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/rules/AGENT.md",
90
+ "sha256": "76b4b210fec68acb2b026959e87f620aa1d30f1fae9cadcfdab7cc8ea2aa994a",
91
+ "mtimeMs": 1776018781680.1848
92
+ },
93
+ "rulesTools": {
94
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/rules/TOOLS.md",
95
+ "sha256": "3f8793720f5419f5864f782c7a8f2b25bc9a99134e6dac0ef8b4e878138b88e3",
96
+ "mtimeMs": 1776018781682.1475
97
+ },
98
+ "rulesMemory": {
99
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/rules/MEMORY.md",
100
+ "sha256": "08e860acc31384fc720a141193773182793c476af6ff496d516b686b20425c45",
101
+ "mtimeMs": 1776018781681.4995
102
+ },
103
+ "workflowSop": {
104
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/workflows/SOP.md",
105
+ "sha256": "e314e638fe1dcb238b503af90c9fdada060db67a2fc3b9319cd88dde99358942",
106
+ "mtimeMs": 1776018781680.2153
107
+ }
108
+ },
109
+ "runtimeSkills": [
110
+ {
111
+ "name": "code-review-excellence",
112
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/code-review-excellence/SKILL.md",
113
+ "sha256": "a765bd62c6ee22eab0cb56e96b5a811b49a9b4dfc1f85a86776aa1d3d6e87532",
114
+ "mtimeMs": 1776018781689.2603
115
+ },
116
+ {
117
+ "name": "cybersecurity-analyst",
118
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/cybersecurity-analyst/SKILL.md",
119
+ "sha256": "c15b191bf605c3e8760db5e95950e0abdfcc78017160d6141a6a41856e345a2e",
120
+ "mtimeMs": 1776018781690.7214
121
+ },
122
+ {
123
+ "name": "data-visualization",
124
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/data-visualization/SKILL.md",
125
+ "sha256": "728d3b95b9ebc744594076a2263c02b2a3f8f16a947437e66c035ef2329a12df",
126
+ "mtimeMs": 1776018781691.8608
127
+ },
128
+ {
129
+ "name": "deep-research",
130
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/deep-research/SKILL.md",
131
+ "sha256": "5637feab59dcc091d307fb0881907d9dfae74d3eccdf51b9bc8acf879c28c682",
132
+ "mtimeMs": 1776018781692.3916
133
+ },
134
+ {
135
+ "name": "excel-analysis",
136
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/excel-analysis/SKILL.md",
137
+ "sha256": "fb681b860b4d3bc20938cfbe490ebdc39d679d1634f1a6c12727bd4ab7ac91d0",
138
+ "mtimeMs": 1776018781693.162
139
+ },
140
+ {
141
+ "name": "find-skills",
142
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/find-skills/SKILL.md",
143
+ "sha256": "54b44dc9539df865fbb060f62fb062e8232e765852a0cf14c38301fe0c1eb264",
144
+ "mtimeMs": 1776018781693.7205
145
+ },
146
+ {
147
+ "name": "humanizer",
148
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/humanizer/SKILL.md",
149
+ "sha256": "6688e4e292ab4f235e2a27f5193a7d048657c74b26ed6000398ee3371c9c3a4b",
150
+ "mtimeMs": 1776018781694.4724
151
+ },
152
+ {
153
+ "name": "malware-behavior",
154
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/malware-behavior/SKILL.md",
155
+ "sha256": "82a86882c355771571269d63c826ee75b1866201f7e6b45e2a1e6bda8b01c2c0",
156
+ "mtimeMs": 1776018781695.041
157
+ },
158
+ {
159
+ "name": "mitre",
160
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/mitre/SKILL.md",
161
+ "sha256": "4e9d3a0f3ecb9cfc89f7518a3a1658d282a2137e4cf76c1f5b443a7570ce9ba7",
162
+ "mtimeMs": 1776018781695.5784
163
+ },
164
+ {
165
+ "name": "observability-logs-search",
166
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/observability-logs-search/SKILL.md",
167
+ "sha256": "ec434341ea8f420fe35851f3edb4a18bf77ff325e1075fc383f74231834f9277",
168
+ "mtimeMs": 1776018781696.0745
169
+ },
170
+ {
171
+ "name": "payload-triage",
172
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/payload-triage/SKILL.md",
173
+ "sha256": "a6429e8aabc11a685889c290765dc596f937173488c07866e54ee79db214b20c",
174
+ "mtimeMs": 1776018781697.077
175
+ },
176
+ {
177
+ "name": "phishing-analysis",
178
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/phishing-analysis/SKILL.md",
179
+ "sha256": "41e4e01d06538c1d118a123c8c69747094c4196ed129ed468aff61df57cb1705",
180
+ "mtimeMs": 1776018781697.5767
181
+ },
182
+ {
183
+ "name": "prd",
184
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/prd/SKILL.md",
185
+ "sha256": "6772e6f0fcc7110d625c7f4595e4990e1910007676c36d217eda4e779041d5e5",
186
+ "mtimeMs": 1776018781698.0488
187
+ },
188
+ {
189
+ "name": "remembering-conversations",
190
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/remembering-conversations/SKILL.md",
191
+ "sha256": "84a2ffa55206e037450bc323e03b121f3742950c95f5838f9b9dec8e5c6d5978",
192
+ "mtimeMs": 1776018781698.8347
193
+ },
194
+ {
195
+ "name": "sequential-thinking",
196
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/sequential-thinking/SKILL.md",
197
+ "sha256": "c517ae710853ee2ea06111d72888fbe1eb432368b0a7984b9c31391ecbc2ef27",
198
+ "mtimeMs": 1776018781699.9058
199
+ },
200
+ {
201
+ "name": "soc-generalist",
202
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/soc-generalist/SKILL.md",
203
+ "sha256": "dd15bfda50a4f34394b7d249179db8885d614f671cff57be6fe34dbce876f804",
204
+ "mtimeMs": 1776018781701.126
205
+ },
206
+ {
207
+ "name": "suspicious-url",
208
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/suspicious-url/SKILL.md",
209
+ "sha256": "be1854a81f271853dd8fb19f434d01bc314a3ccb373bde6faf796236cd529eb0",
210
+ "mtimeMs": 1776018781701.6086
211
+ },
212
+ {
213
+ "name": "systematic-debugging",
214
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/systematic-debugging/SKILL.md",
215
+ "sha256": "4999cb851360485eca5074e727bbdd62ef20549c5d5b01216fcbf5831badb473",
216
+ "mtimeMs": 1776018781702.296
217
+ },
218
+ {
219
+ "name": "translation-expertise",
220
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/translation-expertise/SKILL.md",
221
+ "sha256": "246ec0c1751185e5ff30da40c698934e90dff71d2eb6d5fcc1448955567de3b2",
222
+ "mtimeMs": 1776018781704.7175
223
+ },
224
+ {
225
+ "name": "web-search",
226
+ "path": "/home/nilsonpmjr/.gemini/antigravity/scratch/socc/socc-canonical/.agents/soc-copilot/skills/web-search/SKILL.md",
227
+ "sha256": "8e652d2267c967700bf4ab4b416d0afc571ed05076082e1bc92b98b85ba7fcb4",
228
+ "mtimeMs": 1776018781706.654
229
+ }
230
+ ]
16
231
  }