Skip to content

refactor(plugin): file logging, install diagnostics, and UI polish#180

Merged
onlycastle merged 7 commits intomainfrom
refactor/plugin-logging-and-ui-polish-20260321
Mar 21, 2026
Merged

refactor(plugin): file logging, install diagnostics, and UI polish#180
onlycastle merged 7 commits intomainfrom
refactor/plugin-logging-and-ui-polish-20260321

Conversation

@onlycastle
Copy link
Owner

Summary

  • Plugin diagnostics: Logger now writes to ~/.betterprompt/debug.log with timestamps; native-deps captures npm output and surfaces actionable error hints
  • Rate limit resilience: SKILL.md updated with longer cooldowns (60s/90s) and progressive backoff for Phase 2 analysis skills on Claude Max
  • UI polish: New sketch-shadow CSS system (--shadow-sketch variables) applied across diagnosis, strengths, activity, and narrative report cards

Changes

  1. refactor(plugin): add file logging and install diagnostics — logger.ts, native-deps.ts
  2. docs(plugin): add rate limit strategy and troubleshooting guide — SKILL.md, README.md, .mcp.json
  3. chore(plugin): rebuild dist artifacts — dist chunk rebuild
  4. style: add sketch shadow system and polish report cards — 8 CSS modules + variables.css
  5. chore: update next-env.d.ts for Next.js dev types path — auto-generated

Test Plan

  • TypeScript compiles without errors
  • All 452 tests pass
  • Manual: verify plugin debug log appears at ~/.betterprompt/debug.log
  • Manual: verify sketch shadow styling on report cards

Generated with Claude Code using /ship-it

onlycastle and others added 5 commits March 21, 2026 08:17
Logger now writes all messages to ~/.betterprompt/debug.log (timestamped)
in addition to stderr. native-deps captures npm output and includes
actionable hints in error messages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SKILL.md: longer cooldowns (60s/90s) between Phase 2 skills to prevent
cascading rate limits on Claude Max. README: troubleshooting section with
common issues and verify-plugin.sh reference. MCP config: use
CLAUDE_PLUGIN_ROOT variable for portable server entry path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rebuilt plugin dist after logger and native-deps source changes.
New chunk hashes replace previous build output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New --shadow-sketch CSS variables for hand-drawn card elevation effect.
Applied across diagnosis, strengths, activity, type-result, and narrative
components for a cohesive sketch-style visual language.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Auto-generated path update: .next/types → .next/dev/types

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@onlycastle
Copy link
Owner Author

Code Review

Found 2 issues (from 9 candidates, filtered at score ≥ 80):

  1. docs/agent/PLUGIN.md not updated for logger behavior change (CLAUDE.md says: "When you add new files, change directory structure, modify the pipeline… update the relevant docs/agent/ doc in the same change")
    logger.ts now writes all messages to ~/.betterprompt/debug.log unconditionally — the PLUGIN.md description still says "Structured stderr logger" and the Local Files table doesn't mention the new log file.

    /**
    * Debug Logger
    *
    * Logging utility for the BetterPrompt plugin.
    * Writes to both stderr and ~/.betterprompt/debug.log.
    * Stderr output is gated by BETTERPROMPT_DEBUG=1;
    * the log file always receives all messages.
    *
    * Output format: [bp:<tag>] <message> {optional JSON}\n
    */

  2. README references scripts/verify-plugin.sh which is not committed in this PR — users following the Troubleshooting section will get "file not found". Either commit the script or remove the reference.

    BetterPrompt/README.md

    Lines 73 to 76 in 68bce01

    If the plugin isn't working, run the verification script:
    ```bash
    bash scripts/verify-plugin.sh


Filtered out (score < 80):

  • dirEnsured latch on failure (40) — best-effort logging by design
  • dataDir vs installDir redundancy (50) — harmless, npm handles dirs
  • Incomplete font alias migration (30) — pre-existing, not introduced by this PR
  • Module docstring "fallback" framing (0) — pre-existing, unchanged
  • README "8 components" lists 6 (70) — minor doc count mismatch
  • Comment overstates stderr capture (45) — stdout IS captured

Generated with Claude Code

If useful, react with a thumbs-up. Otherwise, thumbs-down.

onlycastle and others added 2 commits March 21, 2026 09:18
Logger description now reflects file + stderr output.
Added ~/.betterprompt/debug.log to Local Files table.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Checks 8 plugin components (location, build artifacts, native deps,
MCP config, registration, data dir, server startup, sessions) and
reports what's broken with fix instructions. Referenced by README
troubleshooting section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@onlycastle onlycastle merged commit a42c4c4 into main Mar 21, 2026
1 check passed
@onlycastle onlycastle deleted the refactor/plugin-logging-and-ui-polish-20260321 branch March 21, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant