arkaos 2.15.0 → 2.16.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 (156) hide show
  1. package/VERSION +1 -1
  2. package/arka/SKILL.md +13 -0
  3. package/arka/skills/comfyui/SKILL.md +82 -0
  4. package/arka/skills/comfyui/references/squads.md +80 -0
  5. package/arka/skills/comfyui/references/workflows.md +435 -0
  6. package/arka/skills/forge/SKILL.md +35 -599
  7. package/arka/skills/forge/references/complexity-engine.md +77 -0
  8. package/arka/skills/forge/references/critic-synthesis.md +154 -0
  9. package/arka/skills/forge/references/workflows.md +408 -0
  10. package/arka/skills/fovory/SKILL.md +91 -0
  11. package/arka/skills/fovory/references/integration.md +186 -0
  12. package/arka/skills/fovory/references/workflows.md +209 -0
  13. package/arka/skills/platform-arka/SKILL.md +121 -0
  14. package/arka/skills/platform-arka/references/workflows.md +202 -0
  15. package/arka/skills/rothbard100/SKILL.md +113 -0
  16. package/arka/skills/rothbard100/references/squad.md +111 -0
  17. package/arka/skills/rothbard100/references/workflows.md +175 -0
  18. package/config/constitution.yaml +8 -0
  19. package/config/hooks/pre-compact.sh +11 -5
  20. package/config/hooks/session-start.sh +4 -5
  21. package/config/hooks/token-hygiene.sh +120 -0
  22. package/config/hooks/user-prompt-submit.sh +28 -10
  23. package/core/agents/__pycache__/schema.cpython-313.pyc +0 -0
  24. package/core/agents/schema.py +20 -1
  25. package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
  26. package/core/synapse/layers.py +7 -0
  27. package/core/workflow/__pycache__/schema.cpython-313.pyc +0 -0
  28. package/core/workflow/schema.py +4 -1
  29. package/departments/brand/SKILL.md +13 -0
  30. package/departments/brand/agents/brand-director.yaml +1 -0
  31. package/departments/brand/agents/brand-strategist.yaml +1 -0
  32. package/departments/brand/agents/ux-designer.yaml +1 -0
  33. package/departments/brand/agents/visual-designer.yaml +1 -0
  34. package/departments/brand/workflows/identity.yaml +1 -0
  35. package/departments/brand/workflows/naming.yaml +1 -0
  36. package/departments/community/SKILL.md +13 -0
  37. package/departments/community/agents/community-manager.yaml +1 -0
  38. package/departments/community/agents/community-strategist.yaml +1 -0
  39. package/departments/community/agents/engagement-designer.yaml +1 -0
  40. package/departments/community/workflows/setup.yaml +1 -0
  41. package/departments/content/SKILL.md +13 -0
  42. package/departments/content/agents/content-strategist.yaml +1 -0
  43. package/departments/content/agents/repurpose-distributor.yaml +1 -0
  44. package/departments/content/agents/scriptwriter.yaml +1 -0
  45. package/departments/content/agents/viral-engineer.yaml +1 -0
  46. package/departments/content/workflows/viral.yaml +1 -0
  47. package/departments/dev/SKILL.md +13 -0
  48. package/departments/dev/agents/architect.yaml +1 -0
  49. package/departments/dev/agents/backend-dev.yaml +1 -0
  50. package/departments/dev/agents/cto.yaml +1 -0
  51. package/departments/dev/agents/dba.yaml +1 -0
  52. package/departments/dev/agents/devops-eng.yaml +1 -0
  53. package/departments/dev/agents/frontend-dev.yaml +1 -0
  54. package/departments/dev/agents/qa-eng.yaml +1 -0
  55. package/departments/dev/agents/research-assistant.yaml +1 -0
  56. package/departments/dev/agents/security-eng.yaml +1 -0
  57. package/departments/dev/agents/tech-lead.yaml +1 -0
  58. package/departments/dev/skills/onboard/SKILL.md +21 -353
  59. package/departments/dev/skills/onboard/references/mcp-config.md +284 -0
  60. package/departments/dev/skills/onboard/references/stack-detection.md +83 -0
  61. package/departments/dev/workflows/debug.yaml +1 -0
  62. package/departments/dev/workflows/feature.yaml +3 -0
  63. package/departments/dev/workflows/refactor.yaml +1 -0
  64. package/departments/ecom/SKILL.md +13 -0
  65. package/departments/ecom/agents/commerce-engineer.yaml +1 -0
  66. package/departments/ecom/agents/cro-specialist.yaml +1 -0
  67. package/departments/ecom/agents/ecom-director.yaml +1 -0
  68. package/departments/ecom/agents/retention-manager.yaml +1 -0
  69. package/departments/ecom/skills/ecommerce/SKILL.md +66 -0
  70. package/departments/ecom/skills/ecommerce/references/audit-flow.md +109 -0
  71. package/departments/ecom/skills/ecommerce/references/playbooks.md +141 -0
  72. package/departments/ecom/workflows/product-page.yaml +1 -0
  73. package/departments/finance/SKILL.md +13 -0
  74. package/departments/finance/agents/cfo.yaml +1 -0
  75. package/departments/finance/agents/financial-analyst.yaml +1 -0
  76. package/departments/finance/agents/investment-strategist.yaml +1 -0
  77. package/departments/finance/workflows/cashflow.yaml +1 -0
  78. package/departments/finance/workflows/model.yaml +1 -0
  79. package/departments/kb/SKILL.md +13 -0
  80. package/departments/kb/agents/data-collector.yaml +1 -0
  81. package/departments/kb/agents/knowledge-curator.yaml +1 -0
  82. package/departments/kb/agents/knowledge-director.yaml +1 -0
  83. package/departments/kb/agents/research-analyst.yaml +1 -0
  84. package/departments/kb/skills/knowledge/SKILL.md +94 -0
  85. package/departments/kb/skills/knowledge/references/async-processing.md +89 -0
  86. package/departments/kb/skills/knowledge/references/ingestion-pipeline.md +308 -0
  87. package/departments/kb/skills/knowledge/scripts/kb-check-capabilities.sh +143 -0
  88. package/departments/kb/skills/knowledge/scripts/kb-cleanup.sh +135 -0
  89. package/departments/kb/skills/knowledge/scripts/kb-queue.sh +156 -0
  90. package/departments/kb/skills/knowledge/scripts/kb-status.sh +195 -0
  91. package/departments/kb/skills/knowledge/scripts/kb-worker.sh +217 -0
  92. package/departments/kb/workflows/learn.yaml +1 -0
  93. package/departments/landing/SKILL.md +13 -0
  94. package/departments/landing/agents/affiliate-manager.yaml +1 -0
  95. package/departments/landing/agents/conversion-strategist.yaml +1 -0
  96. package/departments/landing/agents/cro-specialist.yaml +1 -0
  97. package/departments/landing/agents/sales-copywriter.yaml +1 -0
  98. package/departments/landing/workflows/launch.yaml +1 -0
  99. package/departments/landing/workflows/offer.yaml +3 -0
  100. package/departments/leadership/SKILL.md +13 -0
  101. package/departments/leadership/agents/culture-coach.yaml +1 -0
  102. package/departments/leadership/agents/hr-specialist.yaml +1 -0
  103. package/departments/leadership/agents/leadership-director.yaml +1 -0
  104. package/departments/leadership/workflows/team-build.yaml +1 -0
  105. package/departments/marketing/SKILL.md +13 -0
  106. package/departments/marketing/agents/content-marketer.yaml +1 -0
  107. package/departments/marketing/agents/marketing-director.yaml +1 -0
  108. package/departments/marketing/agents/paid-specialist.yaml +1 -0
  109. package/departments/marketing/agents/seo-specialist.yaml +1 -0
  110. package/departments/marketing/workflows/campaign.yaml +1 -0
  111. package/departments/marketing/workflows/social.yaml +1 -0
  112. package/departments/ops/SKILL.md +13 -0
  113. package/departments/ops/agents/automation-engineer.yaml +1 -0
  114. package/departments/ops/agents/doc-writer.yaml +1 -0
  115. package/departments/ops/agents/ops-lead.yaml +1 -0
  116. package/departments/ops/skills/operations/SKILL.md +83 -0
  117. package/departments/ops/skills/operations/references/calendar-email.md +73 -0
  118. package/departments/ops/skills/operations/references/clickup-ops.md +224 -0
  119. package/departments/ops/skills/update/SKILL.md +19 -45
  120. package/departments/ops/skills/update/references/sync-engine.md +93 -0
  121. package/departments/ops/skills/update/references/workflows.md +84 -0
  122. package/departments/ops/workflows/lean-audit.yaml +1 -0
  123. package/departments/org/SKILL.md +13 -0
  124. package/departments/org/agents/coo.yaml +1 -0
  125. package/departments/org/agents/org-designer.yaml +1 -0
  126. package/departments/org/agents/people-ops.yaml +1 -0
  127. package/departments/org/workflows/design.yaml +2 -0
  128. package/departments/pm/SKILL.md +13 -0
  129. package/departments/pm/agents/pm-director.yaml +1 -0
  130. package/departments/pm/agents/product-owner.yaml +1 -0
  131. package/departments/pm/agents/scrum-master.yaml +1 -0
  132. package/departments/quality/SKILL.md +13 -0
  133. package/departments/quality/agents/copy-director.yaml +1 -0
  134. package/departments/quality/agents/cqo.yaml +1 -0
  135. package/departments/quality/agents/tech-director.yaml +1 -0
  136. package/departments/saas/SKILL.md +13 -0
  137. package/departments/saas/agents/cs-manager.yaml +1 -0
  138. package/departments/saas/agents/growth-engineer.yaml +1 -0
  139. package/departments/saas/agents/metrics-analyst.yaml +1 -0
  140. package/departments/saas/agents/saas-strategist.yaml +1 -0
  141. package/departments/saas/workflows/metrics.yaml +1 -0
  142. package/departments/saas/workflows/validate.yaml +1 -0
  143. package/departments/sales/SKILL.md +13 -0
  144. package/departments/sales/agents/sales-closer.yaml +1 -0
  145. package/departments/sales/agents/sales-director.yaml +1 -0
  146. package/departments/sales/agents/sales-ops.yaml +1 -0
  147. package/departments/sales/workflows/pipeline.yaml +1 -0
  148. package/departments/strategy/SKILL.md +13 -0
  149. package/departments/strategy/agents/business-model-designer.yaml +1 -0
  150. package/departments/strategy/agents/market-analyst.yaml +1 -0
  151. package/departments/strategy/agents/strategy-director.yaml +1 -0
  152. package/departments/strategy/workflows/analysis.yaml +1 -0
  153. package/departments/strategy/workflows/swot.yaml +1 -0
  154. package/installer/index.js +19 -0
  155. package/package.json +1 -1
  156. package/pyproject.toml +1 -1
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: arka-knowledge
3
+ description: >
4
+ Dynamic knowledge base powered by Obsidian. Async background processing: queues YouTube
5
+ downloads, transcribes with Whisper (local or API), and pauses for interactive analysis.
6
+ Runs 5 parallel analysis agents (Frameworks, Strategy, Voice & Style, Principles, Topics)
7
+ to build expert personas. Learns from articles and URLs. Creates searchable persona profiles,
8
+ topic cross-references, and source catalogs. Generates content in any learned persona's voice
9
+ and style. All output organized in Obsidian vault with MOC pages.
10
+ Use when user says "kb", "learn", "persona", "knowledge", "youtube", "transcribe", "article",
11
+ "research", "analyze", "source", "topic", "search knowledge", "write as", "queue", "process",
12
+ "capabilities", or wants to learn from any content source or use a persona's expertise.
13
+ ---
14
+
15
+ # Knowledge Base — ARKA OS Department
16
+
17
+ Dynamic knowledge acquisition and management system. Learn from YouTube videos, articles, books, and any content source. Build expert personas and a searchable knowledge base.
18
+
19
+ **ALL output goes to the Obsidian vault.**
20
+
21
+ **Background processing:** Downloads and transcriptions run as background jobs. Queue 100 URLs and keep working. Process results interactively when ready.
22
+
23
+ ## Obsidian Configuration
24
+
25
+ - **Vault:** `/Users/andreagroferreira/Documents/Personal`
26
+ - **Config:** Read `knowledge/obsidian-config.json` for full path/convention details
27
+ - **MCP:** Use Obsidian MCP when available, fallback to direct file Write
28
+ - **Conventions:** YAML frontmatter, wikilinks `[[]]`, MOC references, kebab-case tags
29
+
30
+ ## Commands
31
+
32
+ | Command | Description |
33
+ |---------|-------------|
34
+ | `/kb learn <url> [url2 ...] [--persona "Name"]` | Queue download + transcription (async, non-blocking) |
35
+ | `/kb learn-text <file/url> --persona "Name"` | Learn from text/article content (synchronous) |
36
+ | `/kb queue` | Show all queued/running/ready jobs |
37
+ | `/kb status [job-id]` | Detailed status of a specific job |
38
+ | `/kb process <job-id>` | Analyze a ready transcription (interactive choices) |
39
+ | `/kb process --all` | Process all ready jobs |
40
+ | `/kb capabilities` | Show available tools and API keys |
41
+ | `/kb cleanup [--older-than 90d]` | Remove old media files |
42
+ | `/kb persona <name>` | View/manage a persona profile |
43
+ | `/kb personas` | List all personas and their stats |
44
+ | `/kb search <query>` | Search knowledge base by topic |
45
+ | `/kb write --persona "Name" --type <type>` | Generate content using a persona's style |
46
+ | `/kb topics` | List all knowledge topics |
47
+ | `/kb update <persona> <youtube-url>` | Add more content to existing persona |
48
+
49
+ ## Scripts Location
50
+
51
+ All KB scripts are in the `scripts/` subdirectory of this skill:
52
+ - `scripts/kb-check-capabilities.sh` — System capability probe
53
+ - `scripts/kb-queue.sh` — Queue dispatcher
54
+ - `scripts/kb-worker.sh` — Background worker
55
+ - `scripts/kb-status.sh` — Status checker
56
+ - `scripts/kb-cleanup.sh` — Media cleanup
57
+
58
+ When installed, scripts live at `~/.claude/skills/arka-knowledge/scripts/`.
59
+
60
+ ## Squad
61
+
62
+ - **Lead:** Clara (KB department)
63
+ - **Specialists:** Persona Analyst, Topic Cataloger, Voice Profiler
64
+ - **Quality Gate:** Marta → Eduardo (copy) + Francisca (tech). Mandatory.
65
+
66
+ ## Job Status Flow
67
+
68
+ ```
69
+ queued → downloading → transcribing → ready → analyzing → completed
70
+ ↓ ↓
71
+ failed failed
72
+ ```
73
+
74
+ The `ready` → `analyzing` transition happens when user runs `/kb process <job-id>`. Analysis requires Claude Code's LLM (5 parallel agents); cannot run in background bash.
75
+
76
+ ## Obsidian Output Paths
77
+
78
+ | Content | Vault Path |
79
+ |---------|-----------|
80
+ | Personas | `Personas/<Name>.md` |
81
+ | Video Sources | `Sources/Videos/<date> <title>.md` |
82
+ | Article Sources | `Sources/Articles/<date> <title>.md` |
83
+ | Topics | `Topics/<Topic Name>.md` |
84
+ | Frameworks | `🧠 Knowledge Base/Frameworks/<name>.md` |
85
+ | Raw Transcripts | `🧠 Knowledge Base/Raw Transcripts/<name>.txt` |
86
+ | MOC Pages | `Personas MOC.md`, `Topics MOC.md`, `Sources MOC.md` |
87
+
88
+ ## References
89
+
90
+ Read only when needed for the task at hand:
91
+
92
+ - **Ingestion pipeline** (`/kb learn`, `/kb learn-text`, `/kb process`, `/kb process --all`, `/kb cleanup`, Obsidian page formats, 5+1 analysis agents): `references/ingestion-pipeline.md`
93
+ - **Async processing** (`/kb queue`, `/kb status`, `/kb capabilities`, job state file, worker mechanics, media storage, status transitions): `references/async-processing.md`
94
+ - **Persona utilities** (`/kb personas`, `/kb persona`, `/kb topics`, `/kb search`, `/kb write`, `/kb update`): `references/ingestion-pipeline.md` (persona output section)
@@ -0,0 +1,89 @@
1
+ # arka-knowledge — async-processing
2
+
3
+ Referenced from SKILL.md. Read only when needed.
4
+
5
+ ## /kb capabilities
6
+
7
+ Check what tools and API keys are available for KB processing.
8
+
9
+ **Steps:**
10
+ 1. Run `bash <scripts-dir>/kb-check-capabilities.sh`
11
+ 2. Read `~/.arka-os/capabilities.json`
12
+ 3. Display results to the user in a formatted table
13
+
14
+ Shows: binary availability (whisper, yt-dlp, ffmpeg, jq, python3), API keys (OpenAI, Gemini, OpenRouter), and the selected transcription method.
15
+
16
+ ## /kb queue
17
+
18
+ Show all jobs and their current status.
19
+
20
+ **Steps:**
21
+ 1. Run `bash <scripts-dir>/kb-status.sh`
22
+ 2. Or read `~/.arka-os/kb-jobs.json` directly and format as a table
23
+ 3. Show: job ID, status, title, transcription method
24
+ 4. Status colors: queued (yellow), downloading/transcribing (blue), ready (green), completed (green), failed (red)
25
+
26
+ ## /kb status [job-id]
27
+
28
+ Detailed status of a specific job.
29
+
30
+ **Steps:**
31
+ 1. Run `bash <scripts-dir>/kb-status.sh <job-id>`
32
+ 2. Or read the job from `~/.arka-os/kb-jobs.json` and display all fields
33
+ 3. If `--json` flag: output raw JSON
34
+
35
+ ## Worker / Queue Mechanics
36
+
37
+ - **Queue dispatcher:** `kb-queue.sh` writes a new job record to `~/.arka-os/kb-jobs.json` (status=`queued`), then detaches `kb-worker.sh` in background.
38
+ - **Worker:** `kb-worker.sh` handles a single job — runs yt-dlp, writes `audio.wav`, transcribes (Whisper local or API), updates status transitions (`downloading` → `transcribing` → `ready` or `failed`).
39
+ - **Concurrency:** all writes to `kb-jobs.json` must use `flock` on `~/.arka-os/kb-jobs.lock` to avoid corruption.
40
+ - **Logs:** per-job — `download.log`, `transcribe.log`, `worker.log` in the job output directory.
41
+ - **LLM boundary:** worker NEVER calls the LLM. The `ready` → `analyzing` → `completed` transitions happen only when `/kb process <job-id>` runs in Claude Code.
42
+
43
+ ## Job Status Flow
44
+
45
+ ```
46
+ queued → downloading → transcribing → ready → analyzing → completed
47
+ ↓ ↓
48
+ failed failed
49
+ ```
50
+
51
+ ## Media Storage
52
+
53
+ ```
54
+ ~/.arka-os/
55
+ ├── media/ # Permanent, organized media storage
56
+ │ ├── 2026-03-15/ # Date-based grouping
57
+ │ │ ├── a1b2c3d4/ # Job ID directory
58
+ │ │ │ ├── metadata.json # yt-dlp output (title, duration)
59
+ │ │ │ ├── audio.wav # Downloaded audio file
60
+ │ │ │ ├── audio.txt # Transcription output
61
+ │ │ │ ├── download.log # yt-dlp log
62
+ │ │ │ ├── transcribe.log # Whisper log
63
+ │ │ │ └── worker.log # Background process log
64
+ ├── kb-jobs.json # Job state file
65
+ ├── capabilities.json # System capabilities
66
+ └── .env # API keys
67
+ ```
68
+
69
+ ## Job State File Shape (`~/.arka-os/kb-jobs.json`)
70
+
71
+ ```json
72
+ {
73
+ "jobs": [
74
+ {
75
+ "id": "a1b2c3d4",
76
+ "url": "<youtube-url>",
77
+ "persona": "<Name or null>",
78
+ "status": "queued|downloading|transcribing|ready|analyzing|completed|failed",
79
+ "method": "whisper-local|whisper-api|gemini|openrouter",
80
+ "output_dir": "~/.arka-os/media/<date>/<id>/",
81
+ "title": "<video title>",
82
+ "duration": "<hh:mm:ss>",
83
+ "created_at": "<ISO8601>",
84
+ "updated_at": "<ISO8601>",
85
+ "error": null
86
+ }
87
+ ]
88
+ }
89
+ ```
@@ -0,0 +1,308 @@
1
+ # arka-knowledge — ingestion-pipeline
2
+
3
+ Referenced from SKILL.md. Read only when needed.
4
+
5
+ ## /kb learn <url> [url2 ...] [--persona "Name"]
6
+
7
+ **This command is NON-BLOCKING.** It queues jobs and returns immediately.
8
+
9
+ ### Step 1: Check Capabilities
10
+ ```bash
11
+ bash <scripts-dir>/kb-check-capabilities.sh
12
+ ```
13
+ Read `~/.arka-os/capabilities.json`. If `yt-dlp` is not available, tell the user to install it and stop. If no transcription method is available, warn the user (download-only mode).
14
+
15
+ ### Step 2: Queue Each URL
16
+ For each URL provided, run:
17
+ ```bash
18
+ bash <scripts-dir>/kb-queue.sh "<url>" --persona "<Name>"
19
+ ```
20
+ Returns a job ID (8 chars) immediately. Download + transcription runs in the background.
21
+
22
+ ### Step 3: Display Summary
23
+ ```
24
+ ═══ ARKA KB — Jobs Queued ═══
25
+ Job a1b2c3d4 → <url1>
26
+ Job e5f6g7h8 → <url2>
27
+ ...
28
+ Transcription: <method>
29
+ Media: ~/.arka-os/media/<date>/
30
+
31
+ Run /kb queue to check progress.
32
+ Run /kb process <job-id> when jobs are ready.
33
+ ═════════════════════════════
34
+ ```
35
+
36
+ **IMPORTANT:** Do NOT wait for downloads to complete. Return to the user immediately after queuing.
37
+
38
+ ## /kb process <job-id>
39
+
40
+ Analyze a ready transcription. This is the INTERACTIVE step that requires Claude Code's LLM.
41
+
42
+ ### Step 1: Validate Job
43
+ Read `~/.arka-os/kb-jobs.json`. Find job by ID. Verify status is `ready`.
44
+
45
+ ### Step 2: Read Transcript
46
+ Read `<job-output-dir>/audio.txt` for the transcription.
47
+ Read `<job-output-dir>/metadata.json` for video title, duration, etc.
48
+
49
+ ### Step 3: Ask User What To Do
50
+
51
+ Use AskUserQuestion:
52
+
53
+ 1. **Full analysis** — Run all 5 agents, create/update persona + source + topics + MOC pages
54
+ 2. **Create/update persona only**
55
+ 3. **Extract frameworks only**
56
+ 4. **Save transcript to Obsidian only**
57
+ 5. **Custom analysis**
58
+
59
+ ### Step 4: Update Job Status
60
+ Set status to `analyzing` using flock:
61
+ ```bash
62
+ (flock -x 200; jq --arg id "<job-id>" '(.jobs[] | select(.id == $id)).status = "analyzing"' ~/.arka-os/kb-jobs.json > /tmp/kb-tmp.$$.json && mv /tmp/kb-tmp.$$.json ~/.arka-os/kb-jobs.json) 200>~/.arka-os/kb-jobs.lock
63
+ ```
64
+
65
+ ### Step 5: Execute Analysis (5 parallel agents + DISC)
66
+
67
+ Launch simultaneously via Task tool:
68
+
69
+ **Agent 1: Frameworks Extractor** — frameworks, models, methodologies, step-by-step processes, acronyms.
70
+
71
+ **Agent 2: Strategy Analyzer** — strategies, tactics, specific advice, results/numbers/case studies.
72
+
73
+ **Agent 3: Voice & Style Profiler** — speaking style (formal/casual), repeated phrases, opening/closing patterns, metaphors.
74
+
75
+ **Agent 4: Principles Extractor** — core beliefs, what they argue against, driving philosophy.
76
+
77
+ **Agent 5: Topic Cataloger** — topics covered, relation to existing KB topics, keywords/categories.
78
+
79
+ **Agent 6: DISC Behavioral Profiler**
80
+ - Likely DISC profile from the content
81
+ - Pace: fast (D/I) vs deliberate (S/C)
82
+ - Focus: tasks/results (D/C) vs people (I/S)
83
+ - Handling disagreement: confront=D, persuade=I, avoid=S, analyze=C
84
+ - Linguistic patterns: imperative=D, enthusiasm=I, caution=S, data-heavy=C
85
+ - Secondary profile + confidence (high/medium/low) with evidence
86
+
87
+ ### Step 6: Write to Obsidian
88
+
89
+ **Create/Update Persona** — `Personas/<Name>.md`:
90
+
91
+ ```markdown
92
+ ---
93
+ type: persona
94
+ name: <Full Name>
95
+ expertise:
96
+ - "<primary expertise>"
97
+ - "<secondary expertise>"
98
+ date_updated: <YYYY-MM-DD>
99
+ tags:
100
+ - "persona"
101
+ - "<expertise-kebab-case>"
102
+ ---
103
+
104
+ # <Full Name>
105
+
106
+ > [One-line description]
107
+
108
+ ## Voice & Style
109
+
110
+ [From Agent 3]
111
+
112
+ ## Behavioral Profile (DISC)
113
+
114
+ > **Primary:** {X} ({name}) | **Secondary:** {Y} ({name}) | **Confidence:** {level}
115
+
116
+ [From Agent 6]
117
+
118
+ ### Communication Patterns
119
+ - **Pace:** {observed}
120
+ - **Focus:** {task vs people}
121
+ - **Decision speed:** {how they advocate for action}
122
+
123
+ ### How to Create Content as This Persona
124
+ - **Tone calibration:** {DISC-based}
125
+ - **Opening pattern:** {DISC-informed}
126
+ - **Argument structure:** {how they build arguments}
127
+ - **Call-to-action style:** {how they close}
128
+
129
+ ### DISC Evidence
130
+ - "{quote for primary}"
131
+ - "{quote for secondary}"
132
+
133
+ ## Core Philosophy
134
+
135
+ [From Agent 4]
136
+
137
+ ## Key Frameworks
138
+
139
+ [From Agent 1]
140
+
141
+ ### Framework: <Name>
142
+ - Step 1: ...
143
+ - Step 2: ...
144
+
145
+ ## Strategies & Tactics
146
+
147
+ [From Agent 2]
148
+
149
+ ## Notable Quotes
150
+
151
+ > "Exact quote"
152
+ > "Another memorable phrase"
153
+
154
+ ## Sources
155
+
156
+ - [[<YYYY-MM-DD> <Video Title>]]
157
+
158
+ ---
159
+ *Part of the [[Personas MOC]]*
160
+ ```
161
+
162
+ **If existing persona — UPDATE:**
163
+ 1. Read existing file
164
+ 2. MERGE new info (don't replace)
165
+ 3. Add new frameworks, strategies, quotes
166
+ 4. Add new source link
167
+ 5. Update `date_updated`
168
+ 6. Note contradictions if position changed
169
+
170
+ **Create Source File** — `Sources/Videos/<YYYY-MM-DD> <Video Title>.md`:
171
+
172
+ ```markdown
173
+ ---
174
+ type: source
175
+ source_type: video
176
+ title: "<Video Title>"
177
+ url: "<youtube-url>"
178
+ persona: "[[<Name>]]"
179
+ date_processed: <YYYY-MM-DD>
180
+ duration: "<duration>"
181
+ tags:
182
+ - "source"
183
+ - "video"
184
+ - "<topic-kebab-case>"
185
+ ---
186
+
187
+ # <Video Title>
188
+
189
+ > Source video for [[<Name>]] persona
190
+
191
+ ## Key Takeaways
192
+
193
+ [Top 5-10 insights]
194
+
195
+ ## Frameworks Found
196
+
197
+ [List — link to persona]
198
+
199
+ ## Full Analysis
200
+
201
+ [Combined output from 5 agents]
202
+
203
+ ## Raw Transcript
204
+
205
+ <details>
206
+ <summary>Click to expand full transcript</summary>
207
+
208
+ [Full transcription text]
209
+
210
+ </details>
211
+
212
+ ---
213
+ *Part of the [[Sources MOC]]*
214
+ ```
215
+
216
+ **Catalog by Topic** — `Topics/<Topic Name>.md`:
217
+
218
+ ```markdown
219
+ ---
220
+ type: topic
221
+ name: <Topic Name>
222
+ related_personas:
223
+ - "[[<Name>]]"
224
+ date_updated: <YYYY-MM-DD>
225
+ tags:
226
+ - "topic"
227
+ - "<topic-kebab-case>"
228
+ ---
229
+
230
+ # <Topic Name>
231
+
232
+ ## Perspectives
233
+
234
+ ### [[<Persona Name>]]
235
+ [What this persona says about this topic]
236
+
237
+ ---
238
+ *Part of the [[Topics MOC]]*
239
+ ```
240
+
241
+ **Update MOC Pages:** `Personas MOC.md`, `Sources MOC.md`, `Topics MOC.md`. Create if absent.
242
+
243
+ ### Step 7: Update Job Status
244
+ Set status to `completed` in `~/.arka-os/kb-jobs.json`.
245
+
246
+ ### Step 8: Report
247
+ ```
248
+ ═══ ARKA KB — Processing Complete ═══
249
+ Job: <job-id>
250
+ Persona: <Name> (new/updated)
251
+ Source: "<Video Title>" (YouTube)
252
+ Duration: <duration>
253
+ Vault: Personas/<Name>.md
254
+ Source: Sources/Videos/<date> <title>.md
255
+ New frameworks found: <count>
256
+ New strategies found: <count>
257
+ Topics tagged: <list>
258
+ Media: <output-dir>
259
+ ══════════════════════════════════════
260
+ ```
261
+
262
+ ## /kb process --all
263
+
264
+ Process all jobs with status `ready`:
265
+ 1. Read `~/.arka-os/kb-jobs.json`
266
+ 2. Filter `status == ready`
267
+ 3. Run the `/kb process <job-id>` workflow for each
268
+ 4. Ask once what analysis type to use (or per-job)
269
+
270
+ ## /kb learn-text <file/url> --persona "Name"
271
+
272
+ Same workflow as `/kb process` full analysis but skip download/transcribe.
273
+ - If URL: use WebFetch
274
+ - If file: read directly
275
+ - Source goes to `Sources/Articles/`
276
+ - Synchronous (no background needed)
277
+
278
+ ## /kb write --persona "Name" --type <type>
279
+
280
+ 1. Read `Personas/<Name>.md` for voice and style
281
+ 2. Read linked source files for frameworks and strategies
282
+ 3. Generate content in that persona's approach
283
+
284
+ Supported types: `landing-page`, `email`, `ad`, `social-post`, `blog`, `pitch`, `script`.
285
+
286
+ With `--personas` (plural) → blend: primary's voice, frameworks from all, annotate origin.
287
+
288
+ ## /kb search <query>
289
+
290
+ 1. Grep across `Personas/`, `Topics/`, `Sources/`
291
+ 2. Return results organized by relevance
292
+ 3. Show which personas have insights
293
+ 4. Include quotes and framework references
294
+
295
+ ## /kb personas
296
+
297
+ List all files in `Personas/`. Show: name, expertise, source count, last updated.
298
+
299
+ ## /kb topics
300
+
301
+ List all files in `Topics/`. Show: topic, related personas, last updated.
302
+
303
+ ## /kb cleanup [--older-than 90d]
304
+
305
+ ```bash
306
+ bash <scripts-dir>/kb-cleanup.sh --older-than <days>
307
+ ```
308
+ Use `--dry-run` first. Confirm before deletion. Report space freed.
@@ -0,0 +1,143 @@
1
+ #!/bin/bash
2
+ # ============================================================================
3
+ # ARKA OS — KB Capability Detection
4
+ # Probes local binaries and API keys, writes ~/.arka-os/capabilities.json
5
+ # ============================================================================
6
+ set -euo pipefail
7
+
8
+ ARKA_DIR="$HOME/.arka-os"
9
+ CAPS_FILE="$ARKA_DIR/capabilities.json"
10
+ ENV_FILE="$ARKA_DIR/.env"
11
+
12
+ mkdir -p "$ARKA_DIR"
13
+
14
+ # Load env if present
15
+ [ -f "$ENV_FILE" ] && source "$ENV_FILE"
16
+
17
+ # ─── Binary checks ──────────────────────────────────────────────────────────
18
+
19
+ check_binary() {
20
+ local name="$1"
21
+ local path=""
22
+ local version=""
23
+
24
+ if path=$(command -v "$name" 2>/dev/null); then
25
+ case "$name" in
26
+ whisper) version=$(pip3 show openai-whisper 2>/dev/null | grep "^Version:" | cut -d' ' -f2 || echo "installed") ;;
27
+ yt-dlp) version=$($path --version 2>&1 | head -1 || echo "unknown") ;;
28
+ ffmpeg) version=$(ffmpeg -version 2>&1 | head -1 | sed 's/ffmpeg version //' | cut -d' ' -f1 || echo "unknown") ;;
29
+ jq) version=$($path --version 2>&1 || echo "unknown") ;;
30
+ python3) version=$($path --version 2>&1 | cut -d' ' -f2 || echo "unknown") ;;
31
+ esac
32
+ version=$(printf '%s' "$version" | tr -d '\n\r' | tr -cd '[:print:]')
33
+ printf '{"available":true,"path":"%s","version":"%s"}' "$path" "$version"
34
+ else
35
+ printf '{"available":false,"path":null,"version":null}'
36
+ fi
37
+ }
38
+
39
+ # ─── API key checks ─────────────────────────────────────────────────────────
40
+
41
+ check_key() {
42
+ local var_name="$1"
43
+ local value="${!var_name:-}"
44
+ if [ -n "$value" ] && [ ${#value} -ge 8 ]; then
45
+ printf '{"configured":true,"key_prefix":"%s***"}' "${value:0:6}"
46
+ else
47
+ printf '{"configured":false,"key_prefix":null}'
48
+ fi
49
+ }
50
+
51
+ # ─── Determine transcription method ─────────────────────────────────────────
52
+
53
+ whisper_available=false
54
+ openai_available=false
55
+
56
+ if command -v whisper &>/dev/null; then
57
+ whisper_available=true
58
+ fi
59
+ if [ -n "${OPENAI_API_KEY:-}" ] && [ ${#OPENAI_API_KEY} -ge 8 ]; then
60
+ openai_available=true
61
+ fi
62
+
63
+ if $whisper_available; then
64
+ transcription_method="local_whisper"
65
+ transcription_note="Using local Whisper (free, private)"
66
+ elif $openai_available; then
67
+ transcription_method="openai_api"
68
+ transcription_note="Using OpenAI Whisper API (requires credits)"
69
+ else
70
+ transcription_method="none"
71
+ transcription_note="No transcription available. Install whisper (pip install openai-whisper) or set OPENAI_API_KEY."
72
+ fi
73
+
74
+ # ─── Build JSON ──────────────────────────────────────────────────────────────
75
+
76
+ cat > "$CAPS_FILE" << JSONEOF
77
+ {
78
+ "generated_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
79
+ "binaries": {
80
+ "whisper": $(check_binary whisper),
81
+ "yt-dlp": $(check_binary yt-dlp),
82
+ "ffmpeg": $(check_binary ffmpeg),
83
+ "jq": $(check_binary jq),
84
+ "python3": $(check_binary python3)
85
+ },
86
+ "api_keys": {
87
+ "OPENAI_API_KEY": $(check_key OPENAI_API_KEY),
88
+ "GEMINI_API_KEY": $(check_key GEMINI_API_KEY),
89
+ "OPENROUTER_API_KEY": $(check_key OPENROUTER_API_KEY),
90
+ "REPLICATE_API_TOKEN": $(check_key REPLICATE_API_TOKEN),
91
+ "FAL_KEY": $(check_key FAL_KEY)
92
+ },
93
+ "transcription": {
94
+ "method": "$transcription_method",
95
+ "note": "$transcription_note"
96
+ }
97
+ }
98
+ JSONEOF
99
+
100
+ # ─── Pretty output if running interactively ──────────────────────────────────
101
+
102
+ if [ -t 1 ]; then
103
+ CYAN='\033[0;36m'
104
+ GREEN='\033[0;32m'
105
+ YELLOW='\033[1;33m'
106
+ RED='\033[0;31m'
107
+ NC='\033[0m'
108
+
109
+ echo ""
110
+ echo -e "${CYAN}═══ ARKA OS — Capabilities ═══${NC}"
111
+ echo ""
112
+ echo -e "${CYAN}Binaries:${NC}"
113
+ for bin in whisper yt-dlp ffmpeg jq python3; do
114
+ if command -v "$bin" &>/dev/null; then
115
+ echo -e " ${GREEN}✓${NC} $bin ($(command -v "$bin"))"
116
+ else
117
+ echo -e " ${RED}✗${NC} $bin — not found"
118
+ fi
119
+ done
120
+
121
+ echo ""
122
+ echo -e "${CYAN}API Keys:${NC}"
123
+ for key in OPENAI_API_KEY GEMINI_API_KEY OPENROUTER_API_KEY REPLICATE_API_TOKEN FAL_KEY; do
124
+ value="${!key:-}"
125
+ if [ -n "$value" ] && [ ${#value} -ge 8 ]; then
126
+ echo -e " ${GREEN}✓${NC} $key (${value:0:6}***)"
127
+ else
128
+ echo -e " ${YELLOW}⚠${NC} $key — not set"
129
+ fi
130
+ done
131
+
132
+ echo ""
133
+ echo -e "${CYAN}Transcription:${NC}"
134
+ case "$transcription_method" in
135
+ local_whisper) echo -e " ${GREEN}✓${NC} $transcription_note" ;;
136
+ openai_api) echo -e " ${GREEN}✓${NC} $transcription_note" ;;
137
+ none) echo -e " ${RED}✗${NC} $transcription_note" ;;
138
+ esac
139
+
140
+ echo ""
141
+ echo -e "Written to: ${CYAN}$CAPS_FILE${NC}"
142
+ echo -e "${CYAN}═══════════════════════════════${NC}"
143
+ fi