-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·192 lines (161 loc) · 7.65 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·192 lines (161 loc) · 7.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!/usr/bin/env bash
# Lumen — AI Product Operating System
# One-line installer for macOS, Linux, Git Bash, and WSL
# Usage: curl -fsSL https://raw.githubusercontent.com/ishwarjha/lumen-product-management/main/install.sh | bash
set -euo pipefail
LUMEN_REPO="https://github.com/ishwarjha/lumen-product-management"
LUMEN_VERSION="2.3.0"
CLAUDE_PLUGINS_DIR="${HOME}/.claude/plugins"
PLUGIN_DIR="${CLAUDE_PLUGINS_DIR}/lumen"
# ── Colours ───────────────────────────────────────────────────────────────────
BOLD="\033[1m"
GREEN="\033[32m"
YELLOW="\033[33m"
RED="\033[31m"
RESET="\033[0m"
info() { echo -e "${BOLD}[lumen]${RESET} $*"; }
success() { echo -e "${GREEN}${BOLD}[lumen]${RESET} $*${RESET}"; }
warn() { echo -e "${YELLOW}${BOLD}[lumen]${RESET} $*${RESET}"; }
error() { echo -e "${RED}${BOLD}[lumen]${RESET} $*${RESET}" >&2; exit 1; }
# ── Prerequisites ─────────────────────────────────────────────────────────────
check_prerequisites() {
if ! command -v git &>/dev/null; then
error "git is required. Install from https://git-scm.com/"
fi
if ! command -v claude &>/dev/null; then
warn "Claude Code CLI not found. Install from https://claude.ai/code before using Lumen."
fi
}
# ── Install ───────────────────────────────────────────────────────────────────
install_lumen() {
info "Installing Lumen v${LUMEN_VERSION}..."
mkdir -p "${CLAUDE_PLUGINS_DIR}"
if [ -d "${PLUGIN_DIR}" ]; then
info "Existing installation found — updating..."
git -C "${PLUGIN_DIR}" fetch --quiet --tags origin
git -C "${PLUGIN_DIR}" reset --hard "refs/tags/v${LUMEN_VERSION}" --quiet
success "Updated to v${LUMEN_VERSION}."
else
info "Cloning Lumen into ${PLUGIN_DIR}..."
git clone --quiet --depth 1 "${LUMEN_REPO}" "${PLUGIN_DIR}"
success "Cloned Lumen v${LUMEN_VERSION}."
fi
}
# ── Register with Claude Code ─────────────────────────────────────────────────
register_plugin() {
info "Registering plugin with Claude Code..."
CLAUDE_DIR="${HOME}/.claude"
CLAUDE_SETTINGS="${CLAUDE_DIR}/settings.json"
INSTALLED_PLUGINS="${CLAUDE_DIR}/plugins/installed_plugins.json"
AGENTS_DIR="${CLAUDE_DIR}/agents"
AGENT_STUB="${AGENTS_DIR}/lumen.md"
NOW=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")
mkdir -p "${AGENTS_DIR}"
# ── 1. Write agent stub ──────────────────────────────────────────────────────
cat > "${AGENT_STUB}" <<STUB
---
name: lumen
description: Lumen is a Product Management AI co-pilot. Use for PM workflows: PMF discovery (W1), churn/PMF recovery (W2), strategy (W3), feature validation with ethics checkpoint (W4), GTM launch (W5), or churn analysis (W6). Invoke with a workflow name or describe the PM problem you're solving.
model: claude-sonnet-4-6
---
You are Lumen, a Product Management AI co-pilot. You operate as the orchestrator of a multi-agent PM system.
Agent definitions, skills, and schemas are in \`${PLUGIN_DIR}/\`. Full orchestration logic is in \`agents/orchestrator.md\`.
## Interaction rules (MANDATORY)
1. **One question at a time.** Never ask multiple context questions in a single message. Ask one, wait for the answer, then ask the next. Show progress: "(2 of 6)".
2. **Acknowledge before moving on.** Briefly confirm each answer before asking the next question (e.g. "Got it — B2B SaaS.").
3. **Run agents only when all required context is collected.** Do not start the agent sequence until every required slot for the workflow is filled.
## Workflows
| ID | Name | PostHog | Key oversight gates |
|----|------|---------|---------------------|
| W1 | PMF Discovery | Recommended (PARTIAL without) | — |
| W2 | PMF / Churn Recovery | No | DecideWell (L2) |
| W3 | Strategy | No | — |
| W4 | Feature Validation | No | DataLayer (L3) → DecideWell (L2) |
| W5 | GTM Launch | No | LaunchPad (L1) |
| W6 | Churn Analysis | No | DecideWell (L2) |
Step-by-step sequences: \`${PLUGIN_DIR}/skills/workflow-sequences/SKILL.md\`
Context slot reference: \`${PLUGIN_DIR}/schemas/context-slots.md\`
STUB
success "Agent stub written to ${AGENT_STUB}."
# ── 2. Register in installed_plugins.json ────────────────────────────────────
if command -v python3 &>/dev/null; then
python3 - <<PYEOF
import json, os, sys
path = "${INSTALLED_PLUGINS}"
entry = {
"scope": "user",
"installPath": "${PLUGIN_DIR}",
"version": "${LUMEN_VERSION}",
"installedAt": "${NOW}",
"lastUpdated": "${NOW}"
}
if os.path.isfile(path):
with open(path) as f:
data = json.load(f)
else:
data = {"version": 2, "plugins": {}}
data.setdefault("plugins", {})
data["plugins"]["lumen@lumen-marketplace"] = [entry]
with open(path, "w") as f:
json.dump(data, f, indent=2)
print("installed_plugins.json updated.")
PYEOF
success "Registered in installed_plugins.json."
else
warn "python3 not found — skipping installed_plugins.json registration."
fi
# ── 3. Add to enabledPlugins in settings.json ────────────────────────────────
if [ ! -f "${CLAUDE_SETTINGS}" ]; then
warn "Claude Code settings not found at ${CLAUDE_SETTINGS}."
warn "Start Claude Code once to generate settings, then re-run this installer."
return
fi
if command -v python3 &>/dev/null; then
python3 - <<PYEOF
import json
path = "${CLAUDE_SETTINGS}"
with open(path) as f:
data = json.load(f)
data.setdefault("enabledPlugins", {})
if "lumen@lumen-marketplace" in data["enabledPlugins"]:
print("lumen@lumen-marketplace already in enabledPlugins — skipping.")
else:
data["enabledPlugins"]["lumen@lumen-marketplace"] = True
with open(path, "w") as f:
json.dump(data, f, indent=2)
print("settings.json updated.")
PYEOF
success "Enabled in Claude Code settings."
else
warn "python3 not found — skipping settings.json update."
warn "Manually add to ${CLAUDE_SETTINGS}: \"enabledPlugins\": { \"lumen@lumen\": true }"
fi
}
# ── Post-install instructions ─────────────────────────────────────────────────
print_next_steps() {
echo ""
echo -e "${BOLD}Lumen v${LUMEN_VERSION} installed.${RESET}"
echo ""
echo "Next steps:"
echo ""
echo " 1. Restart Claude Code"
echo " 2. Run: /lumen:pmf-discovery"
echo " → SetupGuide starts automatically. No credentials required."
echo ""
echo "Optional — connect MCPs for full functionality:"
echo " Step 1: SUPABASE_URL + SUPABASE_ANON_KEY → Knowledge Graph"
echo " Step 4: POSTHOG_MCP_URL → PMF scoring"
echo " Step 3: SLACK_BOT_TOKEN → Slack reports"
echo ""
echo " Run /lumen:setup for the interactive guide."
echo ""
echo -e "${GREEN}${BOLD}Done.${RESET}"
}
# ── Main ──────────────────────────────────────────────────────────────────────
main() {
check_prerequisites
install_lumen
register_plugin
print_next_steps
}
main "$@"