Skip to main content
ClaudeWave
Slash Command475 repo starsupdated 2d ago

manage-knowhow

Manage knowhow entries (workflow and system)

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/catlog22/maestro-flow/HEAD/.claude/commands/manage-knowhow.md -o ~/.claude/commands/manage-knowhow.md
Then start a new Claude Code session; the slash command loads automatically.

manage-knowhow.md

<purpose>
Manage knowhow across two stores: workflow (`.workflow/knowhow/`) and system memory (`~/.claude/projects/*/memory/`). Operations: list, search, view, edit, delete, prune.
</purpose>

<required_reading>
@~/.maestro/workflows/knowhow.md
</required_reading>

<context>
Arguments: $ARGUMENTS

Dual store architecture (paths, formats, index) defined in workflow knowhow.md.

**Subcommands:**
- `list` — List entries from both stores (default if no arguments)
- `search <query>` — Full-text search across both stores
- `view <id|file>` — Display a workflow entry by ID or system file by name
- `edit <file>` — Edit a system memory file (MEMORY.md or topic file)
- `delete <id|file>` — Remove an entry/file (with confirmation)
- `prune` — Bulk cleanup by criteria

**Flags:**
- `--store <workflow|system|all>` — Target store (default: `all` for list/search, inferred for other ops)
- `--tag <tag>` — Filter by tag (workflow store)
- `--type <compact|tip>` — Filter by entry type (workflow store)
- `--before <YYYY-MM-DD>` — Entries before date
- `--after <YYYY-MM-DD>` — Entries after date
- `--dry-run` — Preview destructive ops without executing
- `--confirm` — Skip confirmation prompt
</context>

<execution>
Follow '~/.maestro/workflows/knowhow.md' Part A (KnowHow Management) completely.
</execution>

<error_codes>
| Code | Severity | Description | Stage |
|------|----------|-------------|-------|
| E001 | error | No memory stores found — for workflow store run `/manage-knowhow-capture`; for system store create `~/.claude/projects/{project}/memory/MEMORY.md` manually | resolve_paths |
| E002 | error | Entry ID or filename not found | execute_view, execute_delete |
| E003 | error | Prune requires at least one filter (--tag, --type, --before, --after) | execute_prune |
| E004 | error | Cannot delete MEMORY.md — use `edit` subcommand instead | execute_delete |
| W001 | warning | Workflow index has orphaned files or dangling references | integrity_check |
| W002 | warning | MEMORY.md references non-existent topic file | integrity_check |
| W003 | warning | MEMORY.md exceeds 200 lines — content will be truncated at load | execute_edit |
</error_codes>

<success_criteria>
- [ ] Both store paths correctly resolved
- [ ] Subcommand correctly detected from arguments
- [ ] Store auto-detected from argument format (KNW-*/TIP-* vs filename)
- [ ] List: both stores displayed with appropriate formatting
- [ ] Search: results from both stores, ranked by relevance
- [ ] View: correct store selected, full content displayed
- [ ] Edit: system memory files editable, MEMORY.md kept under 200 lines
- [ ] Delete: MEMORY.md protected, confirmation required, references checked
- [ ] Prune: workflow-only, filters validated, index updated
- [ ] Integrity check catches orphans and broken links
- [ ] Next step routed
</success_criteria>

<completion>
### Next-step routing

| Condition | Suggestion |
|-----------|-----------|
| Want to capture new knowhow | `/manage-knowhow-capture` |
| View project state | `/manage-status` |
| Prune stale entries | `/manage-knowledge-audit --scope knowhow` |
</completion>