opencode-skills-collection 3.0.46 → 3.0.48
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/bundled-skills/.antigravity-install-manifest.json +15 -1
- package/bundled-skills/2slides-ppt-generator/SKILL.md +1 -1
- package/bundled-skills/2slides-ppt-generator/scripts/create_pdf_slides.py +2 -1
- package/bundled-skills/2slides-ppt-generator/scripts/generate_narration.py +2 -1
- package/bundled-skills/2slides-ppt-generator/scripts/generate_slides.py +13 -7
- package/bundled-skills/accint-solve/SKILL.md +205 -0
- package/bundled-skills/android-cli/SKILL.md +239 -0
- package/bundled-skills/android-cli/references/interact.md +83 -0
- package/bundled-skills/android-cli/references/journeys.md +105 -0
- package/bundled-skills/android-dev/references/hybrid.md +7 -4
- package/bundled-skills/android-dev/references/react-native.md +5 -2
- package/bundled-skills/atlas-contract/SKILL.md +4 -4
- package/bundled-skills/atlas-ledger/SKILL.md +10 -7
- package/bundled-skills/bun-development/SKILL.md +1 -1
- package/bundled-skills/cloud-penetration-testing/SKILL.md +1 -1
- package/bundled-skills/codebase-to-wordpress-converter/SKILL.md +1 -0
- package/bundled-skills/codex-fable5/SKILL.md +154 -0
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/getting-started.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +4 -4
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/dos-verify-done-claims/SKILL.md +173 -0
- package/bundled-skills/ecl-harness-engineer/LICENSE +21 -0
- package/bundled-skills/ecl-harness-engineer/SKILL.md +714 -0
- package/bundled-skills/ecl-harness-engineer/agents/analyzer.md +119 -0
- package/bundled-skills/ecl-harness-engineer/agents/auditor.md +212 -0
- package/bundled-skills/ecl-harness-engineer/agents/creator-config.md +343 -0
- package/bundled-skills/ecl-harness-engineer/agents/creator-docs.md +201 -0
- package/bundled-skills/ecl-harness-engineer/agents/creator-linters.md +123 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/adapter-schema.md +204 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/generic.md +156 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/go.md +212 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/java.md +205 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/python.md +225 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/rust.md +220 -0
- package/bundled-skills/ecl-harness-engineer/references/adapters/typescript.md +245 -0
- package/bundled-skills/ecl-harness-engineer/references/architecture-diagrams.md +420 -0
- package/bundled-skills/ecl-harness-engineer/references/audit-templates.md +649 -0
- package/bundled-skills/ecl-harness-engineer/references/capability-registry.md +485 -0
- package/bundled-skills/ecl-harness-engineer/references/darwin-eval-prompts.md +373 -0
- package/bundled-skills/ecl-harness-engineer/references/documentation-templates.md +741 -0
- package/bundled-skills/ecl-harness-engineer/references/durability-patterns.md +423 -0
- package/bundled-skills/ecl-harness-engineer/references/ecl-harness.md +1431 -0
- package/bundled-skills/ecl-harness-engineer/references/environment-config-guide.md +534 -0
- package/bundled-skills/ecl-harness-engineer/references/environment-detection-guide.md +751 -0
- package/bundled-skills/ecl-harness-engineer/references/eval-templates.md +377 -0
- package/bundled-skills/ecl-harness-engineer/references/gc-templates.md +798 -0
- package/bundled-skills/ecl-harness-engineer/references/greenfield-templates.md +1385 -0
- package/bundled-skills/ecl-harness-engineer/references/linter-templates.md +448 -0
- package/bundled-skills/ecl-harness-engineer/references/observability-templates.md +315 -0
- package/bundled-skills/efficient-web-research/SKILL.md +320 -0
- package/bundled-skills/environment-setup-guide/SKILL.md +2 -2
- package/bundled-skills/evolution/SKILL.md +1 -1
- package/bundled-skills/gitops-workflow/SKILL.md +1 -1
- package/bundled-skills/linkerd-patterns/SKILL.md +1 -1
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package-lock.json +504 -1317
- package/bundled-skills/loki-mode/examples/todo-app-generated/frontend/package.json +2 -2
- package/bundled-skills/lovable-cleanup/SKILL.md +416 -0
- package/bundled-skills/monopoly/SKILL.md +397 -0
- package/bundled-skills/monopoly/patterns/SKILL.md +331 -0
- package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +174 -0
- package/bundled-skills/monopoly/security-checklist/SKILL.md +69 -0
- package/bundled-skills/monopoly/tech-matrix/SKILL.md +268 -0
- package/bundled-skills/pagespeed-enhancer/SKILL.md +579 -0
- package/bundled-skills/polis-protocol/SKILL.md +6 -3
- package/bundled-skills/sharp-coder/SKILL.md +131 -0
- package/bundled-skills/unship/SKILL.md +11 -5
- package/bundled-skills/uv-package-manager/resources/implementation-playbook.md +1 -1
- package/bundled-skills/varlock/SKILL.md +2 -2
- package/package.json +1 -1
- package/skills_index.json +314 -4
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
# Observability Templates
|
|
2
|
+
|
|
3
|
+
Templates for agent observability infrastructure.
|
|
4
|
+
|
|
5
|
+
Advanced profile only. Load this reference only when the user explicitly requests agent execution
|
|
6
|
+
traces, observability hooks, metrics, or debugging of long-running agent sessions. Do not create
|
|
7
|
+
`harness/trace` or observability hooks as part of the default core harness.
|
|
8
|
+
|
|
9
|
+
## Trace Format
|
|
10
|
+
|
|
11
|
+
Standard format for recording agent execution sessions.
|
|
12
|
+
|
|
13
|
+
```go
|
|
14
|
+
// harness/trace/format.go
|
|
15
|
+
package trace
|
|
16
|
+
|
|
17
|
+
import (
|
|
18
|
+
"encoding/json"
|
|
19
|
+
"os"
|
|
20
|
+
"time"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
// AgentTrace captures a complete agent execution session
|
|
24
|
+
type AgentTrace struct {
|
|
25
|
+
SessionID string `json:"session_id"`
|
|
26
|
+
AgentType string `json:"agent_type"`
|
|
27
|
+
StartTime time.Time `json:"start_time"`
|
|
28
|
+
EndTime time.Time `json:"end_time"`
|
|
29
|
+
Prompt string `json:"prompt"`
|
|
30
|
+
SystemPrompt string `json:"system_prompt,omitempty"`
|
|
31
|
+
WorkingDir string `json:"working_dir"`
|
|
32
|
+
Messages []MessageTrace `json:"messages"`
|
|
33
|
+
ToolCalls []ToolTrace `json:"tool_calls"`
|
|
34
|
+
TokenUsage TokenUsage `json:"token_usage"`
|
|
35
|
+
Outcome Outcome `json:"outcome"`
|
|
36
|
+
Result string `json:"result,omitempty"`
|
|
37
|
+
Error string `json:"error,omitempty"`
|
|
38
|
+
Metadata map[string]any `json:"metadata,omitempty"`
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type MessageTrace struct {
|
|
42
|
+
ID string `json:"id,omitempty"`
|
|
43
|
+
Role string `json:"role"`
|
|
44
|
+
Content string `json:"content"`
|
|
45
|
+
Timestamp time.Time `json:"timestamp"`
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type ToolTrace struct {
|
|
49
|
+
ID string `json:"id"`
|
|
50
|
+
Tool string `json:"tool"`
|
|
51
|
+
Input json.RawMessage `json:"input"`
|
|
52
|
+
Output string `json:"output"`
|
|
53
|
+
Duration time.Duration `json:"duration"`
|
|
54
|
+
Timestamp time.Time `json:"timestamp"`
|
|
55
|
+
IsError bool `json:"is_error"`
|
|
56
|
+
ErrCode int `json:"err_code,omitempty"`
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
type TokenUsage struct {
|
|
60
|
+
InputTokens int64 `json:"input_tokens"`
|
|
61
|
+
OutputTokens int64 `json:"output_tokens"`
|
|
62
|
+
TotalTokens int64 `json:"total_tokens"`
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type Outcome string
|
|
66
|
+
|
|
67
|
+
const (
|
|
68
|
+
OutcomeSuccess Outcome = "success"
|
|
69
|
+
OutcomeError Outcome = "error"
|
|
70
|
+
OutcomeTimeout Outcome = "timeout"
|
|
71
|
+
OutcomeCancelled Outcome = "cancelled"
|
|
72
|
+
OutcomeMaxTurns Outcome = "max_turns"
|
|
73
|
+
OutcomeMaxToolCalls Outcome = "max_tool_calls"
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
// TraceBuilder constructs traces incrementally
|
|
77
|
+
type TraceBuilder struct {
|
|
78
|
+
trace AgentTrace
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
func NewTraceBuilder(sessionID, agentType string) *TraceBuilder {
|
|
82
|
+
return &TraceBuilder{
|
|
83
|
+
trace: AgentTrace{
|
|
84
|
+
SessionID: sessionID,
|
|
85
|
+
AgentType: agentType,
|
|
86
|
+
StartTime: time.Now(),
|
|
87
|
+
Messages: make([]MessageTrace, 0),
|
|
88
|
+
ToolCalls: make([]ToolTrace, 0),
|
|
89
|
+
Metadata: make(map[string]any),
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
func (b *TraceBuilder) AddMessage(msg MessageTrace) { b.trace.Messages = append(b.trace.Messages, msg) }
|
|
95
|
+
func (b *TraceBuilder) AddToolCall(tc ToolTrace) { b.trace.ToolCalls = append(b.trace.ToolCalls, tc) }
|
|
96
|
+
|
|
97
|
+
func (b *TraceBuilder) Build() AgentTrace {
|
|
98
|
+
b.trace.EndTime = time.Now()
|
|
99
|
+
return b.trace
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
func (t *AgentTrace) Export(path string) error {
|
|
103
|
+
data, err := json.MarshalIndent(t, "", " ")
|
|
104
|
+
if err != nil {
|
|
105
|
+
return err
|
|
106
|
+
}
|
|
107
|
+
return os.WriteFile(path, data, 0644)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
func Load(path string) (*AgentTrace, error) {
|
|
111
|
+
data, err := os.ReadFile(path)
|
|
112
|
+
if err != nil {
|
|
113
|
+
return nil, err
|
|
114
|
+
}
|
|
115
|
+
var trace AgentTrace
|
|
116
|
+
return &trace, json.Unmarshal(data, &trace)
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Self-Test Framework
|
|
121
|
+
|
|
122
|
+
Framework for testing agent behavior with validation.
|
|
123
|
+
|
|
124
|
+
```go
|
|
125
|
+
// harness/selftest/runner.go
|
|
126
|
+
package selftest
|
|
127
|
+
|
|
128
|
+
import (
|
|
129
|
+
"context"
|
|
130
|
+
"encoding/json"
|
|
131
|
+
"fmt"
|
|
132
|
+
"time"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
// TestCase defines a single agent test
|
|
136
|
+
type TestCase struct {
|
|
137
|
+
Name string `json:"name"`
|
|
138
|
+
Category string `json:"category"`
|
|
139
|
+
Prompt string `json:"prompt"`
|
|
140
|
+
InitFiles map[string]string `json:"init_files,omitempty"`
|
|
141
|
+
Timeout time.Duration `json:"timeout"`
|
|
142
|
+
MaxTurns int `json:"max_turns,omitempty"`
|
|
143
|
+
Expected *Expectations `json:"expected,omitempty"`
|
|
144
|
+
Validators []Validator `json:"-"`
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
type Expectations struct {
|
|
148
|
+
Files map[string]FileExpectation `json:"files,omitempty"`
|
|
149
|
+
ToolCalls []ToolCallExpectation `json:"tool_calls,omitempty"`
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
type FileExpectation struct {
|
|
153
|
+
MustExist bool `json:"must_exist"`
|
|
154
|
+
MustContain []string `json:"must_contain,omitempty"`
|
|
155
|
+
MustNotContain []string `json:"must_not_contain,omitempty"`
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
type ToolCallExpectation struct {
|
|
159
|
+
Tool string `json:"tool"`
|
|
160
|
+
MustOccur bool `json:"must_occur,omitempty"`
|
|
161
|
+
MustNotOccur bool `json:"must_not_occur,omitempty"`
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
type Validator func(result *AgentResult) error
|
|
165
|
+
|
|
166
|
+
type AgentResult struct {
|
|
167
|
+
TestName string `json:"test_name"`
|
|
168
|
+
Success bool `json:"success"`
|
|
169
|
+
Error string `json:"error,omitempty"`
|
|
170
|
+
Duration time.Duration `json:"duration"`
|
|
171
|
+
ToolCalls []ToolCallRecord `json:"tool_calls"`
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
type ToolCallRecord struct {
|
|
175
|
+
Tool string `json:"tool"`
|
|
176
|
+
Input json.RawMessage `json:"input"`
|
|
177
|
+
Output string `json:"output"`
|
|
178
|
+
IsError bool `json:"is_error"`
|
|
179
|
+
Duration time.Duration `json:"duration"`
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
type Runner struct {
|
|
183
|
+
WorkDir string
|
|
184
|
+
DefaultTimeout time.Duration
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
func NewRunner(workDir string) *Runner {
|
|
188
|
+
return &Runner{WorkDir: workDir, DefaultTimeout: 2 * time.Minute}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
func (r *Runner) Run(ctx context.Context, tc TestCase) (*AgentResult, error) {
|
|
192
|
+
result := &AgentResult{
|
|
193
|
+
TestName: tc.Name,
|
|
194
|
+
ToolCalls: make([]ToolCallRecord, 0),
|
|
195
|
+
}
|
|
196
|
+
start := time.Now()
|
|
197
|
+
defer func() { result.Duration = time.Since(start) }()
|
|
198
|
+
|
|
199
|
+
// TODO: Integrate with actual agent execution
|
|
200
|
+
return result, fmt.Errorf("not yet integrated with agent")
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Observability Hook
|
|
205
|
+
|
|
206
|
+
Hook that records tool calls for analysis and replay.
|
|
207
|
+
|
|
208
|
+
```go
|
|
209
|
+
// hooks/observability/observability.go
|
|
210
|
+
package observability
|
|
211
|
+
|
|
212
|
+
import (
|
|
213
|
+
"encoding/json"
|
|
214
|
+
"sync"
|
|
215
|
+
"time"
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
type ToolTrace struct {
|
|
219
|
+
Tool string `json:"tool"`
|
|
220
|
+
Input json.RawMessage `json:"input"`
|
|
221
|
+
Output string `json:"output"`
|
|
222
|
+
IsError bool `json:"is_error"`
|
|
223
|
+
Duration time.Duration `json:"duration"`
|
|
224
|
+
Timestamp time.Time `json:"timestamp"`
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// TraceRecorder collects tool traces
|
|
228
|
+
type TraceRecorder struct {
|
|
229
|
+
mu sync.RWMutex
|
|
230
|
+
traces []ToolTrace
|
|
231
|
+
sessionId string
|
|
232
|
+
startTime time.Time
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
func NewTraceRecorder(sessionId string) *TraceRecorder {
|
|
236
|
+
return &TraceRecorder{
|
|
237
|
+
traces: make([]ToolTrace, 0),
|
|
238
|
+
sessionId: sessionId,
|
|
239
|
+
startTime: time.Now(),
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
func (r *TraceRecorder) Record(trace ToolTrace) {
|
|
244
|
+
r.mu.Lock()
|
|
245
|
+
defer r.mu.Unlock()
|
|
246
|
+
r.traces = append(r.traces, trace)
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
func (r *TraceRecorder) GetTraces() []ToolTrace {
|
|
250
|
+
r.mu.RLock()
|
|
251
|
+
defer r.mu.RUnlock()
|
|
252
|
+
result := make([]ToolTrace, len(r.traces))
|
|
253
|
+
copy(result, r.traces)
|
|
254
|
+
return result
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
func (r *TraceRecorder) ExportJSON() ([]byte, error) {
|
|
258
|
+
r.mu.RLock()
|
|
259
|
+
defer r.mu.RUnlock()
|
|
260
|
+
return json.MarshalIndent(map[string]any{
|
|
261
|
+
"session_id": r.sessionId,
|
|
262
|
+
"start_time": r.startTime,
|
|
263
|
+
"end_time": time.Now(),
|
|
264
|
+
"traces": r.traces,
|
|
265
|
+
}, "", " ")
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Summary returns aggregate statistics
|
|
269
|
+
func (r *TraceRecorder) Summary() TraceSummary {
|
|
270
|
+
r.mu.RLock()
|
|
271
|
+
defer r.mu.RUnlock()
|
|
272
|
+
|
|
273
|
+
summary := TraceSummary{
|
|
274
|
+
TotalCalls: len(r.traces),
|
|
275
|
+
ToolCounts: make(map[string]int),
|
|
276
|
+
}
|
|
277
|
+
for _, t := range r.traces {
|
|
278
|
+
summary.ToolCounts[t.Tool]++
|
|
279
|
+
if t.IsError {
|
|
280
|
+
summary.TotalErrors++
|
|
281
|
+
}
|
|
282
|
+
summary.TotalDuration += t.Duration
|
|
283
|
+
}
|
|
284
|
+
return summary
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
type TraceSummary struct {
|
|
288
|
+
TotalCalls int `json:"total_calls"`
|
|
289
|
+
TotalErrors int `json:"total_errors"`
|
|
290
|
+
TotalDuration time.Duration `json:"total_duration"`
|
|
291
|
+
ToolCounts map[string]int `json:"tool_counts"`
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Integration Pattern
|
|
296
|
+
|
|
297
|
+
To wire the observability hook into an existing agent:
|
|
298
|
+
|
|
299
|
+
```go
|
|
300
|
+
// In agent initialization:
|
|
301
|
+
recorder := observability.NewTraceRecorder(sessionId)
|
|
302
|
+
hook := observability.NewObservabilityHook(recorder)
|
|
303
|
+
|
|
304
|
+
// Register as PostToolUse hook
|
|
305
|
+
agent.AddPostToolUseHook(hook)
|
|
306
|
+
|
|
307
|
+
// After agent completes:
|
|
308
|
+
traces := recorder.GetTraces()
|
|
309
|
+
summary := recorder.Summary()
|
|
310
|
+
summary.Print()
|
|
311
|
+
|
|
312
|
+
// Export for analysis
|
|
313
|
+
data, _ := recorder.ExportJSON()
|
|
314
|
+
os.WriteFile("trace.json", data, 0644)
|
|
315
|
+
```
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: efficient-web-research
|
|
3
|
+
risk: safe
|
|
4
|
+
description: >
|
|
5
|
+
Protocol for token-efficient web research. Use when accessing URLs, GitHub repos, or running search queries. Prevents full-page fetching waste.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Efficient Web Research Skill
|
|
9
|
+
|
|
10
|
+
A protocol for accessing web content in the most token-efficient, accurate, and structured way —
|
|
11
|
+
using the right tool at the right depth, and stopping as soon as the question is answerable.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Core Principle
|
|
16
|
+
|
|
17
|
+
> **Fetch the minimum needed to answer. Skim before you dive. Stop when you can answer.**
|
|
18
|
+
|
|
19
|
+
Every unnecessary fetch wastes tokens and adds noise. This skill enforces a layered approach
|
|
20
|
+
where you escalate fetch depth only when shallower layers fail.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 1 — Classify the Input
|
|
25
|
+
|
|
26
|
+
Before fetching anything, identify what kind of input you received:
|
|
27
|
+
|
|
28
|
+
| Input Type | Example | Go To |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| GitHub repo URL | `github.com/user/repo` | [GitHub Protocol](#github-protocol) |
|
|
31
|
+
| Specific page URL | `docs.python.org/3/library/os` | [URL Protocol](#url-protocol) |
|
|
32
|
+
| Topic / query (no URL) | "how does RAFT consensus work" | [Search Protocol](#search-protocol) |
|
|
33
|
+
| Multiple URLs | List of links | [Multi-URL Protocol](#multi-url-protocol) |
|
|
34
|
+
| PDF / file link | `.pdf`, `.txt`, `.md` URL | [File Protocol](#file-protocol) |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## GitHub Protocol
|
|
39
|
+
|
|
40
|
+
Use when input is a GitHub URL (repo, file, PR, issue, etc.)
|
|
41
|
+
|
|
42
|
+
### Step 1 — Parse the URL
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
github.com/{owner}/{repo} → Repo root
|
|
46
|
+
github.com/{owner}/{repo}/tree/{branch} → Directory
|
|
47
|
+
github.com/{owner}/{repo}/blob/{branch}/{path} → Single file
|
|
48
|
+
github.com/{owner}/{repo}/issues/{n} → Issue
|
|
49
|
+
github.com/{owner}/{repo}/pull/{n} → Pull request
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Step 2 — Use GitHub API (preferred over scraping)
|
|
53
|
+
|
|
54
|
+
Always prefer the GitHub API. It returns clean JSON — no HTML parsing needed.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
# Repo metadata (name, description, language, stars, topics)
|
|
58
|
+
GET https://api.github.com/repos/{owner}/{repo}
|
|
59
|
+
|
|
60
|
+
# File tree (see what files exist — very cheap)
|
|
61
|
+
GET https://api.github.com/repos/{owner}/{repo}/git/trees/{ref}?recursive=1
|
|
62
|
+
|
|
63
|
+
# Single file content (base64 encoded)
|
|
64
|
+
GET https://api.github.com/repos/{owner}/{repo}/contents/{path}?ref={ref}
|
|
65
|
+
|
|
66
|
+
# README only (usually enough to understand the repo)
|
|
67
|
+
GET https://api.github.com/repos/{owner}/{repo}/readme
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Step 3 — Layered Fetch for Repos
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Layer 1 (always do first):
|
|
74
|
+
→ Fetch repo metadata + README only
|
|
75
|
+
→ Can you answer the user's question now? YES → STOP. NO → continue.
|
|
76
|
+
|
|
77
|
+
Layer 2 (only if needed):
|
|
78
|
+
→ Fetch file tree to understand structure
|
|
79
|
+
→ Identify the 1-3 most relevant files based on the question
|
|
80
|
+
→ Can you answer now? YES → STOP. NO → continue.
|
|
81
|
+
|
|
82
|
+
Layer 3 (last resort):
|
|
83
|
+
→ Fetch specific relevant files only (never fetch all files)
|
|
84
|
+
→ Prioritize: main entry point, config files, key modules
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Token Rules for GitHub
|
|
88
|
+
|
|
89
|
+
- README alone answers ~70% of "what does this repo do" questions — always try it first
|
|
90
|
+
- Never fetch more than 3 files in a single research turn
|
|
91
|
+
- If a file exceeds ~300 lines, read only the top (imports + class/function signatures)
|
|
92
|
+
- Decode base64 content from API before passing to context
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## URL Protocol
|
|
97
|
+
|
|
98
|
+
Use when the user gives a specific non-GitHub URL (docs, articles, blogs, etc.)
|
|
99
|
+
|
|
100
|
+
### Step 1 — Assess the URL type
|
|
101
|
+
|
|
102
|
+
| Site type | Likely works with | Notes |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| Static docs / MDN / ReadTheDocs | `read_url_content` | Fast, clean, cheap |
|
|
105
|
+
| News articles / blogs | `read_url_content` | Usually fine |
|
|
106
|
+
| SPAs / React/Next.js apps | `browser_subagent` | JS-rendered |
|
|
107
|
+
| Auth-gated pages | `browser_subagent` | Needs login |
|
|
108
|
+
| Raw GitHub files (raw.githubusercontent) | `read_url_content` | Direct text |
|
|
109
|
+
|
|
110
|
+
### Step 2 — Layered Fetch
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
Layer 1 — Skim
|
|
114
|
+
→ Fetch the URL with read_url_content
|
|
115
|
+
→ Read only headings (H1, H2, H3) and first paragraph
|
|
116
|
+
→ Does this page contain what the user needs? NO → try a different URL or search. YES → continue.
|
|
117
|
+
|
|
118
|
+
Layer 2 — Targeted Extract
|
|
119
|
+
→ If the page has anchor links (e.g. /docs/page#section), fetch with the anchor
|
|
120
|
+
→ Extract only the relevant section (200–500 tokens max)
|
|
121
|
+
→ Can you answer? YES → STOP.
|
|
122
|
+
|
|
123
|
+
Layer 3 — Full Fetch
|
|
124
|
+
→ Fetch full page, strip boilerplate (nav, footer, ads, cookie banners, sidebars)
|
|
125
|
+
→ Cap at 2000 tokens. Summarize before passing to answer.
|
|
126
|
+
|
|
127
|
+
Layer 4 — Browser Subagent (last resort only)
|
|
128
|
+
→ Use ONLY if read_url_content returns empty, garbled, or JS-placeholder content
|
|
129
|
+
→ Instruct subagent: "Navigate to [URL], wait for content to load, extract [specific section]"
|
|
130
|
+
→ Do NOT use browser_subagent for static pages — it's expensive
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### What to Strip from Fetched Pages
|
|
134
|
+
|
|
135
|
+
Always remove before using fetched content:
|
|
136
|
+
- Navigation menus and breadcrumbs
|
|
137
|
+
- Cookie banners and GDPR notices
|
|
138
|
+
- "Related articles" / "You might also like" blocks
|
|
139
|
+
- Footer content (copyright, links)
|
|
140
|
+
- Social share buttons
|
|
141
|
+
- Ads and sponsored content
|
|
142
|
+
|
|
143
|
+
Extract and keep:
|
|
144
|
+
- Main article / documentation body
|
|
145
|
+
- Code blocks
|
|
146
|
+
- Tables with data
|
|
147
|
+
- Numbered steps or procedures
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Search Protocol
|
|
152
|
+
|
|
153
|
+
Use when the user gives a topic, question, or query — not a specific URL.
|
|
154
|
+
|
|
155
|
+
### Step 1 — Sharpen the Query Before Searching
|
|
156
|
+
|
|
157
|
+
Do NOT search the raw user query. Transform it first:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
Raw: "how to deploy fastapi on aws"
|
|
161
|
+
Sharpened: "fastapi AWS deployment tutorial 2024"
|
|
162
|
+
|
|
163
|
+
Raw: "python async vs threads"
|
|
164
|
+
Sharpened: "Python asyncio vs threading performance comparison"
|
|
165
|
+
|
|
166
|
+
Raw: "best way to structure react project"
|
|
167
|
+
Sharpened: "React project folder structure best practices"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Query sharpening rules:**
|
|
171
|
+
- Add specificity: version numbers, technology names, "tutorial" / "guide" / "comparison"
|
|
172
|
+
- Add recency if relevant: current year
|
|
173
|
+
- Remove filler words: "how do I", "what is the", "can you explain"
|
|
174
|
+
- For code questions: add the language + framework name explicitly
|
|
175
|
+
|
|
176
|
+
### Step 2 — Search and Select
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
1. Run search_web with the sharpened query
|
|
180
|
+
2. Get results (titles + snippets)
|
|
181
|
+
3. Scan titles + snippets ONLY — do not fetch yet
|
|
182
|
+
4. Pick the TOP 1-2 most relevant results (max 3 in complex cases)
|
|
183
|
+
5. Skip results from: forums (if docs exist), aggregator blogs, paywalled sites
|
|
184
|
+
6. Prefer: official docs, GitHub repos, well-known tech blogs, academic sources
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Step 3 — Fetch Selected Results
|
|
188
|
+
|
|
189
|
+
Apply the URL Protocol (above) to each selected URL.
|
|
190
|
+
Process results one at a time — only fetch the second URL if the first didn't answer the question.
|
|
191
|
+
|
|
192
|
+
### Token Rules for Search
|
|
193
|
+
|
|
194
|
+
- Never read more than 3 URLs per search query
|
|
195
|
+
- If the snippet already contains the answer → do NOT fetch the full page, use the snippet
|
|
196
|
+
- For factual questions (dates, names, simple facts) → snippet is usually enough
|
|
197
|
+
- For procedural questions (how to do X) → fetch 1 relevant page, targeted section only
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Multi-URL Protocol
|
|
202
|
+
|
|
203
|
+
Use when the user provides a list of URLs to compare or summarize.
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
1. Skim all URLs first (Layer 1 fetch for each)
|
|
207
|
+
2. Group by relevance to the user's question
|
|
208
|
+
3. Deep-fetch only the most relevant 1-3 URLs
|
|
209
|
+
4. Summarize each in 3-5 sentences before combining
|
|
210
|
+
5. Never dump raw content from multiple pages — always summarize per-source first
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## File Protocol
|
|
216
|
+
|
|
217
|
+
Use when URL points directly to a file (PDF, .txt, .md, .csv, etc.)
|
|
218
|
+
|
|
219
|
+
- `.md` / `.txt` / `.csv` → `read_url_content` works directly, read full content
|
|
220
|
+
- `.pdf` → Use browser_subagent or a PDF extraction tool; extract text only
|
|
221
|
+
- `.json` / `.yaml` → `read_url_content`, parse structure, summarize schema + key values
|
|
222
|
+
- Large files (>500 lines) → Read first 100 lines + last 20 lines + search for relevant sections
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Anti-Patterns (Never Do These)
|
|
227
|
+
|
|
228
|
+
| Anti-pattern | Why it's bad | Do this instead |
|
|
229
|
+
|---|---|---|
|
|
230
|
+
| Fetching full page for a simple fact | Wastes 1000s of tokens | Use snippet or targeted anchor |
|
|
231
|
+
| Using browser_subagent for static sites | Very expensive | Use read_url_content first |
|
|
232
|
+
| Searching with the raw user query | Vague results | Sharpen query first |
|
|
233
|
+
| Fetching 5+ search results | Token explosion | Max 3, stop when answered |
|
|
234
|
+
| Dumping raw HTML into context | Noisy, wasteful | Always strip to Markdown |
|
|
235
|
+
| Fetching "just in case" | Unnecessary tokens | Only fetch what's needed to answer |
|
|
236
|
+
| Re-fetching the same URL | Redundant | Cache result in context, reuse |
|
|
237
|
+
| Fetching entire GitHub repo | Extremely wasteful | README + targeted files only |
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Decision Flowchart (Quick Reference)
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
Input received
|
|
245
|
+
│
|
|
246
|
+
├─ GitHub URL?
|
|
247
|
+
│ ├─ Fetch README + metadata via API
|
|
248
|
+
│ ├─ Answered? → STOP
|
|
249
|
+
│ ├─ Need more? → Fetch file tree, pick 1-3 files
|
|
250
|
+
│ └─ Still need more? → Fetch specific files only
|
|
251
|
+
│
|
|
252
|
+
├─ Specific URL?
|
|
253
|
+
│ ├─ Try read_url_content → skim headings
|
|
254
|
+
│ ├─ Answered? → STOP
|
|
255
|
+
│ ├─ Need more? → Targeted section fetch
|
|
256
|
+
│ ├─ Still need more? → Full fetch, stripped
|
|
257
|
+
│ └─ JS-rendered / broken? → browser_subagent (last resort)
|
|
258
|
+
│
|
|
259
|
+
├─ Topic/query?
|
|
260
|
+
│ ├─ Sharpen query
|
|
261
|
+
│ ├─ search_web → scan snippets
|
|
262
|
+
│ ├─ Snippet enough? → Answer from snippet, STOP
|
|
263
|
+
│ ├─ Need more? → Fetch top 1 result (targeted)
|
|
264
|
+
│ └─ Still need more? → Fetch top 2nd result (targeted)
|
|
265
|
+
│
|
|
266
|
+
└─ List of URLs?
|
|
267
|
+
├─ Skim all (Layer 1 each)
|
|
268
|
+
├─ Deep fetch top 1-3 relevant ones
|
|
269
|
+
└─ Summarize per-source, then combine
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Output Format Rules
|
|
275
|
+
|
|
276
|
+
After fetching, structure your response as:
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Source: [URL or "Web search for: query"]
|
|
280
|
+
Summary: [2-5 sentences of what was found]
|
|
281
|
+
Answer: [Direct answer to user's question]
|
|
282
|
+
Confidence: [High / Medium / Low — based on source quality]
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
For multiple sources:
|
|
286
|
+
```
|
|
287
|
+
Source 1: ...
|
|
288
|
+
Source 2: ...
|
|
289
|
+
Combined Answer: ...
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Never output:
|
|
293
|
+
- Raw HTML fragments
|
|
294
|
+
- Full page dumps
|
|
295
|
+
- Unattributed information
|
|
296
|
+
- More than needed to answer the question
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## Token Budget Guide
|
|
301
|
+
|
|
302
|
+
| Operation | Approximate token cost | When to use |
|
|
303
|
+
|---|---|---|
|
|
304
|
+
| GitHub README fetch | ~300–800 tokens | Always first for repos |
|
|
305
|
+
| GitHub API metadata | ~200 tokens | Always for repos |
|
|
306
|
+
| Skim (headings only) | ~100–200 tokens | Always first for URLs |
|
|
307
|
+
| Targeted section fetch | ~300–600 tokens | When skim isn't enough |
|
|
308
|
+
| Full page fetch (stripped) | ~1000–2000 tokens | Only when targeted fails |
|
|
309
|
+
| browser_subagent | ~2000–5000 tokens | Last resort only |
|
|
310
|
+
| Search snippet scan | ~300–500 tokens | Always before fetching |
|
|
311
|
+
|
|
312
|
+
**Rule of thumb:** If you're about to spend >2000 tokens on a fetch, ask yourself if there's a cheaper path first.
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Limitations
|
|
317
|
+
|
|
318
|
+
- **JavaScript Reliance**: Standard fetching may not fully render Single Page Applications (SPAs). You must fallback to `browser_subagent` for these, which is slower and more expensive.
|
|
319
|
+
- **Paywalls & Protections**: This skill cannot bypass CAPTCHAs, bot protections (e.g., strict Cloudflare rules), or hard paywalls.
|
|
320
|
+
- **GitHub API Limits**: Frequent GitHub API requests without authentication may hit rate limits.
|
|
@@ -86,7 +86,7 @@ Provide verification steps to ensure everything works:
|
|
|
86
86
|
tmpdir="$(mktemp -d)"
|
|
87
87
|
trap 'rm -rf "$tmpdir"' EXIT
|
|
88
88
|
curl -fsSLo "$tmpdir/homebrew-install.sh" https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
|
|
89
|
-
|
|
89
|
+
cat "$tmpdir/homebrew-install.sh" # review the full installer before executing
|
|
90
90
|
/bin/bash "$tmpdir/homebrew-install.sh"
|
|
91
91
|
|
|
92
92
|
# Install Node.js
|
|
@@ -102,7 +102,7 @@ sudo apt update
|
|
|
102
102
|
tmpdir="$(mktemp -d)"
|
|
103
103
|
trap 'rm -rf "$tmpdir"' EXIT
|
|
104
104
|
curl -fsSLo "$tmpdir/nodesource-setup.sh" https://deb.nodesource.com/setup_20.x
|
|
105
|
-
|
|
105
|
+
cat "$tmpdir/nodesource-setup.sh" # review the full installer before sudo
|
|
106
106
|
sudo -E bash "$tmpdir/nodesource-setup.sh"
|
|
107
107
|
sudo apt install -y nodejs
|
|
108
108
|
\`\`\`
|
|
@@ -37,7 +37,7 @@ For reliable automatic triggering, use Claude Code hooks. Install with `--with-h
|
|
|
37
37
|
tmpdir="$(mktemp -d)"
|
|
38
38
|
trap 'rm -rf "$tmpdir"' EXIT
|
|
39
39
|
curl -fsSLo "$tmpdir/makepad-skills-install.sh" https://raw.githubusercontent.com/ZhangHanDong/makepad-skills/main/install.sh
|
|
40
|
-
|
|
40
|
+
cat "$tmpdir/makepad-skills-install.sh" # review the full installer before executing
|
|
41
41
|
bash "$tmpdir/makepad-skills-install.sh" --with-hooks
|
|
42
42
|
```
|
|
43
43
|
|
|
@@ -144,7 +144,7 @@ brew install fluxcd/tap/flux
|
|
|
144
144
|
tmpdir="$(mktemp -d)"
|
|
145
145
|
trap 'rm -rf "$tmpdir"' EXIT
|
|
146
146
|
curl -fsSLo "$tmpdir/flux-install.sh" https://fluxcd.io/install.sh
|
|
147
|
-
|
|
147
|
+
cat "$tmpdir/flux-install.sh" # review the full installer before sudo
|
|
148
148
|
sudo bash "$tmpdir/flux-install.sh"
|
|
149
149
|
|
|
150
150
|
# Bootstrap Flux
|
|
@@ -76,7 +76,7 @@ brew install linkerd
|
|
|
76
76
|
tmpdir="$(mktemp -d)"
|
|
77
77
|
trap 'rm -rf "$tmpdir"' EXIT
|
|
78
78
|
curl --proto '=https' --tlsv1.2 -sSfL https://run.linkerd.io/install -o "$tmpdir/linkerd-install.sh"
|
|
79
|
-
|
|
79
|
+
cat "$tmpdir/linkerd-install.sh" # review the full installer before executing
|
|
80
80
|
sh "$tmpdir/linkerd-install.sh"
|
|
81
81
|
|
|
82
82
|
# Validate cluster
|