maestro-flow 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex/skills/learn-decompose/SKILL.md +144 -144
- package/.codex/skills/learn-follow/SKILL.md +83 -83
- package/.codex/skills/learn-investigate/SKILL.md +84 -84
- package/.codex/skills/learn-retro/SKILL.md +113 -113
- package/.codex/skills/learn-second-opinion/SKILL.md +116 -116
- package/.codex/skills/maestro/SKILL.md +11 -8
- package/.codex/skills/maestro-amend/SKILL.md +4 -4
- package/.codex/skills/maestro-analyze/SKILL.md +2 -2
- package/.codex/skills/maestro-blueprint/SKILL.md +4 -4
- package/.codex/skills/maestro-companion/SKILL.md +4 -4
- package/.codex/skills/maestro-composer/SKILL.md +217 -217
- package/.codex/skills/maestro-grill/SKILL.md +1 -1
- package/.codex/skills/maestro-help/SKILL.md +30 -30
- package/.codex/skills/maestro-init/SKILL.md +1 -1
- package/.codex/skills/maestro-learn/SKILL.md +80 -80
- package/.codex/skills/maestro-merge/SKILL.md +76 -76
- package/.codex/skills/maestro-milestone-release/SKILL.md +74 -74
- package/.codex/skills/maestro-player/SKILL.md +3 -3
- package/.codex/skills/maestro-quick/SKILL.md +129 -129
- package/.codex/skills/maestro-ralph/SKILL.md +9 -9
- package/.codex/skills/maestro-ralph-beta/SKILL.md +34 -34
- package/.codex/skills/maestro-ralph-execute/SKILL.md +5 -5
- package/.codex/skills/maestro-tools-execute/SKILL.md +3 -3
- package/.codex/skills/maestro-tools-register/SKILL.md +3 -3
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +412 -412
- package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
- package/.codex/skills/manage-harvest/SKILL.md +99 -99
- package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
- package/.codex/skills/manage-knowhow/SKILL.md +95 -95
- package/.codex/skills/manage-knowhow-capture/SKILL.md +137 -137
- package/.codex/skills/manage-status/SKILL.md +7 -7
- package/.codex/skills/manage-wiki/SKILL.md +55 -55
- package/.codex/skills/quality-auto-test/SKILL.md +1 -1
- package/.codex/skills/quality-debug/SKILL.md +8 -8
- package/.codex/skills/quality-refactor/SKILL.md +3 -3
- package/.codex/skills/quality-review/SKILL.md +1 -1
- package/.codex/skills/quality-sync/SKILL.md +111 -111
- package/.codex/skills/quality-test/SKILL.md +1 -1
- package/.codex/skills/spec-add/SKILL.md +2 -2
- package/.codex/skills/spec-load/SKILL.md +1 -1
- package/.codex/skills/spec-map/SKILL.md +204 -204
- package/.codex/skills/spec-remove/SKILL.md +75 -75
- package/.codex/skills/spec-setup/SKILL.md +2 -2
- package/.codex/skills/wiki-connect/SKILL.md +73 -73
- package/.codex/skills/wiki-digest/SKILL.md +87 -87
- package/dist/src/ralph/skill-scanner.d.ts.map +1 -1
- package/dist/src/ralph/skill-scanner.js +9 -3
- package/dist/src/ralph/skill-scanner.js.map +1 -1
- package/package.json +1 -1
|
@@ -55,7 +55,7 @@ Update `doc-index.json` timestamps and `state.json.codebase_last_refreshed`. Dis
|
|
|
55
55
|
| Code | Severity | Description |
|
|
56
56
|
|------|----------|-------------|
|
|
57
57
|
| E001 | fatal | `.workflow/` not initialized |
|
|
58
|
-
| E002 | fatal | No codebase docs exist -- use
|
|
58
|
+
| E002 | fatal | No codebase docs exist -- use `$manage-codebase-rebuild` instead |
|
|
59
59
|
| W001 | warning | No changes detected since last refresh |
|
|
60
60
|
</error_codes>
|
|
61
61
|
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: manage-harvest
|
|
3
|
-
description: Extract knowledge from artifacts into wiki/spec/issues
|
|
4
|
-
argument-hint: "[<session-id|path>] [--to wiki|spec|issue|auto] [--source <type>] [--recent N] [--dry-run] [-y] [--prune] [--age N]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep,
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<purpose>
|
|
9
|
-
Knowledge extraction from workflow artifacts, routed into three stores: wiki entries,
|
|
10
|
-
spec conventions, and trackable issues. Prevents knowledge loss from completed sessions.
|
|
11
|
-
|
|
12
|
-
**Closed-loop**: harvest extracts → stores → downstream consumers (wiki-digest, spec-load, maestro-plan --gaps).
|
|
13
|
-
</purpose>
|
|
14
|
-
|
|
15
|
-
<required_reading>
|
|
16
|
-
@~/.maestro/workflows/harvest.md
|
|
17
|
-
</required_reading>
|
|
18
|
-
|
|
19
|
-
<context>
|
|
20
|
-
$ARGUMENTS — session-id, path, or empty for scan mode.
|
|
21
|
-
|
|
22
|
-
**Modes:**
|
|
23
|
-
- No args → `scan`: discover all harvestable artifacts, interactive selection
|
|
24
|
-
- `<session-id>` → `session`: harvest specific session
|
|
25
|
-
- `<path>` → `path`: harvest from explicit directory
|
|
26
|
-
|
|
27
|
-
**Flags:**
|
|
28
|
-
- `--to <target>` — Force routing: wiki, spec, issue, auto (default: auto)
|
|
29
|
-
- `--source <type>` — Filter: analysis, brainstorm, debug, lite-plan, lite-fix, scratchpad, session, learning, all
|
|
30
|
-
- `--recent N` — Artifacts within last N days (default: 30)
|
|
31
|
-
- `--dry-run` — Preview without writing
|
|
32
|
-
- `-y` — Skip confirmations
|
|
33
|
-
- `--min-confidence N` — Minimum 0.0-1.0 (default: 0.5)
|
|
34
|
-
- `--prune` — State hygiene mode: classify artifacts, graduate harvested → knowhow, archive from state.json, prune accumulated_context
|
|
35
|
-
- `--age N` — Graduation age threshold in days (default: 14). Used with `--prune`
|
|
36
|
-
|
|
37
|
-
**Source registry:**
|
|
38
|
-
| Source | Scan Path | Key Files |
|
|
39
|
-
|--------|-----------|-----------|
|
|
40
|
-
| analysis | `.workflow/.analysis/ANL-*/` | conclusions.json |
|
|
41
|
-
| brainstorm | `.workflow/scratch/brainstorm-*/` | guidance-specification.md |
|
|
42
|
-
| lite-plan | `.workflow/.lite-plan/*/` | plan.json |
|
|
43
|
-
| lite-fix | `.workflow/.lite-fix/*/` | fix-plan.json |
|
|
44
|
-
| debug | `.workflow/.debug/*/` | debug-log.md |
|
|
45
|
-
| scratchpad | `.workflow/.scratchpad/` | *.md |
|
|
46
|
-
| session | `.workflow/active/WFS-*/` | workflow-session.json |
|
|
47
|
-
| learning | `.workflow/specs/` | learnings.md |
|
|
48
|
-
</context>
|
|
49
|
-
|
|
50
|
-
<execution>
|
|
51
|
-
Follow '~/.maestro/workflows/harvest.md' Stages 1–8 (standard mode) or Stage 9 (`--prune` mode).
|
|
52
|
-
|
|
53
|
-
**Key invariants:**
|
|
54
|
-
1. **Read-only until Stage 6** — extraction/classification in-memory only
|
|
55
|
-
2. **Dedup before write** — check harvest-log.jsonl + existing stores
|
|
56
|
-
3. **Stable fragment IDs** — `HRV-{8 hex}` from `hash(source_id + content_hash)`
|
|
57
|
-
4. **Never modify source artifacts** — purely extractive
|
|
58
|
-
5. **Confidence filtering** — below threshold logged but not routed
|
|
59
|
-
6. **Spec format enforcement** — all spec routing must use `<spec-entry>` closed-tag format with `title`, `description`, `keywords`, `date`, `source="harvest"` attributes
|
|
60
|
-
|
|
61
|
-
**Routing rules:**
|
|
62
|
-
- Universal design patterns → `coding` or `arch` category
|
|
63
|
-
- Component-level pitfalls → `learning` category
|
|
64
|
-
- Quality enforcement rules → `quality` category
|
|
65
|
-
- Wiki: `maestro wiki create --type <type> --slug harvest-<source_type>-<short_id>`
|
|
66
|
-
- Spec: `maestro wiki append spec-<file> --body "<content>" --keywords "<kws>"` (unified write path) or
|
|
67
|
-
- Issue: append to `issues.jsonl` matching canonical schema, with `source: "harvest"` field (distinguishes from `manage-issue-discover`, which uses `source: "discover"` — required for cross-skill dedup when both write concurrently)
|
|
68
|
-
|
|
69
|
-
**Next steps:**
|
|
70
|
-
|
|
71
|
-
**Prune mode** (`--prune`): Classifies artifacts (active/graduated/stale/protected), graduates harvested artifacts to wiki knowhow, archives from `artifacts[]` → `artifact_archive[]`, prunes resolved entries from accumulated_context. Files on disk are never deleted. Always backs up state.json before writing.
|
|
72
|
-
</execution>
|
|
73
|
-
|
|
74
|
-
<error_codes>
|
|
75
|
-
| Code | Severity | Condition | Recovery |
|
|
76
|
-
|------|----------|-----------|----------|
|
|
77
|
-
| E001 | error | .workflow/ not initialized | Run $maestro-init |
|
|
78
|
-
| E002 | error | Invalid --to target | Valid: wiki, spec, issue, auto |
|
|
79
|
-
| E003 | error | Invalid --source type | Display valid types |
|
|
80
|
-
| E004 | error | Session ID not found | Show available sessions |
|
|
81
|
-
| W001 | warning | No harvestable artifacts in window | Widen --recent |
|
|
82
|
-
| W003 | warning | Fragments below threshold | Lower --min-confidence |
|
|
83
|
-
| W004 | warning | Duplicate fragments skipped | Review harvest-log.jsonl |
|
|
84
|
-
</error_codes>
|
|
85
|
-
|
|
86
|
-
<success_criteria>
|
|
87
|
-
- [ ] Mode resolved (scan / session / path)
|
|
88
|
-
- [ ] Artifacts discovered and parsed
|
|
89
|
-
- [ ] Fragments extracted with category, confidence, tags
|
|
90
|
-
- [ ] Dedup check passed against harvest-log.jsonl and stores
|
|
91
|
-
- [ ] If not dry-run: routed items written to target stores
|
|
92
|
-
- [ ] harvest-log.jsonl updated with provenance
|
|
93
|
-
- [ ] harvest-report-{date}.md written
|
|
94
|
-
- [ ] No source artifacts modified
|
|
95
|
-
- [ ] If --prune: artifacts classified (active/graduated/stale/protected)
|
|
96
|
-
- [ ] If --prune: graduated artifacts → knowhow + artifact_archive[]
|
|
97
|
-
- [ ] If --prune: accumulated_context pruned (resolved deferred/blockers, deduplicated decisions)
|
|
98
|
-
- [ ] If --prune: state.json backed up before modification
|
|
99
|
-
</success_criteria>
|
|
1
|
+
---
|
|
2
|
+
name: manage-harvest
|
|
3
|
+
description: Extract knowledge from artifacts into wiki/spec/issues
|
|
4
|
+
argument-hint: "[<session-id|path>] [--to wiki|spec|issue|auto] [--source <type>] [--recent N] [--dry-run] [-y] [--prune] [--age N]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Knowledge extraction from workflow artifacts, routed into three stores: wiki entries,
|
|
10
|
+
spec conventions, and trackable issues. Prevents knowledge loss from completed sessions.
|
|
11
|
+
|
|
12
|
+
**Closed-loop**: harvest extracts → stores → downstream consumers (wiki-digest, spec-load, maestro-plan --gaps).
|
|
13
|
+
</purpose>
|
|
14
|
+
|
|
15
|
+
<required_reading>
|
|
16
|
+
@~/.maestro/workflows/harvest.md
|
|
17
|
+
</required_reading>
|
|
18
|
+
|
|
19
|
+
<context>
|
|
20
|
+
$ARGUMENTS — session-id, path, or empty for scan mode.
|
|
21
|
+
|
|
22
|
+
**Modes:**
|
|
23
|
+
- No args → `scan`: discover all harvestable artifacts, interactive selection
|
|
24
|
+
- `<session-id>` → `session`: harvest specific session
|
|
25
|
+
- `<path>` → `path`: harvest from explicit directory
|
|
26
|
+
|
|
27
|
+
**Flags:**
|
|
28
|
+
- `--to <target>` — Force routing: wiki, spec, issue, auto (default: auto)
|
|
29
|
+
- `--source <type>` — Filter: analysis, brainstorm, debug, lite-plan, lite-fix, scratchpad, session, learning, all
|
|
30
|
+
- `--recent N` — Artifacts within last N days (default: 30)
|
|
31
|
+
- `--dry-run` — Preview without writing
|
|
32
|
+
- `-y` — Skip confirmations
|
|
33
|
+
- `--min-confidence N` — Minimum 0.0-1.0 (default: 0.5)
|
|
34
|
+
- `--prune` — State hygiene mode: classify artifacts, graduate harvested → knowhow, archive from state.json, prune accumulated_context
|
|
35
|
+
- `--age N` — Graduation age threshold in days (default: 14). Used with `--prune`
|
|
36
|
+
|
|
37
|
+
**Source registry:**
|
|
38
|
+
| Source | Scan Path | Key Files |
|
|
39
|
+
|--------|-----------|-----------|
|
|
40
|
+
| analysis | `.workflow/.analysis/ANL-*/` | conclusions.json |
|
|
41
|
+
| brainstorm | `.workflow/scratch/brainstorm-*/` | guidance-specification.md |
|
|
42
|
+
| lite-plan | `.workflow/.lite-plan/*/` | plan.json |
|
|
43
|
+
| lite-fix | `.workflow/.lite-fix/*/` | fix-plan.json |
|
|
44
|
+
| debug | `.workflow/.debug/*/` | debug-log.md |
|
|
45
|
+
| scratchpad | `.workflow/.scratchpad/` | *.md |
|
|
46
|
+
| session | `.workflow/active/WFS-*/` | workflow-session.json |
|
|
47
|
+
| learning | `.workflow/specs/` | learnings.md |
|
|
48
|
+
</context>
|
|
49
|
+
|
|
50
|
+
<execution>
|
|
51
|
+
Follow '~/.maestro/workflows/harvest.md' Stages 1–8 (standard mode) or Stage 9 (`--prune` mode).
|
|
52
|
+
|
|
53
|
+
**Key invariants:**
|
|
54
|
+
1. **Read-only until Stage 6** — extraction/classification in-memory only
|
|
55
|
+
2. **Dedup before write** — check harvest-log.jsonl + existing stores
|
|
56
|
+
3. **Stable fragment IDs** — `HRV-{8 hex}` from `hash(source_id + content_hash)`
|
|
57
|
+
4. **Never modify source artifacts** — purely extractive
|
|
58
|
+
5. **Confidence filtering** — below threshold logged but not routed
|
|
59
|
+
6. **Spec format enforcement** — all spec routing must use `<spec-entry>` closed-tag format with `title`, `description`, `keywords`, `date`, `source="harvest"` attributes
|
|
60
|
+
|
|
61
|
+
**Routing rules:**
|
|
62
|
+
- Universal design patterns → `coding` or `arch` category
|
|
63
|
+
- Component-level pitfalls → `learning` category
|
|
64
|
+
- Quality enforcement rules → `quality` category
|
|
65
|
+
- Wiki: `maestro wiki create --type <type> --slug harvest-<source_type>-<short_id>`
|
|
66
|
+
- Spec: `maestro wiki append spec-<file> --body "<content>" --keywords "<kws>"` (unified write path) or `$spec-add "<category> <content>"`
|
|
67
|
+
- Issue: append to `issues.jsonl` matching canonical schema, with `source: "harvest"` field (distinguishes from `manage-issue-discover`, which uses `source: "discover"` — required for cross-skill dedup when both write concurrently)
|
|
68
|
+
|
|
69
|
+
**Next steps:** `$manage-wiki health`, `maestro search --type note`, `$wiki-connect --fix`, `$wiki-digest`, `$manage-issue list --source harvest`
|
|
70
|
+
|
|
71
|
+
**Prune mode** (`--prune`): Classifies artifacts (active/graduated/stale/protected), graduates harvested artifacts to wiki knowhow, archives from `artifacts[]` → `artifact_archive[]`, prunes resolved entries from accumulated_context. Files on disk are never deleted. Always backs up state.json before writing.
|
|
72
|
+
</execution>
|
|
73
|
+
|
|
74
|
+
<error_codes>
|
|
75
|
+
| Code | Severity | Condition | Recovery |
|
|
76
|
+
|------|----------|-----------|----------|
|
|
77
|
+
| E001 | error | .workflow/ not initialized | Run $maestro-init |
|
|
78
|
+
| E002 | error | Invalid --to target | Valid: wiki, spec, issue, auto |
|
|
79
|
+
| E003 | error | Invalid --source type | Display valid types |
|
|
80
|
+
| E004 | error | Session ID not found | Show available sessions |
|
|
81
|
+
| W001 | warning | No harvestable artifacts in window | Widen --recent |
|
|
82
|
+
| W003 | warning | Fragments below threshold | Lower --min-confidence |
|
|
83
|
+
| W004 | warning | Duplicate fragments skipped | Review harvest-log.jsonl |
|
|
84
|
+
</error_codes>
|
|
85
|
+
|
|
86
|
+
<success_criteria>
|
|
87
|
+
- [ ] Mode resolved (scan / session / path)
|
|
88
|
+
- [ ] Artifacts discovered and parsed
|
|
89
|
+
- [ ] Fragments extracted with category, confidence, tags
|
|
90
|
+
- [ ] Dedup check passed against harvest-log.jsonl and stores
|
|
91
|
+
- [ ] If not dry-run: routed items written to target stores
|
|
92
|
+
- [ ] harvest-log.jsonl updated with provenance
|
|
93
|
+
- [ ] harvest-report-{date}.md written
|
|
94
|
+
- [ ] No source artifacts modified
|
|
95
|
+
- [ ] If --prune: artifacts classified (active/graduated/stale/protected)
|
|
96
|
+
- [ ] If --prune: graduated artifacts → knowhow + artifact_archive[]
|
|
97
|
+
- [ ] If --prune: accumulated_context pruned (resolved deferred/blockers, deduplicated decisions)
|
|
98
|
+
- [ ] If --prune: state.json backed up before modification
|
|
99
|
+
</success_criteria>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: manage-issue-discover
|
|
3
3
|
description: Discover issues via multi-perspective analysis
|
|
4
4
|
argument-hint: "[-y|--yes] [-c|--concurrency N] [--continue] \"[by-prompt 'what to look for']\""
|
|
5
|
-
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep,
|
|
5
|
+
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
<purpose>
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: manage-knowhow
|
|
3
|
-
description: Manage knowhow entries (workflow and system)
|
|
4
|
-
argument-hint: "[list|search|view|edit|delete|prune] [query|id|file] [--store workflow|system|all] [--tag tag] [--type type]"
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Glob, Grep,
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<purpose>
|
|
9
|
-
Manage knowhow entries across workflow and system stores. Provides list, search, view, edit, delete, and prune operations over `.workflow/knowhow/` (workflow store) and `~/.claude/projects/{project}/memory/` (system store).
|
|
10
|
-
</purpose>
|
|
11
|
-
|
|
12
|
-
<context>
|
|
13
|
-
$ARGUMENTS — subcommand followed by options. Defaults to `list` if no arguments.
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
$manage-knowhow
|
|
17
|
-
$manage-knowhow "list --store workflow"
|
|
18
|
-
$manage-knowhow "search authentication"
|
|
19
|
-
$manage-knowhow "view KNW-20260318-001"
|
|
20
|
-
$manage-knowhow "edit MEMORY.md"
|
|
21
|
-
$manage-knowhow "delete TIP-20260318-001 --confirm"
|
|
22
|
-
$manage-knowhow "prune --before 2026-01-01 --type tip --dry-run"
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**Subcommands**: `list`, `search`, `view`, `edit`, `delete`, `prune`.
|
|
26
|
-
|
|
27
|
-
**Flags**:
|
|
28
|
-
- `--store workflow|system|all` — Target store (default: all)
|
|
29
|
-
- `--tag <tag>` — Filter by tag
|
|
30
|
-
- `--type <session|tip|template|recipe|reference|decision>` — Filter by knowhow type
|
|
31
|
-
- `--confirm` — Skip delete confirmation prompt
|
|
32
|
-
- `--before <date>` / `--after <date>` — Date filters for prune
|
|
33
|
-
- `--dry-run` — Preview prune without deleting
|
|
34
|
-
</context>
|
|
35
|
-
|
|
36
|
-
<execution>
|
|
37
|
-
|
|
38
|
-
### Step 1: Resolve Store Paths
|
|
39
|
-
|
|
40
|
-
- **Workflow store**: `.workflow/knowhow/` (entries: `KNW-*.md`, `TIP-*.md`, `TPL-*.md`, `RCP-*.md`, `REF-*.md`, `DCS-*.md`, indexed in `.workflow/wiki-index.json`)
|
|
41
|
-
- **System store**: `~/.claude/projects/{project}/memory/` (files: `MEMORY.md` + topic `.md` files)
|
|
42
|
-
|
|
43
|
-
Derive system path from project root (replace path separators with `--`, prefix drive letter).
|
|
44
|
-
|
|
45
|
-
### Step 2: Parse Subcommand
|
|
46
|
-
|
|
47
|
-
Default to `list` if no arguments. Parse first token as subcommand.
|
|
48
|
-
|
|
49
|
-
### Step 3: Execute Subcommand
|
|
50
|
-
|
|
51
|
-
**list**: Show entries from both stores (or filtered by `--store`, `--tag`, `--type`).
|
|
52
|
-
- Workflow: use `maestro search --type knowhow --json` or read `.workflow/wiki-index.json`, display ID, type, category, date, tags, title
|
|
53
|
-
- System: list `.md` files in system memory directory
|
|
54
|
-
|
|
55
|
-
**search `<query>`**: Full-text grep across both stores. Rank by match count.
|
|
56
|
-
|
|
57
|
-
**view `<id|file>`**: Auto-detect store from format (`KNW-*/TIP-*/TPL-*/RCP-*/REF-*/DCS-*` = workflow, else system). Display full content.
|
|
58
|
-
|
|
59
|
-
**edit `<file>`**: Edit a system memory file. Read current content, apply changes. Warn if MEMORY.md exceeds 200 lines (W003).
|
|
60
|
-
|
|
61
|
-
**delete `<id|file>`**: Require confirmation (or `--confirm` flag). MEMORY.md cannot be deleted (E004). Remove entry file (WikiIndexer auto-updates `.workflow/wiki-index.json` on next access).
|
|
62
|
-
|
|
63
|
-
**prune**: Requires at least one filter (`--tag`, `--type`, `--before`, `--after`). Workflow store only. `--dry-run` previews without deleting.
|
|
64
|
-
|
|
65
|
-
### Step 4: Integrity Check
|
|
66
|
-
|
|
67
|
-
After write operations, verify:
|
|
68
|
-
- No orphaned files without index entries (W001)
|
|
69
|
-
- No dangling index references to missing files (W001)
|
|
70
|
-
- System MEMORY.md references valid topic files (W002)
|
|
71
|
-
</execution>
|
|
72
|
-
|
|
73
|
-
<error_codes>
|
|
74
|
-
| Code | Severity | Description |
|
|
75
|
-
|------|----------|-------------|
|
|
76
|
-
| E001 | error | No stores found — for workflow store run
|
|
77
|
-
| E002 | error | Entry ID or filename not found |
|
|
78
|
-
| E003 | error | Prune requires at least one filter flag |
|
|
79
|
-
| E004 | error | Cannot delete MEMORY.md — use `edit` subcommand instead |
|
|
80
|
-
| W001 | warning | Index has orphaned files or dangling references |
|
|
81
|
-
| W002 | warning | MEMORY.md references non-existent topic file |
|
|
82
|
-
| W003 | warning | MEMORY.md exceeds 200 lines — content truncated at load |
|
|
83
|
-
</error_codes>
|
|
84
|
-
|
|
85
|
-
<success_criteria>
|
|
86
|
-
- [ ] Store paths resolved correctly for both workflow and system stores
|
|
87
|
-
- [ ] Subcommand parsed and validated (defaults to list)
|
|
88
|
-
- [ ] list: displays entries from selected stores with filtering
|
|
89
|
-
- [ ] search: full-text grep across stores, ranked by match count
|
|
90
|
-
- [ ] view: auto-detects store, displays full content
|
|
91
|
-
- [ ] edit: reads and applies changes to system memory files
|
|
92
|
-
- [ ] delete: requires confirmation, prevents MEMORY.md deletion
|
|
93
|
-
- [ ] prune: requires filter, supports --dry-run, workflow store only
|
|
94
|
-
- [ ] Integrity check after write operations (orphans, dangling refs)
|
|
95
|
-
</success_criteria>
|
|
1
|
+
---
|
|
2
|
+
name: manage-knowhow
|
|
3
|
+
description: Manage knowhow entries (workflow and system)
|
|
4
|
+
argument-hint: "[list|search|view|edit|delete|prune] [query|id|file] [--store workflow|system|all] [--tag tag] [--type type]"
|
|
5
|
+
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<purpose>
|
|
9
|
+
Manage knowhow entries across workflow and system stores. Provides list, search, view, edit, delete, and prune operations over `.workflow/knowhow/` (workflow store) and `~/.claude/projects/{project}/memory/` (system store).
|
|
10
|
+
</purpose>
|
|
11
|
+
|
|
12
|
+
<context>
|
|
13
|
+
$ARGUMENTS — subcommand followed by options. Defaults to `list` if no arguments.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
$manage-knowhow
|
|
17
|
+
$manage-knowhow "list --store workflow"
|
|
18
|
+
$manage-knowhow "search authentication"
|
|
19
|
+
$manage-knowhow "view KNW-20260318-001"
|
|
20
|
+
$manage-knowhow "edit MEMORY.md"
|
|
21
|
+
$manage-knowhow "delete TIP-20260318-001 --confirm"
|
|
22
|
+
$manage-knowhow "prune --before 2026-01-01 --type tip --dry-run"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Subcommands**: `list`, `search`, `view`, `edit`, `delete`, `prune`.
|
|
26
|
+
|
|
27
|
+
**Flags**:
|
|
28
|
+
- `--store workflow|system|all` — Target store (default: all)
|
|
29
|
+
- `--tag <tag>` — Filter by tag
|
|
30
|
+
- `--type <session|tip|template|recipe|reference|decision>` — Filter by knowhow type
|
|
31
|
+
- `--confirm` — Skip delete confirmation prompt
|
|
32
|
+
- `--before <date>` / `--after <date>` — Date filters for prune
|
|
33
|
+
- `--dry-run` — Preview prune without deleting
|
|
34
|
+
</context>
|
|
35
|
+
|
|
36
|
+
<execution>
|
|
37
|
+
|
|
38
|
+
### Step 1: Resolve Store Paths
|
|
39
|
+
|
|
40
|
+
- **Workflow store**: `.workflow/knowhow/` (entries: `KNW-*.md`, `TIP-*.md`, `TPL-*.md`, `RCP-*.md`, `REF-*.md`, `DCS-*.md`, indexed in `.workflow/wiki-index.json`)
|
|
41
|
+
- **System store**: `~/.claude/projects/{project}/memory/` (files: `MEMORY.md` + topic `.md` files)
|
|
42
|
+
|
|
43
|
+
Derive system path from project root (replace path separators with `--`, prefix drive letter).
|
|
44
|
+
|
|
45
|
+
### Step 2: Parse Subcommand
|
|
46
|
+
|
|
47
|
+
Default to `list` if no arguments. Parse first token as subcommand.
|
|
48
|
+
|
|
49
|
+
### Step 3: Execute Subcommand
|
|
50
|
+
|
|
51
|
+
**list**: Show entries from both stores (or filtered by `--store`, `--tag`, `--type`).
|
|
52
|
+
- Workflow: use `maestro search --type knowhow --json` or read `.workflow/wiki-index.json`, display ID, type, category, date, tags, title
|
|
53
|
+
- System: list `.md` files in system memory directory
|
|
54
|
+
|
|
55
|
+
**search `<query>`**: Full-text grep across both stores. Rank by match count.
|
|
56
|
+
|
|
57
|
+
**view `<id|file>`**: Auto-detect store from format (`KNW-*/TIP-*/TPL-*/RCP-*/REF-*/DCS-*` = workflow, else system). Display full content.
|
|
58
|
+
|
|
59
|
+
**edit `<file>`**: Edit a system memory file. Read current content, apply changes. Warn if MEMORY.md exceeds 200 lines (W003).
|
|
60
|
+
|
|
61
|
+
**delete `<id|file>`**: Require confirmation (or `--confirm` flag). MEMORY.md cannot be deleted (E004). Remove entry file (WikiIndexer auto-updates `.workflow/wiki-index.json` on next access).
|
|
62
|
+
|
|
63
|
+
**prune**: Requires at least one filter (`--tag`, `--type`, `--before`, `--after`). Workflow store only. `--dry-run` previews without deleting.
|
|
64
|
+
|
|
65
|
+
### Step 4: Integrity Check
|
|
66
|
+
|
|
67
|
+
After write operations, verify:
|
|
68
|
+
- No orphaned files without index entries (W001)
|
|
69
|
+
- No dangling index references to missing files (W001)
|
|
70
|
+
- System MEMORY.md references valid topic files (W002)
|
|
71
|
+
</execution>
|
|
72
|
+
|
|
73
|
+
<error_codes>
|
|
74
|
+
| Code | Severity | Description |
|
|
75
|
+
|------|----------|-------------|
|
|
76
|
+
| E001 | error | No stores found — for workflow store run `$manage-knowhow-capture`; for system store run `$manage-memory-capture` or create MEMORY.md |
|
|
77
|
+
| E002 | error | Entry ID or filename not found |
|
|
78
|
+
| E003 | error | Prune requires at least one filter flag |
|
|
79
|
+
| E004 | error | Cannot delete MEMORY.md — use `edit` subcommand instead |
|
|
80
|
+
| W001 | warning | Index has orphaned files or dangling references |
|
|
81
|
+
| W002 | warning | MEMORY.md references non-existent topic file |
|
|
82
|
+
| W003 | warning | MEMORY.md exceeds 200 lines — content truncated at load |
|
|
83
|
+
</error_codes>
|
|
84
|
+
|
|
85
|
+
<success_criteria>
|
|
86
|
+
- [ ] Store paths resolved correctly for both workflow and system stores
|
|
87
|
+
- [ ] Subcommand parsed and validated (defaults to list)
|
|
88
|
+
- [ ] list: displays entries from selected stores with filtering
|
|
89
|
+
- [ ] search: full-text grep across stores, ranked by match count
|
|
90
|
+
- [ ] view: auto-detects store, displays full content
|
|
91
|
+
- [ ] edit: reads and applies changes to system memory files
|
|
92
|
+
- [ ] delete: requires confirmation, prevents MEMORY.md deletion
|
|
93
|
+
- [ ] prune: requires filter, supports --dry-run, workflow store only
|
|
94
|
+
- [ ] Integrity check after write operations (orphans, dangling refs)
|
|
95
|
+
</success_criteria>
|