Ghm harvest

From mattgierhart/PRD-driven-context-engineering · View interactive version

Ghm harvest is an AI agent skill from the GitHub repository mattgierhart/PRD-driven-context-engineering. 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.

How to use this skill

Skill file

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 Execution Plan for temp file references
  2. List all files in temp/ directory
  3. Match temps to EPIC (by date or naming)

Checklist

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

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

### [ID]: [Title]

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

[Extracted content, properly formatted]

Checklist

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

## 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

Testability Check

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:

DON'T:

Handoff

After harvest completes:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.