feat(hooks): SessionStart hook auto-injects Purchasely skill pointers#5
Merged
Conversation
3 tasks
724648c to
d5952b3
Compare
…inters
Lets Claude/Cursor/Copilot CLI know the integrate/review/debug skills and
/purchasely:question command exist as soon as a session starts, without the
user having to type a slash command first.
Files:
- hooks/hooks.json — Claude Code plugin hook config (startup|clear|compact)
- hooks/hooks-cursor.json — Cursor hook config
- hooks/session-start — POSIX shell script, zero deps, emits JSON in the
correct envelope per host (Claude Code's
hookSpecificOutput, Cursor's additional_context,
or the generic additionalContext)
- hooks/run-hook.cmd — polyglot cmd/bash wrapper for Windows (Git Bash/WSL)
- hooks/intro.md — short pointer text injected into context
- .claude-plugin/plugin.json — references hooks/hooks.json
Tested locally: all three output envelopes produce valid JSON.
d5952b3 to
d3e617d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objectif
Ajouter un hook
SessionStartqui injecte automatiquement un court pointer vers les skills Purchasely (integrate,review,debug) et la commande/purchasely:questionà chaque démarrage de session, sur le modèle d'obra/superpowers/hooks/.Sans ce hook, l'utilisateur doit explicitement taper
/purchasely:questionou nommer la skill ; avec, Claude / Cursor / Copilot CLI savent que le plugin est disponible dès le démarrage.Fichiers ajoutés
hooks/hooks.jsonmatcher: "startup|clear|compact")hooks/hooks-cursor.jsonsessionStart)hooks/session-starthooks/run-hook.cmdhooks/intro.md.claude-plugin/plugin.json./hooks/hooks.jsonDétection du format de sortie
Le script
session-startdétecte le host via variables d'environnement et émet :CLAUDECODE=1ouCLAUDE_PLUGIN_ROOTdéfini) →{"hookSpecificOutput": {"hookEventName": "SessionStart", "additionalContext": "..."}}CURSOR_AGENTouCURSOR_TRACE_ID) →{"additional_context": "..."}{"additionalContext": "..."}Contenu injecté
Court paragraphe + bullet list pointant vers les 3 skills et la slash command — pas un dump du contenu des skills, juste un signal que le playbook existe. Voir
hooks/intro.md. ~25 lignes.Tests locaux
Tous valident comme JSON correct.
Acceptance criteria
/bin/sh+awkPOSIX).CHANGELOG.mdmis à jour :### Added— SessionStart hook auto-injects Purchasely skill pointers.Generated by Claude Code