---
name: augment-generic
description: >
  Intentionally store portable knowledge as Augment generic memories under
  `.generic/` from Pi. Use when the user asks to "/augment:generic", "store as
  generic", "promote to generic", or import knowledgebase/notes into shared
  memory — not for cross-project decoction or within-project sleep.
---

# Augment Generic Store for Pi

Write **user- or agent-authored** shared knowledge into the reserved pseudo-project
`.generic/`. This is separate from **sleep** (one project, WORK → SPEC/ARCH) and
**decoction** (cross-project recurrence, `derived_from` ≥4 projects). Do not call
`augment_decoction_glean` for this flow.

cwd may be a knowledgebase, notes tree, or any path — **do not** treat it as the
target Augment project. Always target project name `.generic`.

## Invocation

Typical:

```text
/augment:generic from: ./science/
```

Optional user hints: `mode: propose|write`, tags (`domain:…`, `source:…`),
kind preference, or a topic filter. Default: infer sources from the named path
or the current working tree; default mode is **propose** when more than three
memories would be written, else **write** after a short plan if the user was
explicitly imperative (“store these now”).

## Procedure

1. **Resolve the generic project**
   - Call `augment_list_projects` with `name: ".generic"`.
   - If missing, call `augment_init_project` with `project_name: ".generic"`.
   - Use the returned numeric `id` as `project_id` for every `augment_upsert_memory`.
   - Never use cwd inference or the active coding project for these writes.

2. **Gather sources**
   - Read the path(s) or pasted notes the user named.
   - Prefer durable claims: definitions, contracts, procedures, tradeoffs,
     invariants. Skip fluff, transcripts, and one-off history.

3. **Chunk**
   - One focused memory per durable claim, contract, or decision.
   - No whole-book dumps. Soft target: a few hundred to a few thousand
     characters; hard limit is the upsert max (~12k). Split rather than stuff.

4. **Kind rules** (strict)
   - Domain facts / contracts / rules → `SPEC`
   - Reusable methods / tradeoffs / architecture patterns → `ARCH`
   - **Never** `WORK`, `ISSUE`, or `TODO` under `.generic/` in this skill.

5. **Name and tags**
   - Stable kebab-style `name` (e.g. `orbital-mechanics-basics`). Prefer
     updating an existing name over inventing near-duplicates.
   - Tags always include something about origin, e.g. `source:knowledgebase`
     and a domain tag such as `domain:science`. Add user-supplied tags.
   - Paths land at `.generic/<KIND>/<name>.md`.

6. **Dedup before write**
   - `augment_search` for each draft’s topic (generics participate in global search).
   - When a near hit is under `.generic/`, `augment_read_memory` it.
   - Same name or same topic already covered → **update in place**
     (`memory_id` or same `name` + kind), merging only portable facts; do not
     drop unique prior content without reason.
   - Skip drafts that add nothing new.

7. **Hygiene**
   - No secrets, credentials, tokens, or private keys.
   - Strip project-local paths, repo names, ticket IDs, and personal details
     unless the knowledge is truly portable.
   - Prefer portable wording (“prefer X over Y when …”) over “in MyProject we…”.

8. **Provenance**
   - Put corpus/source notes in the **body** (and tags), e.g. a short
     `Source: …` line. Do **not** require multi-project `derived_from`;
     decoction’s four-project rule does not apply.

9. **Review gate**
   - If more than three memories would be created/updated, or the import is a
     whole tree: present a batch table — `kind`, `name`, one-line summary,
     create vs update — and **wait for explicit approval** before any upsert.
   - Small explicit “store this claim” requests may write after step 6 without
     a multi-item batch, still reporting what was written.

10. **Write**
    - `augment_upsert_memory` with `project_id` = `.generic`’s id, `kind`,
      `name`, `content`, `tags`.
    - Report each path (`.generic/...`), action (created/updated), and any
      skipped duplicates.

## Out of scope

| User intent | Use instead |
|-------------|-------------|
| Recurring patterns across ≥4 projects | `augment-decoction` |
| Fold settled WORK in one project | `augment-sleep` |
| Speculative unproven links/memories | `augment-dream` |
| Day-to-day repo memory | `augment-context` + normal upsert on the real project |

Do not hard-delete project memories after a generic store.

## Guardrails

- Never call `augment_decoction_glean` or `augment_decoction_cleanup` from this skill.
- Never set the active coding project to `.generic` for normal session work;
  only use `.generic` as the storage target for these upserts.
- Prefer fewer sharp memories over many overlapping ones.
- When unsure whether knowledge is portable, ask or keep it in the real project
  instead of promoting it.
