@jaguilar87/gaia-ops 3.14.0 โ†’ 4.0.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 (122) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/INSTALL.md +451 -0
  3. package/README.md +73 -58
  4. package/agents/cloud-troubleshooter.md +35 -89
  5. package/agents/devops-developer.md +29 -110
  6. package/agents/gaia.md +34 -189
  7. package/agents/gitops-operator.md +28 -117
  8. package/agents/speckit-planner.md +34 -261
  9. package/agents/terraform-architect.md +30 -100
  10. package/bin/README.md +95 -57
  11. package/bin/gaia-doctor.js +45 -1
  12. package/bin/gaia-history.js +252 -0
  13. package/bin/gaia-init.js +213 -29
  14. package/bin/gaia-metrics.js +704 -173
  15. package/bin/gaia-skills-diagnose.js +937 -0
  16. package/bin/gaia-status.js +239 -0
  17. package/commands/README.md +127 -130
  18. package/commands/speckit.add-task.md +33 -7
  19. package/commands/speckit.analyze-task.md +1 -1
  20. package/commands/speckit.init.md +72 -142
  21. package/commands/speckit.plan.md +38 -7
  22. package/commands/speckit.specify.md +51 -26
  23. package/commands/speckit.tasks.md +1 -1
  24. package/config/README.md +40 -35
  25. package/config/cloud/aws.json +140 -0
  26. package/config/cloud/gcp.json +145 -0
  27. package/config/context-contracts.gcp.json +5 -0
  28. package/config/context-contracts.json +82 -0
  29. package/hooks/README.md +63 -312
  30. package/hooks/modules/README.md +20 -2
  31. package/hooks/modules/audit/event_detector.py +1 -33
  32. package/hooks/modules/audit/logger.py +4 -6
  33. package/hooks/modules/context/__init__.py +2 -5
  34. package/hooks/modules/context/context_writer.py +67 -44
  35. package/hooks/modules/core/__init__.py +0 -5
  36. package/hooks/modules/security/__init__.py +4 -0
  37. package/hooks/modules/security/approval_constants.py +22 -0
  38. package/hooks/modules/security/safe_commands.py +78 -7
  39. package/hooks/modules/security/tiers.py +27 -14
  40. package/hooks/modules/tools/bash_validator.py +30 -10
  41. package/hooks/modules/tools/cloud_pipe_validator.py +176 -0
  42. package/hooks/modules/tools/task_validator.py +81 -27
  43. package/hooks/post_tool_use.py +45 -35
  44. package/hooks/pre_tool_use.py +99 -155
  45. package/hooks/subagent_stop.py +229 -75
  46. package/package.json +5 -2
  47. package/skills/README.md +37 -16
  48. package/skills/agent-protocol/SKILL.md +59 -29
  49. package/skills/approval/SKILL.md +43 -275
  50. package/skills/approval/examples.md +138 -0
  51. package/skills/approval/reference.md +62 -0
  52. package/skills/command-execution/SKILL.md +28 -102
  53. package/skills/command-execution/reference.md +82 -0
  54. package/skills/context-updater/SKILL.md +10 -8
  55. package/skills/developer-patterns/SKILL.md +91 -0
  56. package/skills/developer-patterns/reference.md +112 -0
  57. package/skills/execution/SKILL.md +82 -415
  58. package/skills/fast-queries/SKILL.md +13 -9
  59. package/skills/gaia-patterns/SKILL.md +83 -0
  60. package/skills/gaia-patterns/reference.md +22 -0
  61. package/skills/git-conventions/SKILL.md +3 -1
  62. package/skills/gitops-patterns/SKILL.md +31 -54
  63. package/skills/gitops-patterns/reference.md +77 -83
  64. package/skills/investigation/SKILL.md +72 -92
  65. package/skills/output-format/SKILL.md +19 -7
  66. package/skills/security-tiers/SKILL.md +19 -17
  67. package/skills/security-tiers/reference.md +35 -0
  68. package/skills/skill-creation/SKILL.md +117 -0
  69. package/skills/speckit-workflow/SKILL.md +75 -0
  70. package/skills/speckit-workflow/reference.md +101 -0
  71. package/skills/terraform-patterns/SKILL.md +39 -64
  72. package/skills/terraform-patterns/reference.md +47 -100
  73. package/speckit/README.md +510 -62
  74. package/speckit/templates/plan-template.md +2 -2
  75. package/speckit/templates/spec-template.md +24 -0
  76. package/speckit/templates/tasks-template.md +41 -0
  77. package/templates/CLAUDE.template.md +71 -67
  78. package/templates/README.md +53 -36
  79. package/{speckit/governance.md โ†’ templates/governance.template.md} +15 -15
  80. package/templates/settings.template.json +8 -7
  81. package/tests/README.md +46 -34
  82. package/tests/conftest.py +31 -2
  83. package/tests/hooks/modules/security/test_safe_commands.py +0 -1
  84. package/tests/hooks/modules/security/test_tiers.py +39 -26
  85. package/tests/hooks/modules/tools/test_task_validator.py +28 -0
  86. package/tests/integration/test_subagent_lifecycle.py +129 -90
  87. package/tests/layer1_prompt_regression/test_agent_prompt_content.py +4 -5
  88. package/tests/layer1_prompt_regression/test_routing_table.py +16 -5
  89. package/tests/layer1_prompt_regression/test_security_tier_consistency.py +1 -1
  90. package/tests/layer1_prompt_regression/test_skill_content_rules.py +7 -6
  91. package/tests/layer1_prompt_regression/test_skills_cross_reference.py +2 -2
  92. package/tests/promptfoo.yaml +1 -1
  93. package/tests/system/test_agent_definitions.py +1 -1
  94. package/tests/system/test_directory_structure.py +4 -7
  95. package/tests/system/test_schema_compatibility.py +55 -34
  96. package/tests/test_cross_layer_consistency.py +459 -0
  97. package/tests/tools/test_context_provider.py +110 -151
  98. package/tools/context/README.md +25 -35
  99. package/tools/context/context_provider.py +64 -369
  100. package/tools/memory/README.md +0 -0
  101. package/tools/validation/skills_report.md +162 -0
  102. package/tools/validation/validate_skills.py +189 -0
  103. package/README.en.md +0 -139
  104. package/bin/README.en.md +0 -112
  105. package/commands/README.en.md +0 -261
  106. package/config/README.en.md +0 -55
  107. package/config/classification-rules.json +0 -170
  108. package/hooks/README.en.md +0 -104
  109. package/hooks/modules/context/discovery_classifier.py +0 -608
  110. package/hooks/modules/context/exhaustion_detector.py +0 -416
  111. package/hooks/modules/core/config_loader.py +0 -193
  112. package/speckit/README.en.md +0 -599
  113. package/speckit/scripts/check-prerequisites.sh +0 -194
  114. package/speckit/scripts/common.sh +0 -126
  115. package/speckit/scripts/create-new-feature.sh +0 -131
  116. package/speckit/scripts/init.sh +0 -42
  117. package/speckit/scripts/setup-plan.sh +0 -95
  118. package/speckit/scripts/update-agent-context.sh +0 -718
  119. package/templates/README.en.md +0 -75
  120. package/tests/README.en.md +0 -82
  121. package/tests/hooks/modules/context/test_discovery_classifier.py +0 -190
  122. package/tests/hooks/modules/core/test_config_loader.py +0 -242
package/CHANGELOG.md CHANGED
@@ -5,6 +5,79 @@ All notable changes to the CLAUDE.md orchestrator instructions are documented in
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.0.0] - 2026-03-03
9
+
10
+ ### Breaking: Contracts as Single Source of Truth
11
+
12
+ Contracts now fully control what context each agent receives. Removed the progressive disclosure layer that was silently overriding contract definitions, and cleaned up ~400 lines of dead code from context_provider.py.
13
+
14
+ #### Changed
15
+ - **context_provider.py**: Contracts are the single source of truth -- removed progressive disclosure filtering that overrode contract-defined sections
16
+ - **context_provider.py**: Simplified output payload -- removed `enrichment` and `progressive_disclosure` keys from response
17
+ - **contracts/terraform-architect.json**: Now reads `cluster_details` and `application_services` sections
18
+ - **contracts/gitops-operator.json**: Now reads `gcp_services` section (GCP overlay)
19
+ - **pre_tool_use.py**: Updated log message to show sections count and rules count
20
+ - **templates/CLAUDE.template.md**: Synced agent routing descriptions with CLAUDE.md
21
+
22
+ #### Fixed
23
+ - **context_provider.py `get_contracts_dir()`**: Path traversal went up 2 levels instead of 3, producing wrong directory -- masked by legacy fallback that silently compensated
24
+
25
+ #### Removed
26
+ - **context_provider.py**: ~400 lines of dead code:
27
+ - Progressive disclosure engine (section filtering, phase-based visibility)
28
+ - `LEGACY_AGENT_CONTRACTS` dictionary (hardcoded fallback contracts)
29
+ - Semantic enrichment pipeline
30
+ - `validate_project_paths()` function
31
+ - Path resolution utility functions
32
+
33
+ #### Tests
34
+ - **tests/tools/test_context_provider.py**: Complete rewrite -- 8 tests covering all 6 agents, payload structure, and invalid agent handling
35
+
36
+ ## [3.15.1] - 2026-02-24
37
+
38
+ ### Fix: Cross-Layer Consistency & Dead Code Cleanup
39
+
40
+ Comprehensive audit of skills, hooks, and security modules. Fixed inconsistencies between layers that caused silent failures (tests pass but system broken).
41
+
42
+ #### Fixed
43
+ - **bash_validator**: Check blocked commands BEFORE safe commands (defense-in-depth order was inverted)
44
+ - **tiers.py**: Split `VALIDATION_PATTERNS` into `T1_PATTERNS` (validate, lint, fmt, check) and `T2_PATTERNS` (plan, template, diff) โ€” aligns with security-tiers skill
45
+ - **tiers.py**: Removed `terraform plan` from `ULTRA_COMMON_T0_COMMANDS` fast-path (was T0, should be T2)
46
+ - **safe_commands.py**: Removed `terraform plan`/`terragrunt plan` from `ALWAYS_SAFE_MULTIWORD` (simulation, not read-only)
47
+ - **safe_commands.py**: Removed `python3`, `python` from `always_safe` (can execute arbitrary code)
48
+ - **safe_commands.py**: Removed `tar`, `gzip`, `gunzip`, `zip`, `unzip` from `always_safe` (modify filesystem)
49
+ - **task_validator.py**: Removed legacy `APPROVAL_INDICATORS` (`'validation["approved"] == True'`, `"Phase 5: Realization"`)
50
+ - **task_validator.py**: Added `speckit-planner` to `META_AGENTS`
51
+ - **pre_tool_use.py**: Resume regex `{6,7}` โ†’ `{5,}` to accept real Claude Code agent IDs
52
+ - **pre_tool_use.py**: Session events now inject BEFORE `# User Task` marker (was after)
53
+ - **post_tool_use.py**: Added `fcntl.flock` to prevent race conditions on `context.json`
54
+ - **post_tool_use.py**: Guard empty timestamps in retention filter
55
+ - **subagent_stop.py**: Fixed indentation bug in consecutive failure detection
56
+ - **subagent_stop.py**: Use `deque(f, maxlen=7)` instead of `f.readlines()` for metrics.jsonl
57
+ - **settings.json**: Moved 7 T3 commands from `allow` โ†’ `ask`: kubectl exec/label/annotate/uncordon, helm rollback, flux suspend/resume
58
+ - **settings.json**: Added `flux create` to `ask` list (was unprotected)
59
+ - **agent-protocol skill**: Removed `CURRENT_PHASE` from AGENT_STATUS (redundant with `PLAN_STATUS`)
60
+ - **agent-protocol skill**: `PLANNING` state now explicitly emitted in Phase 2
61
+ - **execution skill**: Scope clarified as T3-only (was accidentally broadened to T2)
62
+ - All 3 hooks: Removed `logging.StreamHandler()` (was sending noise to stderr)
63
+
64
+ #### Removed
65
+ - **`config_loader.py`** โ€” Dead code, never imported by any module
66
+ - **`discovery_classifier.py`** โ€” Deprecated, replaced by context_writer.py (609 lines)
67
+ - **`exhaustion_detector.py`** โ€” Never worked (wrong glob pattern, wrong file format parsing, 200K thresholds obsolete with 1M context)
68
+ - **`detect_speckit_milestone()`** in event_detector.py โ€” Dead code (post_hook only runs for Bash, not Skill)
69
+ - **`SPECKIT_MILESTONE`** enum value from EventType
70
+ - **`test_config_loader.py`** โ€” Tests for deleted module
71
+ - **`test_discovery_classifier.py`** โ€” Tests for deleted module
72
+ - Slow execution detection in subagent_stop.py (duration_ms always None)
73
+
74
+ #### Added
75
+ - **`test_cross_layer_consistency.py`** โ€” 24 tests validating consistency between settings.json โ†” safe_commands โ†” blocked_commands โ†” tiers โ†” skills โ†” task_validator
76
+
77
+ #### Metrics
78
+ - Dead code removed: ~1,500 lines (config_loader + discovery_classifier + exhaustion_detector + dead test files)
79
+ - All 890 tests pass, 0 failures
80
+
8
81
  ## [3.12.0] - 2026-02-17
9
82
 
10
83
  ### Refactor: Principle-First Skills & Agent Deduplication
package/INSTALL.md ADDED
@@ -0,0 +1,451 @@
1
+ # Gaia-Ops Installation Guide
2
+
3
+ This guide will help you install and configure Gaia-Ops in your project. The process is automatic and takes less than 5 minutes.
4
+
5
+ ## ๐ŸŽฏ What is Gaia-Ops?
6
+
7
+ Gaia-Ops is a system of specialized AI agents that automate DevOps tasks. Think of it as having a team of experts (Terraform, Kubernetes, GCP, AWS) working together, coordinated by an intelligent orchestrator.
8
+
9
+ ---
10
+
11
+ ## ๐Ÿš€ Quick Installation (Recommended)
12
+
13
+ ### Option 1: Interactive Installation
14
+
15
+ The easiest way - the installer will guide you step by step:
16
+
17
+ ```bash
18
+ npx gaia-init
19
+ ```
20
+
21
+ It will ask questions like:
22
+ - Where are your GitOps files?
23
+ - Where is your Terraform code?
24
+ - What is your GCP project?
25
+
26
+ ### Option 2: Non-Interactive Installation
27
+
28
+ For CI/CD scripts or if you already know the values:
29
+
30
+ ```bash
31
+ npx gaia-init --non-interactive \
32
+ --gitops ./gitops \
33
+ --terraform ./terraform \
34
+ --app-services ./app-services \
35
+ --project-id my-gcp-project \
36
+ --cluster my-gke-cluster
37
+ ```
38
+
39
+ ---
40
+
41
+ ## ๐Ÿ”„ How Installation Works
42
+
43
+ ### Installation Flow
44
+
45
+ ```
46
+ User runs: npx gaia-init
47
+ โ†“
48
+ [Detector] scans your project
49
+ โ†“
50
+ Finds automatically:
51
+ - GitOps directory
52
+ - Terraform directory
53
+ - Apps directory
54
+ โ†“
55
+ [Installer] asks for missing data:
56
+ - GCP Project ID
57
+ - Region
58
+ - Cluster name
59
+ โ†“
60
+ [Installer] checks Claude Code
61
+ โ†“
62
+ Already installed?
63
+ โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
64
+ โ†“ โ†“
65
+ YES NO
66
+ โ†“ โ†“
67
+ Use Install
68
+ existing new
69
+ โ†“ โ†“
70
+ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
71
+ โ†“
72
+ Creates .claude/ structure
73
+ โ†“
74
+ Creates symlinks to gaia-ops:
75
+ .claude/agents โ†’ node_modules/.../agents
76
+ .claude/tools โ†’ node_modules/.../tools
77
+ .claude/hooks โ†’ node_modules/.../hooks
78
+ .claude/commands โ†’ node_modules/.../commands
79
+ .claude/config โ†’ node_modules/.../config
80
+ .claude/skills โ†’ node_modules/.../skills
81
+ .claude/speckit โ†’ node_modules/.../speckit
82
+ .claude/templates โ†’ node_modules/.../templates
83
+ โ†“
84
+ Generates config files:
85
+ - CLAUDE.md (orchestrator)
86
+ - project-context.json
87
+ - settings.json
88
+ โ†“
89
+ Validates installation:
90
+ โœ… Symlinks correct
91
+ โœ… Claude Code available
92
+ โœ… Valid configuration
93
+ โ†“
94
+ Ready! You can use: claude-code
95
+ ```
96
+
97
+ ### Real Installation Example
98
+
99
+ ```
100
+ Example: Installation in project with GitOps and Terraform
101
+
102
+ 1. User: npx gaia-init
103
+ โ†“
104
+ 2. Detector finds:
105
+ โœ… ./gitops (52 YAML files detected)
106
+ โœ… ./terraform (15 .tf files detected)
107
+ โŒ ./app-services (not found)
108
+ โ†“
109
+ 3. Installer asks:
110
+ ? GCP Project ID: โ†’ aaxis-rnd-general-project
111
+ ? Primary region: โ†’ us-central1
112
+ ? Cluster name: โ†’ tcm-gke-non-prod
113
+ โ†“
114
+ 4. Checks Claude Code:
115
+ โœ… Claude Code already installed at /usr/local/bin/claude
116
+ โญ๏ธ Skipping reinstall
117
+ โ†“
118
+ 5. Creates structure:
119
+ โœ… .claude/ created
120
+ โœ… 6 symlinks created
121
+ โœ… CLAUDE.md generated (196 lines)
122
+ โœ… project-context.json created
123
+ โ†“
124
+ 6. Result:
125
+ โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
126
+ โœ… Gaia-Ops installed successfully!
127
+
128
+ ๐Ÿ“š Documentation available:
129
+ - .claude/agents/README.md
130
+ - .claude/config/README.md
131
+ - .claude/commands/README.md
132
+
133
+ ๐Ÿš€ Next steps:
134
+ 1. Run: claude-code
135
+ 2. Ask: "Show me GKE clusters"
136
+ 3. Or use: /gaia to explore the system
137
+ ```
138
+
139
+ ---
140
+
141
+ ## โš™๏ธ Installation Options
142
+
143
+ ### Environment Variables
144
+
145
+ Configure before installing to avoid questions:
146
+
147
+ ```bash
148
+ # Configure paths
149
+ export CLAUDE_GITOPS_DIR="./gitops"
150
+ export CLAUDE_TERRAFORM_DIR="./terraform"
151
+ export CLAUDE_APP_SERVICES_DIR="./app-services"
152
+
153
+ # Configure project
154
+ export CLAUDE_PROJECT_ID="my-gcp-project"
155
+ export CLAUDE_REGION="us-central1"
156
+ export CLAUDE_CLUSTER_NAME="my-gke-cluster"
157
+
158
+ # Install without questions
159
+ npx gaia-init --non-interactive
160
+ ```
161
+
162
+ ### Complete CLI Options
163
+
164
+ ```
165
+ gaia-init [options]
166
+
167
+ Options:
168
+ --non-interactive Skip prompts, use provided values or defaults
169
+ --gitops <path> GitOps directory path
170
+ --terraform <path> Terraform directory path
171
+ --app-services <path> Applications directory path
172
+ --project-id <id> GCP project ID
173
+ --region <region> Primary region (default: us-central1)
174
+ --cluster <name> Cluster name
175
+ --skip-claude-install Skip Claude Code installation
176
+ ```
177
+
178
+ ---
179
+
180
+ ## ๐Ÿ“ฆ What Gets Installed?
181
+
182
+ ### Created Structure
183
+
184
+ ```
185
+ your-project/
186
+ โ”œโ”€โ”€ .claude/ โ† New directory
187
+ โ”‚ โ”œโ”€โ”€ agents/ (symlink) โ†’ Agent definitions
188
+ โ”‚ โ”œโ”€โ”€ skills/ (symlink) โ†’ Skill modules
189
+ โ”‚ โ”œโ”€โ”€ tools/ (symlink) โ†’ Orchestration tools
190
+ โ”‚ โ”œโ”€โ”€ hooks/ (symlink) โ†’ Security validations
191
+ โ”‚ โ”œโ”€โ”€ commands/ (symlink) โ†’ Slash commands
192
+ โ”‚ โ”œโ”€โ”€ config/ (symlink) โ†’ Configuration (contracts, rules)
193
+ โ”‚ โ”œโ”€โ”€ templates/ (symlink) โ†’ Installation templates
194
+ โ”‚ โ”œโ”€โ”€ speckit/ (symlink) โ†’ Spec-Kit framework
195
+ โ”‚ โ”œโ”€โ”€ project-context/ โ† Your project context (SSOT)
196
+ โ”‚ โ”œโ”€โ”€ logs/ โ† Audit logs
197
+ โ”‚ โ””โ”€โ”€ settings.json โ† Security configuration
198
+ โ”œโ”€โ”€ CLAUDE.md โ† Main orchestrator
199
+ โ””โ”€โ”€ node_modules/
200
+ โ””โ”€โ”€ @jaguilar87/gaia-ops/ โ† npm package
201
+ ```
202
+
203
+ ---
204
+
205
+ ## ๐Ÿ“š Documentation Available After Installation
206
+
207
+ Once installed, you have access to **complete documentation** in each directory:
208
+
209
+ ### Directory READMEs
210
+
211
+ ```
212
+ .claude/
213
+ โ”œโ”€โ”€ agents/ 6 agents (terraform-architect, gitops-operator, etc.)
214
+ โ”œโ”€โ”€ skills/README.md 17 skill modules
215
+ โ”œโ”€โ”€ commands/README.md 7 speckit slash commands
216
+ โ”œโ”€โ”€ config/README.md Contracts, git standards, universal rules
217
+ โ”œโ”€โ”€ hooks/README.md 3 hooks (pre, post, metrics)
218
+ โ”œโ”€โ”€ tools/ Context, memory, validation, review
219
+ โ”œโ”€โ”€ speckit/README.md Spec-Kit framework
220
+ โ”œโ”€โ”€ templates/README.md Installation templates
221
+ โ””โ”€โ”€ bin/README.md CLI utilities
222
+ ```
223
+
224
+ ---
225
+
226
+ ## โœ… Post-Installation
227
+
228
+ ### 1. Verify Installation
229
+
230
+ ```bash
231
+ # Check created structure
232
+ ls -la .claude/
233
+
234
+ # Should show symlinks:
235
+ # agents -> ../node_modules/@jaguilar87/gaia-ops/agents
236
+ # tools -> ../node_modules/@jaguilar87/gaia-ops/tools
237
+ ```
238
+
239
+ ### 2. Review Generated Configuration
240
+
241
+ ```bash
242
+ # View generated CLAUDE.md
243
+ cat CLAUDE.md
244
+
245
+ # View project-context.json
246
+ cat .claude/project-context/project-context.json
247
+ ```
248
+
249
+ ### 3. Start Claude Code
250
+
251
+ ```bash
252
+ claude-code
253
+ ```
254
+
255
+ ### 4. Test the System
256
+
257
+ ```bash
258
+ # In Claude Code, try:
259
+ "Show me GKE clusters"
260
+ "List deployments in production namespace"
261
+
262
+ # Or use slash commands:
263
+ /gaia Explain how routing works
264
+ ```
265
+
266
+ ---
267
+
268
+ ## ๐Ÿ”„ Package Updates
269
+
270
+ ### โš ๏ธ Files That Get Overwritten
271
+
272
+ When you update `@jaguilar87/gaia-ops`, these files are **regenerated from templates**:
273
+
274
+ | File | Behavior | Recommended Action |
275
+ |------|----------|-------------------|
276
+ | `CLAUDE.md` | โš ๏ธ **Overwritten** | Backup if you customize |
277
+ | `.claude/settings.json` | โš ๏ธ **Overwritten** | Backup if you customize |
278
+ | `.claude/project-context/project-context.json` | โœ… **Preserved** | Safe |
279
+ | `.claude/logs/` | โœ… **Preserved** | Safe |
280
+ | Other `.claude/` files | โœ… **Auto-updated via symlinks** | Safe |
281
+
282
+ ### Update Process
283
+
284
+ ```bash
285
+ # 1. Backup (optional, if you customized)
286
+ cp CLAUDE.md CLAUDE.md.backup
287
+ cp .claude/settings.json .claude/settings.json.backup
288
+
289
+ # 2. Update package
290
+ npm install @jaguilar87/gaia-ops@latest
291
+
292
+ # 3. Postinstall hook automatically regenerates:
293
+ # - CLAUDE.md
294
+ # - .claude/settings.json
295
+
296
+ # 4. If you made backup, compare and merge changes
297
+ diff CLAUDE.md CLAUDE.md.backup
298
+ ```
299
+
300
+ ---
301
+
302
+ ## ๐Ÿ› ๏ธ Claude Code Management
303
+
304
+ ### Avoiding Multiple Installations
305
+
306
+ Gaia-Ops **automatically detects** if you already have Claude Code installed and **does NOT reinstall it**.
307
+
308
+ #### Installation Verification
309
+
310
+ ```bash
311
+ # See where Claude Code is installed
312
+ which claude-code
313
+
314
+ # Should show ONE location:
315
+ # โœ… /usr/local/bin/claude-code (native - recommended)
316
+ ```
317
+
318
+ #### If You Have Multiple Installations
319
+
320
+ **Option 1: Automatic Cleanup**
321
+ ```bash
322
+ npx gaia-cleanup
323
+ ```
324
+
325
+ **Option 2: Manual Cleanup**
326
+ ```bash
327
+ # Remove npm global installation (if exists)
328
+ npm -g uninstall @anthropic-ai/claude-code
329
+
330
+ # Verify only one remains
331
+ which claude-code
332
+ claude-code --version
333
+ ```
334
+
335
+ ---
336
+
337
+ ## ๐Ÿ› Troubleshooting
338
+
339
+ ### Problem: Claude Code Not Found
340
+
341
+ **Solution:**
342
+ ```bash
343
+ # Verify installation
344
+ which claude-code
345
+
346
+ # If not found, install manually
347
+ npm install -g @anthropic-ai/claude-code
348
+ ```
349
+
350
+ ---
351
+
352
+ ### Problem: Multiple Claude Code Installations
353
+
354
+ **Solution:**
355
+ ```bash
356
+ # Automatic cleanup
357
+ npx gaia-cleanup
358
+ ```
359
+
360
+ ---
361
+
362
+ ### Problem: Permission Denied on npm global
363
+
364
+ **Solution (recommended):**
365
+ ```bash
366
+ mkdir ~/.npm-global
367
+ npm config set prefix '~/.npm-global'
368
+ export PATH=~/.npm-global/bin:$PATH
369
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
370
+ ```
371
+
372
+ ---
373
+
374
+ ### Problem: Symlinks Not Created
375
+
376
+ **Solution:**
377
+ ```bash
378
+ # Re-run installation
379
+ npx gaia-init --force
380
+ ```
381
+
382
+ ---
383
+
384
+ ## ๐Ÿงน Uninstallation
385
+
386
+ ### Complete Uninstallation
387
+
388
+ ```bash
389
+ # Interactive script (recommended)
390
+ npx gaia-uninstall
391
+
392
+ # Forced uninstall (no questions)
393
+ npx gaia-uninstall --force --remove-all
394
+ ```
395
+
396
+ ### Manual Uninstallation
397
+
398
+ ```bash
399
+ # 1. Remove .claude/ directory
400
+ rm -rf .claude/
401
+
402
+ # 2. Remove generated files
403
+ rm CLAUDE.md AGENTS.md
404
+
405
+ # 3. Uninstall npm package
406
+ npm uninstall @jaguilar87/gaia-ops
407
+ ```
408
+
409
+ ---
410
+
411
+ ## ๐Ÿ’ก Design Principles
412
+
413
+ Gaia-Ops is designed with these principles:
414
+
415
+ โœ… **Minimal** - Only creates what's needed, no duplicates
416
+ โœ… **Adaptive** - Auto-detects existing installations
417
+ โœ… **Non-invasive** - Works from any directory
418
+ โœ… **Safe** - Validates paths and skips reinstalls
419
+ โœ… **Clear** - Explicit feedback on each step
420
+ โœ… **Documented** - Complete documentation in each directory
421
+
422
+ ---
423
+
424
+ ## ๐Ÿ“ž Support
425
+
426
+ ### Resources
427
+
428
+ - **Documentation:** Inside `.claude/*/README.md`
429
+ - **Issues:** https://github.com/metraton/gaia-ops/issues
430
+ - **Email:** jaguilar1897@gmail.com
431
+
432
+ ### Frequently Asked Questions
433
+
434
+ **Q: Can I use gaia-ops in multiple projects?**
435
+ A: Yes. Install in each project and each will have its own `project-context.json`.
436
+
437
+ **Q: Do symlinks work on Windows?**
438
+ A: Yes, but you need to enable developer mode or run as administrator.
439
+
440
+ **Q: Can I customize CLAUDE.md without it being overwritten?**
441
+ A: Not directly. Better: contribute changes to the template in the repository.
442
+
443
+ **Q: How do I update only documentation without changing code?**
444
+ A: `npm update @jaguilar87/gaia-ops` - symlinks point to the new version automatically.
445
+
446
+ ---
447
+
448
+ **Version:** 4.0.0
449
+ **Last updated:** 2026-03-03
450
+ **Maintained by:** Jorge Aguilar + Gaia (meta-agent)
451
+