From taches-principled
Traces bugs backward through the call stack to find the original invalid data or incorrect behavior trigger
How this skill is triggered — by the user, by Claude, or both
Slash command
/taches-principled:root-cause-tracing [error description or symptom][error description or symptom]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
IF an error occurs deep in execution with a long call chain → trace backward one level at a time to find the original trigger
IF an error occurs deep in execution with a long call chain → trace backward one level at a time to find the original trigger IF unable to trace manually because of missing context → add instrumentation (stack trace logging) before the failure point, not after IF the immediate cause is obvious but its origin is unclear → trace one more level up: "what called this, and with what value?" IF a test case pollutes global state but the source is unknown → bisect across tests to isolate the first polluter IF multiple layers of validation could prevent recurrence → add defense-in-depth at each layer after fixing the source
Bugs manifest deep in the call stack. Every error has an original trigger upstream from where it surfaces. Fix at the source, not the symptom.
Never fix where the error appears. Trace backward through the call chain until you find where invalid data or incorrect behavior originated. Then fix at the source and add validation at every layer between source and symptom.
When manual tracing hits a dead end:
// Before the problematic operation — log context, not just the error
const stack = new Error().stack;
console.error('DEBUG [operation]:', { input, cwd, stack });
console.error() in tests (logger may be suppressed in test output)A root cause identified at its source with layered validation preventing recurrence. The fix includes:
Forward tracing (from entry point to error) follows the happy path. Backward tracing (from error to entry point) follows the actual execution path. These can diverge when invalid state enters mid-execution.
Logging before a failure captures the state that caused the failure. Logging after captures the error but loses the cause context. Always instrument before the dangerous operation.
Fixing the source is necessary but not sufficient. Add validation at intermediate layers so the next similar bug is caught earlier. The fix is complete when the bug is impossible to reintroduce at any layer.
npx claudepluginhub git-fg/taches-principled --plugin tp-session-auditProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.