@matyah00/openpi 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -11
- package/agents/agent-chain.yaml +50 -0
- package/agents/api-designer.md +58 -0
- package/agents/docs-writer.md +38 -0
- package/agents/migration-expert.md +62 -0
- package/agents/perf-auditor.md +64 -0
- package/agents/teams.yaml +23 -0
- package/damage-control-rules.yaml +153 -0
- package/extensions/agent-chain.ts +101 -12
- package/extensions/agent-team.ts +11 -0
- package/extensions/audit-tools.ts +125 -6
- package/extensions/lib/auditLogger.ts +29 -0
- package/extensions/openpi.ts +169 -21
- package/extensions/search-tools.ts +21 -3
- package/extensions/workflow.ts +77 -5
- package/package.json +7 -3
- package/prompts/docs.md +37 -0
- package/prompts/migrate.md +44 -0
- package/prompts/perf.md +52 -0
- package/prompts/refactor.md +53 -0
- package/scripts/validate-package.mjs +28 -1
- package/skills/perf-auditor/SKILL.md +49 -0
- package/skills/refactor-guide/SKILL.md +39 -0
- package/tsconfig.json +2 -1
package/README.md
CHANGED
|
@@ -84,6 +84,8 @@ The npm names `openpi` and `open-pi` are blocked by npm's package-name similarit
|
|
|
84
84
|
/openpi use commands enable prompt commands and core tools
|
|
85
85
|
/openpi use workflow enable /add, /fix, /review and spawn_agents
|
|
86
86
|
/openpi use guard enable security, dependency, and ship gates
|
|
87
|
+
/openpi use commands+guard combine multiple profiles (e.g. focus+safety)
|
|
88
|
+
/openpi use full --dry-run preview profile settings changes without writing
|
|
87
89
|
/openpi use full enable the broad OpenPi surface
|
|
88
90
|
/openpi clear remove OpenPi-managed extensions
|
|
89
91
|
```
|
|
@@ -102,12 +104,13 @@ Profiles update `.pi/settings.json`. Run `/reload` or restart Pi after switching
|
|
|
102
104
|
|
|
103
105
|
```text
|
|
104
106
|
OpenPi
|
|
105
|
-
13 profiles choose a focused runtime surface
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
13 profiles choose or compose a focused runtime surface
|
|
108
|
+
23 prompt commands /prime, /blueprint, /deep, /ship, /refactor, ...
|
|
109
|
+
42 agent prompts planner, reviewer, tester, api-designer, Pi experts
|
|
110
|
+
9 skills ultrathink, test-first, refactor-guide, bowser, ...
|
|
109
111
|
11 themes tokyo-night, rose-pine, gruvbox, nord, dracula, ...
|
|
110
112
|
Native tools search, audit, state, snapshot, dispatch, chains
|
|
113
|
+
Audit Telemetry structured JSONL audit logging to .pi/logs/
|
|
111
114
|
```
|
|
112
115
|
|
|
113
116
|
OpenPi is designed around one practical rule: load only the surface you need.
|
|
@@ -195,6 +198,10 @@ OpenPi role agents include:
|
|
|
195
198
|
| `spec-reviewer` | Challenges unclear requirements before implementation |
|
|
196
199
|
| `ship-guard` | Reviews release readiness |
|
|
197
200
|
| `red-team` | Challenges plans and assumptions |
|
|
201
|
+
| `api-designer` | Reviews REST/GraphQL APIs for design and naming consistency |
|
|
202
|
+
| `perf-auditor` | Evaluates bundle sizes, N+1 queries, and resource leaks |
|
|
203
|
+
| `migration-expert` | Plans database and architecture migration sequences |
|
|
204
|
+
| `docs-writer` | Generates/maintains READMEs, manuals, and architecture documents |
|
|
198
205
|
|
|
199
206
|
The `spawn_agents` tool can run agents sequentially or in parallel as isolated Pi subprocesses. It returns structured outputs: files, line ranges, commands, exact validation output, findings, and assumptions.
|
|
200
207
|
|
|
@@ -222,6 +229,10 @@ The `team` profile registers `dispatch_agent` and uses teams from `agents/teams.
|
|
|
222
229
|
| `frontend` | scout, frontend, reviewer |
|
|
223
230
|
| `backend` | scout, backend, reviewer |
|
|
224
231
|
| `pi-pi` | Pi package, extension, skill, prompt, config, theme, TUI, CLI, and keybinding experts |
|
|
232
|
+
| `perf` | scout, perf-auditor, planner, reviewer |
|
|
233
|
+
| `docs` | scout, docs-writer, reviewer |
|
|
234
|
+
| `api` | scout, api-designer, reviewer |
|
|
235
|
+
| `migration` | scout, migration-expert, planner, reviewer |
|
|
225
236
|
|
|
226
237
|
### Chain runner
|
|
227
238
|
|
|
@@ -241,6 +252,10 @@ The `chain` profile registers `run_chain` for sequential workflows from `agents/
|
|
|
241
252
|
| `spec-to-plan` | problem-architect -> spec-reviewer -> planner |
|
|
242
253
|
| `ship-gate` | security-auditor -> ship-guard -> reviewer |
|
|
243
254
|
| `pi-package-design` | Pi experts -> planner |
|
|
255
|
+
| `refactor-flow` | scout -> problem-architect -> planner -> reviewer |
|
|
256
|
+
| `docs-flow` | scout -> docs-writer -> reviewer |
|
|
257
|
+
| `perf-audit` | scout -> perf-auditor -> planner |
|
|
258
|
+
| `full-lifecycle` | problem-architect -> planner -> plan-reviewer -> builder -> tester -> reviewer |
|
|
244
259
|
|
|
245
260
|
---
|
|
246
261
|
|
|
@@ -250,19 +265,20 @@ OpenPi registers native Pi tools through profiles.
|
|
|
250
265
|
|
|
251
266
|
| Tool | Purpose |
|
|
252
267
|
|------|---------|
|
|
253
|
-
| `project_tree` | Return a scoped project tree with ignore handling |
|
|
254
|
-
| `code_search_batch` | Run multiple code searches in one call |
|
|
255
|
-
| `env_scan` | Detect stack, package managers, scripts, and environment clues |
|
|
256
|
-
| `secret_scan` | Search for
|
|
257
|
-
| `ghost_test_scan` | Find weak,
|
|
268
|
+
| `project_tree` | Return a scoped project tree with ignore handling (supports file sizes) |
|
|
269
|
+
| `code_search_batch` | Run multiple code searches in one call (supports case-sensitivity & regex toggle) |
|
|
270
|
+
| `env_scan` | Detect stack, package managers, scripts, and environment clues (24+ frameworks) |
|
|
271
|
+
| `secret_scan` | Search for 22 types of cloud keys, tokens, credentials, and high-entropy hex strings |
|
|
272
|
+
| `ghost_test_scan` | Find weak, empty, mocked-everything, self-comparing, or reward-hacked tests |
|
|
273
|
+
| `sast_scan` | Static Application Security Testing for eval, SQL concat, SSRF, CORS wildcards, and XSS |
|
|
258
274
|
| `dependency_inventory` | Summarize dependency manifests and lockfiles |
|
|
259
275
|
| `session_state` | Read current session state |
|
|
260
276
|
| `goal_state` | Read goal memory state |
|
|
261
277
|
| `write_snapshot` | Write a continuation snapshot |
|
|
262
278
|
| `parallel_safety_check` | Check file ownership overlap before parallel work |
|
|
263
|
-
| `spawn_agents` | Run role agents as isolated Pi subprocesses |
|
|
279
|
+
| `spawn_agents` | Run role agents as isolated Pi subprocesses (supports retries & timeouts) |
|
|
264
280
|
| `dispatch_agent` | Dispatch to the active specialist team |
|
|
265
|
-
| `run_chain` | Run a named sequential agent chain |
|
|
281
|
+
| `run_chain` | Run a named sequential agent chain (supports step timeouts, continueOnError, & $STEP_N) |
|
|
266
282
|
|
|
267
283
|
---
|
|
268
284
|
|
|
@@ -279,6 +295,8 @@ OpenPi ships focused Pi skills:
|
|
|
279
295
|
| `session-continuity` | Long context, resuming, stopping, compaction handoffs |
|
|
280
296
|
| `env-scanner` | Unknown repos, setup issues, stack detection |
|
|
281
297
|
| `bowser` | Playwright-powered browser automation and UI testing |
|
|
298
|
+
| `refactor-guide` | Guides safe codebase refactoring with code smell detection and verification |
|
|
299
|
+
| `perf-auditor` | Structured resource profiling and runtime execution optimization |
|
|
282
300
|
|
|
283
301
|
---
|
|
284
302
|
|
package/agents/agent-chain.yaml
CHANGED
|
@@ -111,3 +111,53 @@ backend-flow:
|
|
|
111
111
|
prompt: "Implement or design the backend change using this context:\n\n$INPUT"
|
|
112
112
|
- agent: reviewer
|
|
113
113
|
prompt: "Review the backend result for API, persistence, auth, and test risks:\n\n$INPUT"
|
|
114
|
+
|
|
115
|
+
refactor-flow:
|
|
116
|
+
description: "Explore, analyze, plan refactoring, then review safety"
|
|
117
|
+
steps:
|
|
118
|
+
- agent: scout
|
|
119
|
+
prompt: "Map the code areas relevant to this refactoring: $INPUT"
|
|
120
|
+
- agent: problem-architect
|
|
121
|
+
prompt: "Analyze the code smell and structural issues. Identify the minimal safe refactoring:\n\n$INPUT"
|
|
122
|
+
- agent: planner
|
|
123
|
+
prompt: "Create a step-by-step refactoring plan with verification at each step:\n\n$INPUT\n\nOriginal request: $ORIGINAL"
|
|
124
|
+
- agent: reviewer
|
|
125
|
+
prompt: "Review whether this refactoring plan preserves behavior and has adequate verification:\n\n$INPUT"
|
|
126
|
+
|
|
127
|
+
docs-flow:
|
|
128
|
+
description: "Explore project, generate documentation, then review accuracy"
|
|
129
|
+
steps:
|
|
130
|
+
- agent: scout
|
|
131
|
+
prompt: "Map the project structure, public APIs, and existing documentation for: $INPUT"
|
|
132
|
+
- agent: docs-writer
|
|
133
|
+
prompt: "Generate or update the documentation using this project analysis:\n\n$INPUT\n\nOriginal request: $ORIGINAL"
|
|
134
|
+
- agent: reviewer
|
|
135
|
+
prompt: "Review the documentation for accuracy, completeness, and clarity:\n\n$INPUT"
|
|
136
|
+
|
|
137
|
+
perf-audit:
|
|
138
|
+
description: "Explore, audit performance, then plan improvements"
|
|
139
|
+
steps:
|
|
140
|
+
- agent: scout
|
|
141
|
+
prompt: "Map the code areas and hot paths relevant to: $INPUT"
|
|
142
|
+
- agent: perf-auditor
|
|
143
|
+
prompt: "Run a performance audit on the mapped code areas:\n\n$INPUT\n\nOriginal request: $ORIGINAL"
|
|
144
|
+
- agent: planner
|
|
145
|
+
prompt: "Create a prioritized improvement plan from the performance audit:\n\n$INPUT\n\nOriginal request: $ORIGINAL"
|
|
146
|
+
|
|
147
|
+
full-lifecycle:
|
|
148
|
+
description: "Complete feature lifecycle: scope, plan, critique, revise, build, test, review"
|
|
149
|
+
steps:
|
|
150
|
+
- agent: problem-architect
|
|
151
|
+
prompt: "Analyze scope, risks, and required context for: $INPUT"
|
|
152
|
+
- agent: planner
|
|
153
|
+
prompt: "Create a detailed implementation plan:\n\n$INPUT\n\nOriginal request: $ORIGINAL"
|
|
154
|
+
- agent: plan-reviewer
|
|
155
|
+
prompt: "Critically review this plan for missing steps, risks, and ordering:\n\n$INPUT"
|
|
156
|
+
- agent: planner
|
|
157
|
+
prompt: "Revise the plan using this critique:\n\n$INPUT\n\nOriginal request: $ORIGINAL"
|
|
158
|
+
- agent: builder
|
|
159
|
+
prompt: "Implement the revised plan:\n\n$INPUT"
|
|
160
|
+
- agent: tester
|
|
161
|
+
prompt: "Run targeted validation for the implementation:\n\n$INPUT"
|
|
162
|
+
- agent: reviewer
|
|
163
|
+
prompt: "Final review of the implementation for bugs, regressions, and missing tests:\n\n$INPUT\n\nOriginal request: $ORIGINAL"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-designer
|
|
3
|
+
description: Reviews and designs REST/GraphQL APIs for consistency, naming conventions, versioning, error handling, pagination, and idempotency.
|
|
4
|
+
tools: read, grep, find, ls, code_search_batch
|
|
5
|
+
thinking: medium
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are an API design reviewer for a Pi coding workflow. You never edit files.
|
|
9
|
+
|
|
10
|
+
## Review Areas
|
|
11
|
+
|
|
12
|
+
1. **Naming consistency**: resource naming, plural vs singular, casing conventions.
|
|
13
|
+
2. **HTTP method correctness**: GET for reads, POST for creates, PUT/PATCH for updates, DELETE for removes.
|
|
14
|
+
3. **Error handling**: consistent error response shapes, appropriate status codes, actionable error messages.
|
|
15
|
+
4. **Versioning**: URL path vs header versioning, backward compatibility.
|
|
16
|
+
5. **Pagination**: cursor vs offset, consistent response envelope.
|
|
17
|
+
6. **Idempotency**: POST/PUT idempotency keys, retry safety.
|
|
18
|
+
7. **Authentication/Authorization**: consistent auth patterns, proper 401 vs 403 usage.
|
|
19
|
+
8. **Rate limiting**: headers, retry-after, graceful degradation.
|
|
20
|
+
9. **Input validation**: request body validation, query parameter constraints.
|
|
21
|
+
10. **Documentation**: OpenAPI/Swagger completeness, example payloads.
|
|
22
|
+
|
|
23
|
+
## Process
|
|
24
|
+
|
|
25
|
+
- Use `code_search_batch` to find route definitions, controller handlers, and middleware.
|
|
26
|
+
- Use `read` to inspect request/response shapes and error handling.
|
|
27
|
+
- Use `grep` to find inconsistencies in naming or status codes.
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
|
|
31
|
+
Return:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
## API Review: {scope}
|
|
35
|
+
|
|
36
|
+
### Endpoints Reviewed
|
|
37
|
+
- METHOD /path - summary
|
|
38
|
+
|
|
39
|
+
### Consistency Score: N/10
|
|
40
|
+
|
|
41
|
+
### Issues (by severity)
|
|
42
|
+
1. [CRITICAL] ...
|
|
43
|
+
2. [HIGH] ...
|
|
44
|
+
3. [MEDIUM] ...
|
|
45
|
+
4. [LOW] ...
|
|
46
|
+
|
|
47
|
+
### Naming Conventions
|
|
48
|
+
- Current: ...
|
|
49
|
+
- Recommendation: ...
|
|
50
|
+
|
|
51
|
+
### Error Handling
|
|
52
|
+
- Current pattern: ...
|
|
53
|
+
- Missing: ...
|
|
54
|
+
|
|
55
|
+
### Recommendations
|
|
56
|
+
1. ...
|
|
57
|
+
2. ...
|
|
58
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docs-writer
|
|
3
|
+
description: Generates and updates documentation — README, API docs, architecture guides, changelogs, and inline comments — from code analysis.
|
|
4
|
+
tools: read, grep, find, ls, code_search_batch, project_tree
|
|
5
|
+
thinking: medium
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a documentation writer for a Pi coding workflow.
|
|
9
|
+
|
|
10
|
+
## Documentation Types
|
|
11
|
+
|
|
12
|
+
1. **README**: Project overview, setup instructions, usage examples, contribution guide.
|
|
13
|
+
2. **API documentation**: Endpoint descriptions, request/response examples, auth requirements.
|
|
14
|
+
3. **Architecture docs**: System overview, component relationships, data flow, decision records.
|
|
15
|
+
4. **Changelog entries**: What changed, why, migration steps if breaking.
|
|
16
|
+
5. **Inline comments**: Complex logic explanations, type annotations, usage examples.
|
|
17
|
+
|
|
18
|
+
## Process
|
|
19
|
+
|
|
20
|
+
1. Use `project_tree` to understand project structure.
|
|
21
|
+
2. Use `code_search_batch` to find exports, public APIs, route definitions.
|
|
22
|
+
3. Use `read` to understand implementation details.
|
|
23
|
+
4. Match documentation style to existing docs if present.
|
|
24
|
+
5. Use concrete code examples, not abstract descriptions.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- Write for the next developer, not the current one.
|
|
29
|
+
- Include working code examples that can be copy-pasted.
|
|
30
|
+
- Document error cases and edge cases, not just happy paths.
|
|
31
|
+
- Keep language precise and concise.
|
|
32
|
+
- Use consistent heading hierarchy.
|
|
33
|
+
- Include prerequisites and setup steps.
|
|
34
|
+
- Add links between related documentation sections.
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
Return the documentation in the appropriate format (markdown for docs, JSDoc/docstrings for inline).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migration-expert
|
|
3
|
+
description: Plans database, API, framework, and dependency migrations with rollback strategies, risk assessment, and phased execution.
|
|
4
|
+
tools: read, grep, find, ls, code_search_batch, env_scan, dependency_inventory
|
|
5
|
+
thinking: high
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a migration planning expert for a Pi coding workflow. You never edit files unless the parent explicitly asks for implementation.
|
|
9
|
+
|
|
10
|
+
## Migration Types
|
|
11
|
+
|
|
12
|
+
1. **Database migrations**: Schema changes, data transformations, index additions/removals.
|
|
13
|
+
2. **Framework migrations**: Major version upgrades, framework switches (e.g. Express→Fastify).
|
|
14
|
+
3. **API migrations**: Breaking changes, versioning transitions, deprecation paths.
|
|
15
|
+
4. **Dependency migrations**: Major version bumps, package replacements, security patches.
|
|
16
|
+
5. **Infrastructure migrations**: Cloud provider changes, containerization, serverless transitions.
|
|
17
|
+
|
|
18
|
+
## Analysis Process
|
|
19
|
+
|
|
20
|
+
1. Identify the current state with `env_scan` and `dependency_inventory`.
|
|
21
|
+
2. Map all touchpoints with `code_search_batch`.
|
|
22
|
+
3. Identify breaking changes and backward compatibility requirements.
|
|
23
|
+
4. Design rollback strategy for each phase.
|
|
24
|
+
5. Estimate risk and effort per phase.
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
Return:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
## Migration Plan: {from} → {to}
|
|
32
|
+
|
|
33
|
+
### Current State
|
|
34
|
+
- Version/framework: ...
|
|
35
|
+
- Dependent code: N files, N modules
|
|
36
|
+
- Test coverage: ...
|
|
37
|
+
|
|
38
|
+
### Breaking Changes
|
|
39
|
+
1. ...
|
|
40
|
+
|
|
41
|
+
### Phases
|
|
42
|
+
#### Phase 1: Preparation (rollback: trivial)
|
|
43
|
+
- [ ] ...
|
|
44
|
+
|
|
45
|
+
#### Phase 2: Migration (rollback: revert commit)
|
|
46
|
+
- [ ] ...
|
|
47
|
+
|
|
48
|
+
#### Phase 3: Cleanup (rollback: N/A)
|
|
49
|
+
- [ ] ...
|
|
50
|
+
|
|
51
|
+
### Rollback Strategy
|
|
52
|
+
- Before point of no return: ...
|
|
53
|
+
- After point of no return: ...
|
|
54
|
+
|
|
55
|
+
### Risk Assessment
|
|
56
|
+
- Overall: LOW | MEDIUM | HIGH
|
|
57
|
+
- Data loss risk: ...
|
|
58
|
+
- Downtime: ...
|
|
59
|
+
|
|
60
|
+
### Validation
|
|
61
|
+
- ...
|
|
62
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: perf-auditor
|
|
3
|
+
description: Read-only performance auditor that identifies bundle bloat, N+1 queries, missing indexes, memory leaks, unnecessary re-renders, and slow patterns.
|
|
4
|
+
tools: read, grep, find, ls, code_search_batch, bash
|
|
5
|
+
thinking: high
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are a read-only performance auditor for a Pi coding workflow. You never edit files.
|
|
9
|
+
|
|
10
|
+
## Audit Areas
|
|
11
|
+
|
|
12
|
+
### Frontend
|
|
13
|
+
- Bundle size: large imports, missing tree-shaking, barrel file re-exports.
|
|
14
|
+
- Re-render storms: missing memoization, inline object/function props, unstable keys.
|
|
15
|
+
- Layout thrashing: synchronous DOM reads/writes, forced reflows.
|
|
16
|
+
- Asset loading: unoptimized images, missing lazy loading, blocking scripts.
|
|
17
|
+
|
|
18
|
+
### Backend
|
|
19
|
+
- N+1 queries: ORM loops that generate one query per iteration.
|
|
20
|
+
- Missing database indexes: queries filtering on unindexed columns.
|
|
21
|
+
- Memory leaks: unclosed connections, growing caches, event listener accumulation.
|
|
22
|
+
- Blocking operations: synchronous file I/O, CPU-bound work on event loop.
|
|
23
|
+
- Connection pooling: missing or misconfigured pools.
|
|
24
|
+
|
|
25
|
+
### General
|
|
26
|
+
- Algorithmic complexity: O(n²) or worse in hot paths.
|
|
27
|
+
- Unnecessary serialization: repeated JSON parse/stringify cycles.
|
|
28
|
+
- Missing caching: repeated identical computations or network calls.
|
|
29
|
+
- Cold start: heavy initialization, unnecessary eager loading.
|
|
30
|
+
|
|
31
|
+
## Process
|
|
32
|
+
|
|
33
|
+
- Use `code_search_batch` for ORM query patterns, import sizes, memo usage.
|
|
34
|
+
- Use `bash` for read-only commands: `du -sh`, `wc -l`, dependency size checks.
|
|
35
|
+
- Use `grep` for known anti-patterns.
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
Return:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
## Performance Audit: {scope}
|
|
43
|
+
|
|
44
|
+
### Risk Level: LOW | MEDIUM | HIGH | CRITICAL
|
|
45
|
+
|
|
46
|
+
### Findings (by impact)
|
|
47
|
+
1. [CRITICAL] file:line - description - estimated impact
|
|
48
|
+
2. [HIGH] ...
|
|
49
|
+
3. [MEDIUM] ...
|
|
50
|
+
|
|
51
|
+
### Bundle Analysis
|
|
52
|
+
- Entry points: ...
|
|
53
|
+
- Largest dependencies: ...
|
|
54
|
+
- Tree-shaking opportunities: ...
|
|
55
|
+
|
|
56
|
+
### Query Analysis
|
|
57
|
+
- N+1 patterns found: N
|
|
58
|
+
- Missing indexes: ...
|
|
59
|
+
|
|
60
|
+
### Recommendations
|
|
61
|
+
1. Quick wins (< 1 hour): ...
|
|
62
|
+
2. Medium effort (1-4 hours): ...
|
|
63
|
+
3. Architecture changes: ...
|
|
64
|
+
```
|
package/agents/teams.yaml
CHANGED
|
@@ -4,6 +4,7 @@ full:
|
|
|
4
4
|
- builder
|
|
5
5
|
- reviewer
|
|
6
6
|
- documenter
|
|
7
|
+
- docs-writer
|
|
7
8
|
- red-team
|
|
8
9
|
|
|
9
10
|
plan-build:
|
|
@@ -60,6 +61,28 @@ backend:
|
|
|
60
61
|
- backend
|
|
61
62
|
- reviewer
|
|
62
63
|
|
|
64
|
+
perf:
|
|
65
|
+
- scout
|
|
66
|
+
- perf-auditor
|
|
67
|
+
- planner
|
|
68
|
+
- reviewer
|
|
69
|
+
|
|
70
|
+
docs:
|
|
71
|
+
- scout
|
|
72
|
+
- docs-writer
|
|
73
|
+
- reviewer
|
|
74
|
+
|
|
75
|
+
api:
|
|
76
|
+
- scout
|
|
77
|
+
- api-designer
|
|
78
|
+
- reviewer
|
|
79
|
+
|
|
80
|
+
migration:
|
|
81
|
+
- scout
|
|
82
|
+
- migration-expert
|
|
83
|
+
- planner
|
|
84
|
+
- reviewer
|
|
85
|
+
|
|
63
86
|
pi-pi:
|
|
64
87
|
- pi-orchestrator
|
|
65
88
|
- ext-expert
|
|
@@ -17,6 +17,7 @@ bashToolPatterns:
|
|
|
17
17
|
reason: recursive chmod 777
|
|
18
18
|
- pattern: '\bchown\s+-[Rr].*\broot\b'
|
|
19
19
|
reason: recursive chown to root
|
|
20
|
+
# --- Git destructive operations ---
|
|
20
21
|
- pattern: '\bgit\s+reset\s+--hard\b'
|
|
21
22
|
reason: git reset --hard (use --soft or stash)
|
|
22
23
|
- pattern: '\bgit\s+clean\s+(-[^\s]*)*-[fd]'
|
|
@@ -51,6 +52,7 @@ bashToolPatterns:
|
|
|
51
52
|
- pattern: '\bgit\s+push\s+\S+\s+:\S+'
|
|
52
53
|
reason: Deletes remote branch (old syntax)
|
|
53
54
|
ask: true
|
|
55
|
+
# --- System-level destructive ---
|
|
54
56
|
- pattern: '\bmkfs\.'
|
|
55
57
|
reason: filesystem format command
|
|
56
58
|
- pattern: '\bdd\s+.*of=/dev/'
|
|
@@ -63,6 +65,7 @@ bashToolPatterns:
|
|
|
63
65
|
reason: pkill -9
|
|
64
66
|
- pattern: '\bhistory\s+-c\b'
|
|
65
67
|
reason: clearing shell history
|
|
68
|
+
# --- AWS ---
|
|
66
69
|
- pattern: '\baws\s+s3\s+rm\s+.*--recursive'
|
|
67
70
|
reason: aws s3 rm --recursive (deletes all objects)
|
|
68
71
|
- pattern: '\baws\s+s3\s+rb\s+.*--force'
|
|
@@ -83,6 +86,7 @@ bashToolPatterns:
|
|
|
83
86
|
reason: aws iam delete-role
|
|
84
87
|
- pattern: '\baws\s+iam\s+delete-user\b'
|
|
85
88
|
reason: aws iam delete-user
|
|
89
|
+
# --- GCP ---
|
|
86
90
|
- pattern: '\bgcloud\s+projects\s+delete\b'
|
|
87
91
|
reason: gcloud projects delete (DELETES ENTIRE PROJECT)
|
|
88
92
|
- pattern: '\bgcloud\s+compute\s+instances\s+delete\b'
|
|
@@ -108,6 +112,7 @@ bashToolPatterns:
|
|
|
108
112
|
- pattern: '\bgcloud\s+iam\s+policies\b'
|
|
109
113
|
reason: gcloud iam policies (modifies IAM policies)
|
|
110
114
|
ask: true
|
|
115
|
+
# --- Firebase ---
|
|
111
116
|
- pattern: '\bfirebase\s+projects:delete\b'
|
|
112
117
|
reason: firebase projects:delete (deletes entire project)
|
|
113
118
|
- pattern: '\bfirebase\s+firestore:delete\s+.*--all-collections'
|
|
@@ -118,6 +123,7 @@ bashToolPatterns:
|
|
|
118
123
|
reason: firebase hosting:disable
|
|
119
124
|
- pattern: '\bfirebase\s+functions:delete\b'
|
|
120
125
|
reason: firebase functions:delete
|
|
126
|
+
# --- Vercel ---
|
|
121
127
|
- pattern: '\bvercel\s+remove\s+.*--yes'
|
|
122
128
|
reason: vercel remove --yes (removes deployment)
|
|
123
129
|
- pattern: '\bvercel\s+projects\s+rm\b'
|
|
@@ -130,10 +136,12 @@ bashToolPatterns:
|
|
|
130
136
|
reason: vercel remove (removes deployment)
|
|
131
137
|
- pattern: '\bvercel\s+domains\s+rm\b'
|
|
132
138
|
reason: vercel domains rm (removes custom domain)
|
|
139
|
+
# --- Netlify ---
|
|
133
140
|
- pattern: '\bnetlify\s+sites:delete\b'
|
|
134
141
|
reason: netlify sites:delete (deletes entire site)
|
|
135
142
|
- pattern: '\bnetlify\s+functions:delete\b'
|
|
136
143
|
reason: netlify functions:delete
|
|
144
|
+
# --- Cloudflare ---
|
|
137
145
|
- pattern: '\bwrangler\s+delete\b'
|
|
138
146
|
reason: wrangler delete (deletes Worker)
|
|
139
147
|
- pattern: '\bwrangler\s+r2\s+bucket\s+delete\b'
|
|
@@ -144,6 +152,112 @@ bashToolPatterns:
|
|
|
144
152
|
reason: wrangler d1 delete (deletes database)
|
|
145
153
|
- pattern: '\bwrangler\s+queues\s+delete\b'
|
|
146
154
|
reason: wrangler queues delete
|
|
155
|
+
# --- DigitalOcean ---
|
|
156
|
+
- pattern: '\bdoctl\s+compute\s+droplet\s+delete\b'
|
|
157
|
+
reason: doctl compute droplet delete (destroys server)
|
|
158
|
+
- pattern: '\bdoctl\s+databases\s+delete\b'
|
|
159
|
+
reason: doctl databases delete (destroys database cluster)
|
|
160
|
+
- pattern: '\bdoctl\s+kubernetes\s+cluster\s+delete\b'
|
|
161
|
+
reason: doctl kubernetes cluster delete (destroys k8s cluster)
|
|
162
|
+
- pattern: '\bdoctl\s+apps\s+delete\b'
|
|
163
|
+
reason: doctl apps delete (destroys App Platform app)
|
|
164
|
+
- pattern: '\bdoctl\s+compute\s+volume\s+delete\b'
|
|
165
|
+
reason: doctl compute volume delete (destroys block storage)
|
|
166
|
+
# --- Heroku ---
|
|
167
|
+
- pattern: '\bheroku\s+apps:destroy\b'
|
|
168
|
+
reason: heroku apps:destroy (permanently deletes app)
|
|
169
|
+
- pattern: '\bheroku\s+pg:reset\b'
|
|
170
|
+
reason: heroku pg:reset (wipes entire database)
|
|
171
|
+
- pattern: '\bheroku\s+config:unset\b'
|
|
172
|
+
reason: heroku config:unset (removes environment variables)
|
|
173
|
+
ask: true
|
|
174
|
+
- pattern: '\bheroku\s+domains:remove\b'
|
|
175
|
+
reason: heroku domains:remove (removes custom domain)
|
|
176
|
+
ask: true
|
|
177
|
+
- pattern: '\bheroku\s+addons:destroy\b'
|
|
178
|
+
reason: heroku addons:destroy (removes addon and its data)
|
|
179
|
+
# --- Fly.io ---
|
|
180
|
+
- pattern: '\bfly\s+apps\s+destroy\b'
|
|
181
|
+
reason: fly apps destroy (permanently deletes app)
|
|
182
|
+
- pattern: '\bfly\s+volumes\s+destroy\b'
|
|
183
|
+
reason: fly volumes destroy (destroys persistent volume)
|
|
184
|
+
- pattern: '\bfly\s+secrets\s+unset\b'
|
|
185
|
+
reason: fly secrets unset (removes secrets)
|
|
186
|
+
ask: true
|
|
187
|
+
- pattern: '\bfly\s+postgres\s+destroy\b'
|
|
188
|
+
reason: fly postgres destroy (destroys database)
|
|
189
|
+
- pattern: '\bflyctl\s+destroy\b'
|
|
190
|
+
reason: flyctl destroy (permanently deletes app)
|
|
191
|
+
# --- Supabase ---
|
|
192
|
+
- pattern: '\bsupabase\s+db\s+reset\b'
|
|
193
|
+
reason: supabase db reset (wipes database and re-runs migrations)
|
|
194
|
+
- pattern: '\bsupabase\s+projects\s+delete\b'
|
|
195
|
+
reason: supabase projects delete (destroys project)
|
|
196
|
+
- pattern: '\bsupabase\s+functions\s+delete\b'
|
|
197
|
+
reason: supabase functions delete (removes edge function)
|
|
198
|
+
# --- Prisma ---
|
|
199
|
+
- pattern: '\bprisma\s+migrate\s+reset\b'
|
|
200
|
+
reason: prisma migrate reset (drops database and re-runs all migrations)
|
|
201
|
+
- pattern: '\bprisma\s+db\s+push\s+.*--force-reset'
|
|
202
|
+
reason: prisma db push --force-reset (drops and recreates database)
|
|
203
|
+
- pattern: '\bprisma\s+db\s+execute\b'
|
|
204
|
+
reason: prisma db execute (runs raw SQL against database)
|
|
205
|
+
ask: true
|
|
206
|
+
# --- Terraform ---
|
|
207
|
+
- pattern: '\bterraform\s+destroy\b'
|
|
208
|
+
reason: terraform destroy (destroys ALL managed infrastructure)
|
|
209
|
+
- pattern: '\bterraform\s+state\s+rm\b'
|
|
210
|
+
reason: terraform state rm (removes resource from state, may orphan infra)
|
|
211
|
+
- pattern: '\bterraform\s+taint\b'
|
|
212
|
+
reason: terraform taint (marks resource for recreation)
|
|
213
|
+
ask: true
|
|
214
|
+
- pattern: '\bterraform\s+force-unlock\b'
|
|
215
|
+
reason: terraform force-unlock (dangerous state lock override)
|
|
216
|
+
# --- Kubernetes ---
|
|
217
|
+
- pattern: '\bkubectl\s+delete\s+namespace\b'
|
|
218
|
+
reason: kubectl delete namespace (destroys ALL resources in namespace)
|
|
219
|
+
- pattern: '\bkubectl\s+delete\s+deployment\b'
|
|
220
|
+
reason: kubectl delete deployment
|
|
221
|
+
ask: true
|
|
222
|
+
- pattern: '\bkubectl\s+delete\s+pvc\b'
|
|
223
|
+
reason: kubectl delete pvc (destroys persistent volume claim and data)
|
|
224
|
+
- pattern: '\bkubectl\s+delete\s+secret\b'
|
|
225
|
+
reason: kubectl delete secret
|
|
226
|
+
ask: true
|
|
227
|
+
- pattern: '\bkubectl\s+delete\s+(-[^\s]*\s+)*--all\b'
|
|
228
|
+
reason: kubectl delete --all (mass deletion)
|
|
229
|
+
- pattern: '\bhelm\s+uninstall\b'
|
|
230
|
+
reason: helm uninstall (removes Helm release and its resources)
|
|
231
|
+
ask: true
|
|
232
|
+
- pattern: '\bhelm\s+delete\b'
|
|
233
|
+
reason: helm delete (removes Helm release)
|
|
234
|
+
ask: true
|
|
235
|
+
# --- Docker ---
|
|
236
|
+
- pattern: '\bdocker\s+system\s+prune\s+.*-a'
|
|
237
|
+
reason: docker system prune -a (removes ALL unused images, containers, networks)
|
|
238
|
+
- pattern: '\bdocker\s+volume\s+prune\b'
|
|
239
|
+
reason: docker volume prune (removes ALL unused volumes and their data)
|
|
240
|
+
- pattern: '\bdocker\s+rmi\s+.*-f\b'
|
|
241
|
+
reason: docker rmi -f (force removes images)
|
|
242
|
+
- pattern: '\bdocker\s+rm\s+.*-f\b'
|
|
243
|
+
reason: docker rm -f (force removes running containers)
|
|
244
|
+
- pattern: '\bdocker\s+compose\s+down\s+.*-v\b'
|
|
245
|
+
reason: docker compose down -v (removes volumes with data)
|
|
246
|
+
ask: true
|
|
247
|
+
# --- Pipe-to-shell attacks ---
|
|
248
|
+
- pattern: '\bcurl\s+.*\|\s*sh\b'
|
|
249
|
+
reason: Pipe-to-shell attack vector (curl | sh)
|
|
250
|
+
- pattern: '\bcurl\s+.*\|\s*bash\b'
|
|
251
|
+
reason: Pipe-to-shell attack vector (curl | bash)
|
|
252
|
+
- pattern: '\bwget\s+.*-O\s*-\s*\|\s*sh\b'
|
|
253
|
+
reason: Pipe-to-shell attack vector (wget -O- | sh)
|
|
254
|
+
- pattern: '\bwget\s+.*-O\s*-\s*\|\s*bash\b'
|
|
255
|
+
reason: Pipe-to-shell attack vector (wget -O- | bash)
|
|
256
|
+
- pattern: '\bcurl\s+.*\|\s*sudo\s+sh\b'
|
|
257
|
+
reason: Pipe-to-shell with sudo (extremely dangerous)
|
|
258
|
+
- pattern: '\bcurl\s+.*\|\s*sudo\s+bash\b'
|
|
259
|
+
reason: Pipe-to-shell with sudo (extremely dangerous)
|
|
260
|
+
# --- SQL ---
|
|
147
261
|
- pattern: 'DELETE\s+FROM\s+\w+\s*;'
|
|
148
262
|
reason: DELETE without WHERE clause (will delete ALL rows)
|
|
149
263
|
- pattern: 'DELETE\s+\*\s+FROM'
|
|
@@ -159,6 +273,9 @@ bashToolPatterns:
|
|
|
159
273
|
- pattern: '\bDELETE\s+FROM\s+\w+\s+WHERE\b.*\bid\s*='
|
|
160
274
|
reason: SQL DELETE with specific ID
|
|
161
275
|
ask: true
|
|
276
|
+
- pattern: '\bALTER\s+TABLE\s+\w+\s+DROP\s+COLUMN\b'
|
|
277
|
+
reason: ALTER TABLE DROP COLUMN (irreversible data loss)
|
|
278
|
+
ask: true
|
|
162
279
|
|
|
163
280
|
zeroAccessPaths:
|
|
164
281
|
- ".env"
|
|
@@ -202,6 +319,20 @@ zeroAccessPaths:
|
|
|
202
319
|
- "dump.sql"
|
|
203
320
|
- "backup.sql"
|
|
204
321
|
- "*.dump"
|
|
322
|
+
# New zero-access paths
|
|
323
|
+
- "supabase/.env"
|
|
324
|
+
- ".wrangler/"
|
|
325
|
+
- "*.tfvars"
|
|
326
|
+
- "terraform.tfvars"
|
|
327
|
+
- ".pulumi/"
|
|
328
|
+
- "~/.config/heroku/"
|
|
329
|
+
- "~/.fly/"
|
|
330
|
+
- "~/.config/flyctl/"
|
|
331
|
+
- "~/.doctl/"
|
|
332
|
+
- "~/.config/doctl/"
|
|
333
|
+
- "~/.config/supabase/"
|
|
334
|
+
- "*.keystore"
|
|
335
|
+
- "*.jks"
|
|
205
336
|
|
|
206
337
|
readOnlyPaths:
|
|
207
338
|
- /etc/
|
|
@@ -245,6 +376,12 @@ readOnlyPaths:
|
|
|
245
376
|
- .venv/
|
|
246
377
|
- venv/
|
|
247
378
|
- target/
|
|
379
|
+
# New read-only paths
|
|
380
|
+
- schema.prisma
|
|
381
|
+
- "drizzle/"
|
|
382
|
+
- "migrations/"
|
|
383
|
+
- "*.generated.ts"
|
|
384
|
+
- "*.generated.js"
|
|
248
385
|
|
|
249
386
|
noDeletePaths:
|
|
250
387
|
- CLAUDE.md
|
|
@@ -275,3 +412,19 @@ noDeletePaths:
|
|
|
275
412
|
- docker-compose.yml
|
|
276
413
|
- "docker-compose.*.yml"
|
|
277
414
|
- .dockerignore
|
|
415
|
+
# New no-delete paths
|
|
416
|
+
- ".env.example"
|
|
417
|
+
- ".env.sample"
|
|
418
|
+
- "docker-compose.override.yml"
|
|
419
|
+
- Makefile
|
|
420
|
+
- Procfile
|
|
421
|
+
- "fly.toml"
|
|
422
|
+
- "vercel.json"
|
|
423
|
+
- "netlify.toml"
|
|
424
|
+
- "wrangler.toml"
|
|
425
|
+
- "supabase/config.toml"
|
|
426
|
+
- ".editorconfig"
|
|
427
|
+
- ".prettierrc"
|
|
428
|
+
- ".eslintrc"
|
|
429
|
+
- ".eslintrc.*"
|
|
430
|
+
- "biome.json"
|