-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive-docs-folder.sh
More file actions
executable file
·140 lines (109 loc) · 4.56 KB
/
archive-docs-folder.sh
File metadata and controls
executable file
·140 lines (109 loc) · 4.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
# Archive entire docs/ folder and deprecate for Obsidian use
set -e
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📦 ARCHIVING docs/ FOLDER"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Goal: Empty docs/ folder, use Obsidian as single source"
echo ""
# Create archive folder
echo "Step 1: Creating archive folder..."
mkdir -p docs/archive-deprecated-2025-10
# Move all markdown files to archive (except CLAUDE.md, README.md, ARCHIVE-AND-DEPRECATE.md)
echo ""
echo "Step 2: Moving files to archive..."
for file in docs/*.md; do
filename=$(basename "$file")
if [ "$filename" != "CLAUDE.md" ] && [ "$filename" != "README.md" ] && [ "$filename" != "ARCHIVE-AND-DEPRECATE.md" ]; then
echo " 📄 $filename"
mv "$file" docs/archive-deprecated-2025-10/
fi
done
# Move old archive folder if it exists
if [ -d "docs/archive" ]; then
echo ""
echo "Step 3: Moving old archive folder..."
mv docs/archive docs/archive-deprecated-2025-10/archive-old
echo " ✅ docs/archive → docs/archive-deprecated-2025-10/archive-old"
fi
# Create redirect README
echo ""
echo "Step 4: Creating redirect README..."
cat > docs/README.md << 'EOFREADME'
# Documentation Moved to Obsidian
**This folder is deprecated as of 2025-10-19.**
## 📍 All documentation is now in Obsidian:
**Location:** `workspace/docs/Obsidian/`
**Structure:**
- `docs/inbox/` - Drafts
- `docs/research/` - Validated findings
- `docs/decisions/` - ADRs (Architecture Decision Records)
- `docs/plans/` - Current plans
- `docs/reports/` - Metrics and outcomes
- `docs/digests/` - Daily/weekly summaries
- `docs/reference/` - Stable guides
- `docs/Memory/` - System concepts
- `archive/` - Historical content
## 🔍 Finding Documentation
**Before making code changes:**
1. Open Obsidian vault at `workspace/docs/Obsidian/`
2. Check `docs/plans/` for current plans
3. Check `docs/decisions/` for ADRs
4. Use tags to find related content
5. Follow links between documents
## 📚 Protocol
See **[CLAUDE.md](CLAUDE.md)** for the complete documentation protocol.
## 🗄️ Old Content
Previous docs from this folder are archived in:
- `docs/archive-deprecated-2025-10/` - All old markdown files
**Do not add new documentation to this folder.**
**Use Obsidian instead.**
---
**For Claude Code and Cove:** Check Obsidian vault first before making changes!
EOFREADME
echo " ✅ docs/README.md created (redirect to Obsidian)"
# Add deprecation notice to CLAUDE.md
echo ""
echo "Step 5: Adding deprecation notice to CLAUDE.md..."
# Create temp file with deprecation notice
cat > /tmp/claude-header.md << 'EOFHEADER'
# IMPORTANT: Documentation Location Change
**As of 2025-10-19, all documentation is in Obsidian.**
**Location:** `workspace/docs/Obsidian/`
**Before making code changes:**
1. Open Obsidian vault at `workspace/docs/Obsidian/`
2. Check `docs/plans/` for current plans
3. Check `docs/decisions/` for ADRs
4. Follow links and tags
**The repo `docs/` folder is deprecated.** See [docs/README.md](README.md) for details.
---
EOFHEADER
# Prepend to CLAUDE.md if not already there
if ! grep -q "Documentation Location Change" docs/CLAUDE.md; then
cat /tmp/claude-header.md docs/CLAUDE.md > /tmp/claude-new.md
mv /tmp/claude-new.md docs/CLAUDE.md
echo " ✅ Deprecation notice added to CLAUDE.md"
else
echo " ⏭️ CLAUDE.md already has deprecation notice"
fi
rm -f /tmp/claude-header.md
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ ARCHIVING COMPLETE!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📁 Final docs/ structure:"
echo " ├── CLAUDE.md (protocol with deprecation notice)"
echo " ├── README.md (redirect to Obsidian)"
echo " ├── ARCHIVE-AND-DEPRECATE.md (this archiving plan)"
echo " └── archive-deprecated-2025-10/ (all old files)"
echo ""
echo "📊 Files archived:"
archived_count=$(find docs/archive-deprecated-2025-10 -maxdepth 1 -name "*.md" | wc -l)
echo " $archived_count markdown files"
echo ""
echo "✅ Obsidian is now the single source of truth!"
echo "✅ Location: workspace/docs/Obsidian/"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"