prior-work-retrieval

Searches declared code, docs, and conversation carriers to verify reusable prior work before new production.

1.4k|216|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/daymade/claude-code-skills --skill prior-work-retrieval
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prior-work-retrieval
Source: https://github.com/daymade/claude-code-skills/tree/main/daymade-claude-code/prior-work-retrieval
Command: npx skills add https://github.com/daymade/claude-code-skills --skill prior-work-retrieval

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Teams repeatedly rebuild solutions that already exist in other projects, old conversations, meeting notes, or archived chats because there is no disciplined way to find and verify prior work before starting new implementation. This Skill enforces a source-verified retrieval workflow so reuse decisions are grounded in opened evidence rather than search snippets or memory.

Core Features & Use Cases

  • Manifest-driven multi-carrier search: Validates an explicit JSON source manifest, then queries filesystem carriers with ripgrep, declared command adapters (semantic/conversation recall), and manual routes such as live WeChat, ranking business-outcome candidates ahead of implementation matches.
  • Verified reuse receipts: Records reuse, adapt, or no-reuse decisions with reasons tied to candidate IDs, checks candidate freshness against Git HEAD and file mtimes, and gates completion through a machine-checked receipt.
  • Companion hooks for Claude Code and Codex: UserPromptSubmit, PreToolUse, and Stop hooks arm retrieval only on explicit prior-work signals, block substantial writes lacking a valid receipt, and never convert ordinary edits into retrieval obligations.
  • Use Case: Before writing a new provider API integration, a user says "we solved this in another project, reuse it" — the Skill searches code, docs, skills, and conversation history, opens the original provider contract, and records an adapt decision before any code is written.

Quick Start

Ask the assistant to find and verify any existing prior work on this task across our declared sources before writing new code, then record a reuse or adapt receipt.

Frequently Asked Questions about prior-work-retrieval

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search for prior work before writing new code?

Run scripts/prior_work.py retrieve with a business-outcome sentence, outcome terms, and implementation terms against a validated source manifest. Open the returned candidates at their original paths, then record a reuse, adapt, or no-reuse receipt with the complete subcommand.

What is the source manifest in prior work retrieval?

The manifest is a JSON file declaring every searchable carrier: filesystem roots with ripgrep globs, command adapters with argv templates, and manual routes like live WeChat. Nothing is searched outside these explicit declarations, and each source carries an authority level and required flag.

Does prior-work-retrieval work with Claude Code and Codex hooks?

Yes, the installer adds UserPromptSubmit, PreToolUse, and Stop handlers to both Claude settings.json and Codex hooks.json. Hooks arm only on explicit prior-work signals, block substantial writes lacking a valid receipt, and leave read-only investigation untouched.

Why does the prior-work hook block my file write?

PreToolUse blocks substantial writes only when the current prompt carried an explicit prior-work signal and no valid receipt exists for the session. Complete the retrieve and complete commands with the exact session id from the hook message, then verify with the check subcommand.

When should I not trigger prior work retrieval?

Skip it for read-only status checks, current-file inspection, ordinary bug fixes, and mechanical verification. A mention of existing tests or files is not a prior-work request, and zero search hits never prove that no prior work exists.