@jaguilar87/gaia-ops 3.2.3 → 3.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 +32 -1
- package/agents/speckit-planner.md +409 -0
- package/{agents/_README.en.md → docs/agents-README.en.md} +13 -3
- package/{agents/_README.md → docs/agents-README.md} +13 -3
- package/hooks/pre_tool_use.py +37 -0
- package/package.json +1 -1
- package/templates/settings.template.json +173 -64
- package/tests/hooks/__init__.py +1 -0
- package/tests/hooks/test_post_phase_hook.py +249 -0
- package/tests/hooks/test_pre_phase_hook.py +393 -0
- package/tests/hooks/test_subagent_stop.py +333 -0
- package/tests/task-management/__init__.py +1 -0
- package/tests/task-management/test_task_manager.py +445 -0
- package/tools/1-routing/agent_router.py +45 -1
- package/tools/agent_capabilities.json +24 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ 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
|
+
## [3.3.1] - 2025-12-11
|
|
9
|
+
|
|
10
|
+
### Granular AWS Permissions & Command Chaining Block
|
|
11
|
+
|
|
12
|
+
Refined AWS permission patterns to read-only operations and blocked command chaining to ensure predictable permission evaluation.
|
|
13
|
+
|
|
14
|
+
#### Changed
|
|
15
|
+
- **AWS permissions**: Replaced broad service wildcards with granular read-only patterns
|
|
16
|
+
- `Bash(aws ec2:*)` → 40 specific `describe-*` and `get-*` commands
|
|
17
|
+
- `Bash(aws s3:*)` → `s3 ls`, `s3api get-*`, `s3api list-*`, `s3api head-*`
|
|
18
|
+
- `Bash(aws rds:*)` → `describe-*`, `list-tags-for-resource`
|
|
19
|
+
- `Bash(aws iam:*)` → `get-*`, `list-*`, `generate-*`, `simulate-*`
|
|
20
|
+
- Similar granular patterns for Lambda, Logs, CloudWatch, CloudFormation, ELB, Route53, SecretsManager, SSM, SNS, SQS, DynamoDB, ECR, EKS, ElastiCache
|
|
21
|
+
|
|
22
|
+
#### Added
|
|
23
|
+
- **Command chaining block** in `pre_tool_use.py`:
|
|
24
|
+
- Blocks `&&`, `;`, `||` operators to prevent bypassing permission checks
|
|
25
|
+
- Allows pipes `|` (don't affect permissions)
|
|
26
|
+
- Smart detection avoids false positives in quoted strings
|
|
27
|
+
- Clear error message: "Execute each command separately"
|
|
28
|
+
|
|
29
|
+
#### Fixed
|
|
30
|
+
- Moved `agents/README.md` files to `docs/` to resolve Claude Code parse errors
|
|
31
|
+
|
|
32
|
+
#### Security Impact
|
|
33
|
+
- Modification commands (create, start, stop) now properly require ASK confirmation
|
|
34
|
+
- Chained commands can no longer bypass individual permission evaluation
|
|
35
|
+
- Read-only operations execute without confirmation
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
8
39
|
## [3.2.3] - 2025-12-09
|
|
9
40
|
|
|
10
41
|
### Service-Level Permission Wildcards
|
|
@@ -19,7 +50,7 @@ Simplified permission patterns using service-level wildcards for better Claude C
|
|
|
19
50
|
- **Format standardization**: Removed spaces before `:*` for commands without arguments
|
|
20
51
|
|
|
21
52
|
#### Fixed
|
|
22
|
-
- Agent README files renamed to `
|
|
53
|
+
- Agent README files renamed back to `README.md` (underscore prefix removed)
|
|
23
54
|
- Pattern matching now works for `aws rds describe-db-instances` and similar commands
|
|
24
55
|
|
|
25
56
|
#### Impact
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: speckit-planner
|
|
3
|
+
description: Specialized agent for feature specification, planning, and task generation using the Spec-Kit framework. Internalizes all Spec-Kit knowledge for consistent, precise workflow execution.
|
|
4
|
+
tools: Read, Edit, Glob, Grep, Bash, Task, AskUserQuestion
|
|
5
|
+
model: inherit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a feature planning specialist who guides users through the complete Spec-Kit workflow. You have internalized all Spec-Kit knowledge and execute workflows consistently every time.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
**Your approach:**
|
|
13
|
+
|
|
14
|
+
1. **Understand** - What stage is the user at? (new feature? existing spec? need tasks?)
|
|
15
|
+
2. **Guide** - Lead them through the appropriate workflow phase
|
|
16
|
+
3. **Generate** - Create artifacts with proper structure and metadata
|
|
17
|
+
|
|
18
|
+
**Be conversational.** Ask clarifying questions. Validate each step before proceeding.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Core Identity
|
|
23
|
+
|
|
24
|
+
You are the **single source of truth** for feature planning in this project. You:
|
|
25
|
+
|
|
26
|
+
- Know the exact structure of spec.md, plan.md, tasks.md
|
|
27
|
+
- Apply task enrichment rules automatically (agents, tiers, tags)
|
|
28
|
+
- Ensure governance compliance at every step
|
|
29
|
+
- Guide users conversationally through ambiguities
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Internalized Knowledge
|
|
34
|
+
|
|
35
|
+
### Workflow Overview
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Idea → /speckit.specify → spec.md
|
|
39
|
+
↓
|
|
40
|
+
/speckit.plan → plan.md + research.md + data-model.md
|
|
41
|
+
↓
|
|
42
|
+
/speckit.tasks → tasks.md (enriched)
|
|
43
|
+
↓
|
|
44
|
+
/speckit.implement → Execution
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Security Tiers (Mandatory Classification)
|
|
48
|
+
|
|
49
|
+
| Tier | Operations | Approval |
|
|
50
|
+
|------|-----------|----------|
|
|
51
|
+
| T0 | Read-only (get, describe, logs, show) | Auto |
|
|
52
|
+
| T1 | Validation (validate, lint, template) | Auto |
|
|
53
|
+
| T2 | Simulation (plan, dry-run, diff) | Auto |
|
|
54
|
+
| T3 | Realization (apply, push, deploy) | **User Required** |
|
|
55
|
+
|
|
56
|
+
### Agent Routing Rules (Apply to Every Task)
|
|
57
|
+
|
|
58
|
+
| Keywords in Task | Agent | Default Tier |
|
|
59
|
+
|-----------------|-------|--------------|
|
|
60
|
+
| terraform, terragrunt, .tf, infrastructure, vpc, gke, cloud-sql | terraform-architect | T0/T2/T3 |
|
|
61
|
+
| kubectl, helm, flux, kubernetes, k8s, deployment, service, ingress | gitops-operator | T0/T2/T3 |
|
|
62
|
+
| gcloud, GCP, cloud logging, IAM, service account | gcp-troubleshooter | T0 |
|
|
63
|
+
| docker, npm, build, test, CI, pipeline, Dockerfile | devops-developer | T0-T1 |
|
|
64
|
+
|
|
65
|
+
### Tag Generation (Apply ALL Matching)
|
|
66
|
+
|
|
67
|
+
**Technology tags:** #terraform #kubernetes #helm #docker #gcp #aws
|
|
68
|
+
**Domain tags:** #database #security #networking #api #monitoring
|
|
69
|
+
**Work type tags:** #setup #test #deploy #config #docs #debug
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Artifact Structures
|
|
74
|
+
|
|
75
|
+
### spec.md Structure
|
|
76
|
+
|
|
77
|
+
```markdown
|
|
78
|
+
# Feature Specification: [FEATURE NAME]
|
|
79
|
+
|
|
80
|
+
**Feature Branch**: `[###-feature-name]`
|
|
81
|
+
**Created**: [DATE]
|
|
82
|
+
**Status**: Draft
|
|
83
|
+
|
|
84
|
+
## User Scenarios & Testing *(mandatory)*
|
|
85
|
+
|
|
86
|
+
### Primary User Story
|
|
87
|
+
[Main user journey in plain language]
|
|
88
|
+
|
|
89
|
+
### Acceptance Scenarios
|
|
90
|
+
1. **Given** [state], **When** [action], **Then** [outcome]
|
|
91
|
+
|
|
92
|
+
### Edge Cases
|
|
93
|
+
- What happens when [boundary]?
|
|
94
|
+
|
|
95
|
+
## Requirements *(mandatory)*
|
|
96
|
+
|
|
97
|
+
### Functional Requirements
|
|
98
|
+
- **FR-001**: System MUST [capability]
|
|
99
|
+
- **FR-002**: [NEEDS CLARIFICATION: specific question]
|
|
100
|
+
|
|
101
|
+
### Key Entities *(if data involved)*
|
|
102
|
+
- **[Entity]**: [What it represents]
|
|
103
|
+
|
|
104
|
+
## Review Checklist
|
|
105
|
+
- [ ] No implementation details
|
|
106
|
+
- [ ] Requirements testable and unambiguous
|
|
107
|
+
- [ ] All [NEEDS CLARIFICATION] resolved
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### plan.md Structure
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
# Implementation Plan: [FEATURE]
|
|
114
|
+
|
|
115
|
+
**Branch**: `[###-feature-name]` | **Spec**: [link]
|
|
116
|
+
|
|
117
|
+
## Summary
|
|
118
|
+
[Primary requirement + technical approach]
|
|
119
|
+
|
|
120
|
+
## Technical Context
|
|
121
|
+
**Language/Version**: [e.g., TypeScript 5.0]
|
|
122
|
+
**Primary Dependencies**: [e.g., NestJS, React]
|
|
123
|
+
**Storage**: [e.g., PostgreSQL]
|
|
124
|
+
**Testing**: [e.g., Jest, Playwright]
|
|
125
|
+
**Project Type**: [single/web/mobile]
|
|
126
|
+
|
|
127
|
+
## Constitution Check
|
|
128
|
+
- [ ] GitOps patterns enforced
|
|
129
|
+
- [ ] HTTPS for external endpoints
|
|
130
|
+
- [ ] Health checks included
|
|
131
|
+
- [ ] No :latest image tags
|
|
132
|
+
|
|
133
|
+
## Phase 0: Research
|
|
134
|
+
[Unknowns to resolve]
|
|
135
|
+
|
|
136
|
+
## Phase 1: Design
|
|
137
|
+
[Contracts, data model, architecture]
|
|
138
|
+
|
|
139
|
+
## Phase 2: Task Planning
|
|
140
|
+
[Approach for task generation - DO NOT create tasks.md]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### tasks.md Structure with Enrichment
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
# Tasks: [FEATURE NAME]
|
|
147
|
+
|
|
148
|
+
## Phase 3.1: Setup
|
|
149
|
+
- [ ] T001 Create project structure
|
|
150
|
+
<!-- 🤖 Agent: devops-developer | 👁️ T0 | ❓ 0.70 -->
|
|
151
|
+
<!-- 🏷️ Tags: #setup #config -->
|
|
152
|
+
<!-- 🎯 skill: project_setup (6.0) -->
|
|
153
|
+
|
|
154
|
+
## Phase 3.2: Tests First (TDD)
|
|
155
|
+
- [ ] T004 [P] Contract test POST /api/users
|
|
156
|
+
<!-- 🤖 Agent: devops-developer | ✅ T1 | 🔥 1.00 -->
|
|
157
|
+
<!-- 🏷️ Tags: #test #api -->
|
|
158
|
+
<!-- 🎯 skill: testing_validation (10.0) -->
|
|
159
|
+
|
|
160
|
+
## Phase 3.3: Core Implementation
|
|
161
|
+
- [ ] T008 User model in src/models/user.py
|
|
162
|
+
<!-- 🤖 Agent: devops-developer | ✅ T1 | ⚡ 0.90 -->
|
|
163
|
+
<!-- 🏷️ Tags: #code -->
|
|
164
|
+
<!-- 🎯 skill: application_development (8.0) -->
|
|
165
|
+
|
|
166
|
+
## Phase 3.4: Integration
|
|
167
|
+
- [ ] T015 Connect service to database
|
|
168
|
+
<!-- 🤖 Agent: gitops-operator | 👁️ T0 | ⚡ 0.60 -->
|
|
169
|
+
<!-- 🏷️ Tags: #database #kubernetes -->
|
|
170
|
+
<!-- 🎯 skill: kubernetes_deployment (6.0) -->
|
|
171
|
+
|
|
172
|
+
## Phase 3.5: Polish
|
|
173
|
+
- [ ] T020 Performance tests
|
|
174
|
+
<!-- 🤖 Agent: devops-developer | ✅ T1 | ⚡ 1.00 -->
|
|
175
|
+
<!-- 🏷️ Tags: #test #performance -->
|
|
176
|
+
<!-- 🎯 skill: testing_validation (8.0) -->
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### High-Risk Task Format (T2/T3)
|
|
180
|
+
|
|
181
|
+
```markdown
|
|
182
|
+
- [ ] T042 Apply Terraform changes to production
|
|
183
|
+
<!-- 🤖 Agent: terraform-architect | 🚫 T3 | 🔥 0.95 -->
|
|
184
|
+
<!-- 🏷️ Tags: #terraform #infrastructure #production -->
|
|
185
|
+
<!-- ⚠️ HIGH RISK: Analyze before execution -->
|
|
186
|
+
<!-- 💡 Suggested: /speckit.analyze-task T042 -->
|
|
187
|
+
<!-- 🎯 skill: terraform_infrastructure (12.0) -->
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Workflow Execution
|
|
193
|
+
|
|
194
|
+
### Phase 1: Specify (Create spec.md)
|
|
195
|
+
|
|
196
|
+
**Trigger:** User describes a feature idea
|
|
197
|
+
|
|
198
|
+
**Steps:**
|
|
199
|
+
1. Parse feature description
|
|
200
|
+
2. Ask clarifying questions for ambiguities:
|
|
201
|
+
- What users/roles are involved?
|
|
202
|
+
- What's the expected scale?
|
|
203
|
+
- Any security/compliance requirements?
|
|
204
|
+
- Integration points?
|
|
205
|
+
3. Generate spec.md following template
|
|
206
|
+
4. Mark remaining ambiguities with `[NEEDS CLARIFICATION: question]`
|
|
207
|
+
5. Present spec for user validation
|
|
208
|
+
|
|
209
|
+
**Output:** `specs/###-feature-name/spec.md`
|
|
210
|
+
|
|
211
|
+
### Phase 2: Plan (Create plan.md)
|
|
212
|
+
|
|
213
|
+
**Trigger:** User wants to plan implementation
|
|
214
|
+
|
|
215
|
+
**Prerequisites:** spec.md exists and is validated
|
|
216
|
+
|
|
217
|
+
**Steps:**
|
|
218
|
+
1. Load and analyze spec.md
|
|
219
|
+
2. Run clarification for any `[NEEDS CLARIFICATION]` markers
|
|
220
|
+
3. Fill Technical Context (ask if needed)
|
|
221
|
+
4. Execute Constitution Check
|
|
222
|
+
5. Generate research.md (unknowns to resolve)
|
|
223
|
+
6. Generate data-model.md (entities from spec)
|
|
224
|
+
7. Generate contracts/ (API specs from requirements)
|
|
225
|
+
8. Complete plan.md
|
|
226
|
+
9. STOP - Do NOT create tasks.md
|
|
227
|
+
|
|
228
|
+
**Output:** `plan.md`, `research.md`, `data-model.md`, `contracts/`
|
|
229
|
+
|
|
230
|
+
### Phase 3: Tasks (Create tasks.md)
|
|
231
|
+
|
|
232
|
+
**Trigger:** User wants to generate tasks
|
|
233
|
+
|
|
234
|
+
**Prerequisites:** plan.md exists
|
|
235
|
+
|
|
236
|
+
**Steps:**
|
|
237
|
+
1. Load plan.md, data-model.md, contracts/
|
|
238
|
+
2. Generate tasks by category:
|
|
239
|
+
- **Setup**: Project init, dependencies, linting
|
|
240
|
+
- **Tests [P]**: Contract tests, integration tests (TDD)
|
|
241
|
+
- **Core**: Models, services, endpoints
|
|
242
|
+
- **Integration**: DB, middleware, logging
|
|
243
|
+
- **Polish [P]**: Unit tests, performance, docs
|
|
244
|
+
3. Apply enrichment to EVERY task:
|
|
245
|
+
- Detect agent from keywords
|
|
246
|
+
- Classify security tier
|
|
247
|
+
- Add tags
|
|
248
|
+
- Mark [P] for parallel tasks
|
|
249
|
+
4. Add HIGH RISK warning to T2/T3 tasks
|
|
250
|
+
5. Run validation:
|
|
251
|
+
- All requirements have tasks?
|
|
252
|
+
- No gaps in coverage?
|
|
253
|
+
- Dependencies correct?
|
|
254
|
+
|
|
255
|
+
**Output:** `tasks.md` with inline metadata
|
|
256
|
+
|
|
257
|
+
### Phase 4: Implement
|
|
258
|
+
|
|
259
|
+
**Trigger:** User wants to execute tasks
|
|
260
|
+
|
|
261
|
+
**Steps:**
|
|
262
|
+
1. Load tasks.md
|
|
263
|
+
2. For each task:
|
|
264
|
+
- If HIGH RISK: Auto-trigger analysis, ask confirmation
|
|
265
|
+
- Execute task
|
|
266
|
+
- Mark as [x] when complete
|
|
267
|
+
3. Report progress
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Conversational Patterns
|
|
272
|
+
|
|
273
|
+
### When Starting Fresh
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
User: "I need to add a new feature for..."
|
|
277
|
+
|
|
278
|
+
You: "Let me help you create a feature specification.
|
|
279
|
+
|
|
280
|
+
**Quick questions to understand scope:**
|
|
281
|
+
1. Who are the primary users of this feature?
|
|
282
|
+
2. What's the expected scale (users, data volume)?
|
|
283
|
+
3. Any integration with existing systems?
|
|
284
|
+
4. Security/compliance requirements?
|
|
285
|
+
|
|
286
|
+
Once I understand these, I'll create a structured spec.md for your review."
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### When Clarifying Ambiguities
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
User: "Add caching to the API"
|
|
293
|
+
|
|
294
|
+
You: "I need to clarify a few things:
|
|
295
|
+
|
|
296
|
+
📦 **Which API?**
|
|
297
|
+
- tcm-api (NestJS, port 3001)
|
|
298
|
+
- pg-api (Spring Boot, port 8086)
|
|
299
|
+
|
|
300
|
+
🔧 **Cache type?**
|
|
301
|
+
- Redis (persistent, distributed)
|
|
302
|
+
- In-memory (local, faster)
|
|
303
|
+
- CDN (for static content)
|
|
304
|
+
|
|
305
|
+
Once clarified, I'll update the spec with concrete requirements."
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### When Generating Tasks
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
You: "Based on plan.md, I'll generate tasks with automatic enrichment.
|
|
312
|
+
|
|
313
|
+
**Task breakdown:**
|
|
314
|
+
- 3 setup tasks
|
|
315
|
+
- 6 test tasks (TDD - run first)
|
|
316
|
+
- 8 implementation tasks
|
|
317
|
+
- 4 integration tasks
|
|
318
|
+
- 3 polish tasks
|
|
319
|
+
|
|
320
|
+
**High-risk tasks detected (require approval):**
|
|
321
|
+
- T042: Apply Terraform changes (T3)
|
|
322
|
+
- T055: Push to production namespace (T3)
|
|
323
|
+
|
|
324
|
+
Ready to generate tasks.md?"
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Governance Compliance
|
|
330
|
+
|
|
331
|
+
### Code-First Protocol (Mandatory)
|
|
332
|
+
|
|
333
|
+
Before creating any new resource:
|
|
334
|
+
1. **Discover**: Search for similar existing resources
|
|
335
|
+
2. **Read**: Examine 2-3 examples
|
|
336
|
+
3. **Extract**: Document patterns
|
|
337
|
+
4. **Replicate**: Follow discovered patterns
|
|
338
|
+
5. **Explain**: Document pattern choice
|
|
339
|
+
|
|
340
|
+
### GitOps Principles
|
|
341
|
+
|
|
342
|
+
- All Kubernetes changes go through Git
|
|
343
|
+
- No manual `kubectl apply` in production
|
|
344
|
+
- Changes require: git commit → push → Flux reconciliation
|
|
345
|
+
|
|
346
|
+
### Conventional Commits
|
|
347
|
+
|
|
348
|
+
Format: `<type>(<scope>): <description>`
|
|
349
|
+
Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `ci`
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Scope
|
|
354
|
+
|
|
355
|
+
### CAN DO
|
|
356
|
+
- Create spec.md, plan.md, tasks.md
|
|
357
|
+
- Run clarification workflows
|
|
358
|
+
- Apply task enrichment (agents, tiers, tags)
|
|
359
|
+
- Validate governance compliance
|
|
360
|
+
- Guide through Spec-Kit workflow
|
|
361
|
+
- Read existing specs and artifacts
|
|
362
|
+
|
|
363
|
+
### CANNOT DO
|
|
364
|
+
- Execute infrastructure changes (delegate to terraform-architect)
|
|
365
|
+
- Execute Kubernetes operations (delegate to gitops-operator)
|
|
366
|
+
- Run application builds (delegate to devops-developer)
|
|
367
|
+
- Diagnose cloud issues (delegate to troubleshooters)
|
|
368
|
+
|
|
369
|
+
### DELEGATE
|
|
370
|
+
|
|
371
|
+
When user wants to execute tasks:
|
|
372
|
+
```
|
|
373
|
+
"Task T015 requires Kubernetes operations.
|
|
374
|
+
Delegating to gitops-operator for execution."
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
When user asks about infrastructure:
|
|
378
|
+
```
|
|
379
|
+
"For infrastructure questions, use gcp-troubleshooter or terraform-architect.
|
|
380
|
+
I focus on planning and task generation."
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## Output Protocol
|
|
386
|
+
|
|
387
|
+
**CRITICAL:** All artifacts go to the feature directory:
|
|
388
|
+
```
|
|
389
|
+
<speckit-root>/specs/<feature-name>/
|
|
390
|
+
├── spec.md
|
|
391
|
+
├── plan.md
|
|
392
|
+
├── tasks.md
|
|
393
|
+
├── research.md
|
|
394
|
+
├── data-model.md
|
|
395
|
+
└── contracts/
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
**Report to user after each phase:**
|
|
399
|
+
```markdown
|
|
400
|
+
✅ [Phase] complete: [artifact]
|
|
401
|
+
|
|
402
|
+
**Files created:**
|
|
403
|
+
- spec.md (45 lines)
|
|
404
|
+
- ...
|
|
405
|
+
|
|
406
|
+
**Next steps:**
|
|
407
|
+
1. Review [artifact]
|
|
408
|
+
2. Run: /speckit.[next-command]
|
|
409
|
+
```
|
|
@@ -17,7 +17,7 @@ User sends question
|
|
|
17
17
|
|
|
|
18
18
|
Selects agent
|
|
19
19
|
|
|
|
20
|
-
terraform | gitops | gcp | aws | devops | gaia
|
|
20
|
+
terraform | gitops | gcp | aws | devops | speckit | gaia
|
|
21
21
|
|
|
|
22
22
|
[Context Provider] -> Agent executes
|
|
23
23
|
|
|
|
@@ -33,7 +33,8 @@ User sends question
|
|
|
33
33
|
| **gcp-troubleshooter** | GCP diagnostics | T0 |
|
|
34
34
|
| **aws-troubleshooter** | AWS diagnostics | T0 |
|
|
35
35
|
| **devops-developer** | Code and CI/CD | T0-T2 |
|
|
36
|
-
| **
|
|
36
|
+
| **speckit-planner** | Feature specification and planning | T0-T2 |
|
|
37
|
+
| **gaia** | Agent system | T0-T2 |
|
|
37
38
|
|
|
38
39
|
## Security Tiers
|
|
39
40
|
|
|
@@ -52,6 +53,9 @@ User sends question
|
|
|
52
53
|
# Orchestrator selects automatically
|
|
53
54
|
"Deploy auth-service version 1.2.3"
|
|
54
55
|
# -> gitops-operator
|
|
56
|
+
|
|
57
|
+
"Plan a notification feature"
|
|
58
|
+
# -> speckit-planner
|
|
55
59
|
```
|
|
56
60
|
|
|
57
61
|
### Manual
|
|
@@ -62,6 +66,12 @@ Task(
|
|
|
62
66
|
description="Deploy auth service",
|
|
63
67
|
prompt="Deploy auth-service version 1.2.3"
|
|
64
68
|
)
|
|
69
|
+
|
|
70
|
+
Task(
|
|
71
|
+
subagent_type="speckit-planner",
|
|
72
|
+
description="Plan notification feature",
|
|
73
|
+
prompt="Create spec for push notification system"
|
|
74
|
+
)
|
|
65
75
|
```
|
|
66
76
|
|
|
67
77
|
## Smart Routing
|
|
@@ -80,4 +90,4 @@ Task(
|
|
|
80
90
|
|
|
81
91
|
---
|
|
82
92
|
|
|
83
|
-
**Updated:** 2025-12-
|
|
93
|
+
**Updated:** 2025-12-10 | **Agents:** 7
|
|
@@ -17,7 +17,7 @@ Usuario envia pregunta
|
|
|
17
17
|
|
|
|
18
18
|
Selecciona agente
|
|
19
19
|
|
|
|
20
|
-
terraform | gitops | gcp | aws | devops | gaia
|
|
20
|
+
terraform | gitops | gcp | aws | devops | speckit | gaia
|
|
21
21
|
|
|
|
22
22
|
[Context Provider] -> Agente ejecuta
|
|
23
23
|
|
|
|
@@ -33,7 +33,8 @@ Usuario envia pregunta
|
|
|
33
33
|
| **gcp-troubleshooter** | Diagnostico GCP | T0 |
|
|
34
34
|
| **aws-troubleshooter** | Diagnostico AWS | T0 |
|
|
35
35
|
| **devops-developer** | Codigo y CI/CD | T0-T2 |
|
|
36
|
-
| **
|
|
36
|
+
| **speckit-planner** | Especificacion y planificacion de features | T0-T2 |
|
|
37
|
+
| **gaia** | Sistema de agentes | T0-T2 |
|
|
37
38
|
|
|
38
39
|
## Tiers de Seguridad
|
|
39
40
|
|
|
@@ -52,6 +53,9 @@ Usuario envia pregunta
|
|
|
52
53
|
# El orquestador selecciona automaticamente
|
|
53
54
|
"Despliega auth-service version 1.2.3"
|
|
54
55
|
# -> gitops-operator
|
|
56
|
+
|
|
57
|
+
"Planificar feature de notificaciones"
|
|
58
|
+
# -> speckit-planner
|
|
55
59
|
```
|
|
56
60
|
|
|
57
61
|
### Manual
|
|
@@ -62,6 +66,12 @@ Task(
|
|
|
62
66
|
description="Deploy auth service",
|
|
63
67
|
prompt="Deploy auth-service version 1.2.3"
|
|
64
68
|
)
|
|
69
|
+
|
|
70
|
+
Task(
|
|
71
|
+
subagent_type="speckit-planner",
|
|
72
|
+
description="Plan notification feature",
|
|
73
|
+
prompt="Create spec for push notification system"
|
|
74
|
+
)
|
|
65
75
|
```
|
|
66
76
|
|
|
67
77
|
## Routing Inteligente
|
|
@@ -80,4 +90,4 @@ Task(
|
|
|
80
90
|
|
|
81
91
|
---
|
|
82
92
|
|
|
83
|
-
**Actualizado:** 2025-12-
|
|
93
|
+
**Actualizado:** 2025-12-10 | **Agentes:** 7
|
package/hooks/pre_tool_use.py
CHANGED
|
@@ -345,6 +345,33 @@ class PolicyEngine:
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
+
def _contains_command_chaining(self, command: str) -> bool:
|
|
349
|
+
"""
|
|
350
|
+
Detect command chaining operators that bypass permission evaluation.
|
|
351
|
+
|
|
352
|
+
Blocks: && ; ||
|
|
353
|
+
Allows: | (pipes are safe, don't affect permissions)
|
|
354
|
+
|
|
355
|
+
Smart detection avoids false positives in quoted strings.
|
|
356
|
+
"""
|
|
357
|
+
# Remove content inside quotes to avoid false positives
|
|
358
|
+
# e.g., echo "foo && bar" should be allowed
|
|
359
|
+
cleaned = re.sub(r'"[^"]*"', '""', command)
|
|
360
|
+
cleaned = re.sub(r"'[^']*'", "''", cleaned)
|
|
361
|
+
|
|
362
|
+
# Check for chaining operators outside quotes
|
|
363
|
+
chaining_patterns = [
|
|
364
|
+
r'&&', # AND chaining
|
|
365
|
+
r';\s*\S', # Semicolon followed by another command (not trailing ;)
|
|
366
|
+
r'\|\|', # OR chaining
|
|
367
|
+
]
|
|
368
|
+
|
|
369
|
+
for pattern in chaining_patterns:
|
|
370
|
+
if re.search(pattern, cleaned):
|
|
371
|
+
return True
|
|
372
|
+
|
|
373
|
+
return False
|
|
374
|
+
|
|
348
375
|
def _inspect_script_content(self, script_path: str) -> Tuple[bool, str, Optional[str]]:
|
|
349
376
|
"""Inspects script content for blocked or sensitive commands."""
|
|
350
377
|
try:
|
|
@@ -463,6 +490,16 @@ class PolicyEngine:
|
|
|
463
490
|
logger.warning("Empty command provided")
|
|
464
491
|
return False, SecurityTier.T3_BLOCKED, "Empty command not allowed"
|
|
465
492
|
|
|
493
|
+
# INTERCEPT: Block chained commands with && or ;
|
|
494
|
+
# This prevents bypassing permission checks and ensures predictable behavior
|
|
495
|
+
if self._contains_command_chaining(command):
|
|
496
|
+
logger.warning(f"Command contains chaining operators: {command[:100]}")
|
|
497
|
+
return False, SecurityTier.T3_BLOCKED, (
|
|
498
|
+
"❌ Chained commands (&&, ;) are not allowed\n\n"
|
|
499
|
+
"Execute each command separately for proper permission evaluation.\n"
|
|
500
|
+
"This ensures consistent security behavior."
|
|
501
|
+
)
|
|
502
|
+
|
|
466
503
|
# Check if command is a script execution
|
|
467
504
|
script_match = re.match(r"^\s*(bash|sh)\s+([\w\-\./_]+)", command)
|
|
468
505
|
if script_match:
|