Skip to content

Commit 90c99b9

Browse files
Fix: Update all directory references to use Title Case paths
History system was broken because hooks and documentation used lowercase paths (history/, hooks/, skills/) while actual directories are Title Case (History/, Hooks/, Skills/). **Root Causes:** 1. Hooks hardcoded 'history' instead of using HISTORY_DIR from pai-paths 2. 50+ documentation files referenced lowercase paths 3. Observability server used old lowercase path 4. Inconsistent casing caused raw-outputs to write to wrong location **Fixes:** - Updated 3 hooks to import and use HISTORY_DIR constant: - capture-all-events.ts - capture-tool-output.ts - capture-session-summary.ts - Fixed Observability server file-ingest.ts and index.ts paths - Updated 50+ documentation files (Skills/, PAI_CONTRACT.md, etc.) - Changed all /history/ → /History/, /hooks/ → /Hooks/, etc. **Impact:** - History capture now writes to correct Title Case directories - Raw outputs go to History/raw-outputs/ (not history/raw-outputs/) - Documentation matches actual directory structure - Observability dashboard reads from correct location Resolves #204
1 parent cfaa319 commit 90c99b9

56 files changed

Lines changed: 363 additions & 221 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/Hooks/capture-all-events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import { readFileSync, appendFileSync, mkdirSync, existsSync, writeFileSync } from 'fs';
1010
import { join } from 'path';
11-
import { PAI_DIR } from './lib/pai-paths';
11+
import { PAI_DIR, HISTORY_DIR } from './lib/pai-paths';
1212
import { enrichEventWithAgentMetadata, isAgentSpawningCall } from './lib/metadata-extraction';
1313

1414
interface HookEvent {
@@ -43,7 +43,7 @@ function getEventsFilePath(): string {
4343
const month = String(pstDate.getMonth() + 1).padStart(2, '0');
4444
const day = String(pstDate.getDate()).padStart(2, '0');
4545

46-
const monthDir = join(PAI_DIR, 'history', 'raw-outputs', `${year}-${month}`);
46+
const monthDir = join(HISTORY_DIR, 'raw-outputs', `${year}-${month}`);
4747

4848
// Ensure directory exists
4949
if (!existsSync(monthDir)) {

.claude/Hooks/capture-session-summary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ ${info.commandsExecuted.length > 0 ? '```bash\n' + info.commandsExecuted.join('\
168168
169169
This session summary was automatically generated by the UOCS SessionEnd hook.
170170
171-
For detailed tool outputs, see: \`\${PAI_DIR}/history/raw-outputs/${timestamp.substring(0, 7)}/\`
171+
For detailed tool outputs, see: \`\${PAI_DIR}/History/raw-outputs/${timestamp.substring(0, 7)}/\`
172172
173173
---
174174

.claude/Hooks/capture-tool-output.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { appendFileSync, mkdirSync, existsSync } from 'fs';
1111
import { join } from 'path';
12-
import { PAI_DIR } from './lib/pai-paths';
12+
import { PAI_DIR, HISTORY_DIR } from './lib/pai-paths';
1313

1414
interface ToolUseData {
1515
tool_name: string;
@@ -20,7 +20,7 @@ interface ToolUseData {
2020
}
2121

2222
// Configuration
23-
const CAPTURE_DIR = join(PAI_DIR, 'history', 'raw-outputs');
23+
const CAPTURE_DIR = join(HISTORY_DIR, 'raw-outputs');
2424
const INTERESTING_TOOLS = ['Bash', 'Edit', 'Write', 'Read', 'Task', 'NotebookEdit'];
2525

2626
async function main() {

.claude/Scratchpad/test-choice.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
3+
# Test the case statement logic with different inputs
4+
5+
test_choice() {
6+
local choice="$1"
7+
local PAI_DIR
8+
local DEFAULT_DIR="$HOME/PAI"
9+
10+
case $choice in
11+
1)
12+
PAI_DIR="$HOME/PAI"
13+
;;
14+
2)
15+
PAI_DIR="$HOME/Projects/PAI"
16+
;;
17+
3)
18+
PAI_DIR="$HOME/Documents/PAI"
19+
;;
20+
4)
21+
PAI_DIR="custom"
22+
;;
23+
*)
24+
PAI_DIR="$DEFAULT_DIR"
25+
;;
26+
esac
27+
28+
echo "Input: [$choice] -> Result: $PAI_DIR"
29+
}
30+
31+
echo "Testing without whitespace trim:"
32+
test_choice "1"
33+
test_choice "2"
34+
test_choice "2 "
35+
test_choice " 2"
36+
test_choice " 2 "
37+
38+
echo ""
39+
echo "Testing WITH whitespace trim:"
40+
test_choice_trimmed() {
41+
local choice="$1"
42+
# Trim whitespace
43+
choice=$(echo "$choice" | xargs)
44+
45+
local PAI_DIR
46+
local DEFAULT_DIR="$HOME/PAI"
47+
48+
case $choice in
49+
1)
50+
PAI_DIR="$HOME/PAI"
51+
;;
52+
2)
53+
PAI_DIR="$HOME/Projects/PAI"
54+
;;
55+
3)
56+
PAI_DIR="$HOME/Documents/PAI"
57+
;;
58+
4)
59+
PAI_DIR="custom"
60+
;;
61+
*)
62+
PAI_DIR="$DEFAULT_DIR"
63+
;;
64+
esac
65+
66+
echo "Input: [$choice] -> Result: $PAI_DIR"
67+
}
68+
69+
test_choice_trimmed "1"
70+
test_choice_trimmed "2"
71+
test_choice_trimmed "2 "
72+
test_choice_trimmed " 2"
73+
test_choice_trimmed " 2 "

.claude/Scratchpad/test-mcp.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
claude_dir="/Users/daniel/Projects/PAI/.claude"
4+
5+
mcp_json_data=$(jq -r '.mcpServers | keys | join(" "), length' "$claude_dir/.mcp.json" 2>/dev/null)
6+
echo "Full data: [$mcp_json_data]"
7+
8+
mcp_json_names=$(echo "$mcp_json_data" | head -1)
9+
echo "Names: [$mcp_json_names]"
10+
11+
mcp_json_count=$(echo "$mcp_json_data" | tail -1)
12+
echo "Count: [$mcp_json_count]"
13+
14+
echo "Test loop:"
15+
for mcp in $mcp_json_names; do
16+
echo " - $mcp"
17+
done
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
claude_dir="/Users/daniel/Projects/PAI/.claude"
4+
5+
# Count MCPs from both settings.json and .mcp.json
6+
mcp_names_raw=""
7+
mcps_count=0
8+
9+
echo "=== Testing MCP Counting Logic ==="
10+
11+
# Check settings.json for .mcpServers (legacy)
12+
if [ -f "$claude_dir/settings.json" ]; then
13+
mcp_data=$(jq -r '.mcpServers | keys | join(" "), length' "$claude_dir/settings.json" 2>/dev/null)
14+
echo "settings.json mcp_data: [$mcp_data]"
15+
if [ -n "$mcp_data" ] && [ "$mcp_data" != "null" ]; then
16+
mcp_names_raw=$(echo "$mcp_data" | head -1)
17+
mcps_count=$(echo "$mcp_data" | tail -1)
18+
echo " Extracted names: [$mcp_names_raw]"
19+
echo " Extracted count: [$mcps_count]"
20+
else
21+
echo " No MCPs in settings.json (data was empty or null)"
22+
fi
23+
fi
24+
25+
# Check .mcp.json (current Claude Code default)
26+
if [ -f "$claude_dir/.mcp.json" ]; then
27+
mcp_json_data=$(jq -r '.mcpServers | keys | join(" "), length' "$claude_dir/.mcp.json" 2>/dev/null)
28+
echo ".mcp.json mcp_json_data: [$mcp_json_data]"
29+
if [ -n "$mcp_json_data" ] && [ "$mcp_json_data" != "null" ]; then
30+
mcp_json_names=$(echo "$mcp_json_data" | head -1)
31+
mcp_json_count=$(echo "$mcp_json_data" | tail -1)
32+
echo " Extracted names: [$mcp_json_names]"
33+
echo " Extracted count: [$mcp_json_count]"
34+
35+
# Combine with settings.json results
36+
if [ -n "$mcp_names_raw" ]; then
37+
mcp_names_raw="$mcp_names_raw $mcp_json_names"
38+
else
39+
mcp_names_raw="$mcp_json_names"
40+
fi
41+
mcps_count=$((mcps_count + mcp_json_count))
42+
echo " Combined names: [$mcp_names_raw]"
43+
echo " Combined count: [$mcps_count]"
44+
else
45+
echo " No MCPs in .mcp.json (data was empty or null)"
46+
fi
47+
fi
48+
49+
echo ""
50+
echo "=== Final Results ==="
51+
echo "mcp_names_raw: [$mcp_names_raw]"
52+
echo "mcps_count: [$mcps_count]"

.claude/Skills/AlexHormoziPitch/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ Value = (Dream Outcome × Perceived Likelihood) / (Time Delay × Effort & Sacrif
6262

6363
## Full Workflow Reference
6464

65-
For complete step-by-step instructions: `read ${PAI_DIR}/commands/create-hormozi-pitch.md`
65+
For complete step-by-step instructions: `read ${PAI_DIR}/Commands/create-hormozi-pitch.md`

.claude/Skills/Art/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Complete visual content system using the **PAI Visual Aesthetic**.
4242
- Neon orange (warmth) + cyan (tech) accents
4343
- Subtle glows on key elements
4444

45-
**Full aesthetic documentation:** `${PAI_DIR}/skills/CORE/aesthetic.md`
45+
**Full aesthetic documentation:** `${PAI_DIR}/Skills/CORE/aesthetic.md`
4646

4747
**This is the SINGLE SOURCE OF TRUTH for all visual styling.**
4848

@@ -74,7 +74,7 @@ Complete visual content system using the **PAI Visual Aesthetic**.
7474
**Default model:** nano-banana-pro (Gemini 3 Pro)
7575

7676
```bash
77-
bun run ${PAI_DIR}/skills/art/tools/generate-ulart-image.ts \
77+
bun run ${PAI_DIR}/Skills/art/tools/generate-ulart-image.ts \
7878
--model nano-banana-pro \
7979
--prompt "[PROMPT]" \
8080
--size 2K \
@@ -120,4 +120,4 @@ What does user need?
120120

121121
---
122122

123-
**For complete visual styling rules, ALWAYS read:** `${PAI_DIR}/skills/CORE/aesthetic.md`
123+
**For complete visual styling rules, ALWAYS read:** `${PAI_DIR}/Skills/CORE/aesthetic.md`

.claude/Skills/Art/workflows/AnnotatedScreenshots.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ If generating combined image is difficult:
248248

249249
**Option A: Generate combined (if model supports):**
250250
```bash
251-
bun run ${PAI_DIR}/skills/art/tools/generate-ulart-image.ts \
251+
bun run ${PAI_DIR}/Skills/art/tools/generate-ulart-image.ts \
252252
--model nano-banana-pro \
253253
--reference-image /path/to/screenshot.png \
254254
--prompt "[ANNOTATION PROMPT]" \

.claude/Skills/Art/workflows/Aphorisms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Sign "{{{assistantName}}}" small in bottom right corner in charcoal (#2D2D2D).
226226
### Step 5: Execute Generation
227227

228228
```bash
229-
bun run ${PAI_DIR}/skills/art/tools/generate-ulart-image.ts \
229+
bun run ${PAI_DIR}/Skills/art/tools/generate-ulart-image.ts \
230230
--model nano-banana-pro \
231231
--prompt "[YOUR PROMPT]" \
232232
--size 2K \

0 commit comments

Comments
 (0)