whyguard: Skill for Kiro

.kiro/skills/trace-historical-decision/SKILL.md

trace-historical-decision is a skill for Kiro from rosselps/whyguard. It costs 37 tokens per session (434 once invoked), scanned A, original, MIT.

A procedure for finding the historical reason behind a code condition, constant, retry, timeout, validation, workaround, or regression test. A regression test checks that a previously protected behavior still works after changes.

In plain words
What is it for?
Use it before simplifying or deleting suspicious historical code. It identifies the exact code, reviews supporting evidence, states the behavior being protected, and suggests a test for that behavior.
Why use it?
It helps prevent removing code whose purpose is easy to miss, especially around payments, authentication, orders, dates, or external services. If the history is unclear, it requires saying that instead of guessing.

Skill for Kiro

Written for Kiro: installed under .kiro/.

This is rosselps/whyguard's own configuration. It tells Kiro how to work on whyguard itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything whyguard configures →

Reuse

Borrowing it

Nothing to install: this file belongs to rosselps/whyguard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/rosselps/whyguard/main/.kiro/skills/trace-historical-decision/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/rosselps/whyguard

Made for: Kiro.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for trace-historical-decision

README.md
[![agentmods](https://agentmods.dev/badge/skills/rosselps/whyguard/trace-historical-decision.svg)](https://agentmods.dev/skills/rosselps/whyguard/trace-historical-decision)
Your own site
<a href="https://agentmods.dev/skills/rosselps/whyguard/trace-historical-decision"><img src="https://agentmods.dev/badge/skills/rosselps/whyguard/trace-historical-decision.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 434 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.00434
Opus 5 $0.00018 $0.00217
Sonnet 5 $0.00007 $0.00087
Haiku 4.5 $0.00004 $0.00043

Measured 7d ago against content hash a21a47cf4e6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

trace-historical-decision scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.kiro/skills/trace-historical-decision/SKILL.md · 38 lines

What it actually says

When to use this skill

Before removing, simplifying, or "cleaning up" a condition, guard clause, retry, timeout, validation call, or special-case branch — especially in payments, auth, orders, dates, or external-API code — trace why it exists first.

Workflow

  1. Identify the exact file, symbol, and changed lines you are about to touch.
  2. Run the deterministic scan against the relevant commit range:
    pnpm whyguard scan --base <base-ref> --head <head-ref> --format json
    
    (Today this is the CLI vertical slice; once the MCP server ships, prefer calling whyguard.trace_symbol instead.)
  3. Review every evidence ID and its strength (strong / medium / weak) — never treat evidence as reliable without checking strength.
  4. State the protected behavior separately from the current implementation. Example: "protects: one idempotency key creates at most one order" vs. "implemented via: an early-return guard checking a Map".
  5. If evidence is weak or absent, say explicitly that the reason is unknown. Do not invent an incident, issue, or justification.
  6. Propose a regression test that encodes the protected behavior before suggesting removal or replacement of the historical code.

Anti-patterns to avoid

  • Removing a guard clause because it "looks redundant" without running a trace first.
  • Citing an issue/PR number from memory instead of the evidence returned by the tool.
  • Treating weak evidence as if it were strong.
  • Concluding "no evidence found" without checking the introducing commit via git log -S.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 38 lines · 37 tokens per session scan A a21a47cf4e6f

Subscribe to this mod's changes

trace-historical-decision is a skill published in the GitHub repository rosselps/whyguard (0 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 434 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

static-code-analysis

Selects, configures, and integrates a static analysis tool for the project's language. Covers tool selection, rule configuration, CI integration, fixing existing violations, and pre-commit hook setup. Invoked when the user asks to add linting, set up static analysis, or configure a code quality tool.

soulcodex/agentic · 65 tokens

mypy

Skill "mypy" from bobmatnyc/claude-mpm, covering mypy - static type checking for python, basic mypy, with common type stubs, for fastapi projects and for django projects.

bobmatnyc/claude-mpm · 24 tokens

grafema-codebase-analysis

Analyze codebases using a graph database instead of reading source files. Use when understanding code architecture, finding functions or call patterns, tracing data flow, checking dependencies, or answering "where is X used?" questions. Grafema builds a queryable code graph from static analysis — prefer querying the…

Disentinel/grafema · 69 tokens

code_explorer

Explores the repository to locate primary source files, coupled UI components, and test files for bug reports or feature requests.

google-gemini/gemini-cli · 28 tokens

session-investigator

Investigate fast-agent session and history files to diagnose issues. Use when a session ended unexpectedly, when debugging tool loops, when correlating sub-agent traces with main sessions, or when analyzing conversation flow and timing. Covers session.json metadata, history JSON format, message structure, tool…

evalstate/fast-agent · 68 tokens

smiles-validation

Strict SMILES validation, structural comparison, and modification verification. Catches invalid LLM-generated molecules.

synthetic-sciences/openscience · 24 tokens