Repository navigation
Conversation
…art of apache#1497) Implement Pilot 2 of Issue apache#1497: add zero-token /magpie-status slash command in plugins/magpie-setup using Claude Code's mod system. - Register /magpie-status during session.start hook with immediate: true. - Hook command.run on magpie-status to execute canonical collect_status.py deterministically via $.process.run with zero tokens and zero model turns. - Support default markdown table format and --format json / --format=json / --json flag overrides. - Try python3 first, falling back cleanly to python on command-not-found or process failure, with actionable diagnostic error text. - Pass PYTHONIOENCODING: utf-8 and defensively wrap stdout reconfiguration in collect_status.py to guarantee safe unicode output across all platforms. - Add 10 comprehensive unit and engine tests in status-command.test.ts. - Normalize path separators in drift-check.test.ts for cross-platform mock matching on Windows, macOS, and Linux. - Update docs/when-to-use-mods.md and status/SKILL.md to document the new command while preserving universal /magpie-setup status skill for non-Claude harnesses. Generated-by: Antigravity
Contributor
Author
|
Ready for review! |
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
/magpie-statusinplugins/magpie-setupusing Claude Code's mod system ($.command.registerandcommand.run), rendering the adoption and health dashboard instantly with zero LLM turns and zero tokens consumed.collect_status.pyvia$.process.run(supporting--format mddefault and--format json/--format=json/--jsonoverrides, with automaticpython3->pythonfallback). This avoids duplicating 770+ lines of Python adoption logic in TypeScript while keeping the universal/magpie-setup statusskill 100% operational for non-Claude harnesses.collect_status.pyagainst Windows consolecp1252encoding errors, and normalized path separators indrift-check.test.tsfor cross-platform mock matching.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)plugins/magpie-setup/hooks/)Test plan
check-claude-modsscript (tools/dev/check-claude-mods.sh) passes:claude plugin validate --strict plugins/magpie-setuppasses with zero errors.claude plugin test plugins/magpie-setuppasses all 19 tests across 2 files (9 indrift-check.test.ts, 10 instatus-command.test.ts).uv run pytest plugins/magpie-setup/skills/status/tests/passes all 18 tests (100%).uv run ruff check plugins/magpie-setup/skills/status/scripts/collect_status.pypasses with zero violations.uv run ruff format --check plugins/magpie-setup/skills/status/scripts/collect_status.pypasses (already formatted).git diff --checkpasses with zero whitespace or line-ending warnings.collect_status.py --format md --repo .and--format json --pretty --repo .execute cleanly.RFC-AI-0004 compliance
/magpie-statusis strictly read-only; mutation remains gated via thesetupskill./magpie-setup status) remains completely functional for non-Claude harnesses (Gemini CLI, Codex, Cursor).Linked issues
Refs #1497 (Pilot 2)
Notes for reviewers (optional)
collect_status.pydeterministically via$.process.run.$across imported module boundaries. Hook registration (session.startandcommand.run) lives directly indrift-check.ts(keepinghooks/hooks.jsonto a single module entrypoint), while execution logic is delegated to the pure, testableexecuteMagpieStatushelper instatus-command.ts.drift-check.test.tswas updated to normalize Windows backslashes (\) to/in mock path endsWith checks so that the plugin test suite passes locally on Windows as well as in CI.collect_status.pynow defensively reconfigures stdout encoding to UTF-8 (try...except) to preventcharmapencode exceptions on Windowscp1252terminals when rendering status indicator emojis.