Repository navigation
feat: local-dev config, sign-in notifier, and internal simplification - #82
Conversation
Central configuration + local-dev environment:
- Add scripts/lib/config.js: one precedence resolver (env > settings >
dev-bundle > prod) for all URLs/ids/knobs, plus a single SKILLMETER_ENV=dev
master switch (isolated ~/.skillbench-dev + dev endpoints, real sign-in flow).
- paths.js sources STATE_DIR/CRED_FILE from config; migrate scattered resolvers
(license-activation, signin, jwt, github-api, transfer, retry_daemon, banner).
- De-duplicate the triplicated JWT decoder (-> lib/jwt) and the two org
normalizers (-> lib/org-scope).
Sign-in success/failure notifier (FileChanged):
- credstore writes a dedicated STATE_DIR/signin-result.json sentinel on
interactive sign-in completion (kept separate from credentials.json, which
refresh rewrites often).
- SessionStart registers it via hookSpecificOutput.watchPaths; a FileChanged
hook (on_signin_result.js) surfaces the result (welcome banner + OSC 777
notification) without the user re-running /skillmeter:signin. Deduped by ts.
Banner redesign:
- Compact content-sized box, "SkillMeter · skillbench" branding, no ANSI
(the systemMessage renderer prints escapes literally).
- welcomeBanner shows the current repo's actually-tracked org
(getRepoScopeDecision) instead of the full org membership.
- New telemetryActiveBanner shown when telemetry is capturing this session.
- Sign-in banner shows after /skillmeter:signout (signed_out still blocks
silent gh auto-relogin, but no longer suppresses the nudge).
Internal simplification (output byte-identical, verified via golden diff):
- Collapse the two divergent telemetry gates into one (runHook resolves the
gate once; session_start reacts via options.onGate).
- Remove the dead 401/403 -> refresh -> unauth retry ladder in transfer.js.
- Shrink logger.js to export only { runHook }; consumers import from lib/*.
Housekeeping:
- Migrate monitor declaration to experimental.monitors in plugin.json.
- Bump plugin version to 0.17.0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (20)
Disabled knowledge base sources:
WalkthroughThis PR centralizes Skillmeter configuration resolution in a new lib/config.js module, refactors credstore.js to add atomic writes, license-validity checks, and a sign-in result sentinel, introduces an on_signin_result.js notifier wired via hooks.json, simplifies logger.js's hook gating to a single ChangesSkillmeter centralized config, credstore sentinel, and hook refactor
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Signin as signin.js
participant Credstore as credstore.js
participant Hooks as hooks.json Watcher
participant Notifier as on_signin_result.js
participant Banner as banner.js
Signin->>Credstore: writeSigninResult(status, ts)
Hooks->>Notifier: FileChanged signin-result.json
Notifier->>Credstore: readSigninResult()
alt already notified for ts
Notifier-->>Notifier: exit silently
else success
Notifier->>Banner: welcomeBanner(repoScopeDecision)
Notifier-->>Notifier: emit OSC 777 + systemMessage
else failure
Notifier-->>Notifier: emit error message + retry instruction
end
Possibly related PRs
Suggested reviewers: Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
A batch of plugin improvements: a central config module with a one-switch local-dev environment, an event-driven sign-in success/failure notifier, a banner redesign, and internal control-flow simplification. Prod behavior is preserved (verified byte-identical via a before/after golden diff across all telemetry-gate modes).
What's included
Central config + local-dev environment
scripts/lib/config.js: single precedence resolver (env > settings > dev-bundle > prod) for every URL/id/knob, plus aSKILLMETER_ENV=devmaster switch → isolated~/.skillbench-dev+ dev endpoints, keeping the real GitHub sign-in/refresh flow.paths.jssourcesSTATE_DIR/CRED_FILEfrom config; scattered resolvers migrated.lib/jwt), one org normalizer (lib/org-scope).Sign-in notifier (FileChanged)
STATE_DIR/signin-result.jsonsentinel written by the background sign-in poller (success/failure/discarded).SessionStartregisters it viawatchPaths; aFileChangedhook (on_signin_result.js) surfaces the outcome (welcome banner + OSC 777 desktop notification) without re-running/skillmeter:signin. Deduped byts.Banner redesign
SkillMeter · skillbenchbranding, no ANSI (thesystemMessagerenderer prints escapes literally).welcomeBannershows the current repo's actually-tracked org (getRepoScopeDecision) instead of the full org membership.telemetryActiveBannerwhen telemetry is capturing this session./skillmeter:signout(thesigned_outsentinel still blocks silent gh auto-relogin, but no longer suppresses the nudge).Internal simplification (output byte-identical)
runHookresolves the gate once;session_startreacts viaoptions.onGate).401/403 → refresh → unauthretry ladder intransfer.js.logger.jsto export only{ runHook }; consumers import fromlib/*.Housekeeping
experimental.monitorsinplugin.json.Verification
node --test skillmeter/test/harness.test.js→ 20/20.claude plugin validate skillmeter→ ✔ passed.Not yet verified (needs a live session)
watchPaths/FileChangedactual firing on the home-dir sentinel, create-event behavior, and min host version. Degrades gracefully (older Claude Code ignoreswatchPaths→ falls back to the re-run UX).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes