arkaos 2.0.0 → 2.0.2

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 (109) hide show
  1. package/README.md +100 -74
  2. package/VERSION +1 -1
  3. package/bin/arkaos +1 -1
  4. package/config/constitution.yaml +4 -0
  5. package/config/hooks/user-prompt-submit-v2.sh +20 -38
  6. package/core/__pycache__/__init__.cpython-313.pyc +0 -0
  7. package/core/agents/__pycache__/__init__.cpython-313.pyc +0 -0
  8. package/core/agents/__pycache__/loader.cpython-313.pyc +0 -0
  9. package/core/agents/__pycache__/schema.cpython-313.pyc +0 -0
  10. package/core/agents/__pycache__/validator.cpython-313.pyc +0 -0
  11. package/core/budget/__init__.py +6 -0
  12. package/core/budget/__pycache__/__init__.cpython-313.pyc +0 -0
  13. package/core/budget/__pycache__/manager.cpython-313.pyc +0 -0
  14. package/core/budget/__pycache__/schema.cpython-313.pyc +0 -0
  15. package/core/budget/manager.py +193 -0
  16. package/core/budget/schema.py +82 -0
  17. package/core/conclave/__pycache__/__init__.cpython-313.pyc +0 -0
  18. package/core/conclave/__pycache__/advisor_db.cpython-313.pyc +0 -0
  19. package/core/conclave/__pycache__/display.cpython-313.pyc +0 -0
  20. package/core/conclave/__pycache__/matcher.cpython-313.pyc +0 -0
  21. package/core/conclave/__pycache__/persistence.cpython-313.pyc +0 -0
  22. package/core/conclave/__pycache__/profiler.cpython-313.pyc +0 -0
  23. package/core/conclave/__pycache__/prompts.cpython-313.pyc +0 -0
  24. package/core/conclave/__pycache__/schema.cpython-313.pyc +0 -0
  25. package/core/governance/__pycache__/__init__.cpython-313.pyc +0 -0
  26. package/core/governance/__pycache__/constitution.cpython-313.pyc +0 -0
  27. package/core/obsidian/__init__.py +6 -0
  28. package/core/obsidian/__pycache__/__init__.cpython-313.pyc +0 -0
  29. package/core/obsidian/__pycache__/templates.cpython-313.pyc +0 -0
  30. package/core/obsidian/__pycache__/writer.cpython-313.pyc +0 -0
  31. package/core/obsidian/templates.py +76 -0
  32. package/core/obsidian/writer.py +148 -0
  33. package/core/orchestration/__init__.py +6 -0
  34. package/core/orchestration/__pycache__/__init__.cpython-313.pyc +0 -0
  35. package/core/orchestration/__pycache__/patterns.cpython-313.pyc +0 -0
  36. package/core/orchestration/__pycache__/protocol.cpython-313.pyc +0 -0
  37. package/core/orchestration/patterns.py +136 -0
  38. package/core/orchestration/protocol.py +96 -0
  39. package/core/registry/__pycache__/__init__.cpython-313.pyc +0 -0
  40. package/core/registry/__pycache__/generator.cpython-313.pyc +0 -0
  41. package/core/runtime/__pycache__/__init__.cpython-313.pyc +0 -0
  42. package/core/runtime/__pycache__/base.cpython-313.pyc +0 -0
  43. package/core/runtime/__pycache__/claude_code.cpython-313.pyc +0 -0
  44. package/core/runtime/__pycache__/codex_cli.cpython-313.pyc +0 -0
  45. package/core/runtime/__pycache__/cursor.cpython-313.pyc +0 -0
  46. package/core/runtime/__pycache__/gemini_cli.cpython-313.pyc +0 -0
  47. package/core/runtime/__pycache__/registry.cpython-313.pyc +0 -0
  48. package/core/runtime/__pycache__/subagent.cpython-313.pyc +0 -0
  49. package/core/specs/__pycache__/__init__.cpython-313.pyc +0 -0
  50. package/core/specs/__pycache__/manager.cpython-313.pyc +0 -0
  51. package/core/specs/__pycache__/schema.cpython-313.pyc +0 -0
  52. package/core/squads/__pycache__/__init__.cpython-313.pyc +0 -0
  53. package/core/squads/__pycache__/loader.cpython-313.pyc +0 -0
  54. package/core/squads/__pycache__/registry.cpython-313.pyc +0 -0
  55. package/core/squads/__pycache__/schema.cpython-313.pyc +0 -0
  56. package/core/synapse/__pycache__/__init__.cpython-313.pyc +0 -0
  57. package/core/synapse/__pycache__/cache.cpython-313.pyc +0 -0
  58. package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
  59. package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
  60. package/core/tasks/__pycache__/__init__.cpython-313.pyc +0 -0
  61. package/core/tasks/__pycache__/manager.cpython-313.pyc +0 -0
  62. package/core/tasks/__pycache__/schema.cpython-313.pyc +0 -0
  63. package/core/tasks/schema.py +6 -0
  64. package/core/workflow/__pycache__/__init__.cpython-313.pyc +0 -0
  65. package/core/workflow/__pycache__/engine.cpython-313.pyc +0 -0
  66. package/core/workflow/__pycache__/loader.cpython-313.pyc +0 -0
  67. package/core/workflow/__pycache__/schema.cpython-313.pyc +0 -0
  68. package/core/workflow/engine.py +44 -0
  69. package/core/workflow/schema.py +1 -0
  70. package/departments/dev/skills/agent-design/SKILL.md +4 -0
  71. package/departments/dev/skills/agent-design/references/architecture-patterns.md +223 -0
  72. package/departments/dev/skills/ai-security/SKILL.md +4 -0
  73. package/departments/dev/skills/ai-security/references/prompt-injection-catalog.md +230 -0
  74. package/departments/dev/skills/ci-cd-pipeline/SKILL.md +4 -0
  75. package/departments/dev/skills/ci-cd-pipeline/references/github-actions-patterns.md +202 -0
  76. package/departments/dev/skills/db-schema/SKILL.md +4 -0
  77. package/departments/dev/skills/db-schema/references/indexing-strategy.md +197 -0
  78. package/departments/dev/skills/dependency-audit/SKILL.md +4 -0
  79. package/departments/dev/skills/dependency-audit/references/license-matrix.md +191 -0
  80. package/departments/dev/skills/incident/SKILL.md +4 -0
  81. package/departments/dev/skills/incident/references/severity-playbook.md +221 -0
  82. package/departments/dev/skills/observability/SKILL.md +4 -0
  83. package/departments/dev/skills/observability/references/slo-design.md +200 -0
  84. package/departments/dev/skills/rag-architect/SKILL.md +5 -0
  85. package/departments/dev/skills/rag-architect/references/chunking-strategies.md +129 -0
  86. package/departments/dev/skills/rag-architect/references/evaluation-guide.md +158 -0
  87. package/departments/dev/skills/red-team/SKILL.md +4 -0
  88. package/departments/dev/skills/red-team/references/mitre-attack-web.md +165 -0
  89. package/departments/dev/skills/security-audit/SKILL.md +4 -0
  90. package/departments/dev/skills/security-audit/references/owasp-2025-deep.md +409 -0
  91. package/departments/dev/skills/security-compliance/SKILL.md +117 -0
  92. package/departments/finance/skills/ciso-advisor/SKILL.md +4 -0
  93. package/departments/finance/skills/ciso-advisor/references/compliance-roadmap.md +172 -0
  94. package/departments/marketing/skills/programmatic-seo/SKILL.md +4 -0
  95. package/departments/marketing/skills/programmatic-seo/references/template-playbooks.md +289 -0
  96. package/departments/ops/skills/gdpr-compliance/SKILL.md +104 -0
  97. package/departments/ops/skills/iso27001/SKILL.md +113 -0
  98. package/departments/ops/skills/quality-management/SKILL.md +118 -0
  99. package/departments/ops/skills/risk-management/SKILL.md +120 -0
  100. package/departments/ops/skills/soc2-compliance/SKILL.md +120 -0
  101. package/departments/strategy/skills/cto-advisor/SKILL.md +4 -0
  102. package/departments/strategy/skills/cto-advisor/references/build-vs-buy-framework.md +190 -0
  103. package/installer/cli.js +13 -2
  104. package/installer/index.js +1 -2
  105. package/installer/migrate.js +123 -0
  106. package/installer/update.js +28 -15
  107. package/package.json +1 -1
  108. package/pyproject.toml +1 -1
  109. package/core/agents/__pycache__/registry_gen.cpython-313.pyc +0 -0
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: ops/quality-management
3
+ description: >
4
+ Quality management system design, process improvement, internal audit management, and management review per ISO 9001.
5
+ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
6
+ ---
7
+
8
+ # Quality Management — `/ops quality-management`
9
+
10
+ > **Agent:** Daniel (Ops Lead) | **Framework:** ISO 9001:2015, QMS, PDCA Cycle
11
+
12
+ ## QMS Implementation Phases
13
+
14
+ | Phase | PDCA | Activities | Deliverables |
15
+ |-------|------|-----------|-------------|
16
+ | 1. Context & Scope | Plan | Interested parties, scope, process map | Context document, scope statement |
17
+ | 2. Leadership | Plan | Quality policy, objectives, roles | Policy, RACI, objectives |
18
+ | 3. Planning | Plan | Risk-based thinking, quality objectives | Risk register, action plans |
19
+ | 4. Support | Do | Resources, competence, awareness, documentation | Training plan, doc control |
20
+ | 5. Operation | Do | Process execution, control of outputs | Procedures, work instructions |
21
+ | 6. Evaluation | Check | Monitoring, internal audit, management review | Audit reports, review minutes |
22
+ | 7. Improvement | Act | Nonconformity, CAPA, continual improvement | CAPA records, improvement log |
23
+
24
+ ## Quality KPIs Dashboard
25
+
26
+ | Category | KPI | Target | Calculation |
27
+ |----------|-----|--------|------------|
28
+ | Process | First Pass Yield | > 95% | (Units passed first / Total) x 100 |
29
+ | Process | Nonconformance Rate | < 1% | (NC count / Total) x 100 |
30
+ | CAPA | Closure Rate (on-time) | > 90% | (On-time closures / Due) x 100 |
31
+ | CAPA | Effectiveness Rate | > 85% | (Effective / Verified) x 100 |
32
+ | Audit | Finding Closure Rate | > 90% | (Closed on time / Total due) x 100 |
33
+ | Audit | Repeat Finding Rate | < 10% | (Repeats / Total findings) x 100 |
34
+ | Customer | Complaint Rate | < 0.1% | (Complaints / Units) x 100 |
35
+ | Customer | Satisfaction Score | > 4.0/5.0 | Average survey score |
36
+
37
+ ## Internal Audit Program
38
+
39
+ | Risk Level | Audit Frequency | Scope |
40
+ |-----------|----------------|-------|
41
+ | High | Quarterly | Critical processes, customer-facing |
42
+ | Medium | Semi-annual | Supporting processes |
43
+ | Low | Annual | Administrative processes |
44
+
45
+ ### Audit Workflow
46
+ 1. Define annual audit schedule based on process risk
47
+ 2. Assign auditors (independent from audited area)
48
+ 3. Prepare audit plan and checklist per ISO 9001 clauses
49
+ 4. Conduct audit: opening meeting, evidence collection, closing
50
+ 5. Document findings: major NC, minor NC, observation, opportunity
51
+ 6. Issue corrective action requests with deadlines
52
+ 7. Verify corrective action effectiveness
53
+ 8. Report results to management review
54
+
55
+ ## Management Review Inputs (ISO 9001 Clause 9.3.2)
56
+
57
+ | Input | Source | Required |
58
+ |-------|--------|----------|
59
+ | Previous review actions | Review records | Yes |
60
+ | Changes in external/internal issues | Context monitoring | Yes |
61
+ | Customer satisfaction and feedback | Surveys, complaints | Yes |
62
+ | Quality objectives achievement | KPI reports | Yes |
63
+ | Process performance and product conformity | Process metrics | Yes |
64
+ | Nonconformities and corrective actions | CAPA system | Yes |
65
+ | Audit results | Internal/external audits | Yes |
66
+ | Supplier performance | Supplier scorecards | Yes |
67
+ | Improvement opportunities | All sources | Yes |
68
+
69
+ ## CAPA Process
70
+
71
+ | Step | Activity | Timeline | Owner |
72
+ |------|----------|----------|-------|
73
+ | 1 | Identify nonconformity or improvement need | Immediate | Anyone |
74
+ | 2 | Contain immediate effects | 24-48 hours | Process owner |
75
+ | 3 | Root cause analysis (5 Whys, Ishikawa, 8D) | 10 days | CAPA owner |
76
+ | 4 | Define corrective/preventive actions | 5 days | CAPA owner |
77
+ | 5 | Implement actions | Per plan | Assigned |
78
+ | 6 | Verify effectiveness | 30-90 days | Quality |
79
+ | 7 | Close and update documentation | 5 days | Quality |
80
+
81
+ ## Proactive Triggers
82
+
83
+ Surface these issues WITHOUT being asked:
84
+
85
+ - No CAPA process defined or CAPA backlog exceeding SLA -> flag as ISO 9001 Clause 10.2 nonconformity risk
86
+ - Management review overdue or not conducted within scheduled period -> flag as Clause 9.3 requirement gap
87
+ - No internal audit schedule or audit program not covering all QMS processes -> flag as Clause 9.2 compliance gap
88
+
89
+ ## Output
90
+
91
+ ```markdown
92
+ ## Quality Management Assessment: <organization>
93
+
94
+ ### QMS Maturity: <Initial | Documented | Implemented | Measured | Optimizing>
95
+
96
+ ### KPI Summary
97
+ | KPI | Current | Target | Status |
98
+ |-----|---------|--------|--------|
99
+
100
+ ### Audit Program Status
101
+ - Audits completed: X/X planned
102
+ - Open findings: X (major: X, minor: X)
103
+ - Overdue CAPAs: X
104
+
105
+ ### Process Performance
106
+ - Processes meeting targets: X/X
107
+ - Processes requiring intervention: X
108
+
109
+ ### Recommendations
110
+ 1. [Priority] Action — Timeline — Owner
111
+
112
+ ### Next Management Review: <date>
113
+ ```
114
+
115
+ ## References
116
+
117
+ - [iso9001-implementation.md](references/iso9001-implementation.md) — ISO 9001:2015 clause-by-clause guidance, process approach, documentation requirements
118
+ - [capa-methodology.md](references/capa-methodology.md) — Root cause analysis techniques, corrective action planning, effectiveness verification
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: ops/risk-management
3
+ description: >
4
+ Enterprise risk identification, assessment, treatment, and monitoring using ISO 31000 and COSO ERM frameworks.
5
+ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
6
+ ---
7
+
8
+ # Risk Management — `/ops risk-management`
9
+
10
+ > **Agent:** Daniel (Ops Lead) | **Framework:** ISO 31000:2018, COSO ERM (2017)
11
+
12
+ ## Risk Management Process (ISO 31000)
13
+
14
+ | Phase | Activities | Deliverables |
15
+ |-------|-----------|-------------|
16
+ | 1. Scope & Context | Define objectives, stakeholders, risk criteria | Context statement, risk appetite |
17
+ | 2. Risk Identification | Identify sources, events, causes, consequences | Risk register (initial) |
18
+ | 3. Risk Analysis | Assess likelihood and impact, determine risk level | Risk scores, risk matrix |
19
+ | 4. Risk Evaluation | Compare against criteria, prioritize for treatment | Prioritized risk list |
20
+ | 5. Risk Treatment | Select and implement treatment options | Treatment plans, residual risk |
21
+ | 6. Monitoring & Review | Track risks, review effectiveness, update register | Updated register, reports |
22
+ | 7. Communication | Report to stakeholders, escalate as needed | Risk reports, dashboards |
23
+
24
+ ## Risk Identification Techniques
25
+
26
+ | Technique | Best For | Output |
27
+ |-----------|---------|--------|
28
+ | Brainstorming | Broad risk discovery | Raw risk list |
29
+ | SWOT Analysis | Strategic risks | Categorized risk themes |
30
+ | Checklist Analysis | Known risk categories | Validated risk list |
31
+ | Process Flow Analysis | Operational risks | Process-linked risks |
32
+ | Scenario Analysis | Emerging/future risks | Scenario-based risk descriptions |
33
+ | Root Cause Analysis | Understanding risk drivers | Causal chains |
34
+
35
+ ## Risk Assessment Matrix (5x5)
36
+
37
+ | Likelihood / Impact | Insignificant (1) | Minor (2) | Moderate (3) | Major (4) | Catastrophic (5) |
38
+ |---------------------|-------------------|-----------|-------------|-----------|------------------|
39
+ | Almost Certain (5) | 5 Medium | 10 High | 15 High | 20 Critical | 25 Critical |
40
+ | Likely (4) | 4 Low | 8 Medium | 12 High | 16 Critical | 20 Critical |
41
+ | Possible (3) | 3 Low | 6 Medium | 9 Medium | 12 High | 15 High |
42
+ | Unlikely (2) | 2 Low | 4 Low | 6 Medium | 8 Medium | 10 High |
43
+ | Rare (1) | 1 Low | 2 Low | 3 Low | 4 Low | 5 Medium |
44
+
45
+ ## Risk Treatment Options
46
+
47
+ | Strategy | When to Use | Example |
48
+ |----------|------------|---------|
49
+ | Avoid | Risk exceeds appetite, activity not essential | Cancel project, exit market |
50
+ | Mitigate | Risk can be reduced to acceptable level | Add controls, improve processes |
51
+ | Transfer | Third party better positioned to manage | Insurance, outsourcing, contracts |
52
+ | Accept | Risk within appetite, cost of treatment exceeds benefit | Document rationale, monitor |
53
+
54
+ ## Risk Register Template
55
+
56
+ | Field | Description |
57
+ |-------|------------|
58
+ | Risk ID | Unique identifier (R-001) |
59
+ | Category | Strategic / Operational / Financial / Compliance / Reputational |
60
+ | Description | Clear statement of risk event and consequence |
61
+ | Owner | Person accountable for managing the risk |
62
+ | Likelihood | 1-5 rating with justification |
63
+ | Impact | 1-5 rating with justification |
64
+ | Inherent Risk | L x I score before treatment |
65
+ | Treatment | Avoid / Mitigate / Transfer / Accept |
66
+ | Controls | Specific controls or actions in place |
67
+ | Residual Risk | L x I score after treatment |
68
+ | Status | Open / In Treatment / Monitored / Closed |
69
+ | Review Date | Next scheduled review |
70
+
71
+ ## COSO ERM Components
72
+
73
+ | Component | Focus | Key Activities |
74
+ |-----------|-------|---------------|
75
+ | Governance & Culture | Tone at the top | Risk oversight, operating structure, values |
76
+ | Strategy & Objective Setting | Risk appetite | Business context, risk appetite, strategy alignment |
77
+ | Performance | Risk identification | Identify, assess, prioritize, implement responses |
78
+ | Review & Revision | Monitoring | Substantial change assessment, performance review |
79
+ | Information & Communication | Reporting | Risk information systems, stakeholder reporting |
80
+
81
+ ## Proactive Triggers
82
+
83
+ Surface these issues WITHOUT being asked:
84
+
85
+ - Risk register older than 6 months without review -> flag as ISO 31000 Clause 6.7 monitoring gap
86
+ - No risk appetite or tolerance defined by leadership -> flag as governance gap blocking effective risk evaluation
87
+ - Critical risk identified without documented mitigation plan -> flag as unacceptable exposure requiring immediate treatment
88
+
89
+ ## Output
90
+
91
+ ```markdown
92
+ ## Risk Assessment: <organization/project>
93
+
94
+ ### Risk Profile Summary
95
+ - Total risks identified: X
96
+ - Critical: X | High: X | Medium: X | Low: X
97
+
98
+ ### Top 5 Risks
99
+ | Rank | Risk | Category | Inherent | Treatment | Residual | Owner |
100
+ |------|------|----------|----------|-----------|----------|-------|
101
+
102
+ ### Risk Appetite Alignment
103
+ - Risks within appetite: X/X
104
+ - Risks exceeding appetite: X (treatment plans required)
105
+
106
+ ### Treatment Plan Status
107
+ - Plans defined: X/X critical+high risks
108
+ - Controls implemented: X/X
109
+ - Effectiveness verified: X/X
110
+
111
+ ### Recommendations
112
+ 1. [Priority] Action — Timeline — Owner
113
+
114
+ ### Next Review: <date>
115
+ ```
116
+
117
+ ## References
118
+
119
+ - [iso31000-guide.md](references/iso31000-guide.md) — ISO 31000 principles, framework, process, risk criteria, treatment selection
120
+ - [coso-erm-framework.md](references/coso-erm-framework.md) — COSO ERM components, principles, risk appetite, strategy integration
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: ops/soc2-compliance
3
+ description: >
4
+ SOC 2 readiness assessment, Trust Services Criteria mapping, control matrix generation, evidence collection, and audit preparation.
5
+ allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent, WebFetch, WebSearch]
6
+ ---
7
+
8
+ # SOC 2 Compliance — `/ops soc2-compliance`
9
+
10
+ > **Agent:** Daniel (Ops Lead) | **Framework:** SOC 2 Type I/II (AICPA), Trust Services Criteria
11
+
12
+ ## Type I vs Type II
13
+
14
+ | Aspect | Type I | Type II |
15
+ |--------|--------|---------|
16
+ | Scope | Control design at a point in time | Design AND operating effectiveness over a period |
17
+ | Duration | Snapshot (single date) | Observation window (6-12 months) |
18
+ | Evidence | Policies, control descriptions | Policies + operating evidence (logs, tickets, configs) |
19
+ | Cost | $20K-$50K | $30K-$100K+ |
20
+ | Best For | First-time compliance | Mature organizations, enterprise customers |
21
+
22
+ ## Trust Services Criteria
23
+
24
+ | Category | Criteria | Required | Focus |
25
+ |----------|---------|----------|-------|
26
+ | Security | CC1-CC9 | Yes (always) | Access, operations, change management, risk |
27
+ | Availability | A1 | Optional | Uptime, DR/BCP, capacity planning |
28
+ | Confidentiality | C1 | Optional | Data classification, encryption, disposal |
29
+ | Processing Integrity | PI1 | Optional | Accuracy, completeness, timeliness |
30
+ | Privacy | P1-P8 | Optional | Notice, consent, collection, retention |
31
+
32
+ ## Security Common Criteria (Required)
33
+
34
+ | Criteria | Domain | Key Controls |
35
+ |----------|--------|-------------|
36
+ | CC1 | Control Environment | Integrity, oversight, org structure, accountability |
37
+ | CC2 | Communication | Internal/external communication, information quality |
38
+ | CC3 | Risk Assessment | Risk identification, fraud risk, change analysis |
39
+ | CC4 | Monitoring | Ongoing monitoring, deficiency evaluation |
40
+ | CC5 | Control Activities | Policies, technology controls |
41
+ | CC6 | Logical & Physical Access | Provisioning, authentication, encryption |
42
+ | CC7 | System Operations | Vulnerability management, incident response |
43
+ | CC8 | Change Management | Authorization, testing, approval |
44
+ | CC9 | Risk Mitigation | Vendor and business partner risk |
45
+
46
+ ## Evidence Collection Matrix
47
+
48
+ | Control Area | Primary Evidence | Secondary Evidence |
49
+ |-------------|-----------------|-------------------|
50
+ | Access Management | User access reviews, provisioning tickets | Role matrix, access logs |
51
+ | Change Management | Change tickets, approval records | Deployment logs, test results |
52
+ | Incident Response | Incident tickets, postmortems | Runbooks, escalation records |
53
+ | Vulnerability Mgmt | Scan reports, patch records | Remediation timelines |
54
+ | Encryption | Config screenshots, certificate inventory | Key rotation logs |
55
+ | Backup & Recovery | Backup logs, DR test results | Recovery time measurements |
56
+ | Vendor Management | Vendor assessments, SOC reports | Contract reviews, risk registers |
57
+
58
+ ## Audit Readiness Checklist
59
+
60
+ - [ ] All controls documented with descriptions, owners, and frequencies
61
+ - [ ] Evidence collected for entire observation period (Type II)
62
+ - [ ] Control matrix reviewed and gaps remediated
63
+ - [ ] Policies signed and distributed within last 12 months
64
+ - [ ] Access reviews completed at required frequency
65
+ - [ ] Vulnerability scans current (no critical/high unpatched beyond SLA)
66
+ - [ ] Incident response plan tested within last 12 months
67
+ - [ ] Vendor risk assessments current for all subservice organizations
68
+ - [ ] DR/BCP tested and documented within last 12 months
69
+ - [ ] Employee security training completed for all staff
70
+
71
+ ### Readiness Scoring
72
+
73
+ | Score | Rating | Action |
74
+ |-------|--------|--------|
75
+ | 90-100% | Audit Ready | Proceed with confidence |
76
+ | 75-89% | Minor Gaps | Address before scheduling audit |
77
+ | 50-74% | Significant Gaps | Remediation required |
78
+ | < 50% | Not Ready | Major program build-out needed |
79
+
80
+ ## Proactive Triggers
81
+
82
+ Surface these issues WITHOUT being asked:
83
+
84
+ - No evidence collection process in place for controls -> flag as audit failure risk requiring immediate process setup
85
+ - Control gaps identified in Trust Services Criteria coverage -> flag as SOC 2 scope gap needing remediation plan
86
+ - Vendor processing customer data without a SOC 2 report or equivalent -> flag as CC9 vendor risk deficiency
87
+
88
+ ## Output
89
+
90
+ ```markdown
91
+ ## SOC 2 Readiness Assessment: <organization>
92
+
93
+ ### Target: Type <I/II> | Categories: <Security, Availability, ...>
94
+
95
+ ### Readiness Score: X% — <Rating>
96
+
97
+ ### Control Matrix Summary
98
+ - Controls mapped: X
99
+ - Fully implemented: X | Partial: X | Missing: X
100
+
101
+ ### Evidence Status
102
+ - Evidence collected: X/X controls
103
+ - Automation coverage: X%
104
+
105
+ ### Gap Analysis
106
+ | Priority | Gap | TSC Ref | Remediation | Owner | Target |
107
+ |----------|-----|---------|-------------|-------|--------|
108
+
109
+ ### Vendor Assessment Status
110
+ - Critical vendors assessed: X/X
111
+ - SOC reports on file: X/X
112
+
113
+ ### Recommended Timeline
114
+ Gap Assessment -> Remediation -> Type I -> Observation -> Type II
115
+ ```
116
+
117
+ ## References
118
+
119
+ - [trust-service-criteria.md](references/trust-service-criteria.md) — All 5 TSC categories with sub-criteria, control objectives, and evidence examples
120
+ - [evidence-collection-guide.md](references/evidence-collection-guide.md) — Evidence types per control, automation approaches, documentation requirements
@@ -111,3 +111,7 @@ Surface these issues WITHOUT being asked:
111
111
  ```
112
112
 
113
113
  ## Output -> Obsidian: `WizardingCode/Strategy/CTO/ADVISORY-<topic>-<date>.md`
114
+
115
+ ## References
116
+
117
+ - [build-vs-buy-framework.md](references/build-vs-buy-framework.md) — Evaluation criteria, TCO calculation template, risk matrix, vendor assessment checklist, and decision tree
@@ -0,0 +1,190 @@
1
+ # Build vs Buy Decision Framework — Deep Reference
2
+
3
+ > Companion to `cto-advisor/SKILL.md`. Evaluation criteria, TCO templates, risk matrices, and decision trees.
4
+
5
+ ## Decision Tree
6
+
7
+ ```
8
+ START: Does this capability differentiate us from competitors?
9
+ YES --> Is the domain well-understood (low technical uncertainty)?
10
+ YES --> BUILD (core IP, known problem)
11
+ NO --> BUILD with PROTOTYPE first (validate feasibility before committing)
12
+ NO --> Does a vendor solution meet >= 70% of requirements?
13
+ YES --> Is vendor lock-in risk acceptable?
14
+ YES --> BUY
15
+ NO --> BUY with ABSTRACTION LAYER (wrap vendor behind interface)
16
+ NO --> Is this a temporary need (< 18 months)?
17
+ YES --> BUY cheapest option, plan to revisit
18
+ NO --> BUILD (no vendor fits, long-term need)
19
+ ```
20
+
21
+ ## Evaluation Criteria Matrix
22
+
23
+ | Criterion | Weight | Score 1 (Buy) | Score 5 | Score 9 (Build) |
24
+ |-----------|--------|---------------|---------|-----------------|
25
+ | **Core IP relevance** | 30% | Commodity (auth, email) | Supporting feature | Core differentiator |
26
+ | **3-year TCO** | 25% | Buy is 3x cheaper | Comparable | Build is 3x cheaper |
27
+ | **Migration risk** | 20% | Easy to switch vendors | Moderate effort | Vendor lock-in is severe |
28
+ | **Vendor stability** | 15% | Profitable, public company | Funded startup | Pre-revenue, single founder |
29
+ | **Integration effort** | 10% | Drop-in, < 1 week | 2-4 weeks | > 2 months custom work |
30
+
31
+ ### Scoring Template
32
+
33
+ ```markdown
34
+ ## Build vs Buy: [Capability Name]
35
+
36
+ | Criterion | Weight | Build Score | Buy Score | Build Weighted | Buy Weighted |
37
+ |-----------|--------|:-----------:|:---------:|:--------------:|:------------:|
38
+ | Core IP relevance | 30% | _ /9 | _ /9 | _ | _ |
39
+ | 3-year TCO | 25% | _ /9 | _ /9 | _ | _ |
40
+ | Migration risk | 20% | _ /9 | _ /9 | _ | _ |
41
+ | Vendor stability | 15% | _ /9 | _ /9 | _ | _ |
42
+ | Integration effort | 10% | _ /9 | _ /9 | _ | _ |
43
+ | **TOTAL** | 100% | | | **_** | **_** |
44
+
45
+ Decision: [BUILD / BUY] — [one-sentence rationale]
46
+ ```
47
+
48
+ ## Total Cost of Ownership (TCO) — 3-Year Template
49
+
50
+ ### Build TCO
51
+
52
+ | Cost Category | Year 1 | Year 2 | Year 3 | 3-Year Total |
53
+ |---------------|--------|--------|--------|-------------|
54
+ | Design and architecture | $ | - | - | $ |
55
+ | Development (engineer-months x rate) | $ | $ | $ | $ |
56
+ | Infrastructure (hosting, CI/CD) | $ | $ | $ | $ |
57
+ | Testing and QA | $ | $ | $ | $ |
58
+ | Maintenance (bugs, patches, upgrades) | - | $ | $ | $ |
59
+ | On-call and incident response | - | $ | $ | $ |
60
+ | Documentation and training | $ | $ | $ | $ |
61
+ | Opportunity cost (what else could team build?) | $ | $ | $ | $ |
62
+ | **Subtotal** | **$** | **$** | **$** | **$** |
63
+
64
+ ### Buy TCO
65
+
66
+ | Cost Category | Year 1 | Year 2 | Year 3 | 3-Year Total |
67
+ |---------------|--------|--------|--------|-------------|
68
+ | License or subscription | $ | $ | $ | $ |
69
+ | Implementation and setup | $ | - | - | $ |
70
+ | Integration development | $ | $ | $ | $ |
71
+ | Data migration | $ | - | - | $ |
72
+ | Training (team onboarding) | $ | $ | $ | $ |
73
+ | Customization and workarounds | $ | $ | $ | $ |
74
+ | Vendor support tier | $ | $ | $ | $ |
75
+ | Price increase risk (estimate 10-15%/yr) | - | $ | $ | $ |
76
+ | Exit cost (migration away if needed) | - | - | $ | $ |
77
+ | **Subtotal** | **$** | **$** | **$** | **$** |
78
+
79
+ ### Hidden Costs Checklist
80
+
81
+ | Often Missed | Applies to | Typical Impact |
82
+ |-------------|-----------|---------------|
83
+ | Onboarding new engineers to custom system | Build | 2-4 weeks per hire |
84
+ | Vendor API rate limits forcing architecture changes | Buy | 1-3 months rework |
85
+ | Security patching and compliance for custom code | Build | 10-20% of dev time |
86
+ | Vendor sunset or acquisition (forced migration) | Buy | 3-12 months disruption |
87
+ | Feature requests blocked by vendor roadmap | Buy | Lost revenue or workarounds |
88
+ | Scaling custom infrastructure beyond initial design | Build | Major refactor |
89
+
90
+ ## Risk Matrix
91
+
92
+ ### Build Risks
93
+
94
+ | Risk | Probability | Impact | Mitigation |
95
+ |------|:-----------:|:------:|-----------|
96
+ | Underestimated scope (2-3x initial estimate) | High | High | Prototype first, time-box Phase 1 |
97
+ | Key engineer leaves | Medium | High | Document architecture, pair programming |
98
+ | Technical debt accumulates | High | Medium | Allocate 20% capacity for maintenance |
99
+ | Security vulnerabilities in custom code | Medium | High | Security review, penetration testing |
100
+ | Feature creep beyond original scope | High | Medium | Strict ADR governance, MVP discipline |
101
+
102
+ ### Buy Risks
103
+
104
+ | Risk | Probability | Impact | Mitigation |
105
+ |------|:-----------:|:------:|-----------|
106
+ | Vendor increases price significantly | Medium | Medium | Contract with price caps, evaluate alternatives |
107
+ | Vendor gets acquired or shuts down | Low | Critical | Data export plan, abstraction layer |
108
+ | Vendor roadmap diverges from your needs | Medium | High | Evaluate vendor responsiveness, contract SLAs |
109
+ | Data portability limitations | Medium | High | Test data export before committing |
110
+ | Vendor outage affects your availability | Medium | High | SLA with credits, failover plan |
111
+ | Compliance requirements vendor cannot meet | Low | Critical | Verify certifications before purchase |
112
+
113
+ ## Vendor Assessment Checklist
114
+
115
+ ### Must-Have (Dealbreakers)
116
+
117
+ - [ ] Meets >= 70% of functional requirements
118
+ - [ ] API available for integration (no manual-only workflows)
119
+ - [ ] Data export capability (no vendor lock-in on data)
120
+ - [ ] Compliance certifications you need (SOC 2, GDPR, HIPAA)
121
+ - [ ] Uptime SLA >= 99.9% with credits
122
+ - [ ] Security practices documented (encryption, access controls)
123
+
124
+ ### Should-Have (Differentiators)
125
+
126
+ - [ ] Active development (releases in last 90 days)
127
+ - [ ] Community or ecosystem (plugins, integrations, forums)
128
+ - [ ] Transparent pricing (no "contact sales" for basic tier)
129
+ - [ ] Multi-region availability
130
+ - [ ] SSO/SAML support
131
+ - [ ] Audit logs and admin controls
132
+ - [ ] Sandbox/staging environment available
133
+
134
+ ### Red Flags
135
+
136
+ | Signal | Risk | Action |
137
+ |--------|------|--------|
138
+ | No public pricing | Enterprise lock-in | Get written pricing with caps |
139
+ | No data export feature | Vendor lock-in | Negotiate contractual export rights |
140
+ | Single founder, no funding | Business continuity | Escrow agreement for source code |
141
+ | No SOC 2 or equivalent | Security gaps | Assess if your compliance requires it |
142
+ | API is an afterthought (limited, poorly documented) | Integration pain | Build POC before committing |
143
+ | Customer success requires professional services | Hidden cost | Factor into TCO |
144
+
145
+ ## Migration Cost Estimation
146
+
147
+ ### From Build to Buy
148
+
149
+ | Phase | Effort | Duration |
150
+ |-------|--------|----------|
151
+ | Vendor evaluation and POC | 1-2 engineers, 2-4 weeks | 1 month |
152
+ | Data migration planning and scripting | 1-2 engineers, 2-4 weeks | 1 month |
153
+ | Integration development | 2-3 engineers, 4-8 weeks | 2 months |
154
+ | Testing and validation | 1-2 engineers, 2-4 weeks | 1 month |
155
+ | Cutover and decommission | 1 engineer, 1-2 weeks | 2 weeks |
156
+ | **Total** | **5-10 engineer-months** | **4-6 months** |
157
+
158
+ ### From Buy to Build
159
+
160
+ | Phase | Effort | Duration |
161
+ |-------|--------|----------|
162
+ | Requirements from vendor feature usage | 1 engineer, 2 weeks | 2 weeks |
163
+ | Architecture and design | 1-2 engineers, 2-4 weeks | 1 month |
164
+ | Core development (MVP) | 2-4 engineers, 8-16 weeks | 3-4 months |
165
+ | Data migration from vendor | 1-2 engineers, 2-4 weeks | 1 month |
166
+ | Feature parity (remaining 30%) | 2-3 engineers, 4-8 weeks | 2 months |
167
+ | **Total** | **10-20 engineer-months** | **6-9 months** |
168
+
169
+ ## Decision Anti-Patterns
170
+
171
+ | Anti-Pattern | Why It Fails | Better Approach |
172
+ |-------------|-------------|-----------------|
173
+ | "We can build it in a weekend" | Maintenance is 80% of lifetime cost | Estimate with 3x multiplier for Year 2-3 |
174
+ | "Vendor X is too expensive" | Compare to full build cost, not just license | Calculate 3-year TCO for both |
175
+ | "Not invented here" (always build) | Team builds commodity features | Build only what differentiates |
176
+ | "Just buy everything" (always buy) | Death by a thousand subscriptions | Own your core IP |
177
+ | "Let's build now, buy later" | Migration cost is often higher than starting with buy | Decide once, commit for 2+ years |
178
+ | Committee decision with no owner | Endless evaluation, no decision | Assign single decision owner with deadline |
179
+
180
+ ## Hybrid Strategy: Buy + Extend
181
+
182
+ Sometimes the best answer is neither pure build nor pure buy:
183
+
184
+ | Pattern | When | Example |
185
+ |---------|------|---------|
186
+ | Buy + API integration | Core vendor, custom workflows | Stripe + custom billing logic |
187
+ | Buy + plugin/extension | Vendor supports extensibility | Shopify + custom app |
188
+ | Buy + abstraction layer | Hedge against vendor lock-in | Interface over any email provider |
189
+ | Buy + custom UI | Vendor backend, your UX | Headless CMS + custom frontend |
190
+ | Open source + self-host | Need control, community does heavy lifting | PostgreSQL, Redis, Grafana |
package/installer/cli.js CHANGED
@@ -1,9 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { parseArgs } from "node:util";
4
+ import { readFileSync } from "node:fs";
5
+ import { dirname, join } from "node:path";
6
+ import { fileURLToPath } from "node:url";
4
7
  import { install } from "./index.js";
5
8
  import { detectRuntime } from "./detect-runtime.js";
6
9
 
10
+ const __dirname = dirname(fileURLToPath(import.meta.url));
11
+ const VERSION = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8")).version;
12
+
7
13
  const { values, positionals } = parseArgs({
8
14
  options: {
9
15
  help: { type: "boolean", short: "h" },
@@ -16,7 +22,6 @@ const { values, positionals } = parseArgs({
16
22
  strict: false,
17
23
  });
18
24
 
19
- const VERSION = "2.0.0-alpha.1";
20
25
  const command = positionals[0] || "install";
21
26
 
22
27
  if (values.version) {
@@ -31,8 +36,9 @@ ArkaOS v${VERSION} — The Operating System for AI Agent Teams
31
36
  Usage:
32
37
  npx arkaos install Install ArkaOS in current environment
33
38
  npx arkaos install --runtime <runtime> Install for specific runtime
34
- npx arkaos doctor Run health checks
35
39
  npx arkaos update Update to latest version
40
+ npx arkaos migrate Migrate from v1 to v2
41
+ npx arkaos doctor Run health checks
36
42
  npx arkaos uninstall Remove ArkaOS
37
43
 
38
44
  Options:
@@ -78,6 +84,11 @@ async function main() {
78
84
  await uninstall();
79
85
  break;
80
86
 
87
+ case "migrate":
88
+ const { migrate } = await import("./migrate.js");
89
+ await migrate();
90
+ break;
91
+
81
92
  default:
82
93
  console.error(`Unknown command: ${command}`);
83
94
  console.error('Run "npx arkaos help" for usage information.');
@@ -8,8 +8,7 @@ import { getRuntimeConfig } from "./detect-runtime.js";
8
8
  const __filename = fileURLToPath(import.meta.url);
9
9
  const __dirname = dirname(__filename);
10
10
  const ARKAOS_ROOT = resolve(__dirname, "..");
11
-
12
- const VERSION = "2.0.0-alpha.1";
11
+ const VERSION = JSON.parse(readFileSync(join(ARKAOS_ROOT, "package.json"), "utf-8")).version;
13
12
 
14
13
  export async function install({ runtime, path, force }) {
15
14
  console.log(`\n ArkaOS v${VERSION} — The Operating System for AI Agent Teams\n`);