@jaguilar87/gaia-ops 2.2.3 → 2.3.1
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/CHANGELOG.md +48 -0
- package/README.md +2 -1
- package/agents/gaia.md +93 -9
- package/commands/gaia.md +10 -10
- package/commands/restore-session.md +7 -7
- package/commands/save-session.md +9 -9
- package/commands/session-status.md +1 -1
- package/commands/speckit.specify.md +12 -21
- package/config/agent-catalog.md +3 -3
- package/config/clarification_rules.json +152 -0
- package/config/context-contracts.md +18 -18
- package/config/git-standards.md +2 -2
- package/config/orchestration-workflow.md +5 -5
- package/hooks/pre_kubectl_security.py +1 -1
- package/hooks/pre_tool_use.py +44 -0
- package/package.json +1 -1
- package/speckit/governance.md +2 -2
- package/templates/CLAUDE.template.md +50 -1
- package/templates/settings.template.json +0 -1
- package/tests/README.md +2 -2
- package/tests/fixtures/project-context.full.json +165 -0
- package/tests/integration/RUN_TESTS.md +2 -2
- package/tests/integration/test_phase_0_regression.py +211 -0
- package/tests/permissions-validation/manual-permission-validation.md +487 -0
- package/tests/permissions-validation/test_permissions_validation.py +77 -8
- package/tests/system/test_directory_structure.py +20 -20
- package/tests/system/test_permissions_system.py +67 -14
- package/tests/tools/test_agent_router.py +6 -1
- package/tests/tools/test_clarify_engine.py +9 -5
- package/tests/tools/test_context_provider.py +3 -3
- package/tests/validators/test_approval_gate.py +10 -10
- package/tools/1-routing/README.md +69 -0
- package/tools/1-routing/__init__.py +10 -0
- package/tools/2-context/README.md +111 -0
- package/tools/2-context/__init__.py +31 -0
- package/tools/{context_provider.py → 2-context/context_provider.py} +4 -3
- package/tools/3-clarification/README.md +123 -0
- package/tools/3-clarification/__init__.py +118 -0
- package/tools/{clarify_engine.py → 3-clarification/engine.py} +6 -4
- package/tools/3-clarification/generic_engine.py +452 -0
- package/tools/{clarify_patterns.py → 3-clarification/patterns.py} +11 -4
- package/tools/3-clarification/user_interaction.py +210 -0
- package/tools/3-clarification/workflow.py +205 -0
- package/tools/4-validation/README.md +139 -0
- package/tools/4-validation/__init__.py +24 -0
- package/tools/5-task-management/README.md +85 -0
- package/tools/5-task-management/__init__.py +10 -0
- package/tools/6-semantic/README.md +109 -0
- package/tools/6-semantic/__init__.py +11 -0
- package/tools/7-utilities/README.md +133 -0
- package/tools/7-utilities/__init__.py +10 -0
- package/tools/7-utilities/task_wrapper.py +229 -0
- package/tools/8-shared/README.md +118 -0
- package/tools/8-shared/__init__.py +14 -0
- package/tools/README.md +209 -0
- package/tools/TASK_WRAPPER.md +332 -0
- package/tools/__init__.py +99 -0
- package/tools/fast-queries/README.md +174 -0
- package/tools/fast-queries/USAGE_GUIDE.md +369 -0
- package/tools/fast-queries/__init__.py +30 -0
- package/tools/fast-queries/run_triage.sh +125 -0
- package/tests/permissions-validation/MANUAL_VALIDATION.md +0 -434
- package/tools/agent_capabilities.json +0 -231
- package/tools/demo_clarify.py +0 -104
- package/tools/task_manager_example.py +0 -215
- /package/tools/{agent_router.py → 1-routing/agent_router.py} +0 -0
- /package/tools/{context_section_reader.py → 2-context/context_section_reader.py} +0 -0
- /package/tools/{approval_gate.py → 4-validation/approval_gate.py} +0 -0
- /package/tools/{commit_validator.py → 4-validation/commit_validator.py} +0 -0
- /package/tools/{task_manager.py → 5-task-management/task_manager.py} +0 -0
- /package/tools/{task_manager_README.md → 5-task-management/task_manager_README.md} +0 -0
- /package/tools/{generate_embeddings.py → 6-semantic/generate_embeddings.py} +0 -0
- /package/tools/{semantic_matcher.py → 6-semantic/semantic_matcher.py} +0 -0
- /package/tools/{agent_invoker_helper.py → 7-utilities/agent_invoker_helper.py} +0 -0
- /package/tools/{quicktriage_devops_developer.sh → fast-queries/appservices/quicktriage_devops_developer.sh} +0 -0
- /package/tools/{quicktriage_aws_troubleshooter.sh → fast-queries/cloud/aws/quicktriage_aws_troubleshooter.sh} +0 -0
- /package/tools/{quicktriage_gcp_troubleshooter.sh → fast-queries/cloud/gcp/quicktriage_gcp_troubleshooter.sh} +0 -0
- /package/tools/{quicktriage_gitops_operator.sh → fast-queries/gitops/quicktriage_gitops_operator.sh} +0 -0
- /package/tools/{quicktriage_terraform_architect.sh → fast-queries/terraform/quicktriage_terraform_architect.sh} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,54 @@ 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
|
+
## [2.3.0] - 2025-11-11
|
|
9
|
+
|
|
10
|
+
### Added - Phase 0 Clarification Module
|
|
11
|
+
- **NEW:** `tools/clarification/` module for intelligent ambiguity detection before routing
|
|
12
|
+
- `clarification/engine.py`: Core clarification engine (refactored from clarify_engine.py)
|
|
13
|
+
- `clarification/patterns.py`: Ambiguity detection patterns (ServiceAmbiguityPattern, NamespaceAmbiguityPattern, etc.)
|
|
14
|
+
- `clarification/workflow.py`: High-level helper functions for orchestrators (`execute_workflow()`)
|
|
15
|
+
- `clarification/__init__.py`: Clean public API
|
|
16
|
+
- **Protocol G** in `agents/gaia.md`: Clarification system analysis and troubleshooting guide
|
|
17
|
+
- **Rule 5.0.1** in `templates/CLAUDE.template.md`: Phase 0 implementation guide with code examples
|
|
18
|
+
- **Phase 0 integration** in `/speckit.specify` command
|
|
19
|
+
- **Regression tests** in `tests/integration/test_phase_0_regression.py`
|
|
20
|
+
- **Clarification metrics** to Key System Metrics (target: 20-30% clarification rate)
|
|
21
|
+
|
|
22
|
+
### Changed - Module Restructuring (BREAKING)
|
|
23
|
+
- **BREAKING:** `clarify_engine.py` and `clarify_patterns.py` moved to `clarification/` module
|
|
24
|
+
- **Old imports:** `from clarify_engine import request_clarification`
|
|
25
|
+
- **New imports:** `from clarification import execute_workflow, request_clarification`
|
|
26
|
+
- Updated `application_services` structure in project-context.json:
|
|
27
|
+
- Added `tech_stack` field (replaces `technology`)
|
|
28
|
+
- Added `namespace` field for service location
|
|
29
|
+
- **Removed** `status` field (dynamic state must be verified in real-time, not stored in SSOT)
|
|
30
|
+
- Service metadata now shows only static information: `tech_stack | namespace | port`
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- Import paths in `tests/tools/test_clarify_engine.py` updated to new module structure
|
|
34
|
+
- Service metadata test updated to reflect removal of dynamic status field
|
|
35
|
+
- All 20 unit tests passing with new module structure
|
|
36
|
+
|
|
37
|
+
### Documentation
|
|
38
|
+
- Added comprehensive Phase 0 implementation guide
|
|
39
|
+
- Added troubleshooting guide for clarification system
|
|
40
|
+
- Updated speckit.specify.md with Phase 0 workflow integration
|
|
41
|
+
- Added Protocol G diagnostic steps in gaia.md
|
|
42
|
+
|
|
43
|
+
### Migration Guide for v2.3.0
|
|
44
|
+
```python
|
|
45
|
+
# Before (v2.2.x)
|
|
46
|
+
from clarify_engine import request_clarification, process_clarification
|
|
47
|
+
|
|
48
|
+
# After (v2.3.0)
|
|
49
|
+
from clarification import execute_workflow
|
|
50
|
+
|
|
51
|
+
# Simple usage
|
|
52
|
+
result = execute_workflow(user_prompt)
|
|
53
|
+
enriched_prompt = result["enriched_prompt"]
|
|
54
|
+
```
|
|
55
|
+
|
|
8
56
|
## [2.2.3] - 2025-11-11
|
|
9
57
|
|
|
10
58
|
### Fixed - Deterministic Project Context Location
|
package/README.md
CHANGED
|
@@ -17,7 +17,8 @@ Sistema de orquestación multi-agente para Claude Code - Toolkit de automatizaci
|
|
|
17
17
|
- **Soporte multi-cloud** - Funciona con GCP, AWS, y listo para Azure
|
|
18
18
|
- **6 agentes especialistas** (terraform-architect, gitops-operator, gcp-troubleshooter, aws-troubleshooter, devops-developer, Gaia)
|
|
19
19
|
- **3 meta-agentes** (Explore, Plan, Gaia)
|
|
20
|
-
- **
|
|
20
|
+
- **Sistema de clarificación genérico** (Phase 0) - Detección automática de ambigüedades desde project-context.json con preguntas dinámicas y multi-tab
|
|
21
|
+
- **Helper AskUserQuestion** - Función `ask()` para forzar UX consistente (SIEMPRE preguntas, nunca texto plano)
|
|
21
22
|
- **Puertas de aprobación** para operaciones T3 (terraform apply, kubectl apply, etc.)
|
|
22
23
|
- **Validación de commits Git** con Conventional Commits
|
|
23
24
|
- **Sistema de provisión de contexto** para ruteo inteligente de agentes
|
package/agents/gaia.md
CHANGED
|
@@ -16,15 +16,15 @@ You are Gaia, the senior system architect and AI agent systems specialist for th
|
|
|
16
16
|
3. **Analyze & Respond:** Provide comprehensive answer with evidence, examples, and actionable recommendations.
|
|
17
17
|
|
|
18
18
|
**Where Everything Lives (Package + Symlink Layout):**
|
|
19
|
-
- 🏗️ Package root:
|
|
20
|
-
- 📋 Orchestrator:
|
|
21
|
-
- 🤖 Agents:
|
|
22
|
-
- 🛠️ Tools:
|
|
23
|
-
- 📚 Config docs:
|
|
24
|
-
- 🗂️ Commands:
|
|
25
|
-
- 🎯 Spec-Kit assets:
|
|
26
|
-
- 🔧 Reference stacks:
|
|
27
|
-
- 💾 Project data: consuming repos host
|
|
19
|
+
- 🏗️ Package root: `$GAIA_OPS_ROOT` (or `node_modules/@jaguilar87/gaia-ops/` when installed)
|
|
20
|
+
- 📋 Orchestrator: `$PROJECT_ROOT/CLAUDE.md` (templated into consuming repos)
|
|
21
|
+
- 🤖 Agents: `$GAIA_OPS_ROOT/agents/*.md` (6 specialists: terraform-architect, gitops-operator, gcp-troubleshooter, aws-troubleshooter, devops-developer, gaia)
|
|
22
|
+
- 🛠️ Tools: `$GAIA_OPS_ROOT/tools/` (context_provider.py, agent_router.py, clarify_engine.py, approval_gate.py, commit_validator.py, task_manager.py)
|
|
23
|
+
- 📚 Config docs: `$GAIA_OPS_ROOT/config/` (AGENTS, orchestration-workflow, git-standards, context-contracts, agent-catalog)
|
|
24
|
+
- 🗂️ Commands: `$GAIA_OPS_ROOT/commands/*.md` (`/gaia`, `/save-session`, `/session-status`, `/speckit.*`)
|
|
25
|
+
- 🎯 Spec-Kit assets: `$GAIA_OPS_ROOT/speckit/README*.md`, `speckit/templates/`, `speckit/scripts/`, `speckit/governance.md`, `speckit/decisions/`
|
|
26
|
+
- 🔧 Reference stacks: `$GAIA_OPS_ROOT/terraform/`, `gitops/`, `app-services/` illustrate how agents interact with user IaC/App repos
|
|
27
|
+
- 💾 Project data: consuming repos host `$PROJECT_ROOT/.claude/project-context.json`, `.claude/logs/`, `.claude/tests/`, while `ops/` carries shared symlink helpers
|
|
28
28
|
|
|
29
29
|
**Your Superpowers:**
|
|
30
30
|
- ✅ You understand the ENTIRE system (no one else does)
|
|
@@ -113,6 +113,8 @@ When `npx @jaguilar87/gaia-ops init` (or `gaia-init` after a global install) run
|
|
|
113
113
|
### Key System Metrics (What to Track)
|
|
114
114
|
|
|
115
115
|
- **Routing Accuracy:** Target 92.7% (from tests)
|
|
116
|
+
- **Clarification Rate:** Target 20-30% (Phase 0 effectiveness)
|
|
117
|
+
- **Clarification Effectiveness:** Routing accuracy improvement post-enrichment
|
|
116
118
|
- **Context Efficiency:** 79-85% token savings (via context_provider.py)
|
|
117
119
|
- **Test Coverage:** 55+ tests, 100% pass rate
|
|
118
120
|
- **Production Uptime:** Track via logs/
|
|
@@ -472,6 +474,88 @@ You:
|
|
|
472
474
|
|
|
473
475
|
**Output:** Feature RFC (Request for Comments)
|
|
474
476
|
|
|
477
|
+
### Protocol G: Clarification System Analysis
|
|
478
|
+
|
|
479
|
+
**Trigger:** "¿Por qué no se activó clarificación?" or "Ambiguity detection issues" or "Analyze Phase 0"
|
|
480
|
+
|
|
481
|
+
**Steps:**
|
|
482
|
+
1. Review clarification logs:
|
|
483
|
+
```bash
|
|
484
|
+
cat .claude/logs/clarifications.jsonl | jq .
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
2. Check configuration:
|
|
488
|
+
```bash
|
|
489
|
+
cat .claude/config/clarification_rules.json
|
|
490
|
+
jq '.global_settings' .claude/config/clarification_rules.json
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
3. Test detection manually:
|
|
494
|
+
```python
|
|
495
|
+
import sys
|
|
496
|
+
sys.path.insert(0, '.claude/tools')
|
|
497
|
+
from clarification import execute_workflow, request_clarification
|
|
498
|
+
|
|
499
|
+
result = request_clarification("Check the API")
|
|
500
|
+
print(f"Needs clarification: {result['needs_clarification']}")
|
|
501
|
+
print(f"Ambiguity score: {result.get('ambiguity_score', 0)}")
|
|
502
|
+
print(f"Patterns detected: {[a['pattern'] for a in result.get('ambiguity_points', [])]}")
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
4. Review pattern definitions:
|
|
506
|
+
```bash
|
|
507
|
+
cat .claude/tools/clarification/patterns.py
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
5. Analyze recent clarifications:
|
|
511
|
+
```bash
|
|
512
|
+
cat .claude/logs/clarifications.jsonl | \
|
|
513
|
+
jq -r '[.timestamp, .ambiguity_score, .original_prompt] | @csv' | \
|
|
514
|
+
tail -20
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
6. Benchmark effectiveness:
|
|
518
|
+
- **Clarification rate:** Target 20-30%
|
|
519
|
+
- **User satisfaction:** No complaints about "too many questions"
|
|
520
|
+
- **Routing accuracy improvement:** Measure before/after enrichment
|
|
521
|
+
|
|
522
|
+
7. Check module structure:
|
|
523
|
+
```bash
|
|
524
|
+
ls -la .claude/tools/clarification/
|
|
525
|
+
# Should show: __init__.py, engine.py, patterns.py, workflow.py
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
**Output:** Clarification effectiveness report + tuning recommendations
|
|
529
|
+
|
|
530
|
+
**Common Issues:**
|
|
531
|
+
|
|
532
|
+
| Issue | Symptom | Fix |
|
|
533
|
+
|-------|---------|-----|
|
|
534
|
+
| Threshold too high | Ambiguity not detected | Lower from 30 to 20 in `clarification_rules.json` |
|
|
535
|
+
| Threshold too low | Too many questions | Raise from 30 to 40 |
|
|
536
|
+
| Missing patterns | New ambiguous terms not caught | Add to `patterns.py` (ServiceAmbiguityPattern.keywords) |
|
|
537
|
+
| Spanish keywords missing | Spanish prompts not detected | Add to keywords list in patterns |
|
|
538
|
+
| Import errors | Module not found | Check symlinks to gaia-ops package |
|
|
539
|
+
| No services found | Tests failing | Verify `project-context.json` has `application_services` section |
|
|
540
|
+
|
|
541
|
+
**Metrics to Track:**
|
|
542
|
+
|
|
543
|
+
```python
|
|
544
|
+
# Calculate clarification rate
|
|
545
|
+
import json
|
|
546
|
+
|
|
547
|
+
with open('.claude/logs/clarifications.jsonl') as f:
|
|
548
|
+
logs = [json.loads(line) for line in f]
|
|
549
|
+
|
|
550
|
+
total_requests = len(logs)
|
|
551
|
+
clarified = sum(1 for log in logs if log.get('ambiguity_score', 0) > 30)
|
|
552
|
+
rate = (clarified / total_requests * 100) if total_requests > 0 else 0
|
|
553
|
+
|
|
554
|
+
print(f"Clarification rate: {rate:.1f}%")
|
|
555
|
+
print(f"Target: 20-30%")
|
|
556
|
+
print(f"Status: {'✅ Good' if 20 <= rate <= 30 else '⚠️ Needs tuning'}")
|
|
557
|
+
```
|
|
558
|
+
|
|
475
559
|
## Research Guidelines (WebSearch Usage)
|
|
476
560
|
|
|
477
561
|
When researching, follow this pattern:
|
package/commands/gaia.md
CHANGED
|
@@ -39,16 +39,16 @@ Task(
|
|
|
39
39
|
## System Context (Auto-provided)
|
|
40
40
|
|
|
41
41
|
**System Paths:**
|
|
42
|
-
- Agent system:
|
|
43
|
-
- Orchestrator logic: /
|
|
44
|
-
- Logs:
|
|
45
|
-
- Tests:
|
|
46
|
-
- Tools:
|
|
47
|
-
- Agents:
|
|
48
|
-
- Commands:
|
|
49
|
-
- Sessions:
|
|
50
|
-
- Ops repository:
|
|
51
|
-
- Project context:
|
|
42
|
+
- Agent system: $PROJECT_ROOT/.claude/
|
|
43
|
+
- Orchestrator logic: $PROJECT_ROOT/CLAUDE.md
|
|
44
|
+
- Logs: $PROJECT_ROOT/.claude/logs/
|
|
45
|
+
- Tests: $PROJECT_ROOT/.claude/tests/
|
|
46
|
+
- Tools: $PROJECT_ROOT/.claude/tools/
|
|
47
|
+
- Agents: $PROJECT_ROOT/.claude/agents/
|
|
48
|
+
- Commands: $PROJECT_ROOT/.claude/commands/
|
|
49
|
+
- Sessions: $PROJECT_ROOT/.claude/session/
|
|
50
|
+
- Ops repository: $PROJECT_ROOT/../ops/
|
|
51
|
+
- Project context: $PROJECT_ROOT/.claude/project-context.json
|
|
52
52
|
|
|
53
53
|
**Spec-Kit Commands:**
|
|
54
54
|
- /speckit.specify - Create/update feature specification
|
|
@@ -6,37 +6,37 @@ This command provides intelligent session restoration with context loading for b
|
|
|
6
6
|
|
|
7
7
|
## Quick command (restore latest relevant)
|
|
8
8
|
```bash
|
|
9
|
-
python3
|
|
9
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/session_startup_check.py
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Shows the most relevant recent session with restoration suggestions.
|
|
13
13
|
|
|
14
14
|
## Restore specific session
|
|
15
15
|
```bash
|
|
16
|
-
python3
|
|
16
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/restore_session.py <bundle-id>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Restores complete session context from the specified bundle.
|
|
20
20
|
|
|
21
21
|
## List available sessions
|
|
22
22
|
```bash
|
|
23
|
-
python3
|
|
23
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/restore_session.py --list
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Shows all available session bundles with descriptions and timestamps.
|
|
27
27
|
|
|
28
28
|
## View session details (without restoring)
|
|
29
29
|
```bash
|
|
30
|
-
python3
|
|
30
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/restore_session.py <bundle-id> --show
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Display detailed information about a session bundle without loading it.
|
|
34
34
|
|
|
35
35
|
## Agent-specific context extraction
|
|
36
36
|
```bash
|
|
37
|
-
python3
|
|
38
|
-
python3
|
|
39
|
-
python3
|
|
37
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/restore_session.py <bundle-id> --agent terraform-architect
|
|
38
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/restore_session.py <bundle-id> --agent gitops-operator
|
|
39
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/restore_session.py <bundle-id> --agent devops-developer
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Extract context specific to a particular agent type for on-demand loading.
|
package/commands/save-session.md
CHANGED
|
@@ -8,14 +8,14 @@ This command saves the complete current session into a new bundle with all conte
|
|
|
8
8
|
|
|
9
9
|
### Default session bundle
|
|
10
10
|
```bash
|
|
11
|
-
python3
|
|
11
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/create_current_session_bundle.py
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Creates: `2025-10-16-session-163244-abc12345`
|
|
15
15
|
|
|
16
16
|
### Custom labeled bundle
|
|
17
17
|
```bash
|
|
18
|
-
python3
|
|
18
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/create_current_session_bundle.py --label agent-upgrades
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Creates: `2025-10-16-agent-upgrades-163244-abc12345`
|
|
@@ -46,11 +46,11 @@ After creating a bundle, **manually update** the `summary.md` file to capture:
|
|
|
46
46
|
- Relevant next steps
|
|
47
47
|
|
|
48
48
|
The auto-generated summary is a template. For accurate session documentation,
|
|
49
|
-
edit:
|
|
49
|
+
edit: `$PROJECT_ROOT/.claude/session/bundles/<bundle-id>/summary.md`
|
|
50
50
|
|
|
51
51
|
## Alternative: Legacy snapshot (updates existing bundle)
|
|
52
52
|
```bash
|
|
53
|
-
python3
|
|
53
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/save_session_snapshot.py
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
- Updates an existing bundle with current active context only
|
|
@@ -59,23 +59,23 @@ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/save_sessi
|
|
|
59
59
|
## Flujo detallado (opcional)
|
|
60
60
|
Si prefieres hacerlo paso a paso o necesitas crear un nuevo bundle antes de guardar:
|
|
61
61
|
|
|
62
|
-
1. **Crear/actualizar bundle**
|
|
62
|
+
1. **Crear/actualizar bundle**
|
|
63
63
|
Ejecuta cualquier comando del agente (p.ej. `/analizer T010`) para que el hook `subagent_stop` genere un bundle fresco.
|
|
64
64
|
|
|
65
65
|
2. **Inspeccionar bundles disponibles**
|
|
66
66
|
```bash
|
|
67
|
-
python3
|
|
67
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/session-manager.py list
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
3. **Copiar contexto activo al bundle deseado**
|
|
71
71
|
```bash
|
|
72
|
-
python3
|
|
72
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/save_session_snapshot.py --bundle-id <bundle-id>
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
4. **(Opcional) Empaquetar para compartir**
|
|
76
76
|
```bash
|
|
77
|
-
tar -czf
|
|
78
|
-
-C
|
|
77
|
+
tar -czf $PROJECT_ROOT/.claude/session/bundles/<bundle-id>.tar.gz \
|
|
78
|
+
-C $PROJECT_ROOT/.claude/session/bundles/<bundle-id> .
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
## Notes
|
|
@@ -6,7 +6,7 @@ This command provides an intelligent overview of your current session state and
|
|
|
6
6
|
|
|
7
7
|
## Quick status check
|
|
8
8
|
```bash
|
|
9
|
-
python3
|
|
9
|
+
python3 $PROJECT_ROOT/.claude/session/scripts/session_startup_check.py
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Shows:
|
|
@@ -31,32 +31,23 @@ Given those arguments, do this:
|
|
|
31
31
|
|
|
32
32
|
```python
|
|
33
33
|
import sys
|
|
34
|
-
sys.path.insert(0, '
|
|
35
|
-
from
|
|
34
|
+
sys.path.insert(0, '.claude/tools')
|
|
35
|
+
from clarification import execute_workflow
|
|
36
36
|
|
|
37
|
-
# Detect ambiguity in feature description
|
|
38
|
-
|
|
37
|
+
# Detect and resolve ambiguity in feature description
|
|
38
|
+
result = execute_workflow(
|
|
39
39
|
user_prompt=feature_description,
|
|
40
|
-
command_context={"command": "speckit.specify"}
|
|
40
|
+
command_context={"command": "speckit.specify"},
|
|
41
|
+
ask_user_question_func=AskUserQuestion # Claude Code tool
|
|
41
42
|
)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
print(clarification_data["summary"])
|
|
44
|
+
# Use enriched description for remaining steps
|
|
45
|
+
feature_description = result["enriched_prompt"]
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
result = process_clarification(
|
|
52
|
-
clarification_data["engine_instance"],
|
|
53
|
-
feature_description,
|
|
54
|
-
response["answers"],
|
|
55
|
-
clarification_data["clarification_context"]
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
# Use enriched description for remaining steps
|
|
59
|
-
feature_description = result["enriched_prompt"]
|
|
47
|
+
# Log clarification if it occurred
|
|
48
|
+
if result["clarification_occurred"]:
|
|
49
|
+
from clarification import get_clarification_summary
|
|
50
|
+
print(get_clarification_summary(result["clarification_data"]))
|
|
60
51
|
```
|
|
61
52
|
|
|
62
53
|
**What gets clarified**:
|
package/config/agent-catalog.md
CHANGED
|
@@ -367,9 +367,9 @@ Task(
|
|
|
367
367
|
description="Analyze routing accuracy",
|
|
368
368
|
prompt="""
|
|
369
369
|
## System Context
|
|
370
|
-
- Agent system:
|
|
371
|
-
- Logs:
|
|
372
|
-
- Tools:
|
|
370
|
+
- Agent system: $PROJECT_ROOT/.claude/
|
|
371
|
+
- Logs: $PROJECT_ROOT/.claude/logs/
|
|
372
|
+
- Tools: $PROJECT_ROOT/.claude/tools/
|
|
373
373
|
|
|
374
374
|
## Task
|
|
375
375
|
Analyze routing accuracy over last 100 invocations. Propose improvements.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0",
|
|
3
|
+
"description": "Clarification system configuration for generic ambiguity detection",
|
|
4
|
+
|
|
5
|
+
"global_settings": {
|
|
6
|
+
"enabled": true,
|
|
7
|
+
"ambiguity_threshold": 30,
|
|
8
|
+
"max_questions_per_clarification": 5,
|
|
9
|
+
"skip_readonly_threshold": 50,
|
|
10
|
+
"cache_results": true,
|
|
11
|
+
"cache_ttl_seconds": 300
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
"entity_types": {
|
|
15
|
+
"service": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"weight": 80,
|
|
18
|
+
"keywords": [
|
|
19
|
+
"the api",
|
|
20
|
+
"el api",
|
|
21
|
+
"la api",
|
|
22
|
+
"api service",
|
|
23
|
+
"the service",
|
|
24
|
+
"el servicio",
|
|
25
|
+
"la aplicación",
|
|
26
|
+
"the app",
|
|
27
|
+
"la app",
|
|
28
|
+
"the web",
|
|
29
|
+
"web service",
|
|
30
|
+
"the bot",
|
|
31
|
+
"el bot"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"namespace": {
|
|
35
|
+
"enabled": true,
|
|
36
|
+
"weight": 60,
|
|
37
|
+
"keywords": [
|
|
38
|
+
"namespace",
|
|
39
|
+
"deploy to",
|
|
40
|
+
"desplegar en",
|
|
41
|
+
"in namespace",
|
|
42
|
+
"en el namespace",
|
|
43
|
+
"en el namespace",
|
|
44
|
+
"in the namespace"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"cluster": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"weight": 70,
|
|
50
|
+
"keywords": [
|
|
51
|
+
"cluster",
|
|
52
|
+
"clúster",
|
|
53
|
+
"in cluster",
|
|
54
|
+
"to cluster"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"environment": {
|
|
58
|
+
"enabled": true,
|
|
59
|
+
"weight": 90,
|
|
60
|
+
"keywords": [
|
|
61
|
+
"production",
|
|
62
|
+
"prod",
|
|
63
|
+
"producción",
|
|
64
|
+
"staging",
|
|
65
|
+
"dev",
|
|
66
|
+
"development"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"resource": {
|
|
70
|
+
"enabled": true,
|
|
71
|
+
"weight": 70,
|
|
72
|
+
"keywords": [
|
|
73
|
+
"the redis",
|
|
74
|
+
"el redis",
|
|
75
|
+
"redis instance",
|
|
76
|
+
"the database",
|
|
77
|
+
"la database",
|
|
78
|
+
"la base de datos",
|
|
79
|
+
"the postgres",
|
|
80
|
+
"el postgres",
|
|
81
|
+
"database"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
"skip_clarification": {
|
|
87
|
+
"if_command_is_slash": true,
|
|
88
|
+
"if_high_specificity": true,
|
|
89
|
+
"specificity_threshold": 0.8,
|
|
90
|
+
"if_readonly_and_low_ambiguity": true
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
"emoji_map": {
|
|
94
|
+
"service": "📦",
|
|
95
|
+
"namespace": "🎯",
|
|
96
|
+
"cluster": "🏢",
|
|
97
|
+
"environment": "⚠️",
|
|
98
|
+
"resource": "🔧",
|
|
99
|
+
"all": "🌐",
|
|
100
|
+
"database": "🗄️",
|
|
101
|
+
"production": "🔴",
|
|
102
|
+
"staging": "🟡",
|
|
103
|
+
"development": "🟢"
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
"question_templates": {
|
|
107
|
+
"service": "¿Qué servicio quieres usar?",
|
|
108
|
+
"namespace": "¿En qué namespace?",
|
|
109
|
+
"cluster": "¿En qué cluster?",
|
|
110
|
+
"environment": "¿En qué entorno?",
|
|
111
|
+
"resource": "¿Qué recurso?"
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
"header_templates": {
|
|
115
|
+
"service": "Servicio",
|
|
116
|
+
"namespace": "Namespace",
|
|
117
|
+
"cluster": "Cluster",
|
|
118
|
+
"environment": "Entorno",
|
|
119
|
+
"resource": "Recurso"
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
"default_option": {
|
|
123
|
+
"label_all": "Todos",
|
|
124
|
+
"description_template": "Aplicar a todos ({count} total)",
|
|
125
|
+
"apply_to_entities": [
|
|
126
|
+
"service",
|
|
127
|
+
"namespace",
|
|
128
|
+
"cluster"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
"performance": {
|
|
133
|
+
"max_analysis_time_ms": 150,
|
|
134
|
+
"max_context_search_time_ms": 100,
|
|
135
|
+
"max_question_generation_time_ms": 100,
|
|
136
|
+
"parallel_search": false
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
"logging": {
|
|
140
|
+
"enabled": true,
|
|
141
|
+
"log_file": ".claude/logs/clarifications.jsonl",
|
|
142
|
+
"log_level": "info",
|
|
143
|
+
"log_format": "jsonl"
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
"notes": {
|
|
147
|
+
"project_context_path": ".claude/project-context/project-context.json",
|
|
148
|
+
"search_strategy": "project-context-only",
|
|
149
|
+
"filesystem_search": false,
|
|
150
|
+
"filesystem_fallback": false
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -164,19 +164,19 @@ terraform-architect:
|
|
|
164
164
|
},
|
|
165
165
|
"terraform_infrastructure": {
|
|
166
166
|
"layout": {
|
|
167
|
-
"base_path": "/
|
|
168
|
-
"modules_path": "/
|
|
169
|
-
"environments_path": "/
|
|
167
|
+
"base_path": "$PROJECT_ROOT/ops/terraform",
|
|
168
|
+
"modules_path": "$PROJECT_ROOT/ops/terraform/modules",
|
|
169
|
+
"environments_path": "$PROJECT_ROOT/ops/terraform/environments"
|
|
170
170
|
},
|
|
171
171
|
"provider_credentials": {
|
|
172
|
-
"gcp_credentials_path": "
|
|
172
|
+
"gcp_credentials_path": "$HOME/.config/gcloud/aaxis-rnd-terraform-sa.json"
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
"operational_guidelines": {
|
|
176
176
|
"commit_standards": {
|
|
177
177
|
"validation_required": true,
|
|
178
|
-
"validator_path": "
|
|
179
|
-
"config_path": "
|
|
178
|
+
"validator_path": "$PROJECT_ROOT/.claude/tools/commit_validator.py",
|
|
179
|
+
"config_path": "$PROJECT_ROOT/.claude/config/git_standards.json"
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
},
|
|
@@ -267,7 +267,7 @@ gitops-operator:
|
|
|
267
267
|
},
|
|
268
268
|
"gitops_configuration": {
|
|
269
269
|
"repository": {
|
|
270
|
-
"path": "/
|
|
270
|
+
"path": "$PROJECT_ROOT/gitops/non-prod-rnd-gke-gitops",
|
|
271
271
|
"remote_url": "git@github.com:aaxis/non-prod-rnd-gke-gitops.git",
|
|
272
272
|
"branch": "main"
|
|
273
273
|
},
|
|
@@ -283,8 +283,8 @@ gitops-operator:
|
|
|
283
283
|
"operational_guidelines": {
|
|
284
284
|
"commit_standards": {
|
|
285
285
|
"validation_required": true,
|
|
286
|
-
"validator_path": "
|
|
287
|
-
"config_path": "
|
|
286
|
+
"validator_path": "$PROJECT_ROOT/.claude/tools/commit_validator.py",
|
|
287
|
+
"config_path": "$PROJECT_ROOT/.claude/config/git_standards.json"
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
},
|
|
@@ -376,12 +376,12 @@ gcp-troubleshooter:
|
|
|
376
376
|
},
|
|
377
377
|
"terraform_infrastructure": {
|
|
378
378
|
"layout": {
|
|
379
|
-
"base_path": "/
|
|
379
|
+
"base_path": "$PROJECT_ROOT/ops/terraform"
|
|
380
380
|
}
|
|
381
381
|
},
|
|
382
382
|
"gitops_configuration": {
|
|
383
383
|
"repository": {
|
|
384
|
-
"path": "/
|
|
384
|
+
"path": "$PROJECT_ROOT/gitops/non-prod-rnd-gke-gitops"
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
},
|
|
@@ -500,8 +500,8 @@ devops-developer:
|
|
|
500
500
|
"operational_guidelines": {
|
|
501
501
|
"commit_standards": {
|
|
502
502
|
"validation_required": true,
|
|
503
|
-
"validator_path": "
|
|
504
|
-
"config_path": "
|
|
503
|
+
"validator_path": "$PROJECT_ROOT/.claude/tools/commit_validator.py",
|
|
504
|
+
"config_path": "$PROJECT_ROOT/.claude/config/git_standards.json"
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
},
|
|
@@ -567,11 +567,11 @@ Task(
|
|
|
567
567
|
## System Context
|
|
568
568
|
|
|
569
569
|
**System Paths:**
|
|
570
|
-
- Agent system:
|
|
571
|
-
- Orchestrator: /
|
|
572
|
-
- Logs:
|
|
573
|
-
- Tools:
|
|
574
|
-
- Tests:
|
|
570
|
+
- Agent system: $PROJECT_ROOT/.claude/
|
|
571
|
+
- Orchestrator: $PROJECT_ROOT/CLAUDE.md
|
|
572
|
+
- Logs: $PROJECT_ROOT/.claude/logs/
|
|
573
|
+
- Tools: $PROJECT_ROOT/.claude/tools/
|
|
574
|
+
- Tests: $PROJECT_ROOT/.claude/tests/
|
|
575
575
|
|
|
576
576
|
**System Knowledge:**
|
|
577
577
|
- 5 specialist agents: terraform-architect, gitops-operator, gcp-troubleshooter, aws-troubleshooter, devops-developer
|
package/config/git-standards.md
CHANGED
|
@@ -17,7 +17,7 @@ This document defines the universal commit message standards for this repository
|
|
|
17
17
|
|
|
18
18
|
```python
|
|
19
19
|
import sys
|
|
20
|
-
sys.path.insert(0, '
|
|
20
|
+
sys.path.insert(0, '$PROJECT_ROOT/.claude/tools')
|
|
21
21
|
from commit_validator import safe_validate_before_commit
|
|
22
22
|
|
|
23
23
|
# Validate commit message
|
|
@@ -463,7 +463,7 @@ Specialist agents perform git commits for:
|
|
|
463
463
|
|
|
464
464
|
### commit_validator.py
|
|
465
465
|
|
|
466
|
-
Located at:
|
|
466
|
+
Located at: `$PROJECT_ROOT/.claude/tools/commit_validator.py`
|
|
467
467
|
|
|
468
468
|
**Functions:**
|
|
469
469
|
|