pi-crew 0.5.2 → 0.5.6
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 +183 -0
- package/README.md +17 -1
- package/docs/architecture.md +2 -0
- package/docs/bugs/cross-session-notification-leakage.md +82 -0
- package/docs/coding-agent-optimization.md +268 -0
- package/docs/deep-review-report.md +384 -0
- package/docs/distillation/cybersecurity-patterns.md +294 -0
- package/docs/migration-v0.4-v0.5.md +208 -0
- package/docs/optimization-plan.md +642 -0
- package/docs/pi-crew-v0.5.5-audit-fix-plan.md +133 -0
- package/docs/pi-mono-opportunities.md +969 -0
- package/docs/pi-mono-review.md +291 -0
- package/docs/skills/REFERENCE.md +144 -0
- package/package.json +12 -9
- package/skills/artifact-analysis-loop/SKILL.md +302 -0
- package/skills/async-worker-recovery/SKILL.md +19 -1
- package/skills/child-pi-spawning/SKILL.md +19 -6
- package/skills/context-artifact-hygiene/SKILL.md +19 -2
- package/skills/delegation-patterns/SKILL.md +68 -3
- package/skills/detection-pipeline-design/SKILL.md +285 -0
- package/skills/event-log-tracing/SKILL.md +20 -6
- package/skills/git-master/SKILL.md +20 -6
- package/skills/hunting-investigation-loop/SKILL.md +401 -0
- package/skills/incident-playbook-construction/SKILL.md +383 -0
- package/skills/live-agent-lifecycle/SKILL.md +20 -6
- package/skills/mailbox-interactive/SKILL.md +19 -6
- package/skills/model-routing-context/SKILL.md +19 -1
- package/skills/multi-perspective-review/SKILL.md +19 -4
- package/skills/observability-reliability/SKILL.md +19 -2
- package/skills/orchestration/SKILL.md +20 -2
- package/skills/ownership-session-security/SKILL.md +20 -2
- package/skills/pi-extension-lifecycle/SKILL.md +20 -2
- package/skills/post-mortem/SKILL.md +7 -2
- package/skills/read-only-explorer/SKILL.md +20 -6
- package/skills/requirements-to-task-packet/SKILL.md +23 -3
- package/skills/resource-discovery-config/SKILL.md +20 -2
- package/skills/runtime-state-reader/SKILL.md +20 -2
- package/skills/safe-bash/SKILL.md +21 -6
- package/skills/scrutinize/SKILL.md +20 -2
- package/skills/secure-agent-orchestration-review/SKILL.md +29 -2
- package/skills/security-review/SKILL.md +560 -0
- package/skills/state-mutation-locking/SKILL.md +22 -2
- package/skills/systematic-debugging/SKILL.md +8 -6
- package/skills/threat-hypothesis-framework/SKILL.md +175 -0
- package/skills/ui-render-performance/SKILL.md +20 -2
- package/skills/verification-before-done/SKILL.md +17 -2
- package/skills/widget-rendering/SKILL.md +21 -6
- package/skills/workspace-isolation/SKILL.md +20 -6
- package/skills/worktree-isolation/SKILL.md +20 -6
- package/src/agents/agent-config.ts +40 -1
- package/src/benchmark/benchmark-runner.ts +45 -0
- package/src/benchmark/feedback-loop.ts +5 -0
- package/src/config/config.ts +32 -5
- package/src/config/role-tools.ts +82 -0
- package/src/config/suggestions.ts +8 -0
- package/src/config/types.ts +4 -0
- package/src/extension/async-notifier.ts +10 -1
- package/src/extension/crew-cleanup.ts +114 -0
- package/src/extension/cross-extension-rpc.ts +1 -1
- package/src/extension/notification-router.ts +18 -0
- package/src/extension/register.ts +27 -19
- package/src/extension/registration/subagent-tools.ts +1 -1
- package/src/extension/team-tool/anchor.ts +201 -0
- package/src/extension/team-tool/api.ts +2 -1
- package/src/extension/team-tool/auto-summarize.ts +154 -0
- package/src/extension/team-tool/run.ts +42 -7
- package/src/extension/team-tool.ts +44 -2
- package/src/hooks/registry.ts +1 -3
- package/src/observability/event-bus.ts +69 -0
- package/src/observability/event-to-metric.ts +0 -2
- package/src/runtime/anchor-manager.ts +473 -0
- package/src/runtime/async-runner.ts +8 -4
- package/src/runtime/auto-summarize.ts +350 -0
- package/src/runtime/background-runner.ts +10 -3
- package/src/runtime/budget-tracker.ts +354 -0
- package/src/runtime/chain-runner.ts +507 -0
- package/src/runtime/child-pi.ts +123 -35
- package/src/runtime/crash-recovery.ts +5 -4
- package/src/runtime/crew-agent-runtime.ts +1 -0
- package/src/runtime/custom-tools/irc-tool.ts +13 -0
- package/src/runtime/custom-tools/submit-result-tool.ts +3 -2
- package/src/runtime/delivery-coordinator.ts +10 -3
- package/src/runtime/dynamic-script-runner.ts +482 -0
- package/src/runtime/foreground-control.ts +87 -17
- package/src/runtime/handoff-manager.ts +589 -0
- package/src/runtime/hidden-handoff.ts +424 -0
- package/src/runtime/live-agent-manager.ts +20 -4
- package/src/runtime/live-session-runtime.ts +39 -4
- package/src/runtime/manifest-cache.ts +2 -1
- package/src/runtime/model-resolver.ts +16 -4
- package/src/runtime/phase-tracker.ts +373 -0
- package/src/runtime/pi-args.ts +11 -1
- package/src/runtime/pi-json-output.ts +31 -0
- package/src/runtime/pipeline-runner.ts +514 -0
- package/src/runtime/progress-tracker.ts +124 -0
- package/src/runtime/retry-runner.ts +354 -0
- package/src/runtime/sandbox.ts +252 -0
- package/src/runtime/scheduler.ts +7 -2
- package/src/runtime/skill-effectiveness.ts +473 -0
- package/src/runtime/skill-instructions.ts +37 -3
- package/src/runtime/subagent-manager.ts +1 -1
- package/src/runtime/task-graph.ts +11 -1
- package/src/runtime/task-runner.ts +92 -18
- package/src/runtime/team-runner.ts +13 -12
- package/src/runtime/tool-progress.ts +10 -3
- package/src/runtime/verification-gates.ts +367 -0
- package/src/schema/team-tool-schema.ts +37 -0
- package/src/skills/discover-skills.ts +5 -0
- package/src/state/active-run-registry.ts +9 -2
- package/src/state/contracts.ts +9 -0
- package/src/state/crew-init.ts +3 -3
- package/src/state/decision-ledger.ts +98 -55
- package/src/state/event-log-rotation.ts +2 -2
- package/src/state/event-log.ts +144 -10
- package/src/state/hook-instinct-bridge.ts +5 -5
- package/src/state/mailbox.ts +10 -0
- package/src/state/run-cache.ts +18 -8
- package/src/state/state-store.ts +3 -1
- package/src/state/types.ts +4 -0
- package/src/tools/safe-bash-extension.ts +1 -0
- package/src/tools/safe-bash.ts +152 -20
- package/src/types/new-api-types.ts +34 -0
- package/src/ui/agent-management-overlay.ts +5 -1
- package/src/ui/crew-widget.ts +29 -15
- package/src/ui/overlays/mailbox-detail-overlay.ts +13 -2
- package/src/ui/powerbar-publisher.ts +101 -7
- package/src/ui/tool-render.ts +15 -15
- package/src/ui/transcript-cache.ts +13 -0
- package/src/utils/bm25-search.ts +16 -8
- package/src/utils/env-filter.ts +8 -5
- package/src/utils/redaction.ts +169 -15
- package/src/utils/session-utils.ts +52 -0
- package/src/utils/sse-parser.ts +10 -1
- package/src/worktree/cleanup.ts +6 -1
- package/src/worktree/worktree-manager.ts +32 -13
- package/workflows/chain.workflow.md +252 -0
- package/workflows/pipeline.workflow.md +27 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: detection-pipeline-design
|
|
3
|
+
description: "Design data pipelines for security monitoring and threat intelligence."
|
|
4
|
+
triggers:
|
|
5
|
+
- "build pipeline"
|
|
6
|
+
- "design detection"
|
|
7
|
+
- "setup monitoring"
|
|
8
|
+
- "enrich data"
|
|
9
|
+
- "threat intelligence"
|
|
10
|
+
---
|
|
11
|
+
# detection-pipeline-design
|
|
12
|
+
|
|
13
|
+
Use this skill when designing data pipelines for security detection and enrichment.
|
|
14
|
+
|
|
15
|
+
## Source
|
|
16
|
+
|
|
17
|
+
Distilled from `building-ioc-enrichment-pipeline-with-opencti` (Anthropic Cybersecurity Skills) and generalized for software/build context.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
- Building detection and monitoring systems
|
|
22
|
+
- Designing security data pipelines
|
|
23
|
+
- Setting up automated threat intelligence
|
|
24
|
+
- Creating alert enrichment workflows
|
|
25
|
+
- Integrating security scanning into CI/CD
|
|
26
|
+
|
|
27
|
+
## Pipeline Architecture
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
┌─────────┐ ┌──────────┐ ┌──────────┐ ┌─────────┐ ┌─────────┐
|
|
31
|
+
│ Input │ → │ Transform│ → │ Enrich │ → │ Score │ → │ Route │
|
|
32
|
+
│ Data │ │ (Norm) │ │ (Context)│ │ (Conf) │ │(Action) │
|
|
33
|
+
└─────────┘ └──────────┘ └──────────┘ └─────────┘ └─────────┘
|
|
34
|
+
↓
|
|
35
|
+
┌──────────┐
|
|
36
|
+
│ Output │
|
|
37
|
+
│ Findings │
|
|
38
|
+
└──────────┘
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Pipeline Components
|
|
42
|
+
|
|
43
|
+
### 1. Input Stage
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
input:
|
|
47
|
+
types:
|
|
48
|
+
- name: file_change
|
|
49
|
+
sources: [git, filesystem]
|
|
50
|
+
- name: log_event
|
|
51
|
+
sources: [application, system]
|
|
52
|
+
- name: alert
|
|
53
|
+
sources: [scanner, monitor]
|
|
54
|
+
- name: dependency
|
|
55
|
+
sources: [npm, pip, cargo]
|
|
56
|
+
format: [json, plain_text, structured]
|
|
57
|
+
polling: [real_time, batch, scheduled]
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. Transform Stage
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
transform:
|
|
64
|
+
operations:
|
|
65
|
+
- name: normalize
|
|
66
|
+
description: Convert to standard format
|
|
67
|
+
output: stix_like_object
|
|
68
|
+
- name: extract_indicators
|
|
69
|
+
description: Pull out IOCs
|
|
70
|
+
extract: [ips, domains, hashes, credentials, tokens]
|
|
71
|
+
- name: enrich_metadata
|
|
72
|
+
description: Add context
|
|
73
|
+
add: [file_type, language, framework, timestamp]
|
|
74
|
+
output_format: json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 3. Enrich Stage
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
enrich:
|
|
81
|
+
internal_sources:
|
|
82
|
+
- name: vulnerability_db
|
|
83
|
+
query: [cve_id, cwe]
|
|
84
|
+
- name: code_analysis
|
|
85
|
+
query: [pattern, structure]
|
|
86
|
+
- name: git_history
|
|
87
|
+
query: [author, commit, diff]
|
|
88
|
+
external_sources:
|
|
89
|
+
- name: npm_audit
|
|
90
|
+
api: npmjs.org
|
|
91
|
+
- name: osv
|
|
92
|
+
api: osv.dev
|
|
93
|
+
- name: gh_advisory
|
|
94
|
+
api: github.com/advisories
|
|
95
|
+
async: true
|
|
96
|
+
timeout_ms: 5000
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 4. Score Stage
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
score:
|
|
103
|
+
confidence_calculation:
|
|
104
|
+
factors:
|
|
105
|
+
- name: source_reliability
|
|
106
|
+
weight: 0.3
|
|
107
|
+
scale: [0-10]
|
|
108
|
+
- name: contextual_evidence
|
|
109
|
+
weight: 0.4
|
|
110
|
+
scale: [0-10]
|
|
111
|
+
- name: historical_matches
|
|
112
|
+
weight: 0.3
|
|
113
|
+
scale: [0-10]
|
|
114
|
+
formula: >
|
|
115
|
+
(reliability * 0.3) +
|
|
116
|
+
(evidence * 0.4) +
|
|
117
|
+
(historical * 0.3)
|
|
118
|
+
thresholds:
|
|
119
|
+
critical: [90-100]
|
|
120
|
+
high: [70-89]
|
|
121
|
+
medium: [40-69]
|
|
122
|
+
low: [0-39]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 5. Route Stage
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
route:
|
|
129
|
+
paths:
|
|
130
|
+
- condition: "score >= 90"
|
|
131
|
+
action: [alert, block, notify]
|
|
132
|
+
destination: [security_team, incident_response]
|
|
133
|
+
- condition: "score >= 70"
|
|
134
|
+
action: [alert, review]
|
|
135
|
+
destination: [security_queue]
|
|
136
|
+
- condition: "score >= 40"
|
|
137
|
+
action: [log, monitor]
|
|
138
|
+
destination: [security_logs]
|
|
139
|
+
- condition: "score < 40"
|
|
140
|
+
action: [ignore]
|
|
141
|
+
destination: []
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Pipeline Design Patterns
|
|
145
|
+
|
|
146
|
+
### Pattern 1: Real-time File Monitoring
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
pipeline:
|
|
150
|
+
name: file-change-detection
|
|
151
|
+
trigger:
|
|
152
|
+
type: filesystem_watch
|
|
153
|
+
paths: ["src/**/*.ts", "src/**/*.js"]
|
|
154
|
+
transform:
|
|
155
|
+
- extract: [imports, function_calls, secrets]
|
|
156
|
+
enrich:
|
|
157
|
+
- check: npm_audit
|
|
158
|
+
- check: known_vulnerable_patterns
|
|
159
|
+
score:
|
|
160
|
+
- base: vulnerability_severity
|
|
161
|
+
- modifier: exploitability
|
|
162
|
+
route:
|
|
163
|
+
critical: slack_alert + block_merge
|
|
164
|
+
high: github_issue + notify
|
|
165
|
+
medium: log + track
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Pattern 2: Dependency Vulnerability Pipeline
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
pipeline:
|
|
172
|
+
name: dependency-vuln-scan
|
|
173
|
+
trigger:
|
|
174
|
+
type: package_lock_change
|
|
175
|
+
transform:
|
|
176
|
+
- extract: [package_names, versions, sources]
|
|
177
|
+
enrich:
|
|
178
|
+
- query: osv_database
|
|
179
|
+
- query: npm_advisories
|
|
180
|
+
- query: github_advisories
|
|
181
|
+
score:
|
|
182
|
+
- base: cvss_score
|
|
183
|
+
- modifier: [has_exploit, is_dependencies]
|
|
184
|
+
route:
|
|
185
|
+
critical: [create_security_issue, alert_team]
|
|
186
|
+
high: [create_issue, schedule_fix]
|
|
187
|
+
medium: [add_to_backlog]
|
|
188
|
+
low: [note_in_changelog]
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Pattern 3: Secret Detection Pipeline
|
|
192
|
+
|
|
193
|
+
```yaml
|
|
194
|
+
pipeline:
|
|
195
|
+
name: secret-detection
|
|
196
|
+
trigger:
|
|
197
|
+
type: git_push
|
|
198
|
+
transform:
|
|
199
|
+
- extract: [api_keys, tokens, passwords, credentials]
|
|
200
|
+
enrich:
|
|
201
|
+
- validate: key_format
|
|
202
|
+
- check: blacklists
|
|
203
|
+
score:
|
|
204
|
+
- base: key_validity
|
|
205
|
+
- modifier: [key_age, exposure_scope]
|
|
206
|
+
route:
|
|
207
|
+
critical: [revoke_key, alert_security, block_push]
|
|
208
|
+
high: [notify_owner, rotate_key]
|
|
209
|
+
medium: [flag_for_review]
|
|
210
|
+
low: [log]
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Implementation Example
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
interface DetectionPipeline {
|
|
217
|
+
name: string;
|
|
218
|
+
input: InputConfig;
|
|
219
|
+
transform: TransformConfig;
|
|
220
|
+
enrich: EnrichConfig;
|
|
221
|
+
score: ScoreConfig;
|
|
222
|
+
route: RouteConfig;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
async function runPipeline(pipeline: DetectionPipeline, data: unknown): Promise<PipelineResult> {
|
|
226
|
+
// 1. Input validation
|
|
227
|
+
const normalized = normalizeInput(data, pipeline.input);
|
|
228
|
+
|
|
229
|
+
// 2. Transform - extract indicators
|
|
230
|
+
const indicators = extractIndicators(normalized, pipeline.transform);
|
|
231
|
+
|
|
232
|
+
// 3. Enrich - query external/internal sources
|
|
233
|
+
const enriched = await enrichIndicators(indicators, pipeline.enrich);
|
|
234
|
+
|
|
235
|
+
// 4. Score - calculate confidence
|
|
236
|
+
const scored = calculateScore(enriched, pipeline.score);
|
|
237
|
+
|
|
238
|
+
// 5. Route - determine action
|
|
239
|
+
const action = determineAction(scored, pipeline.route);
|
|
240
|
+
|
|
241
|
+
return { indicators, enriched, scored, action };
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Enforcement — Detection Pipeline Design Gate
|
|
246
|
+
|
|
247
|
+
**Before deploying detection pipelines, verify:**
|
|
248
|
+
|
|
249
|
+
- [ ] Input format validated before transform stage
|
|
250
|
+
- [ ] Scoring thresholds tuned to environment (not hardcoded defaults)
|
|
251
|
+
- [ ] Confidence calculation includes multiple factors (reliability, evidence, history)
|
|
252
|
+
- [ ] Route actions match score thresholds (critical → block, low → ignore)
|
|
253
|
+
- [ ] False positive rate measured and acceptable
|
|
254
|
+
- [ ] External API calls are async (non-blocking)
|
|
255
|
+
|
|
256
|
+
If ANY answer is NO → Stop. Tune the pipeline before deploying.
|
|
257
|
+
|
|
258
|
+
## Anti-Patterns
|
|
259
|
+
|
|
260
|
+
- **Don't** skip input validation (garbage in, garbage out)
|
|
261
|
+
- **Don't** skip enrichment (missing context leads to false positives)
|
|
262
|
+
- **Don't** use fixed thresholds (tune based on environment)
|
|
263
|
+
- **Don't** ignore false positive rates (kills analyst productivity)
|
|
264
|
+
- **Don't** block on external APIs in synchronous path (use async)
|
|
265
|
+
|
|
266
|
+
## Tools & Integrations
|
|
267
|
+
|
|
268
|
+
| Tool | Pipeline Role |
|
|
269
|
+
|------|---------------|
|
|
270
|
+
| `semgrep` | Static analysis, pattern matching |
|
|
271
|
+
| `npm audit` | Dependency vulnerability |
|
|
272
|
+
| `trufflehog` | Secret scanning |
|
|
273
|
+
| `grype` | Container vulnerability |
|
|
274
|
+
| `syft` | SBOM generation |
|
|
275
|
+
|
|
276
|
+
## Verification
|
|
277
|
+
|
|
278
|
+
For pipeline design changes:
|
|
279
|
+
```bash
|
|
280
|
+
cd pi-crew
|
|
281
|
+
npx tsc --noEmit
|
|
282
|
+
node --experimental-strip-types --test test/unit/detection-pipeline.test.ts
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
*See also: `detection-signature-authoring` (in security-review) for detection rule patterns.*
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: event-log-tracing
|
|
3
|
-
description: "Structured event logging for worker lifecycle, live agents, crash recovery.
|
|
3
|
+
description: "Structured event logging for worker lifecycle, live agents, crash recovery."
|
|
4
|
+
triggers:
|
|
5
|
+
- "event log"
|
|
6
|
+
- "trace events"
|
|
7
|
+
- "worker crashed"
|
|
8
|
+
- "agent died"
|
|
9
|
+
- "stale run"
|
|
4
10
|
---
|
|
5
|
-
|
|
6
11
|
# event-log-tracing
|
|
7
12
|
|
|
8
13
|
Every pi-crew run writes a persistent event log at `.crew/state/runs/<runId>/events.jsonl`. Events are the primary evidence for understanding what happened — especially when workers crash, agents get stuck, or runs become orphaned.
|
|
@@ -31,8 +36,6 @@ Every event is a JSON object on one line:
|
|
|
31
36
|
**Optional fields:** `taskId`, `message`, `data`, `metadata`
|
|
32
37
|
**Metadata auto-populated:** `seq` (line number), `provenance` (who wrote it), `fingerprint` (for terminal events)
|
|
33
38
|
|
|
34
|
-
---
|
|
35
|
-
|
|
36
39
|
## Event Taxonomy
|
|
37
40
|
|
|
38
41
|
### Worker Lifecycle Events (from child-pi.ts via onLifecycleEvent callback)
|
|
@@ -112,8 +115,6 @@ These track the full lifecycle from spawn to cleanup.
|
|
|
112
115
|
| `crew.run.reconciled_stale` | `reconcileStaleRun` repaired a stale run | `{verdict}` |
|
|
113
116
|
| `crew.run.orphan_cancelled` | `cancelOrphanedRuns` cancelled a run | `{ownerSessionId, cancelledTasks}` |
|
|
114
117
|
|
|
115
|
-
---
|
|
116
|
-
|
|
117
118
|
## appendEvent Pipeline
|
|
118
119
|
|
|
119
120
|
```
|
|
@@ -257,6 +258,19 @@ crew.run.reconciled_stale verdict=pid_dead
|
|
|
257
258
|
|
|
258
259
|
---
|
|
259
260
|
|
|
261
|
+
## Enforcement — Event Log Tracing Gate
|
|
262
|
+
|
|
263
|
+
**Before interpreting events or debugging crashes, verify:**
|
|
264
|
+
|
|
265
|
+
- [ ] Event format validated (required fields: time, type, runId present)
|
|
266
|
+
- [ ] runId correlation confirmed (all events have same runId for the trace)
|
|
267
|
+
- [ ] Terminal events have fingerprints (completed/failed/cancelled)
|
|
268
|
+
- [ ] Event sequence matches expected lifecycle pattern
|
|
269
|
+
- [ ] Corrupt JSONL handled (skip malformed lines, don't fail entire read)
|
|
270
|
+
- [ ] Secrets redacted in data fields before logging
|
|
271
|
+
|
|
272
|
+
If ANY answer is NO → Stop. Re-examine event source and format.
|
|
273
|
+
|
|
260
274
|
## Anti-patterns
|
|
261
275
|
|
|
262
276
|
- **`logInternalError` only logs in debug mode**: Production errors are silent — `events.jsonl` is the only durable evidence. Always emit events, never rely on `console.error`.
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-master
|
|
3
|
-
description: Commit and release hygiene for safe version-control work.
|
|
3
|
+
description: "Commit and release hygiene for safe version-control work."
|
|
4
|
+
triggers:
|
|
5
|
+
- "commit this"
|
|
6
|
+
- "tag release"
|
|
7
|
+
- "bump version"
|
|
8
|
+
- "publish package"
|
|
9
|
+
- "prepare release"
|
|
4
10
|
---
|
|
5
|
-
|
|
6
11
|
# git-master
|
|
7
12
|
|
|
8
13
|
Use this skill for commit/release hygiene. This skill covers git workflow from local changes to published releases.
|
|
@@ -186,6 +191,19 @@ git stash drop # remove latest stash
|
|
|
186
191
|
git stash clear # remove all stashes
|
|
187
192
|
```
|
|
188
193
|
|
|
194
|
+
## Enforcement — Git Master Gate
|
|
195
|
+
|
|
196
|
+
**Before committing or publishing, verify:**
|
|
197
|
+
|
|
198
|
+
- [ ] `git status` reviewed — only related files staged
|
|
199
|
+
- [ ] `git diff --staged` reviewed — no unintended changes
|
|
200
|
+
- [ ] Tests pass locally (`npm test` or appropriate test command)
|
|
201
|
+
- [ ] No secrets in staged changes (API keys, tokens, passwords)
|
|
202
|
+
- [ ] Commit message follows format: `type(scope): subject` (50 chars or less)
|
|
203
|
+
- [ ] No generated files staged unless intentional
|
|
204
|
+
|
|
205
|
+
If ANY answer is NO → Stop. Fix issues before committing.
|
|
206
|
+
|
|
189
207
|
## Anti-patterns
|
|
190
208
|
|
|
191
209
|
- **Committing generated files**: Don't commit `dist/`, `build/`, `*.min.js` unless intentional
|
|
@@ -195,8 +213,6 @@ git stash clear # remove all stashes
|
|
|
195
213
|
- **Committing secrets**: Check for `API_KEY`, `TOKEN`, `PASSWORD`, `SECRET` before staging
|
|
196
214
|
- **Unclear messages**: "fix stuff" is not a valid commit message
|
|
197
215
|
|
|
198
|
-
---
|
|
199
|
-
|
|
200
216
|
## Source patterns
|
|
201
217
|
|
|
202
218
|
- `src/state/atomic-write.ts` — atomic git-safe file writes
|
|
@@ -204,8 +220,6 @@ git stash clear # remove all stashes
|
|
|
204
220
|
- `src/utils/conflict-detect.ts` — git conflict detection
|
|
205
221
|
- `package.json` — version field, publish scripts
|
|
206
222
|
|
|
207
|
-
---
|
|
208
|
-
|
|
209
223
|
## Verification
|
|
210
224
|
|
|
211
225
|
```bash
|