arkaos 2.6.0 → 2.8.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.
- package/VERSION +1 -1
- package/config/constitution.yaml +8 -0
- package/config/hooks/cwd-changed.sh +104 -0
- package/config/hooks/session-start.sh +60 -0
- package/config/hooks/user-prompt-submit-v2.sh +26 -1
- package/config/hooks/user-prompt-submit.sh +105 -277
- package/config/settings-template.json +22 -0
- package/config/standards/ecosystem-workflow.md +60 -0
- package/config/user-claude.md +15 -0
- package/installer/adapters/claude-code.js +26 -0
- package/installer/index.js +39 -16
- package/installer/update.js +32 -11
- package/knowledge/agents-registry.json +6 -6
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/departments/ecommerce/SKILL.md +0 -363
- package/departments/ecommerce/agents/ecommerce-manager.md +0 -91
- package/departments/knowledge/SKILL.md +0 -474
- package/departments/knowledge/agents/knowledge-curator.md +0 -89
- package/departments/operations/SKILL.md +0 -422
- package/departments/operations/agents/coo.md +0 -88
- /package/departments/{knowledge → kb}/scripts/kb-check-capabilities.sh +0 -0
- /package/departments/{knowledge → kb}/scripts/kb-cleanup.sh +0 -0
- /package/departments/{knowledge → kb}/scripts/kb-queue.sh +0 -0
- /package/departments/{knowledge → kb}/scripts/kb-status.sh +0 -0
- /package/departments/{knowledge → kb}/scripts/kb-worker.sh +0 -0
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.8.0
|
package/config/constitution.yaml
CHANGED
|
@@ -58,6 +58,10 @@ enforcement_levels:
|
|
|
58
58
|
rule: "ArkaOS instructions override runtime defaults"
|
|
59
59
|
enforcement: "ArkaOS context injected with highest priority"
|
|
60
60
|
|
|
61
|
+
- id: context-verification
|
|
62
|
+
rule: "Orchestrators must confirm understanding, ask clarifying questions, and challenge assumptions before executing any task"
|
|
63
|
+
enforcement: "Pre-execution gate — restate request, ask at least 1 clarifying question, apply devil's advocate to at least 1 assumption"
|
|
64
|
+
|
|
61
65
|
quality_gate:
|
|
62
66
|
description: "Mandatory pre-delivery review. Nothing ships without APPROVED verdict."
|
|
63
67
|
trigger: "After the last execution phase, before delivery to user"
|
|
@@ -105,6 +109,10 @@ enforcement_levels:
|
|
|
105
109
|
rule: "Key decisions persisted in agent memory files"
|
|
106
110
|
enforcement: "Post-execution hook saves decisions to agent MEMORY.md"
|
|
107
111
|
|
|
112
|
+
- id: workflow-standard
|
|
113
|
+
rule: "All ecosystem skills must follow the standard 7-phase workflow defined in config/standards/ecosystem-workflow.md"
|
|
114
|
+
enforcement: "Ecosystem SKILL.md files must reference or implement all 7 phases"
|
|
115
|
+
|
|
108
116
|
should:
|
|
109
117
|
description: "Best practices. Encouraged but not enforced."
|
|
110
118
|
rules:
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# ArkaOS — CwdChanged Hook
|
|
4
|
+
# Fires when the working directory changes. Detects ecosystem and injects
|
|
5
|
+
# project context so Claude knows which squad and stack to use.
|
|
6
|
+
# ============================================================================
|
|
7
|
+
|
|
8
|
+
input=$(cat)
|
|
9
|
+
NEW_CWD=$(echo "$input" | jq -r '.cwd // ""' 2>/dev/null)
|
|
10
|
+
|
|
11
|
+
if [ -z "$NEW_CWD" ] || [ ! -d "$NEW_CWD" ]; then
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# ─── Detect ecosystem from ecosystems.json ─────────────────────────────
|
|
16
|
+
ECOSYSTEMS_FILE="$HOME/.claude/skills/arka/knowledge/ecosystems.json"
|
|
17
|
+
ECOSYSTEM=""
|
|
18
|
+
ECOSYSTEM_NAME=""
|
|
19
|
+
|
|
20
|
+
if [ -f "$ECOSYSTEMS_FILE" ] && command -v python3 &>/dev/null; then
|
|
21
|
+
eval "$(python3 -c "
|
|
22
|
+
import json, os, sys
|
|
23
|
+
|
|
24
|
+
cwd = '$NEW_CWD'
|
|
25
|
+
eco_file = os.path.expanduser('$ECOSYSTEMS_FILE')
|
|
26
|
+
|
|
27
|
+
try:
|
|
28
|
+
data = json.load(open(eco_file))
|
|
29
|
+
ecosystems = data.get('ecosystems', {})
|
|
30
|
+
|
|
31
|
+
for eco_id, eco in ecosystems.items():
|
|
32
|
+
projects = eco.get('projects', [])
|
|
33
|
+
for proj in projects:
|
|
34
|
+
# Check if cwd contains the project name
|
|
35
|
+
if proj in cwd:
|
|
36
|
+
print(f'ECOSYSTEM=\"{eco_id}\"')
|
|
37
|
+
print(f'ECOSYSTEM_NAME=\"{eco.get(\"name\", eco_id)}\"')
|
|
38
|
+
sys.exit(0)
|
|
39
|
+
|
|
40
|
+
# No match by project name, try by path patterns
|
|
41
|
+
if '/herd/' in cwd or '/Herd/' in cwd:
|
|
42
|
+
dir_name = os.path.basename(cwd.rstrip('/'))
|
|
43
|
+
for eco_id, eco in ecosystems.items():
|
|
44
|
+
for proj in eco.get('projects', []):
|
|
45
|
+
if proj == dir_name:
|
|
46
|
+
print(f'ECOSYSTEM=\"{eco_id}\"')
|
|
47
|
+
print(f'ECOSYSTEM_NAME=\"{eco.get(\"name\", eco_id)}\"')
|
|
48
|
+
sys.exit(0)
|
|
49
|
+
except Exception:
|
|
50
|
+
pass
|
|
51
|
+
|
|
52
|
+
print('ECOSYSTEM=\"\"')
|
|
53
|
+
print('ECOSYSTEM_NAME=\"\"')
|
|
54
|
+
" 2>/dev/null)"
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# ─── Detect stack ──────────────────────────────────────────────────────
|
|
58
|
+
STACK="unknown"
|
|
59
|
+
if [ -f "$NEW_CWD/composer.json" ]; then
|
|
60
|
+
STACK="laravel"
|
|
61
|
+
elif [ -f "$NEW_CWD/package.json" ]; then
|
|
62
|
+
if grep -q '"nuxt"' "$NEW_CWD/package.json" 2>/dev/null; then
|
|
63
|
+
STACK="nuxt"
|
|
64
|
+
elif grep -q '"next"' "$NEW_CWD/package.json" 2>/dev/null; then
|
|
65
|
+
STACK="nextjs"
|
|
66
|
+
elif grep -q '"react"' "$NEW_CWD/package.json" 2>/dev/null; then
|
|
67
|
+
STACK="react"
|
|
68
|
+
elif grep -q '"vue"' "$NEW_CWD/package.json" 2>/dev/null; then
|
|
69
|
+
STACK="vue"
|
|
70
|
+
else
|
|
71
|
+
STACK="node"
|
|
72
|
+
fi
|
|
73
|
+
elif [ -f "$NEW_CWD/pyproject.toml" ]; then
|
|
74
|
+
STACK="python"
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
# ─── Check for project descriptor ─────────────────────────────────────
|
|
78
|
+
DIR_NAME=$(basename "$NEW_CWD")
|
|
79
|
+
DESCRIPTOR=""
|
|
80
|
+
DESCRIPTOR_FILE="$HOME/.claude/skills/arka/projects/${DIR_NAME}.md"
|
|
81
|
+
DESCRIPTOR_DIR="$HOME/.claude/skills/arka/projects/${DIR_NAME}/PROJECT.md"
|
|
82
|
+
|
|
83
|
+
if [ -f "$DESCRIPTOR_FILE" ]; then
|
|
84
|
+
DESCRIPTOR="$DESCRIPTOR_FILE"
|
|
85
|
+
elif [ -f "$DESCRIPTOR_DIR" ]; then
|
|
86
|
+
DESCRIPTOR="$DESCRIPTOR_DIR"
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# ─── Build context output ─────────────────────────────────────────────
|
|
90
|
+
CONTEXT=""
|
|
91
|
+
|
|
92
|
+
if [ -n "$ECOSYSTEM" ]; then
|
|
93
|
+
CONTEXT="[arka:project-context] Ecosystem: ${ECOSYSTEM_NAME} (${ECOSYSTEM}) | Stack: ${STACK} | Use /arka-${ECOSYSTEM} for dedicated squad routing."
|
|
94
|
+
elif [ "$STACK" != "unknown" ]; then
|
|
95
|
+
CONTEXT="[arka:project-context] Stack: ${STACK} | No ecosystem assigned. Use /arka onboard to register this project."
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
if [ -n "$DESCRIPTOR" ]; then
|
|
99
|
+
CONTEXT="${CONTEXT} Descriptor: ${DESCRIPTOR}"
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
if [ -n "$CONTEXT" ]; then
|
|
103
|
+
echo "{\"additionalContext\": \"${CONTEXT}\"}"
|
|
104
|
+
fi
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# ArkaOS — SessionStart Hook
|
|
4
|
+
# Uses systemMessage (same protocol as claude-mem) for guaranteed display.
|
|
5
|
+
# ============================================================================
|
|
6
|
+
|
|
7
|
+
# ─── Profile ───────────────────────────────────────────────────────────
|
|
8
|
+
NAME="founder"
|
|
9
|
+
COMPANY="WizardingCode"
|
|
10
|
+
VERSION="2.x"
|
|
11
|
+
|
|
12
|
+
if [ -f "$HOME/.arkaos/profile.json" ] && command -v python3 &>/dev/null; then
|
|
13
|
+
NAME=$(python3 -c "import json; p=json.load(open('$HOME/.arkaos/profile.json')); print(p.get('name', p.get('role', 'founder')))" 2>/dev/null || echo "founder")
|
|
14
|
+
COMPANY=$(python3 -c "import json; print(json.load(open('$HOME/.arkaos/profile.json')).get('company', 'WizardingCode'))" 2>/dev/null || echo "WizardingCode")
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [ -f "$HOME/.arkaos/.repo-path" ]; then
|
|
18
|
+
REPO=$(cat "$HOME/.arkaos/.repo-path")
|
|
19
|
+
[ -f "$REPO/VERSION" ] && VERSION=$(cat "$REPO/VERSION" | tr -d '[:space:]')
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# ─── Time greeting ─────────────────────────────────────────────────────
|
|
23
|
+
HOUR=$(date +%H)
|
|
24
|
+
if [ "$HOUR" -ge 5 ] && [ "$HOUR" -lt 12 ]; then GREETING="Bom dia"
|
|
25
|
+
elif [ "$HOUR" -ge 12 ] && [ "$HOUR" -lt 19 ]; then GREETING="Boa tarde"
|
|
26
|
+
else GREETING="Boa noite"; fi
|
|
27
|
+
|
|
28
|
+
# ─── Version drift ─────────────────────────────────────────────────────
|
|
29
|
+
SYNC_STATE="$HOME/.arkaos/sync-state.json"
|
|
30
|
+
DRIFT=""
|
|
31
|
+
|
|
32
|
+
if [ -f "$SYNC_STATE" ]; then
|
|
33
|
+
SYNCED=$(python3 -c "import json; print(json.load(open('$SYNC_STATE'))['version'])" 2>/dev/null || echo "none")
|
|
34
|
+
if [ "$SYNCED" != "$VERSION" ]; then
|
|
35
|
+
DRIFT="\\n[arka:update-available] Core v${VERSION} != synced v${SYNCED}. Run /arka update."
|
|
36
|
+
fi
|
|
37
|
+
else
|
|
38
|
+
DRIFT="\\n[arka:update-available] Never synced. Run /arka update."
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# ─── Build message ─────────────────────────────────────────────────────
|
|
42
|
+
MSG="╔══════════════════════════════════════════════╗\\n"
|
|
43
|
+
MSG+="║ ║\\n"
|
|
44
|
+
MSG+="║ A R K A O S ║\\n"
|
|
45
|
+
MSG+="║ ║\\n"
|
|
46
|
+
MSG+="║ The Operating System for AI Teams ║\\n"
|
|
47
|
+
MSG+="║ by WizardingCode ║\\n"
|
|
48
|
+
MSG+="║ ║\\n"
|
|
49
|
+
MSG+="╚══════════════════════════════════════════════╝\\n"
|
|
50
|
+
MSG+="\\n"
|
|
51
|
+
MSG+="${GREETING}, ${NAME} (${COMPANY})\\n"
|
|
52
|
+
MSG+="ArkaOS v${VERSION} | 65 agents | 17 departments | 244+ skills"
|
|
53
|
+
MSG+="${DRIFT}"
|
|
54
|
+
|
|
55
|
+
# ─── Output as systemMessage (same protocol as claude-mem) ─────────────
|
|
56
|
+
python3 -c "
|
|
57
|
+
import json
|
|
58
|
+
msg = '''$(echo -e "$MSG")'''
|
|
59
|
+
print(json.dumps({'systemMessage': msg}))
|
|
60
|
+
"
|
|
@@ -43,6 +43,31 @@ if [ -f "$ARKAOS_VERSION_FILE" ]; then
|
|
|
43
43
|
fi
|
|
44
44
|
fi
|
|
45
45
|
|
|
46
|
+
# ─── Session Greeting ───────────────────────────────────────────────────
|
|
47
|
+
_SESSION_MARKER="/tmp/arkaos-session-$$"
|
|
48
|
+
if [ ! -f "$_SESSION_MARKER" ] && [ ! -f "/tmp/arkaos-greeted-today" ]; then
|
|
49
|
+
touch "$_SESSION_MARKER"
|
|
50
|
+
touch "/tmp/arkaos-greeted-today"
|
|
51
|
+
|
|
52
|
+
_GREETING_NAME=""
|
|
53
|
+
_GREETING_COMPANY=""
|
|
54
|
+
_GREETING_VERSION=""
|
|
55
|
+
|
|
56
|
+
if [ -f "$HOME/.arkaos/profile.json" ] && command -v python3 &>/dev/null; then
|
|
57
|
+
_GREETING_NAME=$(python3 -c "import json; p=json.load(open('$HOME/.arkaos/profile.json')); print(p.get('name', p.get('role', 'founder')))" 2>/dev/null)
|
|
58
|
+
_GREETING_COMPANY=$(python3 -c "import json; print(json.load(open('$HOME/.arkaos/profile.json')).get('company', ''))" 2>/dev/null)
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
if [ -f "$HOME/.arkaos/.repo-path" ]; then
|
|
62
|
+
_GR_REPO=$(cat "$HOME/.arkaos/.repo-path")
|
|
63
|
+
if [ -f "$_GR_REPO/VERSION" ]; then
|
|
64
|
+
_GREETING_VERSION=$(cat "$_GR_REPO/VERSION")
|
|
65
|
+
fi
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
_ARKA_GREETING="[arka:greeting] _ ____ _ __ _ ___ ____ / \\ | _ \\| |/ / / \\ / _ \\/ ___| / _ \\ | |_) | ' / / _ \\| | | \\___ \\ / ___ \\| _ <| . \\ / ___ \\ |_| |___) | /_/ \\_\\_| \\_\\_|\\_\\/_/ \\_\\___/|____/ Welcome back, ${_GREETING_NAME:-founder} (${_GREETING_COMPANY:-WizardingCode}). ArkaOS v${_GREETING_VERSION:-2.x} ready. Type /arka help or just describe what you need. "
|
|
69
|
+
fi
|
|
70
|
+
|
|
46
71
|
# ─── Performance Timing ──────────────────────────────────────────────────
|
|
47
72
|
_HOOK_START_NS=$(date +%s%N 2>/dev/null || echo "0")
|
|
48
73
|
_hook_ms() {
|
|
@@ -128,7 +153,7 @@ if [ -z "$python_result" ]; then
|
|
|
128
153
|
fi
|
|
129
154
|
|
|
130
155
|
# ─── Output ──────────────────────────────────────────────────────────────
|
|
131
|
-
echo "{\"additionalContext\": \"${_SYNC_NOTICE:-}$python_result\"}"
|
|
156
|
+
echo "{\"additionalContext\": \"${_ARKA_GREETING:-}${_SYNC_NOTICE:-}$python_result\"}"
|
|
132
157
|
|
|
133
158
|
# ─── Metrics ─────────────────────────────────────────────────────────────
|
|
134
159
|
elapsed=$(_hook_ms)
|