@pushrec/skills 0.2.0 → 0.3.4

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/README.md CHANGED
@@ -2,7 +2,15 @@
2
2
 
3
3
  CLI for the pushREC Agent Skills Marketplace. Install, manage, and update Claude Code skills.
4
4
 
5
- **Version:** `0.1.0` | **Published:** 2026-02-19
5
+ **Local repo version target:** `0.3.4`
6
+
7
+ **Do not assume npm latest from this file.** Verify before customer-facing instructions:
8
+
9
+ ```bash
10
+ npm view @pushrec/skills version
11
+ ```
12
+
13
+ As of 2026-02-27: npm `latest` = `0.2.0`, `next` = `0.3.2`. Local tree at `0.3.4` (Windows readiness). 19 test files, 139 tests passing.
6
14
 
7
15
  ## Quick Start
8
16
 
@@ -30,19 +38,22 @@ pushrec-skills auth login
30
38
 
31
39
  | Command | Description |
32
40
  |---------|-------------|
33
- | `pushrec-skills list` | Browse available skills |
34
- | `pushrec-skills install <name>` | Install a skill |
35
- | `pushrec-skills install --all` | Install all licensed skills |
36
- | `pushrec-skills update [name]` | Update installed skills |
37
- | `pushrec-skills search <query>` | Search the catalog |
38
- | `pushrec-skills info <name>` | Get skill details |
39
- | `pushrec-skills uninstall <name>` | Remove a skill |
41
+ | `pushrec-skills install [name]` | Install a skill (or `--all` for all available) |
42
+ | `pushrec-skills update [name]` | Update installed skills to latest versions |
43
+ | `pushrec-skills sync [name]` | Synchronize local skills with the registry (install missing + update installed) |
44
+ | `pushrec-skills list` | List available or installed skills |
45
+ | `pushrec-skills search <query>` | Search skills by keyword |
46
+ | `pushrec-skills info <name>` | Show detailed information about a skill |
47
+ | `pushrec-skills uninstall <name>` | Uninstall a skill from the active skills root |
48
+ | `pushrec-skills rollback <name>` | Rollback an installed skill to a backup snapshot |
40
49
 
41
- ### Utility
50
+ ### Setup & Utility
42
51
 
43
52
  | Command | Description |
44
53
  |---------|-------------|
45
- | `pushrec-skills health` | Check registry connectivity |
54
+ | `pushrec-skills setup` | One-command onboarding: verify license, activate device, install all skills |
55
+ | `pushrec-skills health` | Check registry server health (use `--full` for full diagnostic) |
56
+ | `pushrec-skills dashboard` | Launch the Generative UI dashboard |
46
57
 
47
58
  ## Registry
48
59
 
@@ -0,0 +1,9 @@
1
+ # Bundled Skills
2
+
3
+ This directory contains skills bundled with the CLI package.
4
+ These skills are installed automatically during `npx @pushrec/skills setup`.
5
+
6
+ ## pushrec-skills
7
+
8
+ Universal entry point for all pushREC skill operations.
9
+ Copied to ~/.claude/skills/pushrec-skills/ during setup if not already installed.
@@ -0,0 +1,381 @@
1
+ ---
2
+ name: pushrec-skills
3
+ version: 1.1.0
4
+ description: "Universal entry point for all pushREC skill operations. Onboarding, skill discovery, troubleshooting, API key setup, and update guidance. Use when: first time using pushREC skills, need help finding the right skill, skill isn't working, setting up API keys, updating skills, or asking how skills work. Aliases: /onboarding, /start, /get-started, /help, /skills, /pushrec."
5
+ category: meta-tools
6
+ aliases: [onboarding, start, get-started, help, skills, pushrec]
7
+ session_behavior: on-demand
8
+ allowed-tools: [Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion]
9
+ ---
10
+
11
+ # pushREC Skills
12
+
13
+ Universal entry point for all pushREC skill operations. Handles first-time onboarding, skill discovery, troubleshooting, API key setup, and update guidance.
14
+
15
+ ## Capabilities
16
+
17
+ | Mode | Trigger | What It Does |
18
+ |------|---------|-------------|
19
+ | **Onboarding** | First-time user (no profile.json) | Diagnostic, profiling, CC 101, first win, skill map, unlock guide |
20
+ | **Recommendation** | "Which skill for X?" | Scan loaded skill descriptions, rank matches, explain WHY |
21
+ | **Troubleshooting** | "X not working" | Run diagnostic, decision tree, escalation path |
22
+ | **API Key Setup** | "Set up API keys" | Read prerequisites.yaml, guide step-by-step by level |
23
+ | **Update Guidance** | "Update skills" | CLI commands for update, list, install new |
24
+ | **System Info** | General questions | Explain how skills work, architecture, concepts |
25
+
26
+ ### Paradigm: LLM-Native Recommendations
27
+
28
+ Claude Code auto-loads ALL installed skill names and descriptions into every session context. You already know what every skill does. No catalog file or recommendation script needed. You ARE the recommendation engine. The only hardcoded data is `references/prerequisites.yaml` (API key requirements cannot be inferred from descriptions).
29
+
30
+ ---
31
+
32
+ ## Intent Detection Protocol
33
+
34
+ Think step by step. Before responding, determine the user's mode.
35
+
36
+ ### Step 1: Check State Files
37
+
38
+ ```bash
39
+ ls ~/.claude/skills/pushrec-skills/state/profile.json 2>/dev/null
40
+ ls ~/.claude/skills/pushrec-skills/state/progress.json 2>/dev/null
41
+ ```
42
+
43
+ ### Step 2: Route Based on State + Input
44
+
45
+ | State | User Signal | Route To |
46
+ |-------|-------------|----------|
47
+ | No profile.json | Any | First-Time Onboarding |
48
+ | Profile exists, onboarding incomplete | Any | Resume Onboarding (pick up where they left off) |
49
+ | Profile exists | "X not working", error messages | Troubleshooting Protocol |
50
+ | Profile exists | "update", "new skills" | Update Guidance |
51
+ | Profile exists | "API key", "set up Google", credential terms | API Key Setup |
52
+ | Profile exists | Skill-related question | Recommendation Protocol |
53
+ | Profile exists | General system question | System Info (explain concepts) |
54
+ | Any | "reset", "start over" | Delete state/ directory, restart onboarding |
55
+ | Ambiguous | Cannot determine intent | Ask ONE clarifying question |
56
+
57
+ ---
58
+
59
+ ## First-Time Onboarding
60
+
61
+ Six phases, executed sequentially. Track progress in `state/progress.json`.
62
+
63
+ ### Phase 0: Diagnostic
64
+
65
+ Run the system readiness check:
66
+
67
+ ```bash
68
+ python3 ~/.claude/skills/pushrec-skills/scripts/diagnostic.py
69
+ ```
70
+
71
+ Parse the JSON output. Present results as a checklist:
72
+ - PASS items: brief confirmation
73
+ - FAIL items (exit code 1): STOP. Guide the user to fix critical prerequisites before continuing.
74
+ - WARN items (exit code 2): note but continue
75
+
76
+ If Claude Code, Node.js, or npm are missing, provide platform-specific install instructions and STOP. Do not proceed with onboarding until critical prerequisites pass.
77
+
78
+ Write `state/progress.json` with `diagnostic: {status: "completed"}`.
79
+
80
+ ### Phase 1: Adaptive Profiling
81
+
82
+ Gather business context to personalize skill recommendations. Use conversational questions, not a rigid form. Write answers to `state/profile.json`.
83
+
84
+ **Round 1 (always ask -- 3 questions):**
85
+ 1. What type of business do you run? (agency, coaching, SaaS, e-commerce, freelance, creator, other)
86
+ 2. What is your primary content platform? (LinkedIn, X/Twitter, YouTube, Instagram, email, podcast, blog, other)
87
+ 3. What is your biggest challenge right now? (not enough content, low engagement, no leads, poor conversion, time management, scaling, other)
88
+
89
+ **Round 2 (ask if user seems engaged and responsive -- 3 questions):**
90
+ 4. Who is your target audience? (open text)
91
+ 5. What is your approximate monthly revenue range? (pre-revenue, <$10K, $10-50K, $50-100K, $100K+)
92
+ 6. How much experience do you have with AI tools? (never used, tried a few times, use weekly, use daily)
93
+
94
+ **Round 3 (ask if terminal comfort or CC experience is NOT obvious from prior answers -- 2 questions):**
95
+ 7. How comfortable are you with the terminal/command line? (never used, basic, comfortable, advanced)
96
+ 8. How much experience do you have with Claude Code specifically? (never, barely, sometimes, regularly, daily)
97
+
98
+ **Adaptive rules:**
99
+ - If the user gives short or impatient answers, skip remaining rounds
100
+ - If diagnostic shows many installed skills and API keys, skip Round 3 (infer advanced user)
101
+ - Write profile.json after each round completes (progressive save)
102
+
103
+ **profile.json schema:** `{"version":"1.0.0", "created_at":"ISO", "business_type":"agency", "content_platform":"linkedin", "biggest_challenge":"not-enough-content", "target_audience":"B2B SaaS founders", "revenue_range":"$50-100K", "ai_experience":"use-daily", "terminal_comfort":"comfortable", "cc_experience":"barely"}`
104
+
105
+ Write `progress.json` with `profiling: {status: "completed"}`.
106
+
107
+ ### Phase 2: Claude Code 101
108
+
109
+ **Conditional:** Skip if `cc_experience` is "regularly" or "daily". Mark as `skipped` with reason in progress.json.
110
+
111
+ Deliver a 60-second overview covering ONLY these basics:
112
+ - Skills are invoked by typing `/skill-name` (for example, `/hormozi`, `/linkedin-copywriting`)
113
+ - Claude Code already sees all your installed skill descriptions -- just describe what you need and it finds the right skill
114
+ - Skills produce real output: copy, strategies, images, automations
115
+ - You can chain skills together in a single conversation
116
+
117
+ Do NOT cover: hooks, sub-agents, settings files, MCP servers, teams, or advanced orchestration. Those are Level 5 concepts.
118
+
119
+ Write `progress.json` with `cc101: {status: "completed"}` or `{status: "skipped", reason: "cc_experience=regularly"}`.
120
+
121
+ ### Phase 3: First Win
122
+
123
+ This is the most important phase. Generate a real, valuable output using ONE skill.
124
+
125
+ **Protocol:**
126
+ 1. Read `state/profile.json`
127
+ 2. Consider ALL loaded skill descriptions in your context
128
+ 3. Select the single best Level 0 skill (NO API keys required) that matches their profile
129
+ 4. Explain your choice: "Based on your profile -- [business_type] focused on [content_platform] with [biggest_challenge] -- I recommend starting with `/[skill-name]` because [specific reason]."
130
+ 5. Generate a custom context prompt they can use with that skill. For example: "Try typing: `/linkedin-copywriting` and then describe your business and target audience."
131
+ 6. WAIT for the user to try it and confirm before proceeding. Ask: "Go ahead and try it now. Let me know when you're ready to continue."
132
+
133
+ **Selection criteria:**
134
+ - Must be Level 0 (no API keys required)
135
+ - Must directly address their biggest_challenge or content_platform
136
+ - Prefer specific skills over general ones (e.g., `/linkedin-copywriting` over `/copywriting` for LinkedIn users)
137
+ - Never fabricate skill names -- only recommend skills that exist in your loaded context
138
+
139
+ Write `progress.json` with `first_win: {status: "completed", skill_recommended: "skill-name"}`.
140
+
141
+ ### Phase 4: Skill Map
142
+
143
+ Present a personalized overview of available skills organized by level. Show only levels relevant to their profile.
144
+
145
+ **Structure:**
146
+ - **Level 0 -- Foundation (available now):** Group by category relevant to their profile. Highlight 5-8 most relevant skills with one-line descriptions. Mention total count (check `~/.claude/skills/registry.json` for current `skill_count` — never hardcode).
147
+ - **Level 1 -- Google Workspace:** List capabilities unlocked (Gmail, Sheets, Docs, Calendar, Drive, Contacts, Slides). Note: "~15 minutes one-time setup."
148
+ - **Level 2 -- Creative and Data:** List key capabilities (AI image generation, voice synthesis, vision analysis, CRM). Note per-service setup time.
149
+ - **Level 3 -- Communication:** List capabilities (SMS, AI phone agents, web scraping). Note KYC requirements.
150
+ - **Level 4 -- Knowledge Management:** Mention Obsidian vault integration. Only highlight if user shows interest in knowledge management.
151
+ - **Level 5 -- Advanced:** Custom agents, multi-skill workflows, hook automation, custom skill creation. Mention for power users only.
152
+
153
+ Write `progress.json` with `skill_map: {status: "completed"}`.
154
+
155
+ ### Phase 5: Progressive Unlock
156
+
157
+ Recommend the NEXT level to unlock based on their profile. One level only -- do not overwhelm.
158
+
159
+ **Selection logic:**
160
+ - If they work with Google Workspace tools: recommend Level 1
161
+ - If they create visual content: recommend Level 2 (fal-ai, gemini-vision)
162
+ - If they need outreach automation: recommend Level 3 (twilio)
163
+ - Default: recommend Level 1 (broadest utility)
164
+
165
+ Provide the specific setup steps for that one level. Reference `/pushrec-skills` for future API key setup help.
166
+
167
+ Write `progress.json` with `unlock_guide: {status: "completed"}` and `completed_at: ISO-8601`.
168
+
169
+ **progress.json schema:** `{"version":"1.0.0", "started_at":"ISO", "completed_at":null, "phases":{"diagnostic":{"status":"completed"}, "profiling":{"status":"completed"}, "cc101":{"status":"skipped","reason":"cc_experience=regularly"}, "first_win":{"status":"completed","skill_recommended":"linkedin-copywriting"}, "skill_map":{"status":"completed"}, "unlock_guide":{"status":"completed"}}, "current_level":"L0", "skills_invoked":["linkedin-copywriting"], "api_keys_configured":[], "last_session_at":"ISO"}`
170
+
171
+ ---
172
+
173
+ ## Returning User Flow
174
+
175
+ If `state/profile.json` exists and `state/progress.json` shows incomplete onboarding:
176
+ 1. Read progress.json to find the last completed phase
177
+ 2. Greet: "Welcome back. You left off at [phase]. Ready to continue?"
178
+ 3. Resume from the next incomplete phase
179
+
180
+ If onboarding is complete, route based on their input signal (see Intent Detection).
181
+
182
+ If the user returns after a long gap (check `last_session_at`), offer a brief refresher:
183
+ - "It has been a while. Want a quick recap of your skill map, or do you have a specific question?"
184
+
185
+ Update `last_session_at` in progress.json at every session.
186
+
187
+ ---
188
+
189
+ ## Recommendation Protocol
190
+
191
+ When a user asks "which skill should I use for X?" or describes a need:
192
+
193
+ 1. **Parse the request** into: domain (marketing, sales, content, automation, research), platform (LinkedIn, YouTube, email), and output type (copy, strategy, image, automation)
194
+ 2. **Scan ALL skill descriptions** loaded in your context. You already have them -- do not read registry.json or any catalog file.
195
+ 3. **Select top 1-3 matches.** For each match, provide:
196
+ - Skill name (invocable as `/name`)
197
+ - WHY it matches their request (one sentence)
198
+ - API key requirement: "No setup needed" (L0) or "Requires [KEY_NAME]" (L1-L4)
199
+ 4. **Rank by specificity:** specific skills beat general ones. Single-purpose skills beat orchestrators unless the user explicitly needs a workflow.
200
+ 5. **If uncertain,** read the candidate skill's SKILL.md before recommending to verify fit.
201
+ 6. **Never fabricate skill names.** Only recommend skills that exist in your loaded context. If no skill matches, say so honestly.
202
+
203
+ Example: "For LinkedIn carousel posts, I recommend: 1. `/linkedin-copywriting` -- designed for LinkedIn content with proven copywriting psychology. No setup needed. 2. `/copywriting` -- broader foundations that work across platforms. No setup needed."
204
+
205
+ ---
206
+
207
+ ## Troubleshooting Protocol
208
+
209
+ When a user reports a problem ("X is not working", errors, unexpected behavior):
210
+
211
+ ### Step 1: Gather Information
212
+
213
+ Ask: Which skill? What command triggered the error? What error message? (Ask them to paste it.)
214
+
215
+ ### Step 2: Run Diagnostic
216
+
217
+ ```bash
218
+ python3 ~/.claude/skills/pushrec-skills/scripts/diagnostic.py
219
+ ```
220
+
221
+ Check for missing prerequisites, missing API keys, or license issues.
222
+
223
+ ### Step 3: Decision Tree
224
+
225
+ | Symptom | Likely Cause | Fix |
226
+ |---------|-------------|-----|
227
+ | "command not found: claude" | Claude Code not installed | Install from anthropic.com |
228
+ | "command not found: node" | Node.js not installed | Install from nodejs.org (v20+) |
229
+ | "ENOENT" or file not found | Skill not installed | Run `npx @pushrec/skills install --all` |
230
+ | Authentication/401 errors | Missing or expired API key | Guide through API key setup for that skill |
231
+ | "Permission denied" | File permission issue | `chmod +x` the script, or check directory permissions |
232
+ | Skill produces no output | Skill invocation issue | Verify skill name, try `/skill-name` syntax |
233
+ | Import errors in scripts | Missing Python dependencies | Check skill's requirements, run `pip install` or `uv run --with` |
234
+ | License validation fails | License issue | Run `npx @pushrec/skills auth login` to re-authenticate |
235
+ | Hook errors in session output | Broken or incompatible hook | Check `~/.claude/settings.json` hooks array, remove or fix the offending hook |
236
+ | Rate limit / throttle errors | API quota exceeded | Wait and retry, or check service dashboard for quota limits |
237
+ | "No space left on device" | Disk full | Free disk space, check `df -h` output |
238
+ | Version mismatch warnings | Claude Code outdated | Run `claude update` to update to latest version |
239
+
240
+ ### Step 4: Escalation
241
+
242
+ If the issue cannot be resolved through troubleshooting:
243
+ 1. Suggest posting in the community: **skool.com/pushrec-2909**
244
+ 2. Include in their post: skill name, error message, diagnostic output, steps already tried
245
+ 3. Mention live Q&A sessions in Skool for real-time help
246
+
247
+ ---
248
+
249
+ ## API Key Setup
250
+
251
+ When a user asks about setting up API keys or unlocking a specific level:
252
+
253
+ ### Step 1: Identify What They Need
254
+
255
+ Read `references/prerequisites.yaml` to check requirements for the requested skill or level.
256
+
257
+ ### Step 2: Guide by Level
258
+
259
+ **Level 1 -- Google OAuth2 (one-time, ~15 minutes):**
260
+ 1. Go to Google Cloud Console (console.cloud.google.com)
261
+ 2. Create a new project (or use existing)
262
+ 3. Enable required APIs: Gmail, Sheets, Docs, Calendar, Drive, Contacts, Slides
263
+ 4. Create OAuth 2.0 credentials (Desktop app type)
264
+ 5. Download the JSON credentials file
265
+ 6. Place it in the location specified by each skill (varies per skill -- check prerequisites.yaml)
266
+ 7. Run the skill's authenticate.py script to complete the OAuth consent flow
267
+
268
+ **Level 2 -- Individual API Keys (~2-5 minutes each):**
269
+ Walk through each service's signup:
270
+ - Provide the setup_url from prerequisites.yaml
271
+ - Tell them which env var to set in `~/.claude/.env`
272
+ - Format: `echo 'KEY_NAME=your-key-here' >> ~/.claude/.env`
273
+
274
+ **Level 3 -- Service Accounts (~10 minutes each):**
275
+ - Note KYC or billing requirements upfront
276
+ - Guide through account creation and credential setup
277
+ - Warn about usage-based billing where applicable
278
+
279
+ **Level 4 -- Obsidian:**
280
+ - Download from obsidian.md (free)
281
+ - Create or open a vault
282
+ - Run `/vault-manager` for guided vault setup
283
+
284
+ After setup, update `progress.json` with new entries in `api_keys_configured`.
285
+
286
+ ---
287
+
288
+ ## Update Guidance
289
+
290
+ When a user asks about updating skills or finding new ones:
291
+
292
+ ### Update Existing Skills
293
+ ```bash
294
+ npx @pushrec/skills update # Update all installed skills
295
+ npx @pushrec/skills update [name] # Update a specific skill
296
+ ```
297
+
298
+ ### Install New Skills
299
+ ```bash
300
+ npx @pushrec/skills install --all # Install any skills added since last install
301
+ npx @pushrec/skills list # See all available vs. installed
302
+ ```
303
+
304
+ ### Check System Health
305
+ ```bash
306
+ python3 ~/.claude/skills/pushrec-skills/scripts/diagnostic.py
307
+ ```
308
+
309
+ Note: `install --all` skips already-installed skills (no duplicates). Running it again after new skills are published picks up the new ones automatically. The `update` command handles version bumps for already-installed skills.
310
+
311
+ ---
312
+
313
+ ## Anti-Patterns
314
+
315
+ | Anti-Pattern | Correct Behavior |
316
+ |-------------|-----------------|
317
+ | Recommending skills not in loaded context | Only recommend skills you can see in the system context |
318
+ | Hardcoding skill-to-profile mappings | Read profile + scan descriptions dynamically every time |
319
+ | Dumping the full skill catalog | Show only relevant skills, grouped by the user's needs |
320
+ | Skipping the diagnostic on first run | Always run diagnostic.py in Phase 0 |
321
+ | Proceeding after critical failures | STOP and help fix prerequisites before continuing |
322
+ | Recommending L1+ skills without mentioning API key requirements | Always state the setup requirement alongside the recommendation |
323
+ | Hardcoding skill counts | Always query dynamically or use safe-floor estimates |
324
+
325
+ ### Verification Checklist
326
+
327
+ Before finishing any response, verify:
328
+ - Think step by step: Did I follow the correct protocol for this mode?
329
+ - Before you finish: Are all skill names I mentioned real skills in my loaded context?
330
+ - If you don't know: Am I certain about API key requirements, or should I check prerequisites.yaml?
331
+ - Did I update state files (profile.json, progress.json) if the user completed a phase?
332
+ - Did I provide clear next steps the user can act on?
333
+
334
+ ---
335
+
336
+ ## Quick Reference
337
+
338
+ | Need | Command or Action |
339
+ |------|-------------------|
340
+ | Start onboarding | Type `/pushrec-skills` |
341
+ | Find a skill | Describe what you need -- the LLM matches automatically |
342
+ | Set up API keys | Type `/pushrec-skills` and ask about API key setup |
343
+ | Update skills | `npx @pushrec/skills update` |
344
+ | Install new skills | `npx @pushrec/skills install --all` |
345
+ | List all skills | `npx @pushrec/skills list` |
346
+ | Check CLI version | `npx @pushrec/skills --version` |
347
+ | Get help | Post in skool.com/pushrec-2909 |
348
+ | Reset onboarding | Type `/pushrec-skills` and say "reset" |
349
+
350
+ ### Prerequisites
351
+
352
+ - **Claude Code subscription:** Pro ($20/mo) or Max ($100/mo) from anthropic.com
353
+ - **Node.js:** v20 or higher (nodejs.org)
354
+ - **npm:** included with Node.js
355
+
356
+ ### State Files
357
+
358
+ The `state/` directory is created automatically on first write. No manual setup needed.
359
+
360
+ | File | Purpose |
361
+ |------|---------|
362
+ | `state/profile.json` | Business profile from adaptive profiling |
363
+ | `state/progress.json` | Completed phases, unlocked levels, skills invoked |
364
+
365
+ **Error recovery:** If `profile.json` or `progress.json` fails to parse (corrupt JSON), offer the user a reset: `rm ~/.claude/skills/pushrec-skills/state/*.json` and restart onboarding.
366
+
367
+ ### Community
368
+
369
+ - **Skool:** skool.com/pushrec-2909
370
+ - **Live Q&A:** check Skool for scheduled sessions
371
+
372
+ ---
373
+
374
+ ## See Also
375
+
376
+ | Resource | Path | Purpose |
377
+ |----------|------|---------|
378
+ | Agent Skills Marketplace | `~/pushrec-vault/1-Projects/agent-skills-marketplace/` | License-gated skill distribution (ThriveCart + Convex + Vercel) |
379
+ | GTM Sprint | `~/pushrec-vault/1-Projects/gtm-sprint-claude-skills/` | Launch strategy, offer tiers, voice bible |
380
+ | Generative UI Dashboard | `~/.claude/skills/generative-ui/` | Visual dashboard with SkillBrowser (verify count via registry.json), SetupChecklist |
381
+ | Registry Runbook | `~/pushrec-vault/1-Projects/agent-skills-marketplace/registry/CLAUDE.md` | Zero-assumptions technical reference (687 lines) |
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env python3
2
+ """SessionStart hook for pushREC Skills onboarding nudge.
3
+
4
+ Reads progress.json and outputs a brief reminder if onboarding is incomplete.
5
+ Exit code 0 always — hooks must never fail the session.
6
+ """
7
+
8
+ import json
9
+ import os
10
+ import sys
11
+ from datetime import datetime, timezone
12
+
13
+ PROGRESS_FILE = os.path.expanduser(
14
+ "~/.claude/skills/pushrec-skills/state/progress.json"
15
+ )
16
+
17
+ # Canonical phase order for determining which phase comes next
18
+ PHASE_ORDER = [
19
+ ("diagnostic", "System Diagnostic"),
20
+ ("profiling", "Adaptive Profiling"),
21
+ ("cc101", "Claude Code 101"),
22
+ ("first_win", "First Win"),
23
+ ("skill_map", "Skill Map"),
24
+ ("unlock_guide", "Progressive Unlock"),
25
+ ]
26
+
27
+
28
+ def main():
29
+ # Prevent hook loops
30
+ if os.environ.get("stop_hook_active"):
31
+ return
32
+
33
+ # No progress file -> first-time user
34
+ if not os.path.exists(PROGRESS_FILE):
35
+ print(
36
+ "pushREC Skills: Welcome! Type /pushrec-skills to start your "
37
+ "personalized onboarding (takes ~30 min)."
38
+ )
39
+ return
40
+
41
+ # Read and parse progress
42
+ try:
43
+ with open(PROGRESS_FILE, "r") as f:
44
+ progress = json.load(f)
45
+ except json.JSONDecodeError as exc:
46
+ sys.stderr.write(f"pushrec-skills: progress.json parse error: {exc}\n")
47
+ return
48
+ except OSError as exc:
49
+ sys.stderr.write(f"pushrec-skills: progress.json read error: {exc}\n")
50
+ return
51
+
52
+ phases = progress.get("phases", {})
53
+ total_phases = len(PHASE_ORDER)
54
+ completed_count = sum(
55
+ 1
56
+ for p in phases.values()
57
+ if isinstance(p, dict) and p.get("status") in ("completed", "skipped")
58
+ )
59
+
60
+ # All phases done -- nothing to show
61
+ if completed_count >= total_phases:
62
+ return
63
+
64
+ # Determine the next incomplete phase
65
+ next_phase_name = None
66
+ for phase_key, phase_label in PHASE_ORDER:
67
+ phase_data = phases.get(phase_key, {})
68
+ if not isinstance(phase_data, dict) or phase_data.get("status") not in (
69
+ "completed",
70
+ "skipped",
71
+ ):
72
+ next_phase_name = phase_label
73
+ break
74
+
75
+ # Build the nudge message
76
+ prefix = ""
77
+ last_session_at = progress.get("last_session_at")
78
+ if last_session_at:
79
+ try:
80
+ last_dt = datetime.fromisoformat(last_session_at.replace("Z", "+00:00"))
81
+ now = datetime.now(timezone.utc)
82
+ days_since = (now - last_dt).days
83
+ if days_since > 7:
84
+ prefix = "Welcome back! It's been a while. "
85
+ except (ValueError, TypeError):
86
+ pass
87
+
88
+ if next_phase_name:
89
+ print(
90
+ f"{prefix}pushREC Skills: {completed_count}/{total_phases} phases complete. "
91
+ f"Next up: {next_phase_name}. Type /pushrec-skills to continue."
92
+ )
93
+ else:
94
+ print(
95
+ f"{prefix}pushREC Skills: {completed_count}/{total_phases} phases complete. "
96
+ "Type /pushrec-skills to continue where you left off."
97
+ )
98
+
99
+
100
+ if __name__ == "__main__":
101
+ try:
102
+ main()
103
+ except Exception:
104
+ pass # Never crash the session
105
+ sys.exit(0)