home / skills / mattgierhart / prd-driven-context-engineering / ghm-harvest

ghm-harvest skill

/.claude/skills/ghm-harvest

This skill extracts durable insights from temporary files and updates the Source of Truth during EPIC Phase E, creating SoT entries and an archive manifest.

npx playbooks add skill mattgierhart/prd-driven-context-engineering --skill ghm-harvest

Review the files below or copy the command above to add this skill to your agents.

Files (4)
SKILL.md
4.4 KB
---
name: ghm-harvest
description: >
  Extracts durable insights from temp/ files to SoT during EPIC Phase E.
  Triggers at EPIC completion or explicit `/ghm-harvest` invocation.
  Outputs new SoT entries and archive manifest.
---

# Harvest

Extract durable insights from temporary files to Source of Truth during EPIC Phase E (Finish).

## Workflow Overview

1. **Enumerate Temps** → List all temp/ files from current EPIC
2. **Identify SoT-worthy** → Determine what should persist
3. **Format Entries** → Convert to proper SoT templates
4. **Archive** → Move temps to archive, update manifest

## Core Output Template

| Element | Definition | Evidence |
|---------|------------|----------|
| **Temp Files** | Files processed | List with paths |
| **New SoT Entries** | IDs created | BR-XXX, UJ-XXX, etc. |
| **Archive Manifest** | What was archived | Paths and dates |
| **Discarded** | What was not kept | Reason for each |

## Harvest Decision Matrix

| Content Type | Action | Destination |
|--------------|--------|-------------|
| Business rule discovered | Extract | `SoT/SoT.BUSINESS_RULES.md` |
| User flow documented | Extract | `SoT/SoT.USER_JOURNEYS.md` |
| API design finalized | Extract | `SoT/SoT.API_CONTRACTS.md` |
| Customer feedback captured | Extract | `SoT/SoT.CUSTOMER_FEEDBACK.md` |
| Session notes | Archive only | `archive/YYYY-MM/` |
| Scratch work | Discard | Delete after review |

## Step 1: Enumerate Temp Files

1. Read EPIC Section 3A for temp file references
2. List all files in `temp/` directory
3. Match temps to EPIC (by date or naming)

### Checklist
- [ ] All EPIC-referenced temps identified
- [ ] Temp directory scanned
- [ ] Files categorized by content type

## Step 2: Identify SoT-Worthy Content

For each temp file, evaluate:

| Question | If Yes | If No |
|----------|--------|-------|
| Is this a business rule? | Extract as BR-XXX | Continue |
| Is this a user flow? | Extract as UJ-XXX | Continue |
| Is this an API design? | Extract as API-XXX | Continue |
| Is this customer evidence? | Extract as CFD-XXX | Continue |
| Is this useful context? | Archive | Continue |
| Is this scratch work? | Discard | - |

### Checklist
- [ ] Each temp file evaluated
- [ ] Extract/Archive/Discard decision made
- [ ] Decisions documented

## Step 3: Format SoT Entries

For each extracted item:

1. Generate appropriate ID using `ghm-id-register`
2. Format per SoT template
3. Add cross-references
4. Insert into correct SoT file

### Entry Template

```markdown
### [ID]: [Title]

**Status**: Active
**Created**: YYYY-MM-DD
**Source**: temp/[filename].md (EPIC-XX)
**Cross-References**: [Related IDs]

[Extracted content, properly formatted]
```

### Checklist
- [ ] All extracts have valid IDs
- [ ] Formatting matches SoT templates
- [ ] Cross-references verified

## Step 4: Archive and Cleanup

1. Create archive directory: `archive/YYYY-MM/`
2. Move processed temps to archive
3. Generate manifest
4. Update EPIC Phase E checklist

### Archive Manifest Template

```markdown
## Archive Manifest: EPIC-XX

**Date**: YYYY-MM-DD
**Archived To**: archive/YYYY-MM/

### Extracted to SoT
| Temp File | New ID | SoT File |
|-----------|--------|----------|
| temp/file.md | BR-XXX | SoT.BUSINESS_RULES.md |

### Archived Only
| Temp File | Reason |
|-----------|--------|
| temp/notes.md | Session context |

### Discarded
| Temp File | Reason |
|-----------|--------|
| temp/scratch.md | No durable value |
```

## Quality Gates

### Pass Checklist
- [ ] All temps processed (none orphaned)
- [ ] Extracted content has valid IDs
- [ ] Archive manifest is complete
- [ ] EPIC Phase E checklist updated

### Testability Check
- [ ] SoT entries are findable by ID
- [ ] Archive manifest matches actual files
- [ ] Temp directory is clean

## Anti-Patterns

| Pattern | Example | Fix |
|---------|---------|-----|
| Orphan temps | Temps not in manifest | → Process all files |
| Lost context | Archive without manifest | → Always create manifest |
| Over-extraction | Everything becomes SoT | → Apply decision matrix |
| Under-extraction | Valuable insights lost | → Review before discard |

## Boundaries

**DO**:
- Extract durable insights
- Format per templates
- Create complete manifests
- Clean up temps

**DON'T**:
- Create new analysis
- Modify conclusions
- Skip the manifest
- Delete without review

## Handoff

After harvest completes:
- SoT files updated with new entries
- Temps archived with manifest
- EPIC Phase E marked complete
- Ready to close EPIC

Overview

This skill extracts durable insights from temporary EPIC files and promotes them into the Source of Truth (SoT) during EPIC Phase E. It runs automatically at EPIC completion or on explicit /ghm-harvest invocation. The skill outputs new SoT entries, moves processed temps into a dated archive, and produces an archive manifest for traceability.

How this skill works

The skill enumerates all files in the temp/ directory and matches them to the current EPIC by name or date. It evaluates each file against a decision matrix to Extract, Archive, or Discard, then formats extracts with generated IDs and inserts them into the appropriate SoT documents. Finally, it moves processed files to archive/YYYY-MM/, writes an archive manifest showing extracted, archived-only, and discarded items, and updates the EPIC Phase E checklist.

When to use it

  • At EPIC Phase E (Finish) to lock down lasting knowledge
  • When closing an EPIC and you need a complete SoT update
  • After a review session with temp notes that may contain durable insights
  • When you want an auditable archive manifest of temporary files
  • On-demand via /ghm-harvest to capture new discoveries immediately

Best practices

  • Run harvest only after review—do not auto-promote unvetted notes
  • Use the decision matrix to avoid over- or under-extraction
  • Generate IDs with the ghm-id-register to ensure consistent cross-references
  • Keep SoT templates current so formatted entries are uniform
  • Always produce an archive manifest and verify the temp directory is clean

Example use cases

  • Convert finalized API designs discovered in temp/ into SoT.API_CONTRACTS.md with API-XXX IDs
  • Extract business rules from meeting notes into SoT.BUSINESS_RULES.md as BR-XXX entries
  • Move session notes and contextual files to archive/YYYY-MM/ with a manifest entry for audit
  • Discard scratch work after review while documenting reasons in the manifest to maintain traceability
  • Trigger on-demand harvest to capture urgent customer feedback found in temp/ into SoT.CUSTOMER_FEEDBACK.md

FAQ

What types of temp files get promoted to SoT?

Business rules, user journeys, finalized API designs, and customer evidence are candidates for extraction per the decision matrix.

How are new IDs generated and tracked?

The skill uses ghm-id-register to create consistent IDs (e.g., BR-XXX, UJ-XXX) and inserts them into SoT entries and the archive manifest.

What happens to files that are not extracted?

Useful context files are archived under archive/YYYY-MM/ and scratch work is discarded after review; both actions are recorded in the manifest.