ai-development-framework 0.1.1 → 0.1.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/.claude/commands/create-prd.md +23 -2
- package/.claude/commands/execute.md +14 -0
- package/.claude/commands/plan-project.md +18 -0
- package/.claude/commands/prime.md +14 -0
- package/.claude/commands/ship.md +45 -0
- package/.claude/commands/start.md +10 -1
- package/.claude/references/knowledge-base-templates.md +124 -0
- package/CLAUDE.md +38 -0
- package/cli/init.js +1 -1
- package/docs/customization.md +56 -0
- package/docs/plans/2026-04-04-knowledge-base-integration-design.md +209 -0
- package/docs/superpowers/plans/2026-04-04-knowledge-base-integration.md +526 -0
- package/package.json +1 -1
|
@@ -31,6 +31,25 @@ Invoke the brainstorming skill to explore the idea before writing anything:
|
|
|
31
31
|
4. User stories should be concrete and testable
|
|
32
32
|
5. Implementation phases should be ordered by dependency and value
|
|
33
33
|
|
|
34
|
+
### Phase 2.5: Seed Knowledge Base (if configured)
|
|
35
|
+
|
|
36
|
+
Check CLAUDE.md for a `## Knowledge Base` section with a `Path:` value. If configured:
|
|
37
|
+
|
|
38
|
+
1. Read `.claude/references/knowledge-base-templates.md` for templates
|
|
39
|
+
2. Create `<kb-path>/overview.md` from the PRD:
|
|
40
|
+
- Vision from Executive Summary
|
|
41
|
+
- Goals from Goals & Success Criteria
|
|
42
|
+
- Target Users from Target Users section
|
|
43
|
+
- Tech Stack from Technical Architecture
|
|
44
|
+
- Feature Areas listing each epic/feature
|
|
45
|
+
3. Create `<kb-path>/architecture/system-design.md` from the PRD's Technical Architecture and System Diagram sections
|
|
46
|
+
4. For each epic or major feature in the PRD, create `<kb-path>/features/<feature-name>.md` using the feature note template:
|
|
47
|
+
- Summary from the epic description
|
|
48
|
+
- GitHub Issues section left empty (populated by `/plan-project`)
|
|
49
|
+
- Key Decisions from any decisions made during brainstorming
|
|
50
|
+
|
|
51
|
+
If no knowledge base configured, skip this phase.
|
|
52
|
+
|
|
34
53
|
### Phase 3: Review and Save
|
|
35
54
|
|
|
36
55
|
1. Present the PRD to the user section by section
|
|
@@ -48,8 +67,10 @@ After saving, tell the user:
|
|
|
48
67
|
> - Run `/plan-project` to decompose this into GitHub milestones and issues
|
|
49
68
|
> - Or run `/plan-feature` to start planning a specific feature from the PRD
|
|
50
69
|
|
|
51
|
-
Commit the PRD:
|
|
70
|
+
Commit the PRD and knowledge base files (if created):
|
|
52
71
|
```bash
|
|
53
72
|
git add docs/plans/PRD.md
|
|
54
|
-
|
|
73
|
+
# If knowledge base was seeded:
|
|
74
|
+
git add <kb-path>/overview.md <kb-path>/architecture/ <kb-path>/features/
|
|
75
|
+
git commit -m "docs: add PRD and seed project knowledge base"
|
|
55
76
|
```
|
|
@@ -27,6 +27,20 @@ Executes an implementation plan task by task with TDD discipline.
|
|
|
27
27
|
|
|
28
28
|
Read every file listed in the plan's "Mandatory Reading" section. This ensures you have the codebase context needed for implementation.
|
|
29
29
|
|
|
30
|
+
#### Knowledge Base Context (if configured)
|
|
31
|
+
|
|
32
|
+
Check CLAUDE.md for a `## Knowledge Base` section with a `Path:` value. If configured:
|
|
33
|
+
|
|
34
|
+
1. Detect the issue number from the plan file or current branch
|
|
35
|
+
2. Grep `<kb-path>/features/*.md` for the issue number — read the matching feature note
|
|
36
|
+
3. Scan other feature notes (first 5 lines each) for related features — read any with clear overlap
|
|
37
|
+
4. Check `<kb-path>/decisions/` for decisions referencing the same feature area
|
|
38
|
+
5. Read `<kb-path>/overview.md` for project context
|
|
39
|
+
|
|
40
|
+
This supplements the plan's mandatory reading with project-level context the plan author may not have included.
|
|
41
|
+
|
|
42
|
+
If no knowledge base configured, skip this step.
|
|
43
|
+
|
|
30
44
|
### Step 3: Execute Tasks
|
|
31
45
|
|
|
32
46
|
For each task in the plan:
|
|
@@ -74,6 +74,24 @@ gh issue create --title "[type]: description" --body "..." --label "feat,priorit
|
|
|
74
74
|
|
|
75
75
|
For issues with dependencies, add a "Blocked by #N" line in the issue body.
|
|
76
76
|
|
|
77
|
+
#### Knowledge Base Integration (if configured)
|
|
78
|
+
|
|
79
|
+
Check CLAUDE.md for a `## Knowledge Base` section with a `Path:` value. If configured, after creating each GitHub issue:
|
|
80
|
+
|
|
81
|
+
1. Check if a feature note already exists in `<kb-path>/features/` for this feature area
|
|
82
|
+
2. If yes: update the `## GitHub Issues` section with the new issue number and title
|
|
83
|
+
3. If no: create a new feature note using `.claude/references/knowledge-base-templates.md` template, with:
|
|
84
|
+
- Summary from the issue description
|
|
85
|
+
- GitHub Issues section listing the new issue
|
|
86
|
+
4. If architectural decisions were made during the planning process, create `<kb-path>/decisions/NNN-title.md` for each significant decision
|
|
87
|
+
|
|
88
|
+
Stage knowledge base files for commit:
|
|
89
|
+
```bash
|
|
90
|
+
git add <kb-path>/features/ <kb-path>/decisions/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
If no knowledge base configured, skip this step.
|
|
94
|
+
|
|
77
95
|
### Phase 6: Generate Roadmap
|
|
78
96
|
|
|
79
97
|
Save a roadmap file to `docs/plans/roadmap.md`:
|
|
@@ -42,6 +42,17 @@ git branch --show-current
|
|
|
42
42
|
- Read `.claude/agents/tester-agent/test-patterns.md` (page inventory)
|
|
43
43
|
- Check `package.json` or equivalent for available scripts/commands
|
|
44
44
|
|
|
45
|
+
### 6. Knowledge Base Context
|
|
46
|
+
|
|
47
|
+
Check CLAUDE.md for a `## Knowledge Base` section with a `Path:` value (e.g., `.obsidian/`). If configured and the directory exists:
|
|
48
|
+
|
|
49
|
+
1. **Always read:** `<kb-path>/overview.md`
|
|
50
|
+
2. **Find linked feature note:** If working on a specific issue (detected from branch name or user input), grep `<kb-path>/features/*.md` for the issue number. Read the matching feature note.
|
|
51
|
+
3. **Scan for related features:** List all files in `<kb-path>/features/`. Read the first 5 lines (`## Summary`) of each. If any feature has a clear dependency or overlap with the current issue (shared entities, referenced in acceptance criteria, same domain area), read the full note.
|
|
52
|
+
4. **Check decisions:** List `<kb-path>/decisions/`. Read any whose title references the same feature area.
|
|
53
|
+
|
|
54
|
+
If no knowledge base configured, skip this section entirely.
|
|
55
|
+
|
|
45
56
|
## Output Format
|
|
46
57
|
|
|
47
58
|
Present a structured summary:
|
|
@@ -67,5 +78,8 @@ Available Commands:
|
|
|
67
78
|
|
|
68
79
|
Knowledge Base: [N domains documented in architect-agent]
|
|
69
80
|
|
|
81
|
+
Project Knowledge: [summary from overview.md if knowledge base exists, or "not configured"]
|
|
82
|
+
Related Features: [list of feature notes loaded for this session]
|
|
83
|
+
|
|
70
84
|
=== Ready. Run /start to begin or specify a command. ===
|
|
71
85
|
```
|
package/.claude/commands/ship.md
CHANGED
|
@@ -10,6 +10,51 @@ Handles the full shipping workflow: staging, committing, pushing, and creating a
|
|
|
10
10
|
2. Verify no uncommitted changes that shouldn't be included
|
|
11
11
|
3. Check current branch is not main/master
|
|
12
12
|
|
|
13
|
+
### Step 1.5: Update Knowledge Base (if configured)
|
|
14
|
+
|
|
15
|
+
Check CLAUDE.md for a `## Knowledge Base` section with a `Path:` value. If configured:
|
|
16
|
+
|
|
17
|
+
1. **Find the feature note:** Detect the current issue number from the branch name. Grep `<kb-path>/features/*.md` for that issue number. If no match, use keyword matching between branch name and feature note filenames.
|
|
18
|
+
|
|
19
|
+
2. **Update the feature note:**
|
|
20
|
+
- `## Implementation Notes` — append what was built: key files created/modified, endpoints added, components built, patterns used
|
|
21
|
+
- `## GitHub Issues` — update the status of the current issue to reflect completion
|
|
22
|
+
- `## Key Decisions` — add any decisions made during implementation that weren't pre-planned
|
|
23
|
+
|
|
24
|
+
3. **Create decision records** (only if warranted):
|
|
25
|
+
- A technology or approach was chosen over alternatives during implementation
|
|
26
|
+
- A pattern was established that future features should follow
|
|
27
|
+
- Something was intentionally excluded and the reason matters for future work
|
|
28
|
+
|
|
29
|
+
4. **Update overview** (only if significant):
|
|
30
|
+
- New integration or service was added to the stack
|
|
31
|
+
- Project scope changed
|
|
32
|
+
|
|
33
|
+
5. Stage knowledge base changes alongside code changes.
|
|
34
|
+
|
|
35
|
+
If no knowledge base configured, skip to Step 2.
|
|
36
|
+
|
|
37
|
+
### Step 1.6: Codex Adversarial Review (optional)
|
|
38
|
+
|
|
39
|
+
This step requires an OpenAI subscription and the Codex plugin installed. If not available, skip to Step 2.
|
|
40
|
+
|
|
41
|
+
Check if the Codex companion script exists:
|
|
42
|
+
```bash
|
|
43
|
+
test -f "$HOME/.claude/plugins/cache/openai-codex/codex/*/scripts/codex-companion.mjs" && echo "codex available" || echo "codex not available"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If Codex is available:
|
|
47
|
+
|
|
48
|
+
1. Ask the user: "Run Codex adversarial review before committing? (requires OpenAI subscription)"
|
|
49
|
+
- If yes: run `/codex:adversarial-review` against the working tree changes
|
|
50
|
+
- If no: skip to Step 2
|
|
51
|
+
2. Present the review output to the user
|
|
52
|
+
3. If the review surfaces significant concerns, ask: "Address these findings before committing, or proceed?"
|
|
53
|
+
- If address: stop `/ship`, let the user fix issues, then re-run `/ship`
|
|
54
|
+
- If proceed: continue to Step 2
|
|
55
|
+
|
|
56
|
+
This does NOT replace the superpowers code review in `/validate`. It is an additional, adversarial perspective that questions design choices, tradeoffs, and assumptions — not just implementation defects.
|
|
57
|
+
|
|
13
58
|
### Step 2: Stage and Commit
|
|
14
59
|
|
|
15
60
|
Use the `/commit` skill (from commit-commands plugin) for proper conventional commit formatting.
|
|
@@ -10,6 +10,7 @@ Run these in parallel:
|
|
|
10
10
|
3. Check current git branch and status
|
|
11
11
|
4. Check for existing GitHub issues: `gh issue list --limit 5 2>/dev/null`
|
|
12
12
|
5. Check for existing plan files: `find docs/plans docs/superpowers/plans -name "*.md" 2>/dev/null`
|
|
13
|
+
6. Check if knowledge base is configured: look for `## Knowledge Base` section with `Path:` in CLAUDE.md. If found, check if the directory exists and has `overview.md`
|
|
13
14
|
|
|
14
15
|
## Step 2: Detect Scope Level
|
|
15
16
|
|
|
@@ -21,7 +22,15 @@ Based on context, determine the entry point:
|
|
|
21
22
|
|
|
22
23
|
**L0 (New Project)** — No PRD, no issues, minimal/no code
|
|
23
24
|
→ "Looks like a fresh project. Let's plan it from scratch."
|
|
24
|
-
→ Route to:
|
|
25
|
+
→ Route to:
|
|
26
|
+
1. Brainstorm functionalities (interactive discussion)
|
|
27
|
+
2. If knowledge base configured in CLAUDE.md:
|
|
28
|
+
a. Create knowledge base folder structure (`overview.md`, `features/`, `decisions/`, `config/`, `research/`, `architecture/`)
|
|
29
|
+
b. Create `overview.md` from brainstorming results using `.claude/references/knowledge-base-templates.md`
|
|
30
|
+
c. Create feature notes in `features/` for each agreed functionality
|
|
31
|
+
3. `/create-prd` (generates PRD from brainstorming, seeds knowledge base if configured)
|
|
32
|
+
4. `/plan-project` (creates GitHub issues, links them to feature notes)
|
|
33
|
+
5. STOP — present the issue list and ask: "Which issue do you want to work on first?"
|
|
25
34
|
|
|
26
35
|
**L1 (New Feature)** — Project exists, user has a feature idea (no specific issue)
|
|
27
36
|
→ "Let's plan this feature."
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Knowledge Base Templates
|
|
2
|
+
|
|
3
|
+
Used by pipeline commands when creating knowledge base notes. The knowledge base path is configured in the project's CLAUDE.md under `## Knowledge Base`.
|
|
4
|
+
|
|
5
|
+
**Security:** Knowledge base notes are committed to git. NEVER store actual secret values (API keys, tokens, passwords) in any note. Store only metadata: which env vars are needed, which services are used, who owns credentials. Actual secrets belong in `.env` files, secret managers, or CI/CD variables.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Feature Note Template
|
|
10
|
+
|
|
11
|
+
Create one per feature area in `<kb-path>/features/<feature-name>.md`.
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
# Feature: [Name]
|
|
15
|
+
|
|
16
|
+
## Summary
|
|
17
|
+
|
|
18
|
+
[1-2 sentences: what this feature does and why]
|
|
19
|
+
|
|
20
|
+
## GitHub Issues
|
|
21
|
+
|
|
22
|
+
- #N — [title] (status: open/closed)
|
|
23
|
+
|
|
24
|
+
## Key Decisions
|
|
25
|
+
|
|
26
|
+
- [Decision and why]
|
|
27
|
+
|
|
28
|
+
## Implementation Notes
|
|
29
|
+
|
|
30
|
+
[Updated by /ship after work is completed — endpoints created, components built, patterns used]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Decision Record Template
|
|
36
|
+
|
|
37
|
+
Create in `<kb-path>/decisions/NNN-title.md` when:
|
|
38
|
+
- A technology or approach was chosen over alternatives
|
|
39
|
+
- A pattern was established that future work should follow
|
|
40
|
+
- Something was intentionally excluded (and why)
|
|
41
|
+
|
|
42
|
+
NOT for every small implementation choice.
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
# NNN: [Title]
|
|
46
|
+
|
|
47
|
+
**Date:** YYYY-MM-DD
|
|
48
|
+
**Status:** Accepted
|
|
49
|
+
|
|
50
|
+
## Context
|
|
51
|
+
|
|
52
|
+
[What situation led to this decision]
|
|
53
|
+
|
|
54
|
+
## Decision
|
|
55
|
+
|
|
56
|
+
[What we chose and why]
|
|
57
|
+
|
|
58
|
+
## Consequences
|
|
59
|
+
|
|
60
|
+
[What this means for future work — both positive and negative]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Overview Template
|
|
66
|
+
|
|
67
|
+
Create once at `<kb-path>/overview.md` during project setup or PRD creation.
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
# [Project Name]
|
|
71
|
+
|
|
72
|
+
## Vision
|
|
73
|
+
|
|
74
|
+
[1-2 sentences: what this project is and why it exists]
|
|
75
|
+
|
|
76
|
+
## Goals
|
|
77
|
+
|
|
78
|
+
- [Goal 1]
|
|
79
|
+
- [Goal 2]
|
|
80
|
+
|
|
81
|
+
## Target Users
|
|
82
|
+
|
|
83
|
+
- [User type 1]: [their key need]
|
|
84
|
+
- [User type 2]: [their key need]
|
|
85
|
+
|
|
86
|
+
## Tech Stack
|
|
87
|
+
|
|
88
|
+
| Layer | Technology | Rationale |
|
|
89
|
+
|-------|-----------|-----------|
|
|
90
|
+
| | | |
|
|
91
|
+
|
|
92
|
+
## Feature Areas
|
|
93
|
+
|
|
94
|
+
- [Feature 1] — see `features/feature-1.md`
|
|
95
|
+
- [Feature 2] — see `features/feature-2.md`
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Architecture Template
|
|
101
|
+
|
|
102
|
+
Create at `<kb-path>/architecture/system-design.md` from PRD's technical architecture section.
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
# System Design
|
|
106
|
+
|
|
107
|
+
## Overview
|
|
108
|
+
|
|
109
|
+
[High-level description of the system architecture]
|
|
110
|
+
|
|
111
|
+
## Components
|
|
112
|
+
|
|
113
|
+
| Component | Responsibility | Tech |
|
|
114
|
+
|-----------|---------------|------|
|
|
115
|
+
| | | |
|
|
116
|
+
|
|
117
|
+
## Data Flow
|
|
118
|
+
|
|
119
|
+
[How data moves through the system]
|
|
120
|
+
|
|
121
|
+
## Integrations
|
|
122
|
+
|
|
123
|
+
[External services and how they connect]
|
|
124
|
+
```
|
package/CLAUDE.md
CHANGED
|
@@ -54,6 +54,44 @@ For non-trivial tasks, choose your discipline level:
|
|
|
54
54
|
- **mobile-tester-agent** — Mobile app testing via mobile-mcp (VERIFY/FLOW)
|
|
55
55
|
- **ui-ux-analyzer** — Design audit agent with screenshots and reports
|
|
56
56
|
|
|
57
|
+
## Knowledge Base
|
|
58
|
+
|
|
59
|
+
Optional Obsidian-compatible project knowledge base. Stores feature specs, architecture decisions, and project overview as markdown notes that the agent reads/writes during the pipeline.
|
|
60
|
+
|
|
61
|
+
**Configuration:** Add `## Knowledge Base` with `Path: <path>` to your project's CLAUDE.md. Default: `.obsidian/`. Remove the section to disable.
|
|
62
|
+
|
|
63
|
+
**Structure:**
|
|
64
|
+
```
|
|
65
|
+
<path>/
|
|
66
|
+
├── overview.md # Project vision, goals, tech stack
|
|
67
|
+
├── architecture/ # System design, data model
|
|
68
|
+
├── features/ # One note per feature area, linked to GitHub issues
|
|
69
|
+
├── decisions/ # Architecture Decision Records (ADRs)
|
|
70
|
+
├── config/ # Integration metadata, env var names (never actual secrets)
|
|
71
|
+
└── research/ # Brainstorming notes, tech comparisons
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**When commands read it:**
|
|
75
|
+
- `/prime` — loads overview + related feature notes (smart/targeted)
|
|
76
|
+
- `/execute` — reads feature context before implementing
|
|
77
|
+
|
|
78
|
+
**When commands write it:**
|
|
79
|
+
- `/start` (L0) — creates structure + feature notes during brainstorming
|
|
80
|
+
- `/create-prd` — seeds overview + architecture from PRD
|
|
81
|
+
- `/plan-project` — creates feature notes alongside GitHub issues
|
|
82
|
+
- `/ship` — updates feature notes with implementation details
|
|
83
|
+
|
|
84
|
+
## Code Review Layers
|
|
85
|
+
|
|
86
|
+
The framework supports two complementary review layers:
|
|
87
|
+
|
|
88
|
+
| Layer | Command | What it checks | Required |
|
|
89
|
+
|-------|---------|---------------|----------|
|
|
90
|
+
| **Superpowers Code Review** | `/validate` Phase 3 | Implementation defects, plan adherence, security, edge cases | Always available |
|
|
91
|
+
| **Codex Adversarial Review** | `/ship` Step 1.6 | Design choices, tradeoffs, assumptions, alternative approaches | Optional (requires OpenAI subscription + Codex plugin) |
|
|
92
|
+
|
|
93
|
+
These are additive — the adversarial review questions whether the *approach* is right, while the code review checks whether the *implementation* is correct.
|
|
94
|
+
|
|
57
95
|
## Rules & References
|
|
58
96
|
|
|
59
97
|
- Domain-specific rules auto-load from `.claude/rules/` based on file paths being edited
|
package/cli/init.js
CHANGED
|
@@ -434,7 +434,7 @@ async function main() {
|
|
|
434
434
|
console.log(' .claude/agents/ 4 specialist agents + template');
|
|
435
435
|
console.log(' .claude/skills/ 2 framework skills');
|
|
436
436
|
console.log(' .claude/rules/ 6 domain rules + template');
|
|
437
|
-
console.log(' .claude/references/
|
|
437
|
+
console.log(' .claude/references/ 6 templates');
|
|
438
438
|
console.log(' .claude/hooks/ 5 guardrails');
|
|
439
439
|
console.log(' docs/ methodology + guides');
|
|
440
440
|
console.log('');
|
package/docs/customization.md
CHANGED
|
@@ -26,6 +26,62 @@ Hooks are shell scripts in `.claude/hooks/`. Edit existing hooks or add new ones
|
|
|
26
26
|
|
|
27
27
|
Each project gets its own `.claude/` folder. Customize CLAUDE.md, rules, and agent knowledge bases per project. The framework's commands stay the same.
|
|
28
28
|
|
|
29
|
+
## Configuring the Knowledge Base
|
|
30
|
+
|
|
31
|
+
The framework includes an optional project knowledge base (Obsidian-compatible) that gives the agent persistent project understanding across sessions.
|
|
32
|
+
|
|
33
|
+
### Enable
|
|
34
|
+
|
|
35
|
+
Add to your project's `CLAUDE.md`:
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
## Knowledge Base
|
|
39
|
+
|
|
40
|
+
Path: .obsidian/
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Custom Path
|
|
44
|
+
|
|
45
|
+
Use any folder name:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
## Knowledge Base
|
|
49
|
+
|
|
50
|
+
Path: knowledge/
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Note:** The framework's `.gitignore` only covers Obsidian config files under `.obsidian/`. If you use a custom path and open it as an Obsidian vault, add these entries to your `.gitignore` (replacing `knowledge/` with your path):
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
knowledge/app.json
|
|
57
|
+
knowledge/appearance.json
|
|
58
|
+
knowledge/core-plugins.json
|
|
59
|
+
knowledge/core-plugins-migration.json
|
|
60
|
+
knowledge/workspace.json
|
|
61
|
+
knowledge/workspace-mobile.json
|
|
62
|
+
knowledge/hotkeys.json
|
|
63
|
+
knowledge/plugins/
|
|
64
|
+
knowledge/themes/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Disable
|
|
68
|
+
|
|
69
|
+
Remove the `## Knowledge Base` section from CLAUDE.md. All knowledge operations are skipped — commands work exactly as before.
|
|
70
|
+
|
|
71
|
+
### What It Does
|
|
72
|
+
|
|
73
|
+
Pipeline commands automatically read from and write to the knowledge base:
|
|
74
|
+
- `/start` creates the structure when starting a new project
|
|
75
|
+
- `/prime` loads relevant notes for context before work
|
|
76
|
+
- `/create-prd` seeds the knowledge base from the PRD
|
|
77
|
+
- `/plan-project` creates feature notes alongside GitHub issues
|
|
78
|
+
- `/execute` reads related feature notes before implementing
|
|
79
|
+
- `/ship` updates feature notes after completing work
|
|
80
|
+
|
|
81
|
+
### Obsidian
|
|
82
|
+
|
|
83
|
+
If you have [Obsidian](https://obsidian.md/) installed, open your project folder as a vault. The `.obsidian/` directory makes it a valid vault. Notes are navigable, linkable, and searchable through Obsidian's UI. Obsidian is not required — the notes are plain markdown.
|
|
84
|
+
|
|
29
85
|
## Contributing
|
|
30
86
|
|
|
31
87
|
1. Fork the repository
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Knowledge Base Integration Design
|
|
2
|
+
|
|
3
|
+
**Date:** 2026-04-04
|
|
4
|
+
**Status:** Approved
|
|
5
|
+
|
|
6
|
+
## Problem
|
|
7
|
+
|
|
8
|
+
The agent starts each session with no project-level context beyond what it can read from code and git history. It doesn't know what features are planned, why decisions were made, or how features relate to each other. This leads to:
|
|
9
|
+
|
|
10
|
+
- Agent trying to implement entire projects in one shot instead of following the issue-based pipeline
|
|
11
|
+
- No persistent project understanding across sessions
|
|
12
|
+
- Brainstorming insights lost after the session ends
|
|
13
|
+
- No automatic check for related features/decisions before starting work
|
|
14
|
+
|
|
15
|
+
## Solution
|
|
16
|
+
|
|
17
|
+
Add an optional, Obsidian-compatible knowledge base (`.obsidian/` by default) that pipeline commands read from and write to at natural checkpoints. The knowledge base complements the existing architect-agent (code-level knowledge) with project-level understanding.
|
|
18
|
+
|
|
19
|
+
## Design
|
|
20
|
+
|
|
21
|
+
### Knowledge Base Structure
|
|
22
|
+
|
|
23
|
+
Default path: `.obsidian/` (configurable via `Knowledge Base: <path>` in project CLAUDE.md).
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
.obsidian/
|
|
27
|
+
├── app.json # Obsidian config (gitignored)
|
|
28
|
+
├── appearance.json # Obsidian config (gitignored)
|
|
29
|
+
├── core-plugins.json # Obsidian config (gitignored)
|
|
30
|
+
├── workspace.json # Obsidian config (gitignored)
|
|
31
|
+
├── overview.md # Project vision, goals, tech stack, target users
|
|
32
|
+
├── architecture/
|
|
33
|
+
│ └── system-design.md # High-level architecture, component diagram
|
|
34
|
+
├── features/
|
|
35
|
+
│ ├── feature-name.md # One per feature area, links to GitHub issues
|
|
36
|
+
│ └── ...
|
|
37
|
+
├── decisions/
|
|
38
|
+
│ └── NNN-title.md # ADR format: context, decision, consequences
|
|
39
|
+
├── config/
|
|
40
|
+
│ └── integrations.md # Third-party services, env var names (never store actual secrets)
|
|
41
|
+
└── research/
|
|
42
|
+
└── ... # Brainstorming notes, tech comparisons
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Gitignore Rules
|
|
46
|
+
|
|
47
|
+
Obsidian config files are gitignored (machine-specific). Notes are committed.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
.obsidian/app.json
|
|
51
|
+
.obsidian/appearance.json
|
|
52
|
+
.obsidian/core-plugins.json
|
|
53
|
+
.obsidian/core-plugins-migration.json
|
|
54
|
+
.obsidian/workspace.json
|
|
55
|
+
.obsidian/hotkeys.json
|
|
56
|
+
.obsidian/plugins/
|
|
57
|
+
.obsidian/themes/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Feature Note Template
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
# Feature: [Name]
|
|
64
|
+
|
|
65
|
+
## Summary
|
|
66
|
+
[1-2 sentences: what this feature does and why]
|
|
67
|
+
|
|
68
|
+
## GitHub Issues
|
|
69
|
+
- #N — [title] (status)
|
|
70
|
+
- #N — [title] (status)
|
|
71
|
+
|
|
72
|
+
## Key Decisions
|
|
73
|
+
- [Decision and why]
|
|
74
|
+
|
|
75
|
+
## Implementation Notes
|
|
76
|
+
[Updated after work is completed — endpoints created, components built, patterns used]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Decision Record Template
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
# NNN: [Title]
|
|
83
|
+
|
|
84
|
+
**Date:** YYYY-MM-DD
|
|
85
|
+
**Status:** Accepted
|
|
86
|
+
|
|
87
|
+
## Context
|
|
88
|
+
[What situation led to this decision]
|
|
89
|
+
|
|
90
|
+
## Decision
|
|
91
|
+
[What we chose and why]
|
|
92
|
+
|
|
93
|
+
## Consequences
|
|
94
|
+
[What this means for future work — both positive and negative]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Command Integration
|
|
98
|
+
|
|
99
|
+
### `/start` — New L0 Behavior
|
|
100
|
+
|
|
101
|
+
Detects empty project → routes to new flow:
|
|
102
|
+
1. Brainstorm functionalities (interactive)
|
|
103
|
+
2. Create `.obsidian/` structure with `overview.md`
|
|
104
|
+
3. Create feature notes in `.obsidian/features/`
|
|
105
|
+
4. Create GitHub issues linked to feature notes
|
|
106
|
+
5. STOP — ask user which issue to work on
|
|
107
|
+
|
|
108
|
+
### `/prime` — Smart Knowledge Loading
|
|
109
|
+
|
|
110
|
+
Add to existing context loading:
|
|
111
|
+
1. Read `.obsidian/overview.md` (always)
|
|
112
|
+
2. If working on a specific issue → read the linked feature note
|
|
113
|
+
3. Scan other feature note filenames + summaries → pull in related ones
|
|
114
|
+
4. Include knowledge context in session summary output
|
|
115
|
+
|
|
116
|
+
### `/create-prd` — Knowledge Base Seeding
|
|
117
|
+
|
|
118
|
+
Add after saving PRD:
|
|
119
|
+
1. Create `.obsidian/overview.md` extracted from PRD (vision, goals, tech stack, users)
|
|
120
|
+
2. Create `.obsidian/architecture/system-design.md` from PRD's architecture section
|
|
121
|
+
|
|
122
|
+
### `/plan-project` — Feature Notes Alongside Issues
|
|
123
|
+
|
|
124
|
+
Add after creating each GitHub issue:
|
|
125
|
+
1. Create `.obsidian/features/<feature-name>.md` with the feature template
|
|
126
|
+
2. Link the GitHub issue numbers in the note
|
|
127
|
+
3. If architectural decisions were made during brainstorming, create `.obsidian/decisions/NNN-title.md`
|
|
128
|
+
|
|
129
|
+
### `/ship` — Knowledge Update Checkpoint
|
|
130
|
+
|
|
131
|
+
Add before committing:
|
|
132
|
+
1. Read the feature note for the issue being completed
|
|
133
|
+
2. Update `## Implementation Notes` with what was built
|
|
134
|
+
3. Update `## GitHub Issues` status if issue is being closed
|
|
135
|
+
4. If a significant decision was made, create a decision record
|
|
136
|
+
5. Commit knowledge updates alongside code
|
|
137
|
+
|
|
138
|
+
### `/execute` — Knowledge-Aware Context
|
|
139
|
+
|
|
140
|
+
Add to mandatory file reading step:
|
|
141
|
+
1. Check `.obsidian/` for the feature note linked to the current issue
|
|
142
|
+
2. Read related feature notes (smart/targeted scan)
|
|
143
|
+
3. Check `.obsidian/decisions/` for relevant past decisions
|
|
144
|
+
|
|
145
|
+
## Read-Before-Work Flow (Smart/Targeted)
|
|
146
|
+
|
|
147
|
+
When the agent starts work on an issue:
|
|
148
|
+
|
|
149
|
+
1. **Always read:** `overview.md` + directly linked feature note
|
|
150
|
+
2. **Scan for related:** list `.obsidian/features/`, read first 5 lines of each, pull in notes with clear dependency/overlap
|
|
151
|
+
3. **Check decisions:** scan `.obsidian/decisions/` titles, read relevant ones
|
|
152
|
+
4. **Check codebase:** existing `/prime` behavior (code structure, git history, architect-agent)
|
|
153
|
+
|
|
154
|
+
### Issue-to-Feature Linking
|
|
155
|
+
|
|
156
|
+
- Feature notes list issue numbers in `## GitHub Issues`
|
|
157
|
+
- Agent greps `.obsidian/features/*.md` for the current issue number
|
|
158
|
+
- Fallback: keyword matching between issue title and feature note filenames/summaries
|
|
159
|
+
|
|
160
|
+
## Write-After-Work Flow (End of Issue)
|
|
161
|
+
|
|
162
|
+
Triggered by `/ship`:
|
|
163
|
+
|
|
164
|
+
### Updated:
|
|
165
|
+
- **Feature note:** `## Implementation Notes`, `## GitHub Issues` status, `## Key Decisions`
|
|
166
|
+
- **Decision records:** only when a technology/approach was chosen over alternatives, a pattern was established, or something was intentionally excluded
|
|
167
|
+
|
|
168
|
+
### Updated only when significant:
|
|
169
|
+
- **Overview:** only when new integration added or scope changed
|
|
170
|
+
|
|
171
|
+
### Not updated:
|
|
172
|
+
- Bug fixes (L3) unless they reveal a design decision
|
|
173
|
+
- Unrelated feature notes
|
|
174
|
+
- No full rewrites — only append/update relevant sections
|
|
175
|
+
|
|
176
|
+
## Configuration & Optionality
|
|
177
|
+
|
|
178
|
+
### CLAUDE.md Configuration
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
## Knowledge Base
|
|
182
|
+
|
|
183
|
+
Path: .obsidian/
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
When path is set → commands read/write from it.
|
|
187
|
+
When absent → knowledge operations skipped entirely. Zero impact.
|
|
188
|
+
|
|
189
|
+
### `/init-claude-md` Integration
|
|
190
|
+
|
|
191
|
+
During setup, ask:
|
|
192
|
+
1. Yes, use `.obsidian/` (default)
|
|
193
|
+
2. Yes, custom path
|
|
194
|
+
3. No — skip knowledge base
|
|
195
|
+
|
|
196
|
+
### Guard Behavior
|
|
197
|
+
|
|
198
|
+
Every command that touches the knowledge base:
|
|
199
|
+
1. Read project CLAUDE.md → look for `Knowledge Base` path
|
|
200
|
+
2. If not found → skip all knowledge operations
|
|
201
|
+
3. If found → check folder exists
|
|
202
|
+
4. If folder doesn't exist → create it with initial structure
|
|
203
|
+
|
|
204
|
+
## Relationship to Existing Systems
|
|
205
|
+
|
|
206
|
+
- **architect-agent:** Keeps code-level knowledge (modules, endpoints, patterns). Knowledge base holds project-level understanding. Agent reads both.
|
|
207
|
+
- **docs/plans/:** Untouched. Superpowers skills write here. Knowledge base is additive.
|
|
208
|
+
- **docs/superpowers/plans/:** Untouched. Same reason.
|
|
209
|
+
- **Obsidian:** Optional. The `.obsidian/` folder works as plain markdown without Obsidian installed. Obsidian users get a navigable vault for free.
|
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
# Knowledge Base Integration Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
|
+
|
|
5
|
+
**Goal:** Add an optional, Obsidian-compatible knowledge base that pipeline commands read from and write to at natural checkpoints, giving the agent persistent project understanding across sessions.
|
|
6
|
+
|
|
7
|
+
**Architecture:** Configurable path (default `.obsidian/`) with feature notes, decision records, and project overview. Existing commands (`/start`, `/prime`, `/create-prd`, `/plan-project`, `/ship`, `/execute`) gain knowledge read/write operations guarded by a `Knowledge Base` config in CLAUDE.md. No new commands or skills.
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** Markdown files, Claude Code commands, `.gitignore` configuration
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Task 1: Gitignore — Add Obsidian Config Exclusions
|
|
14
|
+
|
|
15
|
+
**Files:**
|
|
16
|
+
- Modify: `.gitignore`
|
|
17
|
+
|
|
18
|
+
- [ ] **Step 1: Add Obsidian config ignores to `.gitignore`**
|
|
19
|
+
|
|
20
|
+
Append to the end of `.gitignore`:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
# Obsidian config (machine-specific, notes are tracked)
|
|
24
|
+
.obsidian/app.json
|
|
25
|
+
.obsidian/appearance.json
|
|
26
|
+
.obsidian/core-plugins.json
|
|
27
|
+
.obsidian/core-plugins-migration.json
|
|
28
|
+
.obsidian/workspace.json
|
|
29
|
+
.obsidian/workspace-mobile.json
|
|
30
|
+
.obsidian/hotkeys.json
|
|
31
|
+
.obsidian/plugins/
|
|
32
|
+
.obsidian/themes/
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- [ ] **Step 2: Verify gitignore works**
|
|
36
|
+
|
|
37
|
+
Run: `git status`
|
|
38
|
+
Expected: Obsidian config files no longer show as untracked (if they were). Knowledge note files (`.obsidian/*.md`, `.obsidian/features/`, etc.) remain trackable.
|
|
39
|
+
|
|
40
|
+
- [ ] **Step 3: Commit**
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git add .gitignore
|
|
44
|
+
git commit -m "chore: add Obsidian config to gitignore"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### Task 2: Reference Templates — Feature Note + Decision Record
|
|
50
|
+
|
|
51
|
+
**Files:**
|
|
52
|
+
- Create: `.claude/references/knowledge-base-templates.md`
|
|
53
|
+
|
|
54
|
+
- [ ] **Step 1: Create the templates reference file**
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
# Knowledge Base Templates
|
|
58
|
+
|
|
59
|
+
Used by pipeline commands when creating knowledge base notes.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Feature Note Template
|
|
64
|
+
|
|
65
|
+
Create one per feature area in `<knowledge-base-path>/features/<feature-name>.md`.
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
# Feature: [Name]
|
|
69
|
+
|
|
70
|
+
## Summary
|
|
71
|
+
|
|
72
|
+
[1-2 sentences: what this feature does and why]
|
|
73
|
+
|
|
74
|
+
## GitHub Issues
|
|
75
|
+
|
|
76
|
+
- #N — [title] (status: open/closed)
|
|
77
|
+
|
|
78
|
+
## Key Decisions
|
|
79
|
+
|
|
80
|
+
- [Decision and why]
|
|
81
|
+
|
|
82
|
+
## Implementation Notes
|
|
83
|
+
|
|
84
|
+
[Updated by /ship after work is completed — endpoints created, components built, patterns used]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Decision Record Template
|
|
88
|
+
|
|
89
|
+
Create in `<knowledge-base-path>/decisions/NNN-title.md` when:
|
|
90
|
+
- A technology or approach was chosen over alternatives
|
|
91
|
+
- A pattern was established that future work should follow
|
|
92
|
+
- Something was intentionally excluded (and why)
|
|
93
|
+
|
|
94
|
+
NOT for every small implementation choice.
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
# NNN: [Title]
|
|
98
|
+
|
|
99
|
+
**Date:** YYYY-MM-DD
|
|
100
|
+
**Status:** Accepted
|
|
101
|
+
|
|
102
|
+
## Context
|
|
103
|
+
|
|
104
|
+
[What situation led to this decision]
|
|
105
|
+
|
|
106
|
+
## Decision
|
|
107
|
+
|
|
108
|
+
[What we chose and why]
|
|
109
|
+
|
|
110
|
+
## Consequences
|
|
111
|
+
|
|
112
|
+
[What this means for future work — both positive and negative]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Overview Template
|
|
116
|
+
|
|
117
|
+
Create once at `<knowledge-base-path>/overview.md` during project setup or PRD creation.
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
# [Project Name]
|
|
121
|
+
|
|
122
|
+
## Vision
|
|
123
|
+
|
|
124
|
+
[1-2 sentences: what this project is and why it exists]
|
|
125
|
+
|
|
126
|
+
## Goals
|
|
127
|
+
|
|
128
|
+
- [Goal 1]
|
|
129
|
+
- [Goal 2]
|
|
130
|
+
|
|
131
|
+
## Target Users
|
|
132
|
+
|
|
133
|
+
- [User type 1]: [their key need]
|
|
134
|
+
- [User type 2]: [their key need]
|
|
135
|
+
|
|
136
|
+
## Tech Stack
|
|
137
|
+
|
|
138
|
+
| Layer | Technology | Rationale |
|
|
139
|
+
|-------|-----------|-----------|
|
|
140
|
+
| | | |
|
|
141
|
+
|
|
142
|
+
## Feature Areas
|
|
143
|
+
|
|
144
|
+
- [Feature 1] — see `features/feature-1.md`
|
|
145
|
+
- [Feature 2] — see `features/feature-2.md`
|
|
146
|
+
```
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
- [ ] **Step 2: Commit**
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
git add .claude/references/knowledge-base-templates.md
|
|
153
|
+
git commit -m "docs: add knowledge base note templates"
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### Task 3: Update `/start` — L0 Knowledge Base Flow
|
|
159
|
+
|
|
160
|
+
**Files:**
|
|
161
|
+
- Modify: `.claude/commands/start.md`
|
|
162
|
+
|
|
163
|
+
- [ ] **Step 1: Add knowledge base detection to Step 1 (Gather Context)**
|
|
164
|
+
|
|
165
|
+
Add item 6 to the existing parallel checks:
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
6. Check if knowledge base exists: look for `Knowledge Base` path in CLAUDE.md, then check if that directory has `overview.md`
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- [ ] **Step 2: Update L0 route to include knowledge base creation**
|
|
172
|
+
|
|
173
|
+
Replace the L0 section:
|
|
174
|
+
|
|
175
|
+
```markdown
|
|
176
|
+
**L0 (New Project)** — No PRD, no issues, minimal/no code
|
|
177
|
+
→ "Looks like a fresh project. Let's plan it from scratch."
|
|
178
|
+
→ Route to:
|
|
179
|
+
1. Brainstorm functionalities (interactive discussion)
|
|
180
|
+
2. If knowledge base configured in CLAUDE.md:
|
|
181
|
+
a. Create knowledge base folder structure (overview.md, features/, decisions/, config/, research/, architecture/)
|
|
182
|
+
b. Create `overview.md` from brainstorming results
|
|
183
|
+
c. Create feature notes in `features/` for each agreed functionality
|
|
184
|
+
3. Create GitHub issues linked to feature notes
|
|
185
|
+
4. STOP — present the issue list and ask: "Which issue do you want to work on first?"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
- [ ] **Step 3: Commit**
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
git add .claude/commands/start.md
|
|
192
|
+
git commit -m "feat: add knowledge base creation to /start L0 flow"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### Task 4: Update `/prime` — Smart Knowledge Loading
|
|
198
|
+
|
|
199
|
+
**Files:**
|
|
200
|
+
- Modify: `.claude/commands/prime.md`
|
|
201
|
+
|
|
202
|
+
- [ ] **Step 1: Add knowledge base loading section**
|
|
203
|
+
|
|
204
|
+
Add a new section `### 6. Knowledge Base Context` after the existing `### 5. Configuration` section:
|
|
205
|
+
|
|
206
|
+
```markdown
|
|
207
|
+
### 6. Knowledge Base Context
|
|
208
|
+
|
|
209
|
+
Check CLAUDE.md for a `Knowledge Base` path (e.g., `.obsidian/`). If configured and the directory exists:
|
|
210
|
+
|
|
211
|
+
1. **Always read:** `<kb-path>/overview.md`
|
|
212
|
+
2. **Find linked feature note:** If working on a specific issue (detected from branch name or user input), grep `<kb-path>/features/*.md` for the issue number. Read the matching feature note.
|
|
213
|
+
3. **Scan for related features:** List all files in `<kb-path>/features/`. Read the first 5 lines (## Summary) of each. If any feature has a clear dependency or overlap with the current issue (shared entities, referenced in acceptance criteria, same domain area), read the full note.
|
|
214
|
+
4. **Check decisions:** List `<kb-path>/decisions/`. Read any whose title references the same feature area.
|
|
215
|
+
|
|
216
|
+
If no knowledge base configured, skip this section entirely.
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- [ ] **Step 2: Update output format**
|
|
220
|
+
|
|
221
|
+
Add to the session summary output template after `Knowledge Base: [N domains documented in architect-agent]`:
|
|
222
|
+
|
|
223
|
+
```markdown
|
|
224
|
+
Project Knowledge: [summary from overview.md if knowledge base exists, or "not configured"]
|
|
225
|
+
Related Features: [list of feature notes loaded for this session]
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
- [ ] **Step 3: Commit**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
git add .claude/commands/prime.md
|
|
232
|
+
git commit -m "feat: add smart knowledge loading to /prime"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
### Task 5: Update `/create-prd` — Knowledge Base Seeding
|
|
238
|
+
|
|
239
|
+
**Files:**
|
|
240
|
+
- Modify: `.claude/commands/create-prd.md`
|
|
241
|
+
|
|
242
|
+
- [ ] **Step 1: Add Phase 2.5 for knowledge base seeding**
|
|
243
|
+
|
|
244
|
+
Add between Phase 2 (Generate PRD) and Phase 3 (Review and Save):
|
|
245
|
+
|
|
246
|
+
```markdown
|
|
247
|
+
### Phase 2.5: Seed Knowledge Base (if configured)
|
|
248
|
+
|
|
249
|
+
Check CLAUDE.md for a `Knowledge Base` path. If configured:
|
|
250
|
+
|
|
251
|
+
1. Read `.claude/references/knowledge-base-templates.md` for templates
|
|
252
|
+
2. Create `<kb-path>/overview.md` from the PRD:
|
|
253
|
+
- Vision from Executive Summary
|
|
254
|
+
- Goals from Goals & Success Criteria
|
|
255
|
+
- Target Users from Target Users section
|
|
256
|
+
- Tech Stack from Technical Architecture
|
|
257
|
+
- Feature Areas listing each epic/feature
|
|
258
|
+
3. Create `<kb-path>/architecture/system-design.md` from the PRD's Technical Architecture and System Diagram sections
|
|
259
|
+
4. For each epic or major feature in the PRD, create `<kb-path>/features/<feature-name>.md` using the feature note template:
|
|
260
|
+
- Summary from the epic description
|
|
261
|
+
- GitHub Issues section left empty (populated by /plan-project)
|
|
262
|
+
- Key Decisions from any decisions made during brainstorming
|
|
263
|
+
|
|
264
|
+
If no knowledge base configured, skip this phase.
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
- [ ] **Step 2: Update Phase 4 commit to include knowledge files**
|
|
268
|
+
|
|
269
|
+
Update the commit step in Phase 4:
|
|
270
|
+
|
|
271
|
+
```markdown
|
|
272
|
+
Commit the PRD and knowledge base files (if created):
|
|
273
|
+
```bash
|
|
274
|
+
git add docs/plans/PRD.md
|
|
275
|
+
# If knowledge base was seeded:
|
|
276
|
+
git add <kb-path>/overview.md <kb-path>/architecture/ <kb-path>/features/
|
|
277
|
+
git commit -m "docs: add PRD and seed project knowledge base"
|
|
278
|
+
```
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
- [ ] **Step 3: Commit**
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
git add .claude/commands/create-prd.md
|
|
285
|
+
git commit -m "feat: add knowledge base seeding to /create-prd"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
### Task 6: Update `/plan-project` — Feature Notes Alongside Issues
|
|
291
|
+
|
|
292
|
+
**Files:**
|
|
293
|
+
- Modify: `.claude/commands/plan-project.md`
|
|
294
|
+
|
|
295
|
+
- [ ] **Step 1: Add knowledge base integration to Phase 5**
|
|
296
|
+
|
|
297
|
+
Add to Phase 5 (Create in GitHub), after each issue is created:
|
|
298
|
+
|
|
299
|
+
```markdown
|
|
300
|
+
#### Knowledge Base Integration (if configured)
|
|
301
|
+
|
|
302
|
+
After creating each GitHub issue:
|
|
303
|
+
|
|
304
|
+
1. Check if a feature note already exists in `<kb-path>/features/` for this feature area
|
|
305
|
+
2. If yes: update the `## GitHub Issues` section with the new issue number and title
|
|
306
|
+
3. If no: create a new feature note using `.claude/references/knowledge-base-templates.md` template, with:
|
|
307
|
+
- Summary from the issue description
|
|
308
|
+
- GitHub Issues section listing the new issue
|
|
309
|
+
4. If architectural decisions were made during the planning process, create `<kb-path>/decisions/NNN-title.md` for each significant decision
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
- [ ] **Step 2: Update Phase 6 commit to include knowledge files**
|
|
313
|
+
|
|
314
|
+
Add to the commit step in Phase 6:
|
|
315
|
+
|
|
316
|
+
```markdown
|
|
317
|
+
# If knowledge base configured:
|
|
318
|
+
git add <kb-path>/features/ <kb-path>/decisions/
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
- [ ] **Step 3: Commit**
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
git add .claude/commands/plan-project.md
|
|
325
|
+
git commit -m "feat: add feature note creation to /plan-project"
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
### Task 7: Update `/ship` — Knowledge Update Checkpoint
|
|
331
|
+
|
|
332
|
+
**Files:**
|
|
333
|
+
- Modify: `.claude/commands/ship.md`
|
|
334
|
+
|
|
335
|
+
- [ ] **Step 1: Add Step 1.5 for knowledge base update**
|
|
336
|
+
|
|
337
|
+
Add between Step 1 (Pre-flight Check) and Step 2 (Stage and Commit):
|
|
338
|
+
|
|
339
|
+
```markdown
|
|
340
|
+
### Step 1.5: Update Knowledge Base (if configured)
|
|
341
|
+
|
|
342
|
+
Check CLAUDE.md for a `Knowledge Base` path. If configured:
|
|
343
|
+
|
|
344
|
+
1. **Find the feature note:** Detect the current issue number from the branch name. Grep `<kb-path>/features/*.md` for that issue number. If no match, use keyword matching between branch name and feature note filenames.
|
|
345
|
+
|
|
346
|
+
2. **Update the feature note:**
|
|
347
|
+
- `## Implementation Notes` — append what was built: key files created/modified, endpoints added, components built, patterns used
|
|
348
|
+
- `## GitHub Issues` — update the status of the current issue to reflect completion
|
|
349
|
+
- `## Key Decisions` — add any decisions made during implementation that weren't pre-planned
|
|
350
|
+
|
|
351
|
+
3. **Create decision records** (only if warranted):
|
|
352
|
+
- A technology or approach was chosen over alternatives during implementation
|
|
353
|
+
- A pattern was established that future features should follow
|
|
354
|
+
- Something was intentionally excluded and the reason matters for future work
|
|
355
|
+
|
|
356
|
+
4. **Update overview** (only if significant):
|
|
357
|
+
- New integration or service was added to the stack
|
|
358
|
+
- Project scope changed
|
|
359
|
+
|
|
360
|
+
5. Stage knowledge base changes alongside code changes.
|
|
361
|
+
|
|
362
|
+
If no knowledge base configured, skip to Step 2.
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
- [ ] **Step 2: Commit**
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
git add .claude/commands/ship.md
|
|
369
|
+
git commit -m "feat: add knowledge update checkpoint to /ship"
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
### Task 8: Update `/execute` — Knowledge-Aware Context
|
|
375
|
+
|
|
376
|
+
**Files:**
|
|
377
|
+
- Modify: `.claude/commands/execute.md`
|
|
378
|
+
|
|
379
|
+
- [ ] **Step 1: Add knowledge base reading to Step 2**
|
|
380
|
+
|
|
381
|
+
Add to Step 2 (Read Mandatory Files), after reading plan-specified files:
|
|
382
|
+
|
|
383
|
+
```markdown
|
|
384
|
+
#### Knowledge Base Context (if configured)
|
|
385
|
+
|
|
386
|
+
Check CLAUDE.md for a `Knowledge Base` path. If configured:
|
|
387
|
+
|
|
388
|
+
1. Detect the issue number from the plan file or current branch
|
|
389
|
+
2. Grep `<kb-path>/features/*.md` for the issue number — read the matching feature note
|
|
390
|
+
3. Scan other feature notes (first 5 lines each) for related features — read any with clear overlap
|
|
391
|
+
4. Check `<kb-path>/decisions/` for decisions referencing the same feature area
|
|
392
|
+
5. Read `<kb-path>/overview.md` for project context
|
|
393
|
+
|
|
394
|
+
This supplements the plan's mandatory reading with project-level context the plan author may not have included.
|
|
395
|
+
|
|
396
|
+
If no knowledge base configured, skip this step.
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
- [ ] **Step 2: Commit**
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
git add .claude/commands/execute.md
|
|
403
|
+
git commit -m "feat: add knowledge-aware context loading to /execute"
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
### Task 9: Update CLAUDE.md Template + Project CLAUDE.md
|
|
409
|
+
|
|
410
|
+
**Files:**
|
|
411
|
+
- Modify: `.claude/references/claude-md-template.md`
|
|
412
|
+
- Modify: `CLAUDE.md`
|
|
413
|
+
|
|
414
|
+
- [ ] **Step 1: Add Knowledge Base section to the template**
|
|
415
|
+
|
|
416
|
+
Add after the `## Agents` section in `.claude/references/claude-md-template.md`:
|
|
417
|
+
|
|
418
|
+
```markdown
|
|
419
|
+
## Knowledge Base
|
|
420
|
+
|
|
421
|
+
Path: .obsidian/
|
|
422
|
+
|
|
423
|
+
[Auto-configured during /init-claude-md setup. Set to the folder path for project knowledge notes. Remove this section to disable knowledge base features.]
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
- [ ] **Step 2: Add Knowledge Base documentation to project CLAUDE.md**
|
|
427
|
+
|
|
428
|
+
Add after the `## Agents` section in `CLAUDE.md`:
|
|
429
|
+
|
|
430
|
+
```markdown
|
|
431
|
+
## Knowledge Base
|
|
432
|
+
|
|
433
|
+
Optional Obsidian-compatible project knowledge base. Stores feature specs, architecture decisions, and project overview as markdown notes that the agent reads/writes during the pipeline.
|
|
434
|
+
|
|
435
|
+
**Configuration:** Add `## Knowledge Base` with `Path: <path>` to your project's CLAUDE.md. Default: `.obsidian/`. Remove the section to disable.
|
|
436
|
+
|
|
437
|
+
**Structure:**
|
|
438
|
+
```
|
|
439
|
+
<path>/
|
|
440
|
+
├── overview.md # Project vision, goals, tech stack
|
|
441
|
+
├── architecture/ # System design, data model
|
|
442
|
+
├── features/ # One note per feature area, linked to GitHub issues
|
|
443
|
+
├── decisions/ # Architecture Decision Records (ADRs)
|
|
444
|
+
├── config/ # Integration metadata, env var names (never actual secrets)
|
|
445
|
+
└── research/ # Brainstorming notes, tech comparisons
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**When commands read it:**
|
|
449
|
+
- `/prime` — loads overview + related feature notes (smart/targeted)
|
|
450
|
+
- `/execute` — reads feature context before implementing
|
|
451
|
+
|
|
452
|
+
**When commands write it:**
|
|
453
|
+
- `/start` (L0) — creates structure + feature notes during brainstorming
|
|
454
|
+
- `/create-prd` — seeds overview + architecture from PRD
|
|
455
|
+
- `/plan-project` — creates feature notes alongside GitHub issues
|
|
456
|
+
- `/ship` — updates feature notes with implementation details
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
- [ ] **Step 3: Commit**
|
|
460
|
+
|
|
461
|
+
```bash
|
|
462
|
+
git add .claude/references/claude-md-template.md CLAUDE.md
|
|
463
|
+
git commit -m "docs: add knowledge base configuration to CLAUDE.md and template"
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
### Task 10: Update Customization Docs
|
|
469
|
+
|
|
470
|
+
**Files:**
|
|
471
|
+
- Modify: `docs/customization.md`
|
|
472
|
+
|
|
473
|
+
- [ ] **Step 1: Add knowledge base customization section**
|
|
474
|
+
|
|
475
|
+
Add before the `## Contributing` section:
|
|
476
|
+
|
|
477
|
+
```markdown
|
|
478
|
+
## Configuring the Knowledge Base
|
|
479
|
+
|
|
480
|
+
The framework includes an optional project knowledge base (Obsidian-compatible) that gives the agent persistent project understanding across sessions.
|
|
481
|
+
|
|
482
|
+
### Enable
|
|
483
|
+
|
|
484
|
+
Add to your project's `CLAUDE.md`:
|
|
485
|
+
|
|
486
|
+
```markdown
|
|
487
|
+
## Knowledge Base
|
|
488
|
+
|
|
489
|
+
Path: .obsidian/
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
### Custom Path
|
|
493
|
+
|
|
494
|
+
Use any folder name:
|
|
495
|
+
|
|
496
|
+
```markdown
|
|
497
|
+
## Knowledge Base
|
|
498
|
+
|
|
499
|
+
Path: knowledge/
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### Disable
|
|
503
|
+
|
|
504
|
+
Remove the `## Knowledge Base` section from CLAUDE.md. All knowledge operations are skipped — commands work exactly as before.
|
|
505
|
+
|
|
506
|
+
### What It Does
|
|
507
|
+
|
|
508
|
+
Pipeline commands automatically read from and write to the knowledge base:
|
|
509
|
+
- `/start` creates the structure when starting a new project
|
|
510
|
+
- `/prime` loads relevant notes for context before work
|
|
511
|
+
- `/create-prd` seeds the knowledge base from the PRD
|
|
512
|
+
- `/plan-project` creates feature notes alongside GitHub issues
|
|
513
|
+
- `/execute` reads related feature notes before implementing
|
|
514
|
+
- `/ship` updates feature notes after completing work
|
|
515
|
+
|
|
516
|
+
### Obsidian
|
|
517
|
+
|
|
518
|
+
If you have [Obsidian](https://obsidian.md/) installed, open your project folder as a vault. The `.obsidian/` directory makes it a valid vault. Notes are navigable, linkable, and searchable through Obsidian's UI. Obsidian is not required — the notes are plain markdown.
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
- [ ] **Step 2: Commit**
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
git add docs/customization.md
|
|
525
|
+
git commit -m "docs: add knowledge base customization guide"
|
|
526
|
+
```
|
package/package.json
CHANGED