@jaguilar87/gaia-ops 1.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 (91) hide show
  1. package/CHANGELOG.md +315 -0
  2. package/CLAUDE.md +154 -0
  3. package/LICENSE +21 -0
  4. package/README.md +221 -0
  5. package/agents/aws-troubleshooter.md +50 -0
  6. package/agents/claude-architect.md +821 -0
  7. package/agents/devops-developer.md +92 -0
  8. package/agents/gcp-troubleshooter.md +50 -0
  9. package/agents/gitops-operator.md +360 -0
  10. package/agents/terraform-architect.md +289 -0
  11. package/bin/gaia-init.js +620 -0
  12. package/commands/architect.md +97 -0
  13. package/commands/restore-session.md +87 -0
  14. package/commands/save-session.md +88 -0
  15. package/commands/session-status.md +61 -0
  16. package/commands/speckit.add-task.md +144 -0
  17. package/commands/speckit.analyze-task.md +65 -0
  18. package/commands/speckit.implement.md +96 -0
  19. package/commands/speckit.init.md +237 -0
  20. package/commands/speckit.plan.md +88 -0
  21. package/commands/speckit.specify.md +161 -0
  22. package/commands/speckit.tasks.md +188 -0
  23. package/config/AGENTS.md +162 -0
  24. package/config/agent-catalog.md +604 -0
  25. package/config/context-contracts.md +682 -0
  26. package/config/git-standards.md +674 -0
  27. package/config/git_standards.json +69 -0
  28. package/config/orchestration-workflow.md +735 -0
  29. package/hooks/__pycache__/post_tool_use.cpython-312.pyc +0 -0
  30. package/hooks/__pycache__/pre_kubectl_security.cpython-312.pyc +0 -0
  31. package/hooks/__pycache__/pre_tool_use.cpython-312.pyc +0 -0
  32. package/hooks/__pycache__/session_start.cpython-312.pyc +0 -0
  33. package/hooks/__pycache__/subagent_stop.cpython-312.pyc +0 -0
  34. package/hooks/post_tool_use.py +463 -0
  35. package/hooks/pre_kubectl_security.py +205 -0
  36. package/hooks/pre_tool_use.py +530 -0
  37. package/hooks/session_start.py +315 -0
  38. package/hooks/subagent_stop.py +549 -0
  39. package/index.js +92 -0
  40. package/package.json +59 -0
  41. package/speckit/README.en.md +648 -0
  42. package/speckit/README.md +353 -0
  43. package/speckit/governance.md +169 -0
  44. package/speckit/scripts/check-prerequisites.sh +194 -0
  45. package/speckit/scripts/common.sh +126 -0
  46. package/speckit/scripts/create-new-feature.sh +131 -0
  47. package/speckit/scripts/init.sh +42 -0
  48. package/speckit/scripts/setup-plan.sh +95 -0
  49. package/speckit/scripts/update-agent-context.sh +718 -0
  50. package/speckit/templates/adr-template.md +118 -0
  51. package/speckit/templates/agent-file-template.md +23 -0
  52. package/speckit/templates/plan-template.md +233 -0
  53. package/speckit/templates/spec-template.md +116 -0
  54. package/speckit/templates/tasks-template-bkp.md +136 -0
  55. package/speckit/templates/tasks-template.md +345 -0
  56. package/templates/CLAUDE.template.md +170 -0
  57. package/templates/code-examples/approval_gate_workflow.py +141 -0
  58. package/templates/code-examples/clarification_workflow.py +94 -0
  59. package/templates/code-examples/commit_validation.py +86 -0
  60. package/templates/project-context.template.json +126 -0
  61. package/templates/settings.template.json +307 -0
  62. package/tools/__pycache__/agent_router.cpython-312.pyc +0 -0
  63. package/tools/__pycache__/approval_gate.cpython-312.pyc +0 -0
  64. package/tools/__pycache__/clarify_engine.cpython-312.pyc +0 -0
  65. package/tools/__pycache__/clarify_patterns.cpython-312.pyc +0 -0
  66. package/tools/__pycache__/commit_validator.cpython-312.pyc +0 -0
  67. package/tools/__pycache__/context_section_reader.cpython-312.pyc +0 -0
  68. package/tools/__pycache__/routing_dashboard.cpython-312.pyc +0 -0
  69. package/tools/__pycache__/routing_feedback.cpython-312.pyc +0 -0
  70. package/tools/__pycache__/semantic_matcher.cpython-312.pyc +0 -0
  71. package/tools/__pycache__/task_manager.cpython-312.pyc +0 -0
  72. package/tools/agent_capabilities.json +231 -0
  73. package/tools/agent_invoker_helper.py +239 -0
  74. package/tools/agent_router.py +730 -0
  75. package/tools/approval_gate.py +318 -0
  76. package/tools/clarify_engine.py +511 -0
  77. package/tools/clarify_patterns.py +356 -0
  78. package/tools/commit_validator.py +338 -0
  79. package/tools/context_provider.py +181 -0
  80. package/tools/context_section_reader.py +301 -0
  81. package/tools/demo_clarify.py +104 -0
  82. package/tools/generate_embeddings.py +168 -0
  83. package/tools/quicktriage_aws_troubleshooter.sh +45 -0
  84. package/tools/quicktriage_devops_developer.sh +38 -0
  85. package/tools/quicktriage_gcp_troubleshooter.sh +51 -0
  86. package/tools/quicktriage_gitops_operator.sh +47 -0
  87. package/tools/quicktriage_terraform_architect.sh +40 -0
  88. package/tools/semantic_matcher.py +222 -0
  89. package/tools/task_manager.py +547 -0
  90. package/tools/task_manager_README.md +395 -0
  91. package/tools/task_manager_example.py +215 -0
@@ -0,0 +1,97 @@
1
+ ---
2
+ description: Invoke claude-architect to analyze system architecture, diagnose issues, or propose improvements
3
+ scope: project
4
+ ---
5
+
6
+ You are invoking the **claude-architect** meta-agent to analyze the agent orchestration system itself.
7
+
8
+ ## Context: System Expert Agent
9
+
10
+ claude-architect is a specialized agent that understands:
11
+ - The entire agent system architecture (.claude/, CLAUDE.md, agents, tools, hooks)
12
+ - Spec-Kit workflows (specify, plan, tasks, implement, add-task, analyze-task)
13
+ - Session management (save, restore, bundles)
14
+ - Multi-repository structure (symlinks, ops/, shared configs)
15
+ - Logs analysis and debugging
16
+ - Test suite and validation
17
+ - Best practices research via web search
18
+
19
+ ## Your Task
20
+
21
+ Invoke the claude-architect agent with the user's request. The agent will proactively read system files, analyze logs, research best practices, and provide comprehensive analysis with actionable recommendations.
22
+
23
+ **IMPORTANT:** Pass the user's exact question/request to the agent. Examples:
24
+ - "Analiza este log y dime quΓ© pasΓ³"
25
+ - "ΒΏPor quΓ© el routing estΓ‘ fallando?"
26
+ - "ΒΏCΓ³mo funciona spec-kit?"
27
+ - "PropΓ³n mejoras al sistema de contexto"
28
+ - "Explica cΓ³mo funcionan los symlinks en ops/"
29
+
30
+ ## Invocation
31
+
32
+ Use the Task tool to invoke claude-architect with this structure:
33
+
34
+ ```
35
+ Task(
36
+ subagent_type="claude-architect",
37
+ description="[Brief 3-5 word description]",
38
+ prompt="""
39
+ ## System Context (Auto-provided)
40
+
41
+ **System Paths:**
42
+ - Agent system: /home/jaguilar/aaxis/rnd/repositories/.claude/
43
+ - Orchestrator logic: /home/jaguilar/aaxis/rnd/repositories/CLAUDE.md
44
+ - Logs: /home/jaguilar/aaxis/rnd/repositories/.claude/logs/
45
+ - Tests: /home/jaguilar/aaxis/rnd/repositories/.claude/tests/
46
+ - Tools: /home/jaguilar/aaxis/rnd/repositories/.claude/tools/
47
+ - Agents: /home/jaguilar/aaxis/rnd/repositories/.claude/agents/
48
+ - Commands: /home/jaguilar/aaxis/rnd/repositories/.claude/commands/
49
+ - Sessions: /home/jaguilar/aaxis/rnd/repositories/.claude/session/
50
+ - Ops repository: /home/jaguilar/aaxis/rnd/repositories/ops/
51
+ - Project context: /home/jaguilar/aaxis/rnd/repositories/.claude/project-context.json
52
+
53
+ **Spec-Kit Commands:**
54
+ - /speckit.specify - Create/update feature specification
55
+ - /speckit.plan - Generate implementation plan
56
+ - /speckit.tasks - Generate tasks.md from plan
57
+ - /speckit.implement - Execute tasks
58
+ - /speckit.add-task - Add ad-hoc task
59
+ - /speckit.analyze-task - Deep-dive task analysis
60
+
61
+ **Session Commands:**
62
+ - /save-session - Persist current session
63
+ - /restore-session - Load previous session
64
+ - /session-status - Check session state
65
+
66
+ **Your System Knowledge:**
67
+ You have complete knowledge of:
68
+ 1. **Agent System:** 5 specialist agents (terraform-architect, gitops-operator, gcp-troubleshooter, aws-troubleshooter, devops-developer)
69
+ 2. **Orchestrator:** CLAUDE.md workflow (routing, context provision, approval gates)
70
+ 3. **Context System:** context_provider.py, context contracts, enrichment
71
+ 4. **Routing:** agent_router.py, semantic matching, triggers
72
+ 5. **Security:** Hooks (pre_tool_use.py, post_tool_use.py), security tiers (T0-T3)
73
+ 6. **Spec-Kit:** Full workflow from specification to implementation
74
+ 7. **Sessions:** Active context, bundles, restoration
75
+ 8. **Multi-repo:** Symlinks structure in ops/ (claude-rnd, claude-vtr)
76
+ 9. **Logs:** JSONL format, audit trail, event tracking
77
+ 10. **Tests:** 55+ tests, routing accuracy, SSOT validation
78
+
79
+ ## User's Request
80
+
81
+ {USER_REQUEST}
82
+
83
+ ## Your Mission
84
+
85
+ 1. **Understand the request:** What does the user want to know/analyze/improve?
86
+ 2. **Locate relevant files:** You know exactly where everything lives - read what you need
87
+ 3. **Analyze deeply:** Don't just read - understand patterns, issues, opportunities
88
+ 4. **Research if needed:** Use WebSearch for best practices, benchmarks, solutions
89
+ 5. **Provide comprehensive answer:** Include evidence, examples, recommendations
90
+ 6. **Propose next steps:** If applicable, suggest concrete action items
91
+
92
+ **Remember:** You are the system expert. You have access to EVERYTHING. Use it.
93
+ """
94
+ )
95
+ ```
96
+
97
+ Replace `{USER_REQUEST}` with the user's actual question/request.
@@ -0,0 +1,87 @@
1
+ ---
2
+ description: Restore a previous Claude session with intelligent context loading
3
+ ---
4
+
5
+ This command provides intelligent session restoration with context loading for both main Claude and specialized sub-agents on-demand.
6
+
7
+ ## Quick command (restore latest relevant)
8
+ ```bash
9
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/session_startup_check.py
10
+ ```
11
+
12
+ Shows the most relevant recent session with restoration suggestions.
13
+
14
+ ## Restore specific session
15
+ ```bash
16
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/restore_session.py <bundle-id>
17
+ ```
18
+
19
+ Restores complete session context from the specified bundle.
20
+
21
+ ## List available sessions
22
+ ```bash
23
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/restore_session.py --list
24
+ ```
25
+
26
+ Shows all available session bundles with descriptions and timestamps.
27
+
28
+ ## View session details (without restoring)
29
+ ```bash
30
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/restore_session.py <bundle-id> --show
31
+ ```
32
+
33
+ Display detailed information about a session bundle without loading it.
34
+
35
+ ## Agent-specific context extraction
36
+ ```bash
37
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/restore_session.py <bundle-id> --agent terraform-architect
38
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/restore_session.py <bundle-id> --agent gitops-operator
39
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/restore_session.py <bundle-id> --agent devops-developer
40
+ ```
41
+
42
+ Extract context specific to a particular agent type for on-demand loading.
43
+
44
+ ## Examples
45
+
46
+ **View recent sessions:**
47
+ ```bash
48
+ # Check what sessions are available
49
+ /restore-session --list
50
+
51
+ # See startup recommendations
52
+ python3 .claude/session/scripts/session_startup_check.py
53
+ ```
54
+
55
+ **Restore a session:**
56
+ ```bash
57
+ # Full session restore
58
+ /restore-session 2025-09-26-session-164535-384ea531
59
+
60
+ # Just view details first
61
+ /restore-session 2025-09-26-session-164535-384ea531 --show
62
+ ```
63
+
64
+ **Agent context loading:**
65
+ ```bash
66
+ # For terraform work
67
+ /restore-session latest --agent terraform-architect
68
+
69
+ # For kubernetes/GitOps work
70
+ /restore-session latest --agent gitops-operator
71
+ ```
72
+
73
+ ## What gets restored
74
+
75
+ - βœ… **Active context** - Current session state, primers, and context files
76
+ - βœ… **Project state** - Git status, working directory, recent changes
77
+ - βœ… **Session metadata** - Task information, timestamps, descriptions
78
+ - βœ… **Conversation summary** - Key accomplishments and next steps
79
+
80
+ ## Session restoration is smart
81
+
82
+ - **Non-destructive**: Backs up current context before restoring
83
+ - **Selective**: Can extract context for specific agents without full restore
84
+ - **Informative**: Shows session details before committing to restore
85
+ - **Flexible**: Supports partial bundle IDs for convenience
86
+
87
+ Use this when you want to continue work from a previous session or need context from past work for current tasks.
@@ -0,0 +1,88 @@
1
+ ---
2
+ description: Persist the current Claude session (bundle + active context) to disk.
3
+ ---
4
+
5
+ This command saves the complete current session into a new bundle with all context, artifacts, and git operations captured. Use it whenever you want a comprehensive snapshot of your work before closing the workspace.
6
+
7
+ ## Quick command (recommended)
8
+
9
+ ### Default session bundle
10
+ ```bash
11
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/create_current_session_bundle.py
12
+ ```
13
+
14
+ Creates: `2025-10-16-session-163244-abc12345`
15
+
16
+ ### Custom labeled bundle
17
+ ```bash
18
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/create_current_session_bundle.py --label agent-upgrades
19
+ ```
20
+
21
+ Creates: `2025-10-16-agent-upgrades-163244-abc12345`
22
+
23
+ **Options:**
24
+ - `--label LABEL` - Add a custom descriptive label to the bundle name
25
+ - `--no-git-ops` - Skip capturing git operations
26
+
27
+ **Common labels:**
28
+ - `agent-upgrades` - Agent system improvements
29
+ - `feature-xyz` - Feature implementation
30
+ - `bugfix-abc` - Bug fix work
31
+ - `infrastructure` - Infrastructure changes
32
+ - `refactor` - Code refactoring
33
+
34
+ **Features:**
35
+ - Creates a brand new bundle with unique timestamp ID
36
+ - Captures complete session context: git operations, modified files, conversation summary
37
+ - Copies important artifacts and active context for full restoration capability
38
+ - Generates comprehensive metadata and human-readable summary template
39
+ - Ready for sharing, archival, or future restoration
40
+
41
+ **⚠️ Important: Update the Summary**
42
+ After creating a bundle, **manually update** the `summary.md` file to capture:
43
+ - Key accomplishments of the session
44
+ - Specific technical changes made
45
+ - Important decisions or findings
46
+ - Relevant next steps
47
+
48
+ The auto-generated summary is a template. For accurate session documentation,
49
+ edit: `.claude/session/bundles/<bundle-id>/summary.md`
50
+
51
+ ## Alternative: Legacy snapshot (updates existing bundle)
52
+ ```bash
53
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/save_session_snapshot.py
54
+ ```
55
+
56
+ - Updates an existing bundle with current active context only
57
+ - Use `--bundle-id=<id>` to target a specific bundle
58
+
59
+ ## Flujo detallado (opcional)
60
+ Si prefieres hacerlo paso a paso o necesitas crear un nuevo bundle antes de guardar:
61
+
62
+ 1. **Crear/actualizar bundle**
63
+ Ejecuta cualquier comando del agente (p.ej. `/analizer T010`) para que el hook `subagent_stop` genere un bundle fresco.
64
+
65
+ 2. **Inspeccionar bundles disponibles**
66
+ ```bash
67
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/session-manager.py list
68
+ ```
69
+
70
+ 3. **Copiar contexto activo al bundle deseado**
71
+ ```bash
72
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/save_session_snapshot.py --bundle-id <bundle-id>
73
+ ```
74
+
75
+ 4. **(Opcional) Empaquetar para compartir**
76
+ ```bash
77
+ tar -czf /home/jaguilar/aaxis/rnd/repositories/.claude/session/bundles/<bundle-id>.tar.gz \
78
+ -C /home/jaguilar/aaxis/rnd/repositories/.claude/session/bundles/<bundle-id> .
79
+ ```
80
+
81
+ ## Notes
82
+ - The exported tarball contains the bundle (metadata, transcript, artifacts).
83
+ - Copying `session/active` preserves the live context (primers, json/md summaries).
84
+ - You can restore later with:
85
+ ```bash
86
+ python3 .claude/session/scripts/session-manager.py import <path-to-bundle-tar>
87
+ ```
88
+ - Keep exports outside of version control unless you intend to commit them.
@@ -0,0 +1,61 @@
1
+ ---
2
+ description: Check current session status and show recent session information
3
+ ---
4
+
5
+ This command provides an intelligent overview of your current session state and recent work.
6
+
7
+ ## Quick status check
8
+ ```bash
9
+ python3 /home/jaguilar/aaxis/rnd/repositories/.claude/session/scripts/session_startup_check.py
10
+ ```
11
+
12
+ Shows:
13
+ - 🎯 Most relevant recent session based on current work
14
+ - πŸ“š Summary of other recent sessions (last 24 hours)
15
+ - πŸ’‘ Smart suggestions for session restoration
16
+ - πŸ”§ Available session management commands
17
+
18
+ ## What you'll see
19
+
20
+ **Current context analysis:**
21
+ - Working directory y feature activa (si se definiΓ³ `SPECIFY_FEATURE`)
22
+ - Recent commits and project activity
23
+ - Relevance scoring for available sessions
24
+
25
+ **Session recommendations:**
26
+ - Bundles with high relevance to current work
27
+ - Time-based suggestions (recent sessions)
28
+ - Project context matching (similar technologies/tasks)
29
+
30
+ **Available actions:**
31
+ - Commands to restore specific sessions
32
+ - Options to view session details
33
+ - Links to session management tools
34
+
35
+ ## Intelligence features
36
+
37
+ The status check analyzes your current work context and compares it with recent sessions to:
38
+
39
+ - **Score relevance** based on project keywords, git activity, and timing
40
+ - **Suggest restoration** when previous sessions are highly relevant
41
+ - **Provide context** about what each session accomplished
42
+ - **Show continuation paths** for ongoing work
43
+
44
+ ## Use cases
45
+
46
+ **Starting a work session:**
47
+ - Run `/session-status` to see if you should continue previous work
48
+ - Get oriented about recent sessions and accomplishments
49
+ - Decide whether to restore context or start fresh
50
+
51
+ **During development:**
52
+ - Check what sessions are available for reference
53
+ - Find sessions related to current task
54
+ - Get quick overview of recent work
55
+
56
+ **Before switching contexts:**
57
+ - Review current session state before saving
58
+ - Check if similar work was done in recent sessions
59
+ - Plan session organization and cleanup
60
+
61
+ This replaces the need to manually browse session directories or remember what you were working on previously.
@@ -0,0 +1,144 @@
1
+ ---
2
+
3
+ **USAGE**: This command requires: `<speckit-root> <feature-name>`
4
+ **Example**: `/speckit.add-task spec-kit-tcm-plan 004-feature-name`
5
+ description: Add a single task to active feature's tasks.md with automatic enrichment. Use during implementation for ad-hoc tasks.
6
+ ---
7
+
8
+ **USAGE**: This command requires: `<speckit-root> <feature-name>`
9
+ **Example**: `/speckit.add-task spec-kit-tcm-plan 004-feature-name`
10
+
11
+ The user input after `/speckit.add-task` MUST contain the high-level task intent (e.g., "Fix database connection pool leak"). Treat `$ARGUMENTS` below as that description and combine it with interactive prompts.
12
+
13
+ User input:
14
+
15
+ $ARGUMENTS
16
+
17
+ ## Overview
18
+ Use this command to append or insert a **single** task in the currently active Spec-Kit feature (e.g., `specs/001-feature-name/tasks.md`). Every task must respect the phase ordering, ID sequencing, and formatting rules defined in `.claude/speckit/templates/tasks-template.md`.
19
+
20
+ **When to use:**
21
+ - Discovered new requirement during implementation
22
+ - Hotfix or bug discovered mid-development
23
+ - Plan changed and need to add unplanned tasks
24
+ - Ad-hoc investigation or research task needed
25
+
26
+ ## Required Inputs (ask the user if any are missing)
27
+ 1. **Task ID** (e.g., `T024`): MUST be unique and sequential for its section. Confirm with the user before writing.
28
+ 2. **Phase**: One of the existing headers (e.g., `## Phase 3.1: Setup`). Ask where the task belongs.
29
+ 3. **Parallel marker**: Whether the task can run in parallel (`[P]`). Default to sequential if unsure.
30
+ 4. **Task description**: Clear action phrased as "Verb ..." and including file paths when applicable. Use the `/speckit.add-task` arguments as starting point and refine with the user.
31
+ 5. **Dependencies / notes** (optional): If the task introduces new dependencies, capture them in the `## Dependencies` or checklist section.
32
+
33
+ ## Procedure
34
+ 1. **Run prerequisite discovery** (repo root):
35
+ ```bash
36
+ .claude/speckit/scripts/check-prerequisites.sh --json --require-tasks --include-tasks
37
+ ```
38
+ Parse `FEATURE_DIR` and ensure `tasks.md` exists.
39
+
40
+ 2. **Load context**:
41
+ - Read `tasks.md` to understand current phases, ordering, and existing task IDs.
42
+ - Read `plan.md` and `.claude/speckit/governance.md` to keep the new task aligned with architectural and governance rules.
43
+
44
+ 3. **Gather missing details**:
45
+ - If the command arguments do not include the task ID, phase, or `[P]` marker, explicitly ask the user.
46
+ - Verify that the proposed ID is unused and fits the numeric ordering inside the chosen phase. If not, negotiate a new ID with the user.
47
+
48
+ 4. **Insert the task with inline metadata**:
49
+ - Add a markdown checklist line under the selected phase, keeping alphabetical order by ID.
50
+ - Format: `- [ ] T0XX [P] Description` (omit `[P]` when sequential).
51
+ - Include precise file paths or scripts where applicable.
52
+ - **IMMEDIATELY add metadata comments** using the enrichment rules:
53
+
54
+ **Enrichment Rules** (analyze task description):
55
+
56
+ | Keywords | Agent | Base Tier |
57
+ |----------|-------|-----------|
58
+ | terraform, terragrunt, .tf, infrastructure, vpc, gke | terraform-architect | T0/T2/T3 |
59
+ | kubectl, helm, flux, kubernetes, deployment, service | gitops-operator | T0/T2/T3 |
60
+ | gcloud, GCP, cloud logging, IAM | gcp-troubleshooter | T0 |
61
+ | docker, npm, build, test, CI, Dockerfile | devops-developer | T0-T1 |
62
+
63
+ **Security Tier**:
64
+ - T0: get, describe, show, list, logs, read
65
+ - T1: validate, lint, template, format
66
+ - T2: plan, dry-run, diff
67
+ - T3: apply, push, create, delete, deploy (⚠️ HIGH RISK)
68
+
69
+ **Tags**: Add ALL matching: #terraform #kubernetes #helm #docker #gcp #database #security #api #monitoring #setup #test #deploy #config #docs
70
+
71
+ **Priority**: ❓ (low) | ⚑ (medium) | πŸ”₯ (high impact)
72
+
73
+ **Example**:
74
+ ```markdown
75
+ - [ ] T042 Configure CORS headers for API endpoints
76
+ <!-- πŸ€– Agent: devops-developer | βœ… T1 | ⚑ 0.75 -->
77
+ <!-- 🏷️ Tags: #api #config #security -->
78
+ <!-- 🎯 skill: api_configuration (6.0) -->
79
+ ```
80
+
81
+ For T2/T3 tasks, add high-risk warning:
82
+ ```markdown
83
+ - [ ] T055 Apply Terraform VPC changes
84
+ <!-- πŸ€– Agent: terraform-architect | 🚫 T3 | πŸ”₯ 0.95 -->
85
+ <!-- 🏷️ Tags: #terraform #infrastructure #networking -->
86
+ <!-- ⚠️ HIGH RISK: Analyze before execution -->
87
+ <!-- πŸ’‘ Suggested: /speckit.analyze-task T055 -->
88
+ <!-- 🎯 skill: terraform_infrastructure (12.0) -->
89
+ ```
90
+
91
+ 5. **Update supporting sections** (if required):
92
+ - `## Dependencies`: reflect any new blocking relationships.
93
+ - `## Validation Checklist` / Governance Compliance: add or adjust items to keep requirements accurate.
94
+
95
+ 6. **Validate task metadata**:
96
+ - Verify metadata comments are present and accurate
97
+ - Check agent assignment matches task type
98
+ - Confirm security tier is appropriate
99
+ - If T2/T3, ensure `⚠️ HIGH RISK` marker is present
100
+
101
+ 7. **Auto-analyze task** (Quality gate):
102
+ - After task is added and enriched, automatically execute `/speckit.analyze-task <Task-ID>`
103
+ - This validates the task before continuing implementation
104
+ - Display analysis output to user
105
+ - User reviews to ensure task is well-defined and properly placed
106
+
107
+ 8. **Report & next steps**:
108
+ - Run `git diff` to show the inserted task WITH inline metadata
109
+ - Summarize the new task details:
110
+ * Task ID and phase
111
+ * Description and file paths
112
+ * Suggested agent and tier
113
+ * High-risk status (if applicable)
114
+ * Dependencies added
115
+ - Mention that analysis was completed (step 7)
116
+ - If task is T2/T3, remind user it will trigger analysis again during `/speckit.implement`
117
+
118
+ ## Notes
119
+ - Never guess the task ID: always confirm with the user
120
+ - Avoid creating multiple tasks in one run; invoke `/speckit.add-task` per task
121
+ - Metadata is added INLINE during task creation (step 4)
122
+ - Honor security tiers: auto-detect T2/T3 operations from task keywords
123
+ - If the user request conflicts with governance.md principles, surface the concern and seek clarification before writing
124
+
125
+ ## Example Usage
126
+ ```bash
127
+ # During implementation, you discover a missing config:
128
+ /speckit.add-task "Configure CORS headers for API endpoints"
129
+
130
+ # System will:
131
+ # 1. Ask for task ID (e.g., T042)
132
+ # 2. Ask for phase (e.g., Integration)
133
+ # 3. Ask if parallel (e.g., yes, different file)
134
+ # 4. Insert task with inline metadata
135
+ # 5. Auto-analyze task (quality gate)
136
+ # 6. Show enriched result
137
+ ```
138
+
139
+ ## Inline Metadata Benefits
140
+ - βœ… No post-processing step required
141
+ - βœ… Consistent metadata format
142
+ - βœ… Automatic agent routing
143
+ - βœ… Security tier classification
144
+ - βœ… High-risk detection for T2/T3
@@ -0,0 +1,65 @@
1
+ ---
2
+
3
+ **USAGE**: This command requires: `<speckit-root> <feature-name>`
4
+ **Example**: `/speckit.analyze-task spec-kit-tcm-plan 004-feature-name`
5
+ description: Deep-dive analysis of a specific task before execution. Auto-triggered for high-risk tasks (T2/T3).
6
+ ---
7
+
8
+ **USAGE**: This command requires: `<speckit-root> <feature-name>`
9
+ **Example**: `/speckit.analyze-task spec-kit-tcm-plan 004-feature-name`
10
+
11
+ The text typed after `/speckit.analyze-task` is the task identifier or description you must inspect. Treat `$ARGUMENTS` literally as that input and reference it throughout the analysis.
12
+
13
+ User input:
14
+
15
+ $ARGUMENTS
16
+
17
+ ## Objective
18
+ Provide a thorough explanation of **one** task without executing it. Clarify what must be done, why it matters, expected side-effects, and how to verify completion using read-only/dry-run steps.
19
+
20
+ ## Workflow
21
+ 1. **Locate the task**
22
+ - Find active feature in `specs/` directory
23
+ - Open the task list (`specs/<feature>/tasks.md`)
24
+ - If the user supplied a description instead of an ID, search the file and confirm the exact task with them before proceeding
25
+
26
+ 2. **Collect context**
27
+ - Record the phase, dependencies, `[P]` parallel marker, and any notes adjacent to the task entry
28
+ - Review the implementation plan (`plan.md`) and `.claude/speckit/governance.md` for constraints that apply to the task
29
+ - Inspect referenced artifacts (contracts/, data-model.md, quickstart.md) so the explanation is accurate
30
+
31
+ 3. **Extract routing metadata**
32
+ - Read the task's inline metadata comments to understand routing information
33
+ - Extract: agent assignment, security tier, tags, and confidence scores
34
+ - Example metadata format:
35
+ ```markdown
36
+ - [ ] T055 Apply Terraform VPC changes
37
+ <!-- πŸ€– Agent: terraform-architect | 🚫 T3 | πŸ”₯ 0.95 -->
38
+ <!-- 🏷️ Tags: #terraform #infrastructure #networking -->
39
+ ```
40
+ - Use this metadata for consultation only. Do NOT execute the task
41
+
42
+ 4. **Produce the explanation**
43
+ Structure the response in four sections:
44
+ - **What it does** – plain-language summary of the task’s action and scope.
45
+ - **Why it matters** – link to plan/constitution requirements and note risks of skipping it.
46
+ - **Impact on system** – dependencies, affected services/repos, expected state after completion (call out T3 or manual approvals).
47
+ - **How to validate** – explicit read-only or dry-run commands someone can run to confirm success.
48
+
49
+ ## Rules
50
+ - Never mark the task as completed or modify `tasks.md`.
51
+ - Ask for clarification if multiple tasks match the input.
52
+ - Highlight manual approvals or cross-team coordination when applicable.
53
+ - Reference file paths and commands precisely; prefer absolute or repo-relative routes.
54
+
55
+ ## Example prompts
56
+ ```bash
57
+ /speckit.analyze-task T011
58
+ /speckit.analyze-task "Update ManagedCertificate for bot service"
59
+ /speckit.analyze-task "Verify health-check BackendConfig"
60
+ ```
61
+
62
+ **Note:** This command is automatically triggered when executing high-risk tasks (T2/T3) via `/speckit.implement`. You can also call it manually to analyze any task before execution.
63
+
64
+ ## Output expectations
65
+ Deliver a concise, well-structured answer (sections or bullet points) so the user can immediately understand intent, impact, and verification steps without running the task.
@@ -0,0 +1,96 @@
1
+ ---
2
+ description: Execute the implementation plan by processing and executing all tasks defined in tasks.md
3
+ ---
4
+
5
+ The user input can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ **IMPORTANT**: This command now requires TWO arguments:
12
+ 1. `<speckit-root>`: Path to spec-kit root directory (e.g., `spec-kit-tcm-plan`)
13
+ 2. `<feature-name>`: Feature name (e.g., `004-project-guidance-deployment`)
14
+
15
+ **Example usage**:
16
+ ```
17
+ /speckit.implement spec-kit-tcm-plan 004-project-guidance-deployment
18
+ ```
19
+
20
+ 1. Extract `<speckit-root>` and `<feature-name>` from $ARGUMENTS. If not provided, ERROR and show usage example.
21
+ 2. Derive paths manually:
22
+ ```
23
+ SPECKIT_ROOT = <speckit-root> (resolve to absolute if relative)
24
+ FEATURE_DIR = $SPECKIT_ROOT/specs/<feature-name>
25
+ TASKS = $FEATURE_DIR/tasks.md
26
+ IMPL_PLAN = $FEATURE_DIR/plan.md
27
+ DATA_MODEL = $FEATURE_DIR/data-model.md
28
+ CONTRACTS_DIR = $FEATURE_DIR/contracts/
29
+ RESEARCH = $FEATURE_DIR/research.md
30
+ QUICKSTART = $FEATURE_DIR/quickstart.md
31
+ ```
32
+ 3. Verify tasks.md exists (REQUIRED for this command). If not found, ERROR with instructions to run /speckit.tasks first.
33
+
34
+ 2. Load and analyze the implementation context:
35
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
36
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
37
+ - **IF EXISTS**: Read data-model.md for entities and relationships
38
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
39
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
40
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
41
+
42
+ 3. Parse tasks.md structure and extract:
43
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
44
+ - **Task dependencies**: Sequential vs parallel execution rules
45
+ - **Task details**: ID, description, file paths, parallel markers [P]
46
+ - **Execution flow**: Order and dependency requirements
47
+ - **High-risk markers**: Identify tasks with `<!-- ⚠️ HIGH RISK -->` markers
48
+
49
+ 4. **High-Risk Task Analysis** (Automatic Safety Check):
50
+ Before executing ANY task, check if it contains:
51
+ ```
52
+ <!-- ⚠️ HIGH RISK: Analyze before execution -->
53
+ <!-- πŸ’‘ Suggested: /speckit.analyze-task T### -->
54
+ ```
55
+
56
+ If found:
57
+ a. Automatically execute `/speckit.analyze-task T###` (do not skip this!)
58
+ b. Display the analysis output to user
59
+ c. Ask for confirmation: "This is a HIGH RISK task (T2/T3). Analysis complete. Proceed with execution? (y/n/skip)"
60
+ d. If user answers:
61
+ - "y" or "yes": Proceed with task execution
62
+ - "n" or "no": Skip task and mark as skipped in tasks.md
63
+ - "skip": Skip task without marking (can be retried later)
64
+
65
+ **IMPORTANT**: Never skip the analysis for high-risk tasks. User safety depends on this review.
66
+
67
+ 5. Execute implementation following the task plan:
68
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
69
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
70
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
71
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
72
+ - **Validation checkpoints**: Verify each phase completion before proceeding
73
+
74
+ 6. Implementation execution rules:
75
+ - **Setup first**: Initialize project structure, dependencies, configuration
76
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
77
+ - **Core development**: Implement models, services, CLI commands, endpoints
78
+ - **Integration work**: Database connections, middleware, logging, external services
79
+ - **Polish and validation**: Unit tests, performance optimization, documentation
80
+
81
+ 7. Progress tracking and error handling:
82
+ - Report progress after each completed task
83
+ - Halt execution if any non-parallel task fails
84
+ - For parallel tasks [P], continue with successful tasks, report failed ones
85
+ - Provide clear error messages with context for debugging
86
+ - Suggest next steps if implementation cannot proceed
87
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
88
+
89
+ 8. Completion validation:
90
+ - Verify all required tasks are completed
91
+ - Check that implemented features match the original specification
92
+ - Validate that tests pass and coverage meets requirements
93
+ - Confirm the implementation follows the technical plan
94
+ - Report final status with summary of completed work
95
+
96
+ Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/tasks` first to regenerate the task list.