# Harvest Project
<!--
ref: @protocol/harvest-project
type: protocol
tags: [authoring, extraction, project, codebase, onboarding, starter]
aliases: [harvest-project, harvest project, harvest my project, project-harvest]
triggers: [harvest my project, harvest project knowledge, harvest code standards, harvest agent harness, ingest my project, codify my project, my project's protocols, what does my project know]
trigger_prompt: When a user needs to extract and organize knowledge from a project's CLAUDE.md to improve accessibility and onboarding for new team members.
category: extract
last_reviewed: 2026-05-07
complements: [@protocol/harvest, @protocol/extract, @protocol/append, @protocol/context-quality, @protocol/onboarding, @protocol/agent-config-integration]
audience: [agent-author, claude-code-user]
version: 4
updated_at: 2026-09-30T20:49:18.151Z
-->
Single-project ancestor of `@protocol/harvest`. Walks **one project's** working surface — CLAUDE.md, the agent harness, code-conventions docs, ADRs, README sections — and converts each high-signal source into a structured protocol in the user's personal repo on protocol.supply.
Different from `@protocol/harvest`, which sweeps a whole workspace across many projects looking for patterns. `harvest-project` is depth-first on one codebase: what does *this* project's CLAUDE.md know that should be addressable on demand?
> You are not building a wiki. You are codifying the things that get retyped into prompts every week.
---
## When to Run
- **Onboarding to protocol.supply.** First time setting up a personal repo, after `@protocol/install` is done.
- **After joining a new project.** The team's CLAUDE.md is dense; you want it broken into addressable protocols you can fetch on demand.
- **Periodically** when the project's CLAUDE.md crosses ~500 lines and starts to feel like a brain dump.
- **When the user says** *"harvest my project"*, *"codify my project"*, *"what does my project know that should be a protocol?"*
---
## Prerequisites
- `@protocol/install` complete (curly + token).
- A target repo on protocol.supply for output. If the user doesn't have one, ask them to create one first via the UI (`/repos/new`) or pass the slug they want and use `POST /repo` to provision.
- Read access to the project's working surface — assume the agent runs from the project root.
---
## What to Walk (in priority order)
| Source | What you're looking for | Likely protocol type |
|---|---|---|
| `CLAUDE.md` (root + nested) | Conventions, gotchas, "always do this", "never do this" | small focused protocols, one per topic |
| `.cursorrules`, agent harness config | Same — conventions in a different format | merge with CLAUDE.md harvest |
| `README.md`, top-level `CONTRIBUTING.md` | Project story, "how we build" framing | one repo-level overview protocol |
| `docs/`, `engineering/`, `decisions/`, `adr/` folders | Architecture decisions, runbooks, runonomies | one protocol per decision/runbook |
| `package.json` scripts + their docs | Workflow operations (`pnpm dev`, `make ship`) | one workflow protocol if non-trivial |
| Persistent CI config + comments | Deploy guardrails, env requirements | one ops protocol |
| Linter / formatter config + ignore files | Code style with reasons | merge into a code-style protocol |
**Skip:** generated files, lockfiles, build artifacts, anything in `node_modules`, `dist`, `.next`, etc.
**Skim, don't deep-read:** vendored library code, third-party schemas, anything not authored by the team.
---
## Steps
### 1. Sniff the working surface
Walk the project root (one level) and the standard knowledge directories. Note what exists:
```bash
ls CLAUDE.md .cursorrules README.md CONTRIBUTING.md 2>/dev/null
ls -d docs/ engineering/ decisions/ adr/ 2>/dev/null
```
If the project has no `CLAUDE.md` and no engineering docs, **stop and report** — there's nothing to harvest. Suggest the user run `@protocol/extract` after their next coding session instead.
### 2. Read CLAUDE.md as a *table of contents*
Don't try to convert CLAUDE.md to one protocol. Read it as a **list of topics** the team has codified. For each `## H2` section, decide:
- Is this a single addressable rule? → one protocol
- Is this a workflow with steps? → one protocol with numbered steps
- Is this a checklist? → one protocol structured as a checklist
- Is this an explanation of *why* something exists? → fold into the relevant rule's protocol as background
Write a one-line plan: **{topic} → @{user-repo}/{folder}/{slug}**.
### 3. Propose a folder structure
For a typical project codebase, three top-level folders work:
- `engineering/` — code-level conventions, code-review notes, testing rules, style decisions
- `process/` — workflows, runbooks, deploy steps, on-call procedures
- `decisions/` — ADRs, RFCs, "why we picked X over Y" docs
Add others only when the project has substantial content for them: `data/`, `frontend/`, `infra/`, `incident-response/`. Don't pre-create empty folders.
### 4. Convert each candidate
For each topic identified in step 2, defer to `@protocol/extract` for the conversion logic — it handles the editorial pass (what to keep, what to cut, frontmatter shape, trigger phrases). The result is a draft markdown document with frontmatter.
**Tag every converted entry with `harvest-project` in `tags:`** so the user can find them later as a cohort.
### 5. Publish the drafts
Use `POST /entry/publish` for each draft (or `POST /repo/{slug}/publish` for a batch). Per `@protocol/api-reference`, the upsert is idempotent — re-running won't duplicate.
```bash
curly protocol /entry/publish -X POST -d '{
"repoId": "<user-repo>",
"content": "<frontmatter+body>"
}'
```
If publish fails (auth, validation), surface the error to the user with the offending file. Don't retry blindly.
### 6. Update the user's CLAUDE.md (optional, recommended)
Once the protocols are published, the project's CLAUDE.md can shrink. Replace each section that became a protocol with a one-line directive:
```markdown
## Code review
For code review standards, run: `curly protocol @<user-repo>/engineering/code-review.md`
```
Or, if `curly protocol bootstrap` is already wired in, the bootstrap call discovers them automatically — and the section can be deleted entirely.
**Always confirm with the user before editing CLAUDE.md.** They may want to keep some sections inline for stability.
### 7. Punch list
Before declaring done, surface for the user:
- Number of protocols created (with slugs)
- Topics from CLAUDE.md that did NOT become protocols (with reasons — "too short," "stylistic preference," "rejected by user")
- High-confidence protocols vs ones that need review
- Suggested next step (run `@protocol/harvest-skills` for the skills folder, or `@protocol/onboarding` for the full progression)
---
## Quality Checks Before Publishing
A harvested protocol passes quality only if:
- It has a clear single responsibility ("one rule, one workflow, one decision" — not three).
- Its trigger phrases are specific enough that the right protocol fires on the right phrase. ("review code" is a trigger; "code" alone is not.)
- It tells an agent **what to do**, not just what someone thought (no philosophical wandering).
- It would be read at most once per session — protocols loaded every turn are CLAUDE.md material, not protocols.
- Its body is under ~400 lines. If longer, split into a parent + appendix per `@protocol/information-tree` (setup and scripts go to appendices, rule 5).
Run `@protocol/context-quality` over each draft before publishing if uncertain.
---
## What NOT to Convert
- **Trivial naming conventions** (camelCase vs snake_case). One line; lives in CLAUDE.md.
- **Build commands** that are already in `package.json` scripts. The script IS the protocol; documenting it again is drift.
- **Personal preferences** that aren't team norms. Those are user-level memory, not project-level protocols.
- **Anything secret or environment-specific.** Tokens, prod URLs, database passwords — never publish.
- **Stale documentation.** If the project's `docs/old-architecture.md` was last edited 18 months ago, ask the user before harvesting.
---
## After harvest-project
Most users follow this with:
- `@protocol/harvest-skills` (Level 03) — convert SKILL.md files into protocols
- `@protocol/harvest-workspace` (Level 04, alias for `@protocol/harvest`) — sweep your workspace docs
- `@protocol/harvest-transcripts` (Level 05, alias for `@protocol/extract`) — comb your past conversations
See `@protocol/onboarding` for the full progression.
---
*Related: `@protocol/groom-protocols` · `@content/youtube/hormozi/we-made-a-big-decision` · `@content/youtube/starter-story/the-onboarding-behind-my-40k-month-app-full-breakdown` · `@content/youtube/saas-academy/stop-churn-before-it-starts-w-johnny-page` · `@content/youtube/hormozi/how-to-get-your-customers-to-stay-forever`*
---
*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*
*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*