/project-toolkit:chestertons-fencefrom project-toolkit
Investigates historical context of existing code, patterns, or constraints before proposing changes. Automates git archaeology, PR/ADR search, and dependency analysis to prevent removing structures without understanding their purpose.
Ships in project-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Enforce epistemic humility before changing existing systems. Understand original purpose before proposing changes.
# Investigate why code exists before changing it
/chestertons-fence "path/to/file.py" "remove unused validation"
# Investigate an ADR before deprecating it
/chestertons-fence "docs/architecture/ADR-005.md" "allow bash scripts"
| Phrase | Context |
|---|---|
why does this exist | Investigating existing code or patterns |
chestertons fence | Explicit investigation request |
before removing | Planning deletion or replacement |
investigate history | Researching original rationale |
prior art investigation | ADR-required investigation |
| Input | Output | Destination |
|---|---|---|
| File path or ADR number | Investigation report | .project-toolkit/analysis/NNN-chestertons-fence-TOPIC.md |
| Component description | Historical context summary | stdout (JSON) |
Use this skill BEFORE proposing changes to existing:
1. Identify Structure What exists? Where is it defined?
|
v
2. Git Archaeology git log, git blame to find origin commit
|
v
3. PR/ADR Search Find the PR or ADR with original rationale
|
v
4. Dependency Analysis What references or depends on this?
|
v
5. Generate Report Fill the investigation template
|
v
6. Decision REMOVE | MODIFY | PRESERVE | REPLACE
Step 1: Identify Structure. Locate the exact file, function, pattern, or constraint under investigation. Record its current form.
Step 2: Git Archaeology. Run git log --follow and git blame on the target. Identify the commit that introduced it, the author, and the date.
Step 3: PR/ADR Search. Search for the originating PR using gh pr list --search. Check ${AWESOME_AI_ARCHITECTURE_DIR:-.project-toolkit/architecture} for related ADRs (default .project-toolkit/architecture). Look for comments explaining intent.
Step 4: Dependency Analysis. Use grep or Grep tool to find all references. Map upstream and downstream dependencies. Identify what breaks if the structure is removed.
Step 5: Generate Report. Use the template at the bundled templates/chestertons-fence-investigation.md in this skill directory. Fill all sections with evidence from steps 1 through 4.
Step 6: Decision. Based on evidence, recommend one action:
| Decision | When to Use |
|---|---|
| PRESERVE | Original rationale still applies |
| MODIFY | Purpose valid but implementation needs updating |
| REPLACE | Better approach exists, original concern addressed |
| REMOVE | Original rationale no longer applies, with evidence |
This skill answers one question: what evidence exists that this code or
constraint has a real purpose? It owns capability code-archaeology, the
evidence-gathering step the review skill's technical-review contract
consumes for code-intent analysis.
For code committed during or after calendar year 2023, apply these rules:
git blame does not establish why the code
exists.review skill's technical-review
contract; this skill supplies the evidence the proposal cites.# Investigate a file or pattern
python3 scripts/investigate.py --target path/to/file.py --change "remove unused validation"
# Investigate an ADR
python3 scripts/investigate.py --target docs/architecture/ADR-005.md --change "allow bash scripts"
# Output as JSON (for automation)
python3 scripts/investigate.py --target path/to/file.py --change "description" --format json
| Script | Purpose | Exit codes |
|---|---|---|
scripts/investigate.py | Git archaeology (origin commit, recent changes), related-ADR search, and dependent search for a target; emits a Markdown or JSON investigation report from the bundled template. | 0=success, 1=error |
| Agent | How to Integrate |
|---|---|
| Analyst | Run this skill first when investigating changes. The report is a prerequisite for any change proposal. |
| Architect | ADRs that deprecate or replace existing patterns MUST include a "Prior Art Investigation" section. Use this skill to generate it. |
| Implementer | Before implementing deletions or major refactoring, verify an investigation report exists. If missing, route to analyst. |
| Critic | When validating plans that remove or replace existing systems, check for investigation evidence. Auto-reject proposals without historical context. |
| Avoid | Why | Instead |
|---|---|---|
| Removing code you do not understand | May break hidden invariants | Investigate first, then decide |
| Assuming dead code is unused | Hyrum's Law: someone depends on it | Run dependency analysis |
| Skipping PR/ADR search | Loses original design rationale | Always check git history and PRs |
| Proposing replacement without evidence | Cannot compare tradeoffs | Document original constraints first |
Investigation reports use the template at the bundled templates/chestertons-fence-investigation.md in this skill directory.
| File | Content |
|---|---|
references/chestertons-fence-mental-model.md | Core mental model, principle, investigation checklist, related models |
references/boy-scout-rule.md | Scoped improvement boundaries, connection to investigation workflow |
references/legacy-code-techniques.md | Bottom-up refactoring approach, inheritance vs composition, reading list |
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (rjmurillo/ai-agents) — no native marketplace selected
npx claudepluginhub p/rjmurillo-copilot-cli-agents-src-copilot-cli104 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator).2 plugins in one repository ship this exact skill · first indexed Nov 13, 2026
Other plugins' skills for the same job