qualia-framework 2.6.0 → 3.2.0

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.
Files changed (321) hide show
  1. package/CLAUDE.md +64 -0
  2. package/README.md +103 -30
  3. package/agents/builder.md +110 -0
  4. package/agents/planner.md +134 -0
  5. package/agents/qa-browser.md +186 -0
  6. package/agents/verifier.md +221 -0
  7. package/bin/cli.js +336 -531
  8. package/bin/install.js +570 -0
  9. package/bin/qualia-ui.js +299 -0
  10. package/bin/state.js +630 -0
  11. package/bin/statusline.js +252 -0
  12. package/guide.md +63 -0
  13. package/hooks/auto-update.js +139 -0
  14. package/hooks/branch-guard.js +47 -0
  15. package/hooks/migration-guard.js +60 -0
  16. package/hooks/pre-compact.js +32 -0
  17. package/hooks/pre-deploy-gate.js +110 -0
  18. package/hooks/pre-push.js +33 -0
  19. package/hooks/session-start.js +170 -0
  20. package/package.json +29 -20
  21. package/rules/design-reference.md +179 -0
  22. package/rules/frontend.md +126 -0
  23. package/skills/qualia/SKILL.md +87 -0
  24. package/skills/qualia-build/SKILL.md +97 -0
  25. package/skills/qualia-debug/SKILL.md +87 -0
  26. package/skills/qualia-design/SKILL.md +93 -0
  27. package/skills/qualia-handoff/SKILL.md +66 -0
  28. package/skills/qualia-idk/SKILL.md +8 -0
  29. package/skills/qualia-learn/SKILL.md +88 -0
  30. package/skills/qualia-new/SKILL.md +323 -0
  31. package/{framework/skills → skills}/qualia-optimize/SKILL.md +1 -1
  32. package/skills/qualia-pause/SKILL.md +63 -0
  33. package/skills/qualia-plan/SKILL.md +101 -0
  34. package/skills/qualia-polish/SKILL.md +157 -0
  35. package/skills/qualia-quick/SKILL.md +37 -0
  36. package/skills/qualia-report/SKILL.md +105 -0
  37. package/skills/qualia-resume/SKILL.md +49 -0
  38. package/skills/qualia-review/SKILL.md +76 -0
  39. package/skills/qualia-ship/SKILL.md +90 -0
  40. package/skills/qualia-skill-new/SKILL.md +167 -0
  41. package/skills/qualia-task/SKILL.md +91 -0
  42. package/skills/qualia-verify/SKILL.md +113 -0
  43. package/templates/DESIGN.md +137 -0
  44. package/templates/plan.md +28 -0
  45. package/templates/project.md +22 -0
  46. package/templates/state.md +27 -0
  47. package/templates/tracking.json +20 -0
  48. package/tests/bin.test.sh +673 -0
  49. package/tests/hooks.test.sh +315 -0
  50. package/tests/state.test.sh +535 -0
  51. package/tests/statusline.test.sh +243 -0
  52. package/bin/collect-metrics.sh +0 -62
  53. package/framework/.claudeignore +0 -51
  54. package/framework/CLAUDE.md +0 -51
  55. package/framework/MCP_SETUP.md +0 -229
  56. package/framework/agents/architecture-strategist.md +0 -53
  57. package/framework/agents/backend-agent.md +0 -150
  58. package/framework/agents/code-simplicity-reviewer.md +0 -86
  59. package/framework/agents/frontend-agent.md +0 -111
  60. package/framework/agents/kieran-typescript-reviewer.md +0 -96
  61. package/framework/agents/performance-oracle.md +0 -111
  62. package/framework/agents/qualia-codebase-mapper.md +0 -761
  63. package/framework/agents/qualia-debugger.md +0 -1204
  64. package/framework/agents/qualia-executor.md +0 -882
  65. package/framework/agents/qualia-integration-checker.md +0 -424
  66. package/framework/agents/qualia-phase-researcher.md +0 -457
  67. package/framework/agents/qualia-plan-checker.md +0 -700
  68. package/framework/agents/qualia-planner.md +0 -1245
  69. package/framework/agents/qualia-project-researcher.md +0 -603
  70. package/framework/agents/qualia-research-synthesizer.md +0 -200
  71. package/framework/agents/qualia-roadmapper.md +0 -606
  72. package/framework/agents/qualia-verifier.md +0 -686
  73. package/framework/agents/red-team-qa.md +0 -130
  74. package/framework/agents/security-auditor.md +0 -72
  75. package/framework/agents/team-orchestrator.md +0 -229
  76. package/framework/agents/teams/framework-audit-team.md +0 -66
  77. package/framework/agents/teams/full-stack-team.md +0 -48
  78. package/framework/agents/teams/optimize-team.md +0 -53
  79. package/framework/agents/teams/review-team.md +0 -70
  80. package/framework/agents/teams/ship-team.md +0 -86
  81. package/framework/agents/test-agent.md +0 -182
  82. package/framework/hooks/auto-format.sh +0 -54
  83. package/framework/hooks/block-env-edit.sh +0 -42
  84. package/framework/hooks/branch-guard.sh +0 -43
  85. package/framework/hooks/confirm-delete.sh +0 -59
  86. package/framework/hooks/migration-validate.sh +0 -77
  87. package/framework/hooks/notification-speak.sh +0 -16
  88. package/framework/hooks/pre-commit.sh +0 -100
  89. package/framework/hooks/pre-compact.sh +0 -56
  90. package/framework/hooks/pre-deploy-gate.sh +0 -160
  91. package/framework/hooks/qualia-colors.sh +0 -32
  92. package/framework/hooks/retention-cleanup.sh +0 -62
  93. package/framework/hooks/save-session-state.sh +0 -185
  94. package/framework/hooks/session-context-loader.sh +0 -96
  95. package/framework/hooks/session-learn.sh +0 -32
  96. package/framework/hooks/skill-announce.sh +0 -123
  97. package/framework/hooks/tool-error-announce.sh +0 -27
  98. package/framework/install.ps1 +0 -323
  99. package/framework/install.sh +0 -313
  100. package/framework/qualia-framework/VERSION +0 -1
  101. package/framework/qualia-framework/assets/qualia-logo.png +0 -0
  102. package/framework/qualia-framework/bin/collect-metrics.sh +0 -67
  103. package/framework/qualia-framework/bin/generate-report-docx.py +0 -429
  104. package/framework/qualia-framework/bin/qualia-tools.js +0 -2201
  105. package/framework/qualia-framework/bin/qualia-tools.test.js +0 -1054
  106. package/framework/qualia-framework/references/checkpoints.md +0 -775
  107. package/framework/qualia-framework/references/completion-checklists.md +0 -359
  108. package/framework/qualia-framework/references/continuation-format.md +0 -249
  109. package/framework/qualia-framework/references/continuation-prompt.md +0 -97
  110. package/framework/qualia-framework/references/decimal-phase-calculation.md +0 -65
  111. package/framework/qualia-framework/references/design-quality.md +0 -56
  112. package/framework/qualia-framework/references/employee-guide.md +0 -167
  113. package/framework/qualia-framework/references/git-integration.md +0 -254
  114. package/framework/qualia-framework/references/git-planning-commit.md +0 -50
  115. package/framework/qualia-framework/references/model-profile-resolution.md +0 -32
  116. package/framework/qualia-framework/references/model-profiles.md +0 -73
  117. package/framework/qualia-framework/references/phase-argument-parsing.md +0 -61
  118. package/framework/qualia-framework/references/planning-config.md +0 -195
  119. package/framework/qualia-framework/references/questioning.md +0 -141
  120. package/framework/qualia-framework/references/tdd.md +0 -263
  121. package/framework/qualia-framework/references/ui-brand.md +0 -160
  122. package/framework/qualia-framework/references/verification-patterns.md +0 -612
  123. package/framework/qualia-framework/templates/DEBUG.md +0 -159
  124. package/framework/qualia-framework/templates/DESIGN.md +0 -81
  125. package/framework/qualia-framework/templates/UAT.md +0 -247
  126. package/framework/qualia-framework/templates/codebase/architecture.md +0 -255
  127. package/framework/qualia-framework/templates/codebase/concerns.md +0 -310
  128. package/framework/qualia-framework/templates/codebase/conventions.md +0 -307
  129. package/framework/qualia-framework/templates/codebase/integrations.md +0 -280
  130. package/framework/qualia-framework/templates/codebase/stack.md +0 -186
  131. package/framework/qualia-framework/templates/codebase/structure.md +0 -285
  132. package/framework/qualia-framework/templates/codebase/testing.md +0 -480
  133. package/framework/qualia-framework/templates/config.json +0 -35
  134. package/framework/qualia-framework/templates/context.md +0 -283
  135. package/framework/qualia-framework/templates/continue-here.md +0 -78
  136. package/framework/qualia-framework/templates/debug-subagent-prompt.md +0 -91
  137. package/framework/qualia-framework/templates/discovery.md +0 -146
  138. package/framework/qualia-framework/templates/lab-notes.md +0 -16
  139. package/framework/qualia-framework/templates/milestone-archive.md +0 -123
  140. package/framework/qualia-framework/templates/milestone.md +0 -115
  141. package/framework/qualia-framework/templates/phase-prompt.md +0 -567
  142. package/framework/qualia-framework/templates/planner-subagent-prompt.md +0 -117
  143. package/framework/qualia-framework/templates/project.md +0 -184
  144. package/framework/qualia-framework/templates/projects/ai-agent.md +0 -156
  145. package/framework/qualia-framework/templates/projects/mobile-app.md +0 -181
  146. package/framework/qualia-framework/templates/projects/voice-agent.md +0 -134
  147. package/framework/qualia-framework/templates/projects/website.md +0 -137
  148. package/framework/qualia-framework/templates/requirements.md +0 -231
  149. package/framework/qualia-framework/templates/research-project/ARCHITECTURE.md +0 -204
  150. package/framework/qualia-framework/templates/research-project/FEATURES.md +0 -147
  151. package/framework/qualia-framework/templates/research-project/PITFALLS.md +0 -200
  152. package/framework/qualia-framework/templates/research-project/STACK.md +0 -120
  153. package/framework/qualia-framework/templates/research-project/SUMMARY.md +0 -170
  154. package/framework/qualia-framework/templates/research.md +0 -552
  155. package/framework/qualia-framework/templates/roadmap.md +0 -206
  156. package/framework/qualia-framework/templates/state.md +0 -179
  157. package/framework/qualia-framework/templates/summary-complex.md +0 -59
  158. package/framework/qualia-framework/templates/summary-minimal.md +0 -41
  159. package/framework/qualia-framework/templates/summary-standard.md +0 -48
  160. package/framework/qualia-framework/templates/summary.md +0 -246
  161. package/framework/qualia-framework/templates/user-setup.md +0 -311
  162. package/framework/qualia-framework/templates/verification-report.md +0 -322
  163. package/framework/qualia-framework/workflows/add-phase.md +0 -179
  164. package/framework/qualia-framework/workflows/add-todo.md +0 -157
  165. package/framework/qualia-framework/workflows/audit-milestone.md +0 -241
  166. package/framework/qualia-framework/workflows/check-todos.md +0 -176
  167. package/framework/qualia-framework/workflows/complete-milestone.md +0 -858
  168. package/framework/qualia-framework/workflows/diagnose-issues.md +0 -219
  169. package/framework/qualia-framework/workflows/discovery-phase.md +0 -289
  170. package/framework/qualia-framework/workflows/discuss-phase.md +0 -534
  171. package/framework/qualia-framework/workflows/execute-phase.md +0 -559
  172. package/framework/qualia-framework/workflows/execute-plan.md +0 -438
  173. package/framework/qualia-framework/workflows/help.md +0 -470
  174. package/framework/qualia-framework/workflows/insert-phase.md +0 -220
  175. package/framework/qualia-framework/workflows/list-phase-assumptions.md +0 -178
  176. package/framework/qualia-framework/workflows/map-codebase.md +0 -327
  177. package/framework/qualia-framework/workflows/new-milestone.md +0 -363
  178. package/framework/qualia-framework/workflows/new-project.md +0 -982
  179. package/framework/qualia-framework/workflows/pause-work.md +0 -122
  180. package/framework/qualia-framework/workflows/plan-milestone-gaps.md +0 -256
  181. package/framework/qualia-framework/workflows/plan-phase.md +0 -422
  182. package/framework/qualia-framework/workflows/progress.md +0 -389
  183. package/framework/qualia-framework/workflows/quick.md +0 -252
  184. package/framework/qualia-framework/workflows/remove-phase.md +0 -326
  185. package/framework/qualia-framework/workflows/research-phase.md +0 -74
  186. package/framework/qualia-framework/workflows/resume-project.md +0 -306
  187. package/framework/qualia-framework/workflows/set-profile.md +0 -80
  188. package/framework/qualia-framework/workflows/settings.md +0 -145
  189. package/framework/qualia-framework/workflows/transition.md +0 -556
  190. package/framework/qualia-framework/workflows/update.md +0 -197
  191. package/framework/qualia-framework/workflows/verify-phase.md +0 -195
  192. package/framework/qualia-framework/workflows/verify-work.md +0 -625
  193. package/framework/rules/context7.md +0 -14
  194. package/framework/rules/frontend.md +0 -33
  195. package/framework/rules/speed.md +0 -23
  196. package/framework/scripts/__pycache__/say.cpython-314.pyc +0 -0
  197. package/framework/scripts/apply-retention.sh +0 -120
  198. package/framework/scripts/bootstrap-pop-os.sh +0 -354
  199. package/framework/scripts/claude-voice +0 -13
  200. package/framework/scripts/cleanup.sh +0 -131
  201. package/framework/scripts/cowork-mode.sh +0 -141
  202. package/framework/scripts/generate-project-claude-md.sh +0 -153
  203. package/framework/scripts/load-test-webhook.js +0 -172
  204. package/framework/scripts/say.py +0 -236
  205. package/framework/scripts/showcase-video-recorder/ffmpeg-builder.js +0 -167
  206. package/framework/scripts/showcase-video-recorder/playwright-helpers.js +0 -216
  207. package/framework/scripts/speak.py +0 -55
  208. package/framework/scripts/speak.sh +0 -18
  209. package/framework/scripts/status.sh +0 -138
  210. package/framework/scripts/sync-to-framework.sh +0 -65
  211. package/framework/scripts/voice-hotkey.py +0 -227
  212. package/framework/scripts/voice-input.sh +0 -51
  213. package/framework/skills/animate/SKILL.md +0 -202
  214. package/framework/skills/bolder/SKILL.md +0 -144
  215. package/framework/skills/browser-qa/SKILL.md +0 -536
  216. package/framework/skills/clarify/SKILL.md +0 -179
  217. package/framework/skills/client-handoff/SKILL.md +0 -135
  218. package/framework/skills/collab-onboard/SKILL.md +0 -111
  219. package/framework/skills/colorize/SKILL.md +0 -170
  220. package/framework/skills/critique/SKILL.md +0 -126
  221. package/framework/skills/deep-research/SKILL.md +0 -240
  222. package/framework/skills/delight/SKILL.md +0 -329
  223. package/framework/skills/deploy/SKILL.md +0 -261
  224. package/framework/skills/deploy-verify/SKILL.md +0 -377
  225. package/framework/skills/deploy-verify/scripts/canary-check.sh +0 -206
  226. package/framework/skills/deploy-verify/scripts/check-console-errors.js +0 -147
  227. package/framework/skills/deploy-verify/scripts/check-cwv.js +0 -139
  228. package/framework/skills/deploy-verify/scripts/project-detect.sh +0 -84
  229. package/framework/skills/deploy-verify/scripts/verify.sh +0 -548
  230. package/framework/skills/design-quieter/SKILL.md +0 -130
  231. package/framework/skills/distill/SKILL.md +0 -149
  232. package/framework/skills/docs-lookup/SKILL.md +0 -79
  233. package/framework/skills/fcm-notifications/SKILL.md +0 -125
  234. package/framework/skills/financial-ledger/SKILL.md +0 -1039
  235. package/framework/skills/frontend-master/NOTICE.md +0 -4
  236. package/framework/skills/frontend-master/SKILL.md +0 -127
  237. package/framework/skills/frontend-master/reference/color-and-contrast.md +0 -132
  238. package/framework/skills/frontend-master/reference/interaction-design.md +0 -123
  239. package/framework/skills/frontend-master/reference/motion-design.md +0 -99
  240. package/framework/skills/frontend-master/reference/responsive-design.md +0 -114
  241. package/framework/skills/frontend-master/reference/spatial-design.md +0 -100
  242. package/framework/skills/frontend-master/reference/typography.md +0 -131
  243. package/framework/skills/frontend-master/reference/ux-writing.md +0 -107
  244. package/framework/skills/harden/SKILL.md +0 -357
  245. package/framework/skills/i18n-rtl/SKILL.md +0 -752
  246. package/framework/skills/learn/SKILL.md +0 -95
  247. package/framework/skills/memory/SKILL.md +0 -50
  248. package/framework/skills/mobile-expo/SKILL.md +0 -977
  249. package/framework/skills/mobile-expo/references/store-checklist.md +0 -550
  250. package/framework/skills/nestjs-backend/README.md +0 -73
  251. package/framework/skills/nestjs-backend/SKILL.md +0 -446
  252. package/framework/skills/nestjs-backend/references/templates.md +0 -1173
  253. package/framework/skills/normalize/SKILL.md +0 -79
  254. package/framework/skills/onboard/SKILL.md +0 -242
  255. package/framework/skills/openrouter-agent/SKILL.md +0 -922
  256. package/framework/skills/polish/SKILL.md +0 -209
  257. package/framework/skills/pr/SKILL.md +0 -66
  258. package/framework/skills/qualia/SKILL.md +0 -199
  259. package/framework/skills/qualia-add-todo/SKILL.md +0 -68
  260. package/framework/skills/qualia-audit-milestone/SKILL.md +0 -95
  261. package/framework/skills/qualia-check-todos/SKILL.md +0 -55
  262. package/framework/skills/qualia-complete-milestone/SKILL.md +0 -134
  263. package/framework/skills/qualia-debug/SKILL.md +0 -149
  264. package/framework/skills/qualia-design/SKILL.md +0 -203
  265. package/framework/skills/qualia-discuss-phase/SKILL.md +0 -72
  266. package/framework/skills/qualia-evolve/SKILL.md +0 -200
  267. package/framework/skills/qualia-execute-phase/SKILL.md +0 -89
  268. package/framework/skills/qualia-framework-audit/SKILL.md +0 -604
  269. package/framework/skills/qualia-guide/SKILL.md +0 -32
  270. package/framework/skills/qualia-help/SKILL.md +0 -114
  271. package/framework/skills/qualia-idk/SKILL.md +0 -352
  272. package/framework/skills/qualia-list-phase-assumptions/SKILL.md +0 -67
  273. package/framework/skills/qualia-new-milestone/SKILL.md +0 -72
  274. package/framework/skills/qualia-new-project/SKILL.md +0 -232
  275. package/framework/skills/qualia-pause-work/SKILL.md +0 -96
  276. package/framework/skills/qualia-plan-milestone-gaps/SKILL.md +0 -57
  277. package/framework/skills/qualia-plan-phase/SKILL.md +0 -104
  278. package/framework/skills/qualia-production-check/SKILL.md +0 -0
  279. package/framework/skills/qualia-progress/SKILL.md +0 -53
  280. package/framework/skills/qualia-quick/SKILL.md +0 -89
  281. package/framework/skills/qualia-report/SKILL.md +0 -166
  282. package/framework/skills/qualia-research-phase/SKILL.md +0 -88
  283. package/framework/skills/qualia-resume-work/SKILL.md +0 -62
  284. package/framework/skills/qualia-review/SKILL.md +0 -263
  285. package/framework/skills/qualia-start/SKILL.md +0 -161
  286. package/framework/skills/qualia-verify-work/SKILL.md +0 -132
  287. package/framework/skills/rag/SKILL.md +0 -750
  288. package/framework/skills/responsive/SKILL.md +0 -231
  289. package/framework/skills/retro/SKILL.md +0 -284
  290. package/framework/skills/sakani-conventions/SKILL.md +0 -136
  291. package/framework/skills/sakani-conventions/evals/evals.json +0 -23
  292. package/framework/skills/sakani-conventions/references/entities.md +0 -365
  293. package/framework/skills/sakani-conventions/references/error-codes.md +0 -95
  294. package/framework/skills/seo-master/SKILL.md +0 -490
  295. package/framework/skills/seo-master/references/checklist.md +0 -199
  296. package/framework/skills/seo-master/references/structured-data.md +0 -609
  297. package/framework/skills/ship/SKILL.md +0 -239
  298. package/framework/skills/stack-researcher/SKILL.md +0 -215
  299. package/framework/skills/status/SKILL.md +0 -154
  300. package/framework/skills/status/scripts/health-check.sh +0 -562
  301. package/framework/skills/subscription-payments/SKILL.md +0 -250
  302. package/framework/skills/supabase/SKILL.md +0 -973
  303. package/framework/skills/supabase/references/templates.md +0 -159
  304. package/framework/skills/team/SKILL.md +0 -67
  305. package/framework/skills/test-runner/SKILL.md +0 -202
  306. package/framework/skills/voice-agent/SKILL.md +0 -1312
  307. package/framework/skills/zoho-workflow/SKILL.md +0 -51
  308. package/framework/statusline-command.sh +0 -117
  309. package/framework/teams/default/inboxes/plan-04.json +0 -9
  310. package/framework/teams/review-team.md +0 -75
  311. package/framework/teams/ship-team.md +0 -86
  312. package/profiles/fawzi.json +0 -16
  313. package/profiles/hasan.json +0 -16
  314. package/profiles/moayad.json +0 -16
  315. package/templates/CLAUDE-owner.md +0 -52
  316. package/templates/CLAUDE.md.hbs +0 -58
  317. package/templates/env.claude.template +0 -12
  318. package/templates/settings.json +0 -172
  319. package/uninstall.sh +0 -90
  320. /package/{framework/rules → rules}/deployment.md +0 -0
  321. /package/{framework/rules → rules}/security.md +0 -0
@@ -1,120 +0,0 @@
1
- #!/bin/bash
2
- # Apply retention policies based on retention.json
3
- #
4
- # Usage: ./apply-retention.sh [--dry-run]
5
- #
6
- # Cross-platform: uses node instead of jq for JSON parsing
7
-
8
- set -e
9
-
10
- CLAUDE_DIR="$HOME/.claude"
11
- CONFIG="$CLAUDE_DIR/config/retention.json"
12
- ARCHIVE_DIR="$CLAUDE_DIR/archive"
13
- DRY_RUN=false
14
-
15
- if [[ "$1" == "--dry-run" ]]; then
16
- DRY_RUN=true
17
- echo "DRY RUN MODE - No changes will be made"
18
- fi
19
-
20
- log() {
21
- echo "[$(date '+%H:%M:%S')] $1"
22
- }
23
-
24
- # Helper: read JSON config value using node (replaces jq)
25
- json_cfg() {
26
- local field="$1"
27
- node -e "try{const d=JSON.parse(require('fs').readFileSync('$CONFIG','utf8'));const v=$field;process.stdout.write(String(v))}catch(e){process.stderr.write(e.message);process.exit(1)}" 2>/dev/null
28
- }
29
-
30
- # Check if node is available (needed for JSON parsing)
31
- if ! command -v node &> /dev/null; then
32
- echo "Error: node is required for JSON parsing. Install Node.js from https://nodejs.org"
33
- exit 1
34
- fi
35
-
36
- # Check if config exists
37
- if [[ ! -f "$CONFIG" ]]; then
38
- echo "Error: Config file not found: $CONFIG"
39
- exit 1
40
- fi
41
-
42
- # Parse retention values using node instead of jq
43
- FILE_HISTORY_DAYS=$(json_cfg "d.policies['file-history'].max_age_days")
44
- DEBUG_DAYS=$(json_cfg "d.policies['debug-logs'].max_age_days")
45
- SNAPSHOT_DAYS=$(json_cfg "d.policies['shell-snapshots'].max_age_days")
46
- TODO_DAYS=$(json_cfg "d.policies.todos.archive_after_days")
47
- PROJECT_DAYS=$(json_cfg "d.policies.projects.archive_after_days")
48
- SESSION_DAYS=$(json_cfg "d.policies['session-env'].max_age_days")
49
-
50
- log "=== Applying Retention Policies ==="
51
- log "Config: $CONFIG"
52
-
53
- # Create archive directories
54
- mkdir -p "$ARCHIVE_DIR/todos" "$ARCHIVE_DIR/projects" "$ARCHIVE_DIR/debug"
55
-
56
- # 1. File-history retention
57
- log "Cleaning file-history (>$FILE_HISTORY_DAYS days)..."
58
- count=$(find "$CLAUDE_DIR/file-history" -type f -mtime +"$FILE_HISTORY_DAYS" 2>/dev/null | wc -l)
59
- log " Found $count files to remove"
60
- if [[ "$DRY_RUN" == false ]]; then
61
- find "$CLAUDE_DIR/file-history" -type f -mtime +"$FILE_HISTORY_DAYS" -delete 2>/dev/null || true
62
- fi
63
-
64
- # 2. Debug log retention
65
- log "Cleaning debug logs (>$DEBUG_DAYS days)..."
66
- count=$(find "$CLAUDE_DIR/debug" -type f -mtime +"$DEBUG_DAYS" 2>/dev/null | wc -l)
67
- log " Found $count files to archive/remove"
68
- if [[ "$DRY_RUN" == false ]]; then
69
- # Move old debug logs to archive
70
- find "$CLAUDE_DIR/debug" -type f -mtime +"$DEBUG_DAYS" -exec mv {} "$ARCHIVE_DIR/debug/" \; 2>/dev/null || true
71
- fi
72
-
73
- # 3. Shell snapshots retention
74
- log "Cleaning shell snapshots (>$SNAPSHOT_DAYS days)..."
75
- count=$(find "$CLAUDE_DIR/shell-snapshots" -type f -mtime +"$SNAPSHOT_DAYS" 2>/dev/null | wc -l)
76
- log " Found $count files to remove"
77
- if [[ "$DRY_RUN" == false ]]; then
78
- find "$CLAUDE_DIR/shell-snapshots" -type f -mtime +"$SNAPSHOT_DAYS" -delete 2>/dev/null || true
79
- fi
80
-
81
- # 4. Todos archival
82
- log "Archiving old todos (>$TODO_DAYS days)..."
83
- count=$(find "$CLAUDE_DIR/todos" -name "*.json" -mtime +"$TODO_DAYS" 2>/dev/null | wc -l)
84
- log " Found $count files to archive"
85
- if [[ "$DRY_RUN" == false ]]; then
86
- find "$CLAUDE_DIR/todos" -name "*.json" -mtime +"$TODO_DAYS" -exec mv {} "$ARCHIVE_DIR/todos/" \; 2>/dev/null || true
87
- fi
88
-
89
- # 5. Projects compression
90
- log "Compressing old project sessions (>$PROJECT_DAYS days)..."
91
- count=$(find "$CLAUDE_DIR/projects" -name "*.jsonl" -mtime +"$PROJECT_DAYS" 2>/dev/null | wc -l)
92
- log " Found $count files to compress"
93
- if [[ "$DRY_RUN" == false ]]; then
94
- find "$CLAUDE_DIR/projects" -name "*.jsonl" -mtime +"$PROJECT_DAYS" -exec gzip {} \; 2>/dev/null || true
95
- fi
96
-
97
- # 6. Session-env cleanup (empty directories)
98
- log "Cleaning empty session-env directories..."
99
- count=$(find "$CLAUDE_DIR/session-env" -type d -empty 2>/dev/null | wc -l)
100
- log " Found $count empty directories"
101
- if [[ "$DRY_RUN" == false ]]; then
102
- find "$CLAUDE_DIR/session-env" -type d -empty -delete 2>/dev/null || true
103
- fi
104
-
105
- # 7. Old session-env files
106
- log "Cleaning old session-env files (>$SESSION_DAYS days)..."
107
- count=$(find "$CLAUDE_DIR/session-env" -type f -mtime +"$SESSION_DAYS" 2>/dev/null | wc -l)
108
- log " Found $count files to remove"
109
- if [[ "$DRY_RUN" == false ]]; then
110
- find "$CLAUDE_DIR/session-env" -type f -mtime +"$SESSION_DAYS" -delete 2>/dev/null || true
111
- fi
112
-
113
- log "=== Retention Policies Applied ==="
114
-
115
- # Show current sizes
116
- log ""
117
- log "Current .claude directory sizes:"
118
- du -sh "$CLAUDE_DIR/projects" "$CLAUDE_DIR/file-history" "$CLAUDE_DIR/debug" "$CLAUDE_DIR/shell-snapshots" "$CLAUDE_DIR/todos" 2>/dev/null | while read line; do
119
- log " $line"
120
- done
@@ -1,354 +0,0 @@
1
- #!/usr/bin/env bash
2
- # ============================================================
3
- # Qualia Solutions — Full Pop!_OS Bootstrap
4
- # Run once on a fresh Pop!_OS install to get the full dev env
5
- # ============================================================
6
-
7
- set -euo pipefail
8
-
9
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
- REPO_DIR="$(dirname "$SCRIPT_DIR")"
11
- CLAUDE_DIR="$HOME/.claude"
12
-
13
- echo ""
14
- echo "=================================================="
15
- echo " Qualia Solutions - Pop!_OS Full Bootstrap "
16
- echo "=================================================="
17
- echo ""
18
-
19
- # ---- System packages ----
20
- echo "[1/14] Installing system packages..."
21
- sudo apt update
22
- sudo apt install -y \
23
- git gh build-essential curl wget jq htop neovim vim tree pv \
24
- inotify-tools software-properties-common apt-transport-https \
25
- ca-certificates gnupg lsb-release unzip zip tar \
26
- python3 python3-pip python3-venv pipx \
27
- docker.io docker-compose \
28
- openssh-client openssh-server ufw bluez bluez-tools \
29
- network-manager rsync smartmontools hwinfo inxi \
30
- ffmpeg gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
31
- gstreamer1.0-libav pavucontrol \
32
- fonts-jetbrains-mono fonts-firacode fonts-noto fonts-noto-color-emoji \
33
- fonts-font-awesome fonts-dejavu fonts-liberation \
34
- gnome-tweaks gnome-shell-extensions
35
- echo " OK system packages"
36
- echo ""
37
-
38
- # ---- Node.js ----
39
- echo "[2/14] Installing Node.js 22 LTS..."
40
- if ! command -v node &>/dev/null || [[ "$(node --version)" != v22* ]]; then
41
- curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
42
- sudo apt install -y nodejs
43
- fi
44
- echo " OK node $(node --version)"
45
- echo ""
46
-
47
- # ---- Google Chrome ----
48
- echo "[3/14] Installing Google Chrome..."
49
- if ! command -v google-chrome-stable &>/dev/null; then
50
- wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg 2>/dev/null || true
51
- echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list >/dev/null
52
- sudo apt update && sudo apt install -y google-chrome-stable
53
- fi
54
- echo " OK chrome"
55
- echo ""
56
-
57
- # ---- VS Code ----
58
- echo "[4/14] Installing VS Code..."
59
- if ! command -v code &>/dev/null; then
60
- wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/ms.gpg
61
- sudo install -D -o root -g root -m 644 /tmp/ms.gpg /etc/apt/keyrings/packages.microsoft.gpg
62
- echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list >/dev/null
63
- sudo apt update && sudo apt install -y code
64
- rm -f /tmp/ms.gpg
65
- fi
66
- echo " OK vscode"
67
- echo ""
68
-
69
- # ---- Cursor ----
70
- echo "[5/14] Installing Cursor..."
71
- if [ ! -f /opt/cursor/cursor.appimage ]; then
72
- echo " Downloading Cursor AppImage..."
73
- wget -q -O /tmp/cursor.appimage "https://downloader.cursor.sh/linux/appImage/x64"
74
- chmod +x /tmp/cursor.appimage
75
- sudo mkdir -p /opt/cursor
76
- sudo mv /tmp/cursor.appimage /opt/cursor/cursor.appimage
77
- mkdir -p ~/.local/share/applications
78
- cat > ~/.local/share/applications/cursor.desktop << 'EOF'
79
- [Desktop Entry]
80
- Name=Cursor
81
- Exec=/opt/cursor/cursor.appimage --no-sandbox %F
82
- Terminal=false
83
- Type=Application
84
- Icon=cursor
85
- Categories=Development;IDE;
86
- MimeType=text/plain;
87
- EOF
88
- fi
89
- echo " OK cursor"
90
- echo ""
91
-
92
- # ---- Claude Desktop ----
93
- echo "[6/14] Installing Claude Desktop..."
94
- if ! command -v claude-desktop &>/dev/null && ! dpkg -l | grep -q claude-desktop; then
95
- echo " Downloading Claude Desktop .deb..."
96
- wget -q -O /tmp/claude-desktop.deb "https://storage.googleapis.com/anthropic-downloads/claude-desktop/claude-desktop-debian.deb" || {
97
- echo " WARN: Could not download Claude Desktop. Install manually from https://claude.ai/download"
98
- }
99
- if [ -f /tmp/claude-desktop.deb ]; then
100
- sudo dpkg -i /tmp/claude-desktop.deb || sudo apt install -f -y
101
- rm -f /tmp/claude-desktop.deb
102
- fi
103
- fi
104
- mkdir -p ~/.config/Claude
105
- cat > ~/.config/Claude/claude_desktop_config.json << 'EOF'
106
- {
107
- "preferences": {
108
- "localAgentModeTrustedFolders": [
109
- "/home/qualia/Desktop",
110
- "/home/qualia"
111
- ],
112
- "coworkScheduledTasksEnabled": true,
113
- "sidebarMode": "task",
114
- "coworkWebSearchEnabled": true
115
- }
116
- }
117
- EOF
118
- echo " OK claude desktop"
119
- echo ""
120
-
121
- # ---- Flatpak apps ----
122
- echo "[7/14] Installing Flatpak apps..."
123
- flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
124
- flatpak install -y flathub com.discordapp.Discord 2>/dev/null || true
125
- flatpak install -y flathub com.anydesk.Anydesk 2>/dev/null || true
126
- flatpak install -y flathub com.mitchellh.ghostty 2>/dev/null || echo " WARN: Ghostty not available via Flatpak — install manually"
127
- echo " OK flatpak apps"
128
- echo ""
129
-
130
- # ---- npm globals ----
131
- echo "[8/14] Installing npm global packages..."
132
- mkdir -p ~/.npm-global
133
- npm config set prefix "$HOME/.npm-global"
134
- export PATH="$HOME/.npm-global/bin:$PATH"
135
- npm i -g pnpm typescript typescript-language-server vercel @railway/cli \
136
- eas-cli expo-cli stripe md-to-pdf firecrawl-cli @openai/codex supabase \
137
- @anthropic-ai/claude-code
138
- echo " OK npm globals"
139
- echo ""
140
-
141
- # ---- pipx ----
142
- echo "[9/14] Installing pipx packages..."
143
- pipx install poetry 2>/dev/null || true
144
- pipx install modal 2>/dev/null || true
145
- echo " OK pipx"
146
- echo ""
147
-
148
- # ---- Git config ----
149
- echo "[10/14] Configuring git..."
150
- git config --global user.name "qualiasolutions"
151
- git config --global user.email "info@qualiasolutions.net"
152
- git config --global core.editor "cursor --wait"
153
- git config --global init.defaultBranch main
154
- git config --global pull.rebase true
155
- git config --global fetch.prune true
156
- git config --global diff.colorMoved zebra
157
- git config --global merge.conflictstyle diff3
158
- git config --global alias.co checkout
159
- git config --global alias.br branch
160
- git config --global alias.ci commit
161
- git config --global alias.st status
162
- git config --global alias.unstage "reset HEAD --"
163
- git config --global alias.last "log -1 HEAD"
164
- git config --global alias.amend "commit --amend --no-edit"
165
- git config --global alias.lg "log --oneline --graph --decorate -20"
166
- git config --global alias.aa "add --all"
167
- git config --global alias.cm "commit -m"
168
- cat > ~/.gitignore_global << 'EOF'
169
- .DS_Store
170
- .env
171
- .env.*
172
- !.env.example
173
- !.env.sample
174
- .idea/
175
- .vscode/
176
- *.swp
177
- *.swo
178
- *~
179
- node_modules/
180
- EOF
181
- git config --global core.excludesFile ~/.gitignore_global
182
- echo " OK git config"
183
- echo ""
184
-
185
- # ---- Ghostty config ----
186
- echo "[11/14] Configuring Ghostty terminal..."
187
- mkdir -p ~/.config/ghostty/themes
188
-
189
- cat > ~/.config/ghostty/themes/Qualia << 'EOF'
190
- palette = 0=#151d2d
191
- palette = 1=#d94343
192
- palette = 2=#2ecc71
193
- palette = 3=#eab308
194
- palette = 4=#3498db
195
- palette = 5=#8B5CF6
196
- palette = 6=#00D9B3
197
- palette = 7=#b5bfe2
198
- palette = 8=#6b7582
199
- palette = 9=#EC4899
200
- palette = 10=#10B981
201
- palette = 11=#f39c12
202
- palette = 12=#7b9ef0
203
- palette = 13=#f4b8e4
204
- palette = 14=#00FFD1
205
- palette = 15=#fafbfe
206
- background = #0a0a14
207
- foreground = #e6ecf7
208
- cursor-color = #00FFD1
209
- cursor-text = #0a0a14
210
- selection-background = #1a2231
211
- selection-foreground = #fafbfe
212
- EOF
213
-
214
- cat > ~/.config/ghostty/config << 'EOF'
215
- theme = Qualia
216
- font-family = JetBrains Mono
217
- font-size = 14
218
- font-thicken = true
219
- adjust-cell-height = 4
220
- window-padding-x = 12
221
- window-padding-y = 8
222
- window-decoration = auto
223
- window-title-font-family = JetBrains Mono
224
- confirm-close-surface = false
225
- window-save-state = always
226
- window-inherit-working-directory = true
227
- window-inherit-font-size = true
228
- cursor-style = bar
229
- cursor-style-blink = false
230
- mouse-hide-while-typing = true
231
- copy-on-select = clipboard
232
- link-url = true
233
- scrollback-limit = 100000
234
- clipboard-paste-protection = false
235
- clipboard-trim-trailing-spaces = true
236
- shell-integration = detect
237
- shell-integration-features = cursor,sudo,title
238
- keybind = ctrl+shift+d=new_split:right
239
- keybind = ctrl+shift+e=new_split:down
240
- keybind = ctrl+shift+h=goto_split:left
241
- keybind = ctrl+shift+l=goto_split:right
242
- keybind = ctrl+shift+j=goto_split:bottom
243
- keybind = ctrl+shift+k=goto_split:top
244
- keybind = ctrl+shift+w=close_surface
245
- keybind = ctrl+shift+t=new_tab
246
- keybind = ctrl+shift+n=new_window
247
- keybind = ctrl+1=goto_tab:1
248
- keybind = ctrl+2=goto_tab:2
249
- keybind = ctrl+3=goto_tab:3
250
- keybind = ctrl+4=goto_tab:4
251
- keybind = ctrl+5=goto_tab:5
252
- keybind = ctrl+equal=increase_font_size:1
253
- keybind = ctrl+minus=decrease_font_size:1
254
- keybind = ctrl+0=reset_font_size
255
- keybind = ctrl+shift+left=resize_split:left,20
256
- keybind = ctrl+shift+right=resize_split:right,20
257
- keybind = ctrl+shift+up=resize_split:up,20
258
- keybind = ctrl+shift+down=resize_split:down,20
259
- gtk-single-instance = true
260
- bold-is-bright = true
261
- EOF
262
- echo " OK ghostty config"
263
- echo ""
264
-
265
- # ---- Bash config ----
266
- echo "[12/14] Updating .bashrc..."
267
- if ! grep -q "Qualia Dev Environment" ~/.bashrc 2>/dev/null; then
268
- cat >> ~/.bashrc << 'BASHEOF'
269
-
270
- # === Qualia Dev Environment ===
271
-
272
- # PATH additions
273
- export PATH="$HOME/.local/bin:$PATH"
274
- export PATH="$HOME/.npm-global/bin:$PATH"
275
-
276
- # pnpm
277
- export PNPM_HOME="$HOME/.local/share/pnpm"
278
- case ":$PATH:" in
279
- *":$PNPM_HOME:"*) ;;
280
- *) export PATH="$PNPM_HOME:$PATH" ;;
281
- esac
282
-
283
- # ElevenLabs TTS (fill in your key)
284
- export ELEVEN_API_KEY="YOUR_ELEVEN_API_KEY_HERE"
285
-
286
- # Cowork mode toggle
287
- alias cowork="~/.claude/scripts/cowork-mode.sh"
288
- BASHEOF
289
- fi
290
- echo " OK bashrc"
291
- echo ""
292
-
293
- # ---- Claude Code config sync ----
294
- echo "[13/14] Syncing Claude Code config..."
295
- bash "$REPO_DIR/team-sync/setup.sh"
296
- echo ""
297
-
298
- # ---- Python venv for TTS ----
299
- echo "[14/14] Setting up Claude TTS venv..."
300
- if [ ! -d "$CLAUDE_DIR/venv" ]; then
301
- python3 -m venv "$CLAUDE_DIR/venv"
302
- fi
303
- "$CLAUDE_DIR/venv/bin/pip" install -q elevenlabs requests httpx pydantic websockets
304
- echo " OK tts venv"
305
- echo ""
306
-
307
- # ---- Docker group ----
308
- sudo usermod -aG docker "$USER" 2>/dev/null || true
309
-
310
- # ---- Firewall ----
311
- echo "Enabling firewall..."
312
- sudo ufw --force enable
313
- sudo ufw default deny incoming
314
- sudo ufw default allow outgoing
315
- sudo ufw allow ssh
316
- echo " OK firewall"
317
- echo ""
318
-
319
- # ---- NVIDIA check ----
320
- echo "Checking NVIDIA..."
321
- if command -v nvidia-smi &>/dev/null; then
322
- nvidia-smi --query-gpu=name,driver_version --format=csv,noheader
323
- echo " OK nvidia"
324
- else
325
- echo " WARN: nvidia-smi not found. Install drivers: sudo apt install system76-driver-nvidia"
326
- fi
327
- echo ""
328
-
329
- # ---- Done ----
330
- echo "=================================================="
331
- echo " Bootstrap complete! "
332
- echo "=================================================="
333
- echo ""
334
- echo "NEXT STEPS:"
335
- echo ""
336
- echo " 1. Fill in API keys:"
337
- echo " nano ~/.claude/settings.json"
338
- echo " (replace all YOUR_*_HERE placeholders)"
339
- echo ""
340
- echo " 2. Fill in ElevenLabs key:"
341
- echo " nano ~/.bashrc"
342
- echo " (replace YOUR_ELEVEN_API_KEY_HERE)"
343
- echo ""
344
- echo " 3. Authenticate GitHub:"
345
- echo " gh auth login"
346
- echo ""
347
- echo " 4. Authenticate Vercel:"
348
- echo " vercel login"
349
- echo ""
350
- echo " 5. Log out and back in (for Docker group)"
351
- echo ""
352
- echo " 6. Verify everything:"
353
- echo " claude --version && gh auth status && vercel whoami && nvidia-smi"
354
- echo ""
@@ -1,13 +0,0 @@
1
- #!/bin/bash
2
- # Voice Claude - DISABLED auto-speak, use manual speak only
3
- # Run: echo "text" | ~/.claude/scripts/speak.py
4
- # Requires ELEVEN_API_KEY in shell profile (~/.zshrc)
5
-
6
- if [ -z "$ELEVEN_API_KEY" ]; then
7
- echo "Warning: ELEVEN_API_KEY not set. Voice output will be disabled." >&2
8
- echo "Add to ~/.zshrc: export ELEVEN_API_KEY=\"your-key\"" >&2
9
- fi
10
-
11
- # Just run claude normally - no voice capture
12
- # To speak something manually: echo "hello" | ~/.claude/scripts/speak.py
13
- exec claude "$@"
@@ -1,131 +0,0 @@
1
- #!/bin/bash
2
- # ~/.claude cleanup script
3
- # Run periodically to keep the directory lean
4
- # Schedule: 0 3 * * 0 ~/.claude/scripts/cleanup.sh >> ~/.claude/cleanup.log 2>&1
5
- # Cross-platform: portable file cleanup (no xargs), cross-platform stat
6
-
7
- set -e
8
- CLAUDE_DIR="$HOME/.claude"
9
- cd "$CLAUDE_DIR" || exit 1
10
-
11
- echo "=== Claude Config Cleanup $(date) ==="
12
- echo ""
13
-
14
- # 0. Remove orphaned worktree project entries
15
- echo "Cleaning orphaned worktree entries..."
16
- count=$(ls -d projects/-var-tmp-* 2>/dev/null | wc -l || echo 0)
17
- rm -rf projects/-var-tmp-* 2>/dev/null || true
18
- echo " Removed: $count orphaned worktree directories"
19
-
20
- # 0.1 Remove stale security warning files
21
- echo "Cleaning orphaned security warning files..."
22
- count=$(ls security_warnings_state_*.json 2>/dev/null | wc -l || echo 0)
23
- rm -f security_warnings_state_*.json 2>/dev/null || true
24
- echo " Removed: $count security warning files"
25
-
26
- # 0.2 Clean plugin cache older than 7 days
27
- echo "Cleaning plugin cache older than 7 days..."
28
- count=$(find plugins/cache -mindepth 2 -maxdepth 2 -type d -mtime +7 2>/dev/null | wc -l || echo 0)
29
- find plugins/cache -mindepth 2 -maxdepth 2 -type d -mtime +7 -exec rm -rf {} + 2>/dev/null || true
30
- echo " Removed: $count cached plugin versions"
31
-
32
- # Keep last N shell snapshots (reduced from 20) — portable, no xargs
33
- KEEP_SNAPSHOTS=10
34
- echo "Cleaning shell snapshots (keeping last $KEEP_SNAPSHOTS)..."
35
- count=$(ls -t shell-snapshots/*.sh 2>/dev/null | tail -n +$((KEEP_SNAPSHOTS + 1)) | wc -l)
36
- ls -t shell-snapshots/*.sh 2>/dev/null | tail -n +$((KEEP_SNAPSHOTS + 1)) | while IFS= read -r f; do
37
- rm -f "$f"
38
- done
39
- echo " Removed: $count files"
40
-
41
- # Keep last N debug logs (reduced from 30) — portable, no xargs
42
- KEEP_DEBUG=15
43
- echo "Cleaning debug logs (keeping last $KEEP_DEBUG)..."
44
- count=$(ls -t debug/*.txt 2>/dev/null | tail -n +$((KEEP_DEBUG + 1)) | wc -l)
45
- ls -t debug/*.txt 2>/dev/null | tail -n +$((KEEP_DEBUG + 1)) | while IFS= read -r f; do
46
- rm -f "$f"
47
- done
48
- echo " Removed: $count files"
49
-
50
- # Clean old file-history sessions (older than 14 days)
51
- echo "Cleaning file-history older than 14 days..."
52
- count=$(find file-history/ -mindepth 1 -maxdepth 1 -type d -mtime +14 2>/dev/null | wc -l)
53
- find file-history/ -mindepth 1 -maxdepth 1 -type d -mtime +14 -exec rm -rf {} \; 2>/dev/null
54
- echo " Removed: $count sessions"
55
-
56
- # Clean old project sessions (older than 14 days for jsonl, 30 days for dirs)
57
- echo "Cleaning project session logs older than 14 days..."
58
- count=$(find projects/ -name "*.jsonl" -mtime +14 2>/dev/null | wc -l)
59
- find projects/ -name "*.jsonl" -mtime +14 -delete 2>/dev/null
60
- echo " Removed: $count session logs"
61
-
62
- echo "Cleaning project UUID directories older than 14 days..."
63
- count=$(find projects/ -mindepth 2 -maxdepth 2 -type d -mtime +14 2>/dev/null | wc -l)
64
- find projects/ -mindepth 2 -maxdepth 2 -type d -mtime +14 -exec rm -rf {} \; 2>/dev/null
65
- echo " Removed: $count project session directories"
66
-
67
- # Clean empty todo files (2 bytes = [])
68
- echo "Cleaning empty todo files..."
69
- count=$(find todos/ -name "*.json" -size 2c 2>/dev/null | wc -l)
70
- find todos/ -name "*.json" -size 2c -delete 2>/dev/null
71
- echo " Removed: $count empty files"
72
-
73
- # Clean old todos (older than 7 days)
74
- echo "Cleaning old todo files..."
75
- count=$(find todos/ -name "*.json" -mtime +7 2>/dev/null | wc -l)
76
- find todos/ -name "*.json" -mtime +7 -delete 2>/dev/null
77
- echo " Removed: $count old files"
78
-
79
- # Clean old session-env files (older than 14 days)
80
- echo "Cleaning session-env older than 14 days..."
81
- count=$(find session-env/ -name "*.json" -mtime +14 2>/dev/null | wc -l)
82
- find session-env/ -name "*.json" -mtime +14 -delete 2>/dev/null
83
- echo " Removed: $count files"
84
-
85
- # Clean old session-env UUID directories (older than 7 days)
86
- echo "Cleaning session-env UUID directories older than 7 days..."
87
- count=$(find session-env/ -mindepth 1 -maxdepth 1 -type d -mtime +7 2>/dev/null | wc -l)
88
- find session-env/ -mindepth 1 -maxdepth 1 -type d -mtime +7 -exec rm -rf {} \; 2>/dev/null
89
- echo " Removed: $count directories"
90
-
91
- # Clean old task output files (older than 7 days)
92
- echo "Cleaning old task files..."
93
- count=$(find tasks/ -name "*.json" -mtime +7 2>/dev/null | wc -l)
94
- find tasks/ -name "*.json" -mtime +7 -delete 2>/dev/null
95
- echo " Removed: $count files"
96
-
97
- # Clean old paste-cache files (older than 3 days)
98
- echo "Cleaning paste-cache older than 3 days..."
99
- count=$(find paste-cache/ -type f -mtime +3 2>/dev/null | wc -l)
100
- find paste-cache/ -type f -mtime +3 -delete 2>/dev/null
101
- echo " Removed: $count files"
102
-
103
- # Rotate history.jsonl if larger than 5MB — cross-platform stat
104
- if [ -f history.jsonl ]; then
105
- size=$(stat -c%s history.jsonl 2>/dev/null || stat -f%z history.jsonl 2>/dev/null || node -e "console.log(require('fs').statSync('history.jsonl').size)" 2>/dev/null || echo 0)
106
- if [ "$size" -gt 5242880 ]; then
107
- echo "Rotating history.jsonl (>5MB)..."
108
- mkdir -p archive
109
- mv history.jsonl "archive/history-$(date +%Y%m%d).jsonl"
110
- touch history.jsonl
111
- echo " Archived to archive/history-$(date +%Y%m%d).jsonl"
112
- fi
113
- fi
114
-
115
- # Remove empty directories
116
- echo "Removing empty directories..."
117
- find projects/ -type d -empty -delete 2>/dev/null
118
- find file-history/ -type d -empty -delete 2>/dev/null
119
- find todos/ -type d -empty -delete 2>/dev/null
120
- find session-env/ -type d -empty -delete 2>/dev/null
121
-
122
- # Report disk usage
123
- echo ""
124
- echo "=== Current Disk Usage ==="
125
- du -sh "$CLAUDE_DIR" 2>/dev/null
126
- echo ""
127
- echo "Breakdown:"
128
- du -sh "$CLAUDE_DIR"/*/ 2>/dev/null | sort -hr | head -10
129
-
130
- echo ""
131
- echo "Cleanup complete!"