feat: one-time GitHub star prompt at Stand Down#117
Merged
Conversation
Collaborator
Author
|
Reviewed and addressed in Changes
Verification
|
Asks users once whether they would like to star the repo on a successful Stand Down. Pattern follows Q00/ouroboros: pure markdown directive in SKILL.md, gh CLI for auth + idempotent PUT, ~/.nelson/prefs.json with a single star_asked flag merged via inline python3 heredoc. Skips silently when gh is unavailable, when the user is unauthenticated, when the mission outcome was not achieved, or when star_asked is already set. Either answer (Star Nelson / Maybe later, plus any custom Other response) locks the prompt forever, across all Nelson projects on the same machine user. Closes nelson-4yt.
Address PR 117 review feedback:
- Reader heredoc for ~/.nelson/prefs.json now matches the writer's
defensive shape (handles missing file, malformed JSON, non-dict
top-level) so a corrupted prefs file skips silently rather than
surfacing a Python traceback in chat.
- Gate the prompt on stand-down.json's outcome_achieved on disk via
MISSION_DIR (with {mission-dir} fallback) instead of relying on the
model remembering whether --outcome-achieved was passed minutes
earlier. SKIP_NO_STAND_DOWN / SKIP_OUTCOME_NOT_ACHIEVED give the
model an explicit, observable signal.
- Document the gh api PUT as idempotent and call out the canonical
slug (harrymunro/nelson) once at the top of the directive.
- Move the README explainer below the star-history image and under a
dedicated "How the star prompt works" subhead so the section still
leads with the chart.
bf20cbc to
b68cdd4
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.
Summary
SKILL.md— no new Python module, subcommand, event type, or test surface.{"star_asked": true}in~/.nelson/prefs.jsonso the prompt is one-shot per user across all Nelson projects on the same machine.Behaviour
The directive tells Claude to:
gh auth statusfails or~/.nelson/prefs.json["star_asked"]is alreadytrue.AskUserQuestionwith two options: Star Nelson / Maybe later.gh api -X PUT /user/starred/harrymunro/nelson(idempotent — no pre-check needed). On API failure, print a friendly note and continue; never block Stand Down.star_asked: trueinto prefs via inlinepython3 -<<'PY'heredoc, preserving any existing keys.Out of scope (deferred per issue notes)
NELSON_NO_STAR_PROMPTenv var (manual workaround documented in README)./nelson-starslash command.Test plan
scripts/check-references.shpasses (no broken cross-references).pytest skills/nelson/scripts/— 278 tests pass.pytest hooks/— 52 tests pass.HOME: fresh-create, key-preservation merge, read-back idempotency, missing-file branch all behave correctly.gh auth logout→ prompt skipped, Stand Down completes.outcome_achieved=false→ prompt skipped.Closes nelson-4yt.