Skip to content
Back to skills

Trace Why

ASecurity

Explain why a line, function or behavior exists by following git blame → commit → Change-Id trailer → OpenSpec change (proposal, design, specs). Use when code is unclear, looks wrong or redundant, before deleting or "simplifying" something, or when the user asks "why is this here".

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 24, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned November 24, 2026

npx -y skills add Vlad-Movchan/specjig --skill trace-why --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Trace Why?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Trace Why
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vlad-movchan-trace-why/badge)](https://www.skillsdirectory.com/skills/vlad-movchan-trace-why)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: trace-why
description: Explain why a line, function or behavior exists by following git blame → commit → Change-Id trailer → OpenSpec change (proposal, design, specs). Use when code is unclear, looks wrong or redundant, before deleting or "simplifying" something, or when the user asks "why is this here".
---

# Trace why

Do not guess intent from code. Follow the chain and quote what was decided.

1. **Blame the line(s).** Ignore pure formatting and move commits:
   ```bash
   git blame -w -C -C -L <start>,<end> --porcelain <file>
   ```
   If the last commit is a refactor/format commit (`Change-Id: none`), blame its parent:
   `git blame <sha>^ -L … <file>` and repeat until you reach a commit with a real Change-Id.
2. **Read the trailer.**
   ```bash
   git log -1 --format='%H%n%s%n%(trailers:key=Change-Id,valueonly)' <sha>
   ```
3. **Open the change.** `openspec/changes/<id>/` if still active, else
   `openspec/changes/archive/*-<id>/`. Read `proposal.md` (why), `design.md` (how,
   alternatives rejected), `challenge.md` (edge cases decided), `tests.md` and the delta specs.
4. **Check the current contract.** `npx openspec show <capability> --type spec` shows the
   requirement as it stands today (later changes may have modified it).
5. **Answer** with: the requirement or decision that explains the line, links to the files,
   and whether the current code still matches it. If the trail breaks (no trailer, change
   missing), say so explicitly and only then fall back to reading surrounding code and tests.

Search locally before asking a human or a tracker:
`grep -rn "<term>" openspec/specs openspec/changes`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.