plugins/dev/skills/discipline/debug-shared-init/SKILL.md
Shared initialization for debugging workflows — session setup, stack detection, reproduction, and bug report generation. Used by /dev:debug and /dev:fix.
npx skillsauth add madappgang/magus debug-shared-initInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Reference patterns for the initialization phase common to all debugging workflows in the
dev plugin. Calling commands set ${SESSION_PREFIX} before this material applies.
${SESSION_PATH} is derived from the session directory creation step below.
Create a uniquely-named session directory under ai-docs/sessions/. The prefix is
set by the calling command (e.g., "dev-debug-quickfix", "dev-debug",
"dev-debug-prodfix").
SESSION_BASE="${SESSION_PREFIX}-$(date +%Y%m%d-%H%M%S)-$(head -c4 /dev/urandom | xxd -p)"
SESSION_PATH="ai-docs/sessions/${SESSION_BASE}"
mkdir -p "${SESSION_PATH}"
echo "Session: ${SESSION_BASE}"
echo "Path: ${SESSION_PATH}"
The entropy suffix (xxd -p of 4 random bytes) prevents collisions between sessions
started within the same second. Always use this exact form — do not shorten or omit
the random component.
Delegate to the dev:stack-detector agent to detect the project's technology stack,
test runner, and file patterns. Pass the session path and the bug description for
context. The agent saves its output to ${SESSION_PATH}/context.json.
Agent prompt template:
SESSION_PATH: ${SESSION_PATH}
Detect technology stack, test runner, and test file patterns for this project.
Bug description for context: {BUG_DESCRIPTION}
Save results to: ${SESSION_PATH}/context.json
Include fields: stack, test_runner_command, full_suite_args, test_file_patterns,
lint_command, typecheck_command
After the agent completes, read ${SESSION_PATH}/context.json to extract
test_runner_command, full_suite_args, and stack for use in subsequent phases.
| Field | Example | Usage |
|---|---|---|
| stack | "react-typescript" | Selects quality-check commands |
| test_runner_command | "bun test" | Prefixed with CI=true for reproduction |
| full_suite_args | "--coverage" | Appended for full-suite validation runs |
| test_file_patterns | ["**/*.test.ts"] | Used to scope grep searches to test files |
| lint_command | "bun run lint" | Run during VALIDATE phase |
| typecheck_command | "bun run typecheck" | Run during VALIDATE phase |
If the bug description contains reproduction steps (a test path, command, or explicit
reproduce: block), attempt reproduction immediately after reading context.json:
CI=true {test_runner_command} {test_args_from_bug_description}
Interpretation rules:
context.jsonDo not block on failed reproduction. If no reproduction steps are present in the bug description, skip this step and proceed directly to localization.
Write ${SESSION_PATH}/bug-report.md after reproduction attempt. This file serves
as the monitoring baseline (error signature) and handoff document for the debugger agent.
# Bug Report
## Error Signature
{exact error message string — used for monitoring baseline; quote verbatim if available}
## Stack Trace
{paste verbatim if provided by user, else "Not provided"}
## Reproduction Path
{shell command or test path that triggers the bug, or "Confirmed via test: {path}",
or "Not reproducible via automated test — see description"}
## Affected File Candidates
{file paths from grep/stack trace scan, or "None found — proceeding to localization"}
## Existing Failing Test
{absolute path to test file if a matching failing test was found, else "None found"}
## Test Runner
{value of test_runner_command from context.json}
## Stack
{value of stack from context.json}
All sections are required. Use the exact literal strings shown above for absent data
(e.g., "Not provided", "None found"). Downstream agents check for these sentinel
values to branch their logic.
Strip recognized flag tokens from $ARGUMENTS before passing the description to any
agent. The clean string is BUG_DESCRIPTION.
Flags are tokens that begin with --. Scan left-to-right and collect all --token
values. Everything that is not a flag token (or a bare -- terminator) is literal
bug description text. After a bare --, all remaining tokens are literal text
regardless of leading dashes.
| Flag | Variable | Default |
|---|---|---|
| --review | ENABLE_REVIEW=true | false |
| --tdd | ENABLE_TDD=true | false |
| --interactive | INTERACTIVE=true | false |
| Flag | Variable | Default |
|---|---|---|
| --interactive | INTERACTIVE=true | false |
| --no-review | SKIP_REVIEW=true | false |
| --unanimous | CONSENSUS_MODE=unanimous | 2/3 STRONG |
| --no-monitor | SKIP_MONITOR=true | false |
After parsing, write ${SESSION_PATH}/config.json with all resolved values and the
calling scope name:
Quick-patch example:
{"review": false, "tdd": false, "interactive": false, "scope": "quick-patch"}
Production-grade example:
{"interactive": false, "skip_review": false, "unanimous": false, "skip_monitor": false, "scope": "production-grade"}
BUG_DESCRIPTION is not saved to config.json — it lives only in the orchestrator's
working context and is injected inline into agent prompts.
testing
A test skill for validation testing. Use when testing skill parsing and validation logic.
tools
--- name: bad-skill description: This skill has invalid YAML in frontmatter allowed-tools: [invalid, array, syntax prerequisites: not-an-array --- # Bad Skill This skill has malformed frontmatter that should fail parsing. The YAML has: - Unclosed array bracket - Wrong type for prerequisites (should be array, not string)
development
Sync model aliases from the curated Firebase database. Fetches default model assignments, short aliases, team compositions, and known model metadata from the claudish API. Run this to get fresh model recommendations.
tools
Release one or more Magus plugins to the distribution repos (magus, magus-alpha, magus-marketing). Handles version inference from git history, marketplace.json updates, tagging, and force-push to lean dist repos. Use whenever the user says "release kanban", "release the dev plugin", "cut a new version of gtd", "bump kanban to 1.7", or hands you a batch like "release kanban and gtd". Also use for multi-plugin releases and for checking what a release would contain before committing.