opencode-skills-collection 4.0.36 → 4.0.38
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 +6 -3
- package/bundled-skills/.antigravity-install-manifest.json +7 -1
- package/bundled-skills/agent-harness-fault-injection/SKILL.md +250 -0
- package/bundled-skills/audit-agent-run-evidence/SKILL.md +165 -0
- package/bundled-skills/boost-asio-pro/SKILL.md +172 -0
- package/bundled-skills/boost-asio-pro/references/build.md +88 -0
- package/bundled-skills/boost-asio-pro/references/classic-boost.md +33 -0
- package/bundled-skills/boost-asio-pro/references/coroutines.md +415 -0
- package/bundled-skills/boost-asio-pro/references/pre-cpp20.md +164 -0
- package/bundled-skills/boost-asio-pro/references/ssl.md +38 -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 +1 -1
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/users/aas-core.md +9 -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/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +3 -3
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/multi-source-search/SKILL.md +139 -0
- package/bundled-skills/multi-source-search/references/report-schema.md +47 -0
- package/bundled-skills/multi-source-search/scripts/validate_report.py +221 -0
- package/bundled-skills/review-multi-agent-orchestration/SKILL.md +201 -0
- package/bundled-skills/ui-slop-score/SKILL.md +80 -0
- package/bundled-skills/youtube-summarizer/SKILL.md +21 -7
- package/bundled-skills/youtube-summarizer/scripts/extract-transcript.py +45 -12
- package/package.json +3 -2
- package/skills_index.json +175 -0
package/README.md
CHANGED
|
@@ -208,14 +208,17 @@ skipped silently. Re-running the pipeline with the same patches is idempotent.
|
|
|
208
208
|
|
|
209
209
|
## Development
|
|
210
210
|
|
|
211
|
-
**Requirements:**
|
|
211
|
+
**Requirements:** Bun ≥ 1.3
|
|
212
212
|
|
|
213
213
|
```bash
|
|
214
214
|
# Install dependencies
|
|
215
|
-
|
|
215
|
+
bun install
|
|
216
216
|
|
|
217
217
|
# Build
|
|
218
|
-
|
|
218
|
+
bun run build
|
|
219
|
+
|
|
220
|
+
# Test
|
|
221
|
+
bun test
|
|
219
222
|
|
|
220
223
|
# Output is in dist/
|
|
221
224
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"updatedAt": "2026-08-
|
|
3
|
+
"updatedAt": "2026-08-21T00:34:53.602Z",
|
|
4
4
|
"entries": [
|
|
5
5
|
"00-andruia-consultant",
|
|
6
6
|
"007",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"agent-evaluation",
|
|
34
34
|
"agent-evaluation-reporting",
|
|
35
35
|
"agent-framework-azure-ai-py",
|
|
36
|
+
"agent-harness-fault-injection",
|
|
36
37
|
"agent-manager-skill",
|
|
37
38
|
"agent-memory",
|
|
38
39
|
"agent-memory-mcp",
|
|
@@ -171,6 +172,7 @@
|
|
|
171
172
|
"atlas-ledger",
|
|
172
173
|
"attack-tree-construction",
|
|
173
174
|
"audio-transcriber",
|
|
175
|
+
"audit-agent-run-evidence",
|
|
174
176
|
"audit-context-building",
|
|
175
177
|
"audit-skills",
|
|
176
178
|
"auri-core",
|
|
@@ -349,6 +351,7 @@
|
|
|
349
351
|
"blockrun",
|
|
350
352
|
"blog-writing-guide",
|
|
351
353
|
"blueprint",
|
|
354
|
+
"boost-asio-pro",
|
|
352
355
|
"box-automation",
|
|
353
356
|
"brain-to-docs",
|
|
354
357
|
"brainstorming",
|
|
@@ -1261,6 +1264,7 @@
|
|
|
1261
1264
|
"multi-agent-task-orchestrator",
|
|
1262
1265
|
"multi-cloud-architecture",
|
|
1263
1266
|
"multi-platform-apps-multi-platform",
|
|
1267
|
+
"multi-source-search",
|
|
1264
1268
|
"n8n-agents",
|
|
1265
1269
|
"n8n-binary-and-data",
|
|
1266
1270
|
"n8n-code-javascript",
|
|
@@ -1531,6 +1535,7 @@
|
|
|
1531
1535
|
"reverse-engineer",
|
|
1532
1536
|
"review-and-simplify-changes",
|
|
1533
1537
|
"review-animations",
|
|
1538
|
+
"review-multi-agent-orchestration",
|
|
1534
1539
|
"review-swarm",
|
|
1535
1540
|
"revops",
|
|
1536
1541
|
"rich-elicitation",
|
|
@@ -1870,6 +1875,7 @@
|
|
|
1870
1875
|
"ui-setup",
|
|
1871
1876
|
"ui-skills",
|
|
1872
1877
|
"ui-skills-root",
|
|
1878
|
+
"ui-slop-score",
|
|
1873
1879
|
"ui-tokens",
|
|
1874
1880
|
"ui-update",
|
|
1875
1881
|
"ui-ux-designer",
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-harness-fault-injection
|
|
3
|
+
description: "Use when an agent workflow needs deterministic recovery evidence for sandbox, MCP/tool, worker, checkpoint, memory, or orchestration failures."
|
|
4
|
+
category: development
|
|
5
|
+
risk: safe
|
|
6
|
+
source: self
|
|
7
|
+
source_type: self
|
|
8
|
+
date_added: "2026-08-19"
|
|
9
|
+
author: Whxuan0701
|
|
10
|
+
tags: [agent-harness, fault-injection, recovery, state-machine, mcp, multi-agent]
|
|
11
|
+
tools: [claude, cursor, gemini, codex-cli]
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Agent Harness Fault Injection
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
Use a deterministic, non-production fault schedule to test whether an agent
|
|
19
|
+
workflow preserves state, budgets, safety boundaries, and evidence when a
|
|
20
|
+
dependency fails. The output is a small fault matrix, an event timeline, and a
|
|
21
|
+
verdict that distinguishes recovered, contained, unrecoverable, and
|
|
22
|
+
inconclusive runs.
|
|
23
|
+
|
|
24
|
+
## When to Use This Skill
|
|
25
|
+
|
|
26
|
+
- Use when a multi-step agent, state machine, loop, or multi-agent workflow has a new recovery path.
|
|
27
|
+
- Use when sandbox execution, an MCP/tool call, a worker, a checkpoint store, or memory can time out or disappear.
|
|
28
|
+
- Use before claiming retry, resume, deadline, isolation, or partial-failure behavior is production-ready.
|
|
29
|
+
- Use when a regression needs reproducible failure evidence instead of a random chaos run.
|
|
30
|
+
|
|
31
|
+
Do not use this skill against a production target, real user data, live credentials,
|
|
32
|
+
or an unbounded external service. Convert those cases to a local simulator or an
|
|
33
|
+
authorized staging harness first.
|
|
34
|
+
|
|
35
|
+
## Safety and Boundary Preconditions
|
|
36
|
+
|
|
37
|
+
1. Freeze the workflow revision, model/prompt configuration, tool schemas, seed,
|
|
38
|
+
input fixture, timeout, retry budget, deadline, and expected terminal states.
|
|
39
|
+
2. Run in a disposable sandbox with synthetic inputs and stubbed tools. Keep
|
|
40
|
+
network disabled unless the test explicitly needs a local test server.
|
|
41
|
+
3. Make every injected failure an in-memory or fixture-controlled event. Never
|
|
42
|
+
delete real data, revoke real credentials, kill an unrelated process, or
|
|
43
|
+
mutate a live service to create a failure.
|
|
44
|
+
4. Record the test scope and a run identifier before starting. A missing scope,
|
|
45
|
+
fixture, or recovery contract makes the verdict `inconclusive`.
|
|
46
|
+
|
|
47
|
+
## Recovery Contract
|
|
48
|
+
|
|
49
|
+
Write the invariant before injecting a fault. A useful contract names the state
|
|
50
|
+
that must survive and the side effects that must not repeat:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
After recovery, resume from the latest durable checkpoint, preserve the task
|
|
54
|
+
identity and safety policy, spend no more than the remaining retry/deadline
|
|
55
|
+
budget, and commit each externally visible effect at most once.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Model the workflow with explicit states. For example:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
created -> running -> checkpointed -> waiting_for_tool
|
|
62
|
+
| |
|
|
63
|
+
v v
|
|
64
|
+
failed <--------- recovering -> resumed -> completed
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
For each transition, define the owner, durable fields, allowed retry count,
|
|
68
|
+
and terminal behavior. In-memory values are not checkpoints unless the harness
|
|
69
|
+
proves they survive the simulated restart.
|
|
70
|
+
|
|
71
|
+
## Fault Matrix
|
|
72
|
+
|
|
73
|
+
Select the smallest set of faults that covers the new recovery logic. Do not
|
|
74
|
+
randomize the schedule until a deterministic schedule has passed.
|
|
75
|
+
|
|
76
|
+
| Fault | Injection boundary | Required observation | Expected containment |
|
|
77
|
+
|---|---|---|---|
|
|
78
|
+
| sandbox denial | before a tool starts | no unsafe side effect; reason is retained | retry only when policy allows |
|
|
79
|
+
| MCP/tool timeout | after request id is assigned | timeout is attributed to that request | bounded retry with same idempotency key |
|
|
80
|
+
| worker restart | after checkpoint write | worker reloads the same task version | resume from latest checkpoint |
|
|
81
|
+
| missing/stale checkpoint | before resume | stale data is rejected or marked | stop safely; never invent progress |
|
|
82
|
+
| parallel branch failure | one branch after fan-out | sibling status is preserved | join policy decides retry, degrade, or stop |
|
|
83
|
+
| memory loss | clear ephemeral context | durable facts are reconstructed | ask or stop when required facts are absent |
|
|
84
|
+
| retry/deadline exhaustion | on the final attempt | no extra call is scheduled | terminal `failed` or `timed_out` |
|
|
85
|
+
|
|
86
|
+
## Deterministic Injection Schedule
|
|
87
|
+
|
|
88
|
+
Use event numbers rather than wall-clock randomness. A schedule should be
|
|
89
|
+
portable across harnesses:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"seed": "harness-fixture-07",
|
|
94
|
+
"faults": [
|
|
95
|
+
{"event": "tool.call", "ordinal": 2, "kind": "timeout", "tool": "search"},
|
|
96
|
+
{"event": "worker.start", "ordinal": 2, "kind": "restart"},
|
|
97
|
+
{"event": "branch.join", "ordinal": 1, "kind": "partial_failure", "branch": "summarize"}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The harness should emit the schedule, not merely the seed. Keep fault identity
|
|
103
|
+
separate from the observed error so a wrapper cannot accidentally turn a
|
|
104
|
+
timeout into a generic failure. Run the same schedule twice and compare the
|
|
105
|
+
normalized timeline before trying a different schedule.
|
|
106
|
+
|
|
107
|
+
## Recovery Rules by Boundary
|
|
108
|
+
|
|
109
|
+
### Sandbox and MCP/tool failures
|
|
110
|
+
|
|
111
|
+
- Assign a request id and idempotency key before the call.
|
|
112
|
+
- Distinguish timeout, explicit tool error, invalid output, and policy denial.
|
|
113
|
+
- Retry only the declared retryable classes; preserve the original error and
|
|
114
|
+
attempt count in the evidence.
|
|
115
|
+
- Do not retry a side effect unless the tool contract says the key is safe to
|
|
116
|
+
replay. A read timeout is not proof that a write did not happen.
|
|
117
|
+
- When the deadline or retry budget is exhausted, emit one terminal event and
|
|
118
|
+
stop scheduling work.
|
|
119
|
+
|
|
120
|
+
### Worker restart and checkpoints
|
|
121
|
+
|
|
122
|
+
- Persist task id, workflow version, state name, completed effects, remaining
|
|
123
|
+
budgets, and the checkpoint sequence before a restart test.
|
|
124
|
+
- Reload the newest valid checkpoint and reject a future-version or corrupted
|
|
125
|
+
checkpoint instead of guessing.
|
|
126
|
+
- Verify that resumption does not replay a committed effect. If exactly-once
|
|
127
|
+
cannot be proven, downgrade the verdict and require reconciliation.
|
|
128
|
+
|
|
129
|
+
### Parallel branches
|
|
130
|
+
|
|
131
|
+
Represent each branch as its own child attempt. The join record must retain
|
|
132
|
+
success, failure, timeout, and not-started states. Choose one predeclared join
|
|
133
|
+
policy:
|
|
134
|
+
|
|
135
|
+
- `all_required`: any required branch failure stops the join;
|
|
136
|
+
- `best_effort`: continue with an explicit degraded marker;
|
|
137
|
+
- `compensate`: run a bounded compensating action and then stop or resume.
|
|
138
|
+
|
|
139
|
+
Never let a successful sibling erase a failed branch from the final ledger.
|
|
140
|
+
|
|
141
|
+
### Memory loss
|
|
142
|
+
|
|
143
|
+
Clear only the ephemeral context named in the schedule. Rebuild from the
|
|
144
|
+
checkpoint and durable evidence, then check that the agent does not fabricate
|
|
145
|
+
missing user intent, tool output, or approval. If a required fact is absent,
|
|
146
|
+
the safe result is `inconclusive` or a human clarification state.
|
|
147
|
+
|
|
148
|
+
## Budgets and Terminal Verdicts
|
|
149
|
+
|
|
150
|
+
Track remaining attempts and remaining time after every event. Do not reset a
|
|
151
|
+
budget on a worker restart or branch retry. Use these verdicts:
|
|
152
|
+
|
|
153
|
+
| Verdict | Meaning |
|
|
154
|
+
|---|---|
|
|
155
|
+
| `recovered` | The declared invariant held and the workflow completed within budget. |
|
|
156
|
+
| `contained_failure` | The fault was isolated and the workflow stopped safely as designed. |
|
|
157
|
+
| `unrecoverable` | Recovery violated an invariant, repeated a side effect, crossed a boundary, or exceeded budget. |
|
|
158
|
+
| `inconclusive` | The fixture, checkpoint, contract, or evidence was insufficient to judge. |
|
|
159
|
+
|
|
160
|
+
`contained_failure` is not autonomous success. Report it separately from
|
|
161
|
+
completed work and include the terminal reason.
|
|
162
|
+
|
|
163
|
+
## Evidence Output
|
|
164
|
+
|
|
165
|
+
Produce one machine-readable record and one concise human summary. Every event
|
|
166
|
+
should include `run_id`, monotonic `seq`, logical `time`, `state_before`,
|
|
167
|
+
`state_after`, `actor`, `event`, `fault_id` (when injected), `attempt`,
|
|
168
|
+
`checkpoint_seq`, `retry_remaining`, `deadline_remaining_ms`, and a redacted
|
|
169
|
+
`evidence_ref`.
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"run_id": "fi-2026-08-19-07",
|
|
174
|
+
"verdict": "recovered",
|
|
175
|
+
"invariants": {"resume_from_checkpoint": "pass", "effect_at_most_once": "pass", "budget": "pass"},
|
|
176
|
+
"faults": [{"id": "f1", "kind": "tool_timeout", "at": "tool.call#2", "handled": true}],
|
|
177
|
+
"timeline": [
|
|
178
|
+
{"seq": 4, "event": "checkpoint.write", "checkpoint_seq": 3},
|
|
179
|
+
{"seq": 5, "event": "tool.timeout", "fault_id": "f1", "retry_remaining": 1},
|
|
180
|
+
{"seq": 8, "event": "workflow.completed", "checkpoint_seq": 4}
|
|
181
|
+
],
|
|
182
|
+
"limitations": ["Tool output was synthetic; no deployed MCP was exercised."]
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The human summary should state the frozen contract, injected schedule, verdict,
|
|
187
|
+
failed invariants, budget consumption, and the narrowest next verification.
|
|
188
|
+
Redact prompts, tokens, private records, and tool payloads; stable references
|
|
189
|
+
are enough for replay.
|
|
190
|
+
|
|
191
|
+
## Example: Local Harness Run
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
Fixture: checkout planner / seed harness-fixture-07
|
|
195
|
+
Schedule: search timeout on call 2; worker restart after checkpoint 3
|
|
196
|
+
Policy: one retry, 2s deadline, all_required branch join
|
|
197
|
+
|
|
198
|
+
Result: recovered
|
|
199
|
+
Proof: checkpoint 3 reloaded, search request key replayed once, no duplicate
|
|
200
|
+
commit, deadline remaining 640ms, final ledger contains both branch outcomes.
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Best Practices
|
|
204
|
+
|
|
205
|
+
- Freeze inputs and schedules so a failure can be replayed from the evidence.
|
|
206
|
+
- Test one boundary at a time, then add a combined schedule for interaction risk.
|
|
207
|
+
- Assert invariants after every recovery transition, not only at final output.
|
|
208
|
+
- Keep attempt-level faults and task-level outcomes in separate ledgers.
|
|
209
|
+
- Treat missing evidence as `inconclusive`, never as a passing recovery.
|
|
210
|
+
|
|
211
|
+
## Limitations
|
|
212
|
+
|
|
213
|
+
- A local stub cannot prove behavior of a deployed model, MCP server, scheduler,
|
|
214
|
+
filesystem, or network.
|
|
215
|
+
- Deterministic schedules cover named paths; they do not estimate random-fault
|
|
216
|
+
frequency or discover unknown failure modes.
|
|
217
|
+
- At-most-once effects require an idempotent, observable contract; a timeline
|
|
218
|
+
alone cannot prove an external write was not duplicated.
|
|
219
|
+
- This skill does not select production SLOs, repair broken workflows, or grant
|
|
220
|
+
permission to test systems outside the declared sandbox.
|
|
221
|
+
|
|
222
|
+
## Security & Safety Notes
|
|
223
|
+
|
|
224
|
+
- Keep tests local-only and read-only by default; use synthetic fixtures and
|
|
225
|
+
fake credentials that cannot access a real account.
|
|
226
|
+
- Require explicit authorization and a disposable staging boundary before any
|
|
227
|
+
test that could contact a non-local service.
|
|
228
|
+
- Do not include destructive commands, exploit payloads, credential material,
|
|
229
|
+
or automatic cleanup of user data in a harness or report.
|
|
230
|
+
- Redact secrets and personal data before storing timelines or attaching them
|
|
231
|
+
to a pull request.
|
|
232
|
+
|
|
233
|
+
## Common Pitfalls
|
|
234
|
+
|
|
235
|
+
- **Problem:** A retry clears the original timeout and hides the fault.
|
|
236
|
+
**Solution:** Keep fault id, original class, attempt, and retry lineage in the ledger.
|
|
237
|
+
- **Problem:** A restart passes because the test reused in-memory state.
|
|
238
|
+
**Solution:** Serialize, clear, and reload only the declared checkpoint fields.
|
|
239
|
+
- **Problem:** A partial fan-out is reported as success.
|
|
240
|
+
**Solution:** Preserve every branch state and apply the predeclared join policy.
|
|
241
|
+
- **Problem:** A missing checkpoint is replaced with guessed progress.
|
|
242
|
+
**Solution:** Stop safely and return `inconclusive` or `unrecoverable` with evidence.
|
|
243
|
+
- **Problem:** A green final answer hides a deadline or duplicate-effect violation.
|
|
244
|
+
**Solution:** Gate the verdict on invariants and remaining budget, not output text alone.
|
|
245
|
+
|
|
246
|
+
## Related Skills
|
|
247
|
+
|
|
248
|
+
- `@agent-evaluation-reporting` - Report autonomous, assisted, failed, timed-out, and invalid outcomes.
|
|
249
|
+
- `@cross-platform-contract-propagation-audit` - Trace recovery fields and status contracts across consumers.
|
|
250
|
+
- `@multi-agent-patterns` - Choose a multi-agent topology before testing its failure behavior.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit-agent-run-evidence
|
|
3
|
+
description: "Use when an agent, harness, gateway, MCP workflow, or multi-step automation claims completion and the available traces, checkpoints, approvals, tool calls, or deployment records must be judged without trusting self-reported success."
|
|
4
|
+
risk: safe
|
|
5
|
+
source: self
|
|
6
|
+
date_added: "2026-08-19"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Audit Agent Run Evidence
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
Turn an end-to-end success statement into independently decidable claims. Reconstruct what happened from available records, grade each claim against the strongest witness, and keep missing evidence distinct from failure.
|
|
14
|
+
|
|
15
|
+
This is a read-only audit. Do not rerun tools, approve actions, resume workers, deploy artifacts, or modify evidence unless the user separately authorizes those actions.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- Auditing a completed or interrupted agent run from traces and artifacts.
|
|
20
|
+
- Checking whether an agent's end-to-end success claim is actually supported.
|
|
21
|
+
- Reviewing MCP, gateway, sandbox, checkpoint, retry, memory, approval, or deployment evidence.
|
|
22
|
+
- Separating autonomous success from human-assisted or merely requested outcomes.
|
|
23
|
+
|
|
24
|
+
Do not use this skill to design instrumentation for a future run or to perform the missing actions. It evaluates evidence that already exists.
|
|
25
|
+
|
|
26
|
+
## Establish the Contract
|
|
27
|
+
|
|
28
|
+
Record these inputs before judging the run:
|
|
29
|
+
|
|
30
|
+
- declared goal and terminal success criteria;
|
|
31
|
+
- run, workflow, task, and parent identifiers;
|
|
32
|
+
- immutable code, configuration, model, prompt, tool-schema, and artifact revisions when available;
|
|
33
|
+
- actors and trust boundaries: orchestrator, worker, sandbox, MCP server, gateway, human approver, CI, and deployment platform;
|
|
34
|
+
- retry, deadline, token, cost, concurrency, and human-escalation budgets;
|
|
35
|
+
- supplied evidence inventory and known collection gaps.
|
|
36
|
+
|
|
37
|
+
Do not silently strengthen the original success criteria. Do not weaken them to match the evidence that happens to exist.
|
|
38
|
+
|
|
39
|
+
## Build a Claim Ledger
|
|
40
|
+
|
|
41
|
+
Split the overall claim into atomic predicates. Give every row a stable claim ID.
|
|
42
|
+
|
|
43
|
+
| Field | Required content |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `claim_id` | Stable identifier |
|
|
46
|
+
| `predicate` | One falsifiable statement |
|
|
47
|
+
| `required_witness` | Source that can independently prove it |
|
|
48
|
+
| `evidence_refs` | Exact event, log, artifact, or record IDs |
|
|
49
|
+
| `counterevidence_refs` | Conflicting records |
|
|
50
|
+
| `coverage` | Required instances versus observed instances |
|
|
51
|
+
| `verdict` | `proven`, `partially_proven`, `contradicted`, or `not_proven` |
|
|
52
|
+
| `gap` | Missing field, actor, interval, or verification |
|
|
53
|
+
|
|
54
|
+
Typical predicates include:
|
|
55
|
+
|
|
56
|
+
- every required step reached its terminal postcondition;
|
|
57
|
+
- sandbox isolation held for every executing worker;
|
|
58
|
+
- each required MCP/tool call has a correlated response;
|
|
59
|
+
- retries respected idempotency and did not duplicate committed effects;
|
|
60
|
+
- a checkpoint was durably written, verified, and actually used for resume;
|
|
61
|
+
- parallel branches satisfied the declared join policy;
|
|
62
|
+
- memory reads cite a versioned source rather than an untracked summary;
|
|
63
|
+
- retry, deadline, token, cost, and escalation budgets were respected;
|
|
64
|
+
- approval was granted by an authorized human for the exact artifact and target;
|
|
65
|
+
- the platform deployed that same artifact and passed the declared health checks.
|
|
66
|
+
|
|
67
|
+
## Normalize Evidence
|
|
68
|
+
|
|
69
|
+
Preserve original records and create a normalized event view with:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"run_id": "run-123",
|
|
74
|
+
"event_id": "evt-42",
|
|
75
|
+
"sequence": 42,
|
|
76
|
+
"observed_at": "RFC3339 timestamp",
|
|
77
|
+
"actor": {"type": "worker", "id": "worker-2"},
|
|
78
|
+
"operation": "mcp.search",
|
|
79
|
+
"state_before": "researching",
|
|
80
|
+
"state_after": "researching",
|
|
81
|
+
"attempt": 2,
|
|
82
|
+
"request_id": "req-9",
|
|
83
|
+
"idempotency_key": "task-7:search:2",
|
|
84
|
+
"input_digest": "sha256:...",
|
|
85
|
+
"output_digest": "sha256:...",
|
|
86
|
+
"checkpoint_seq": 3,
|
|
87
|
+
"parent_event_id": "evt-41",
|
|
88
|
+
"status": "succeeded",
|
|
89
|
+
"evidence_ref": "tool-log:991"
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Use `null` or `unknown` for absent values. Never synthesize IDs, timestamps, digests, costs, approvals, or outcomes.
|
|
94
|
+
|
|
95
|
+
Verify bundle hashes or signatures when supplied. Check duplicate IDs, broken parent links, non-monotonic per-source sequences, impossible state transitions, unaccounted clock skew, and unexplained trace gaps. Treat an integrity failure as counterevidence for claims that depend on the affected records.
|
|
96
|
+
|
|
97
|
+
## Rank Witnesses
|
|
98
|
+
|
|
99
|
+
Prefer the witness closest to the effect:
|
|
100
|
+
|
|
101
|
+
| Claim | Strong witness | Insufficient alone |
|
|
102
|
+
|---|---|---|
|
|
103
|
+
| Code changed | Commit/tree and diff | Agent narration |
|
|
104
|
+
| Test passed | Complete test result bound to revision | Command invocation |
|
|
105
|
+
| MCP effect occurred | Server or provider audit record | Client request |
|
|
106
|
+
| Checkpoint resumed | Durable checkpoint plus verified load event | Checkpoint file exists |
|
|
107
|
+
| Human approved | Authorization-system decision bound to artifact and target | Approval requested |
|
|
108
|
+
| Deployment succeeded | Platform record plus required health checks | Deployment started |
|
|
109
|
+
| Memory grounded a decision | Versioned memory read and citation | Final answer resembles memory |
|
|
110
|
+
|
|
111
|
+
An orchestrator and its child worker are not independent witnesses when they repeat the same unverified result. A cryptographic digest proves byte identity, not semantic correctness.
|
|
112
|
+
|
|
113
|
+
## Reconstruct the Run
|
|
114
|
+
|
|
115
|
+
1. Order events by causal links and per-source sequence; use timestamps only as supporting evidence.
|
|
116
|
+
2. Build the state-transition path and mark every gap or illegal transition.
|
|
117
|
+
3. Link each retry chain by logical operation, request ID, and idempotency key.
|
|
118
|
+
4. Link checkpoints to the state they contain and the resume event that consumes them.
|
|
119
|
+
5. Preserve every parallel branch outcome; apply the declared `all_required`, `quorum`, `first_success`, or other join rule.
|
|
120
|
+
6. Track remaining budgets at each transition. A late success after budget exhaustion is a budget violation.
|
|
121
|
+
7. Bind approvals and deployment records to exact artifact digests and targets.
|
|
122
|
+
|
|
123
|
+
Do not infer successful completion from a final state label when required intermediate predicates are missing.
|
|
124
|
+
|
|
125
|
+
## Assign Verdicts
|
|
126
|
+
|
|
127
|
+
- `proven`: authentic evidence covers every instance of the predicate and no reliable counterevidence remains.
|
|
128
|
+
- `partially_proven`: some required instances or fields are proven and the uncovered portion is named.
|
|
129
|
+
- `contradicted`: reliable evidence conflicts with the predicate.
|
|
130
|
+
- `not_proven`: evidence is absent, circular, unverifiable, or only self-reported.
|
|
131
|
+
|
|
132
|
+
Use `not_proven`, not `contradicted`, for missing logs. Use `contradicted` when the trace shows a failed health check, duplicate effect, unauthorized approver, corrupt checkpoint, skipped required branch, or exhausted budget.
|
|
133
|
+
|
|
134
|
+
The end-to-end verdict cannot be stronger than its weakest required predicate. Optional diagnostics may remain unproven without failing the run if they were never part of the declared contract.
|
|
135
|
+
|
|
136
|
+
## Report
|
|
137
|
+
|
|
138
|
+
Return sections in this order:
|
|
139
|
+
|
|
140
|
+
1. **Scope and evidence inventory** — run identity, declared criteria, records inspected, integrity checks.
|
|
141
|
+
2. **Claim ledger** — one row per predicate with verdict and exact references.
|
|
142
|
+
3. **Reconstructed timeline** — only state-changing, fault, retry, checkpoint, join, approval, and deployment events.
|
|
143
|
+
4. **Gaps and counterevidence** — identify the affected claims and whether collection can still recover the evidence.
|
|
144
|
+
5. **Overall verdict** — one sentence plus the blocking claim IDs.
|
|
145
|
+
|
|
146
|
+
Example conclusion:
|
|
147
|
+
|
|
148
|
+
> `partially_proven`: repository steps C1-C18 and checkpoint recovery C22 are proven, but deployment success is not proven because C31 has only a client-side start event and no platform health result.
|
|
149
|
+
|
|
150
|
+
## Common Mistakes
|
|
151
|
+
|
|
152
|
+
- Treating a successful process exit as proof of the business postcondition.
|
|
153
|
+
- Counting retries as separate successful logical operations.
|
|
154
|
+
- Accepting a child agent's summary as independent corroboration.
|
|
155
|
+
- Calling a checkpoint recoverable without observing a verified reload.
|
|
156
|
+
- Calling an approval request an approval grant.
|
|
157
|
+
- Reporting percentages without listing the denominator and missing instances.
|
|
158
|
+
- Recommending instrumentation as though it were evidence from the completed run.
|
|
159
|
+
|
|
160
|
+
## Limitations
|
|
161
|
+
|
|
162
|
+
- An audit cannot recover facts that no trusted source recorded.
|
|
163
|
+
- Provider logs may establish external effects without proving the agent's internal reasoning.
|
|
164
|
+
- Redaction may be necessary for secrets and personal data; record the redaction scope and preserve stable references.
|
|
165
|
+
- If evidence collection would mutate external state or expose sensitive data, stop and request authorization.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: boost-asio-pro
|
|
3
|
+
description: "Use when writing asynchronous C++ networking code with Boost.Asio or standalone Asio — TCP/UDP servers and clients, SSL/TLS, timers, strands, composed async ops. Covers io_context, co_spawn, awaitable, async_read/async_write, asio::spawn, yield_context, and pre-C++20 callback styles."
|
|
4
|
+
category: development
|
|
5
|
+
risk: safe
|
|
6
|
+
source: community
|
|
7
|
+
source_repo: alexprivalov/boost-asio-skill
|
|
8
|
+
source_type: community
|
|
9
|
+
date_added: "2026-08-18"
|
|
10
|
+
author: alexprivalov
|
|
11
|
+
tags: [cpp, boost, asio, async, networking, coroutines]
|
|
12
|
+
tools: [claude, cursor, gemini]
|
|
13
|
+
license: "MIT"
|
|
14
|
+
license_source: "https://github.com/alexprivalov/boost-asio-skill/blob/main/LICENSE"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Boost.Asio / standalone Asio
|
|
18
|
+
|
|
19
|
+
## Overview
|
|
20
|
+
|
|
21
|
+
Write async C++ networking code that compiles on the *user's* Boost, not the newest one. Asio's API changed shape three times (classic `io_service` → `io_context` → C++20 coroutines) and most Asio code on the internet is from the first era, so **pick the style from the toolchain first**, then follow that style's reference file.
|
|
22
|
+
|
|
23
|
+
**References:** [Boost.Asio](https://www.boost.org/doc/libs/latest/doc/html/boost_asio.html) · [standalone Asio](https://think-async.com/Asio/)
|
|
24
|
+
|
|
25
|
+
Asio's API changed shape three times, so the same task has three correct answers depending on the Boost version in front of you. This skill makes the agent establish that version first, then apply the rules that are genuinely easy to get wrong — strand versus write serialization, buffer and connection lifetime, composed reads for framing — and finally check its own output against a list before calling it done.
|
|
26
|
+
|
|
27
|
+
## When to Use This Skill
|
|
28
|
+
|
|
29
|
+
- Use when writing or reviewing async C++ networking code with Boost.Asio or standalone Asio: TCP/UDP servers and clients, SSL/TLS streams, timers, resolvers.
|
|
30
|
+
- Use when the code involves `io_context`, `io_service`, `co_spawn`, `awaitable`, `async_read`, `async_write`, `strand`, `asio::spawn`, `yield_context`, or completion-handler callbacks.
|
|
31
|
+
- Use when the target toolchain is old: an older Boost or a pre-C++20 standard, where coroutine examples will not compile.
|
|
32
|
+
- Use when async code compiles but misbehaves: interleaved writes, dangling buffers, sockets closing early, `operation_aborted` treated as an error.
|
|
33
|
+
|
|
34
|
+
## Step 1: pick the style (do this before writing code)
|
|
35
|
+
|
|
36
|
+
Determine the Boost (or Asio) version and the C++ standard actually in use — `find_package(Boost)` output, `dpkg -l libboost-dev`, `brew info boost`, `CMAKE_CXX_STANDARD`, or ask. Do not assume the newest.
|
|
37
|
+
|
|
38
|
+
| Boost | C++ std | Style | Read |
|
|
39
|
+
|-------|---------|-------|------|
|
|
40
|
+
| ≥ 1.77 | C++20 | Coroutines (`co_await` + `awaitable<T>`) — preferred | [references/coroutines.md](references/coroutines.md) |
|
|
41
|
+
| ≥ 1.74 | C++11–17 | Completion handlers (callbacks) — the portable baseline | [references/pre-cpp20.md](references/pre-cpp20.md) |
|
|
42
|
+
| ≥ 1.80 | C++11–17 | Stackful `asio::spawn` + `yield_context` (links Boost.Coroutine — not header-only) | [references/pre-cpp20.md](references/pre-cpp20.md) |
|
|
43
|
+
| 1.62–1.65 | C++11 | Classic `io_service` / `strand.wrap` / `expires_from_now` | [references/classic-boost.md](references/classic-boost.md) |
|
|
44
|
+
|
|
45
|
+
SSL/TLS in any style: [references/ssl.md](references/ssl.md). CMake for any style: [references/build.md](references/build.md).
|
|
46
|
+
|
|
47
|
+
`io_context`, `make_strand`, `bind_executor`, `steady_timer`, `signal_set`, `async_read`/`async_write`/`async_read_until`, buffers and `resolver` are **library** features — identical in the coroutine and callback styles. Only the suspension mechanism differs.
|
|
48
|
+
|
|
49
|
+
## Step 2: version floors (verified by compiling, not from docs)
|
|
50
|
+
|
|
51
|
+
Reach for one of these and the build breaks on older distros:
|
|
52
|
+
|
|
53
|
+
| Feature | Floor |
|
|
54
|
+
|---------|-------|
|
|
55
|
+
| `experimental/awaitable_operators.hpp` (the `\|\|` / `&&` operators) | **Boost ≥ 1.77** / Asio ≥ 1.20 |
|
|
56
|
+
| `as_tuple` completion token | **Boost ≥ 1.79** / Asio ≥ 1.21 |
|
|
57
|
+
| `co_composed` (custom composed ops) | **Boost ≥ 1.85** / Asio ≥ 1.30 |
|
|
58
|
+
| 3-arg `asio::spawn(ex, fn, token)` | **Boost ≥ 1.80** (older Boost has only `spawn(ex, fn)`) |
|
|
59
|
+
| `any_io_executor` (`strand<any_io_executor>`, `tcp::socket`'s default executor) | **Boost ≥ 1.74** — the floor for the callback style; below it, use legacy `io_context::strand` |
|
|
60
|
+
| `io_context`, `make_strand`, `expires_after` | **Boost ≥ 1.66** — below it, classic `io_service` |
|
|
61
|
+
|
|
62
|
+
Distro floors that bite: **Debian bookworm ships Boost 1.74** (no `awaitable_operators.hpp` — `#include` fails outright), Ubuntu 20.04 ships 1.71 (no `any_io_executor`), Debian 9 ships 1.62.
|
|
63
|
+
|
|
64
|
+
Language, not library: the chrono literals `250ms` / `30s` are **C++14**. For a true C++11 build write `std::chrono::milliseconds(250)`.
|
|
65
|
+
|
|
66
|
+
## Step 3: the rules that are actually easy to get wrong
|
|
67
|
+
|
|
68
|
+
**A strand does not serialize writes.** A strand serializes handler *execution*, not whole composed operations. Two `async_write`s in flight on the same strand still **interleave bytes on the wire**. Full-duplex (a read loop plus concurrent pushes/replies) needs a per-connection strand **and** an outbound queue with an in-flight flag, so at most one `async_write` exists at a time. This is the single most common wrong answer about Asio.
|
|
69
|
+
|
|
70
|
+
**Buffers do not own memory.** `asio::buffer()` is a view. Storage must outlive the operation: coroutine locals are fine across `co_await` in the same frame; in callback style the same data must become a **member**, not a local.
|
|
71
|
+
|
|
72
|
+
**Connections must outlive their handlers.** `enable_shared_from_this`, and capture `self` in *every* `co_spawn` / handler — read loop, write loop, and each timer.
|
|
73
|
+
|
|
74
|
+
**Frame with composed reads.** `async_read` (fills the buffer exactly) for a length prefix and then the body; never `async_read_some`, which returns short.
|
|
75
|
+
|
|
76
|
+
**Wrap `as_tuple`.** Always `as_tuple(use_awaitable)`. Bare `as_tuple` resolves against the operation's default token and compiles in some contexts, fails in others.
|
|
77
|
+
|
|
78
|
+
**`async_accept(make_strand(...))` changes two things**: it forces an explicit completion token back on the call, and the accepted socket is `basic_stream_socket<tcp, strand<...>>`, not `tcp::socket`. Take it **by value** or with `auto` — binding it to `tcp::socket&` will not compile.
|
|
79
|
+
|
|
80
|
+
**Re-arming a timer resolves the pending wait with `operation_aborted`.** In an idle-timeout loop that is the signal to keep waiting, not an error.
|
|
81
|
+
|
|
82
|
+
**GCC needs `-fcoroutines`** for the C++20 style, and header-only Boost needs `BOOST_ERROR_CODE_HEADER_ONLY` defined in exactly one place (CMake).
|
|
83
|
+
|
|
84
|
+
## Common mistakes
|
|
85
|
+
|
|
86
|
+
| Mistake | Fix |
|
|
87
|
+
|---------|-----|
|
|
88
|
+
| Buffer dangling (local goes out of scope during async op) | Ensure buffer lifetime ≥ operation lifetime; coroutine locals or members, not callback locals |
|
|
89
|
+
| Forgetting `io.run()` | No handlers dispatch without `run()` / `run_one()` |
|
|
90
|
+
| Concurrent socket access without strand | Wrap in `strand<>` or serialize via one coroutine chain |
|
|
91
|
+
| Assuming a strand prevents interleaved writes | Add a write queue — see Step 3 |
|
|
92
|
+
| Using `use_awaitable` where `deferred` suffices | Omit the token (default is `deferred`) unless using `\|\|` / `&&` |
|
|
93
|
+
| Ignoring short reads/writes | Use composed `async_read` / `async_write` / `async_read_until`, not `async_read_some` |
|
|
94
|
+
| Not setting `reuse_address` on the acceptor | Set before `bind`/`listen` or restarts hit "address in use" |
|
|
95
|
+
| SSL operations without a strand | *All* `ssl::stream` ops need strand synchronization |
|
|
96
|
+
| Blocking inside a handler | Never block in a completion handler |
|
|
97
|
+
| Accepting a socket with the wrong executor type | See `async_accept(make_strand(...))` in Step 3 |
|
|
98
|
+
| Requiring the `Boost::system` component | Header-only since 1.74: `Boost::headers` + `BOOST_ERROR_CODE_HEADER_ONLY`. Only classic (pre-1.66) needs the link |
|
|
99
|
+
| Missing `-fcoroutines` on GCC | Build fails — add `$<$<CXX_COMPILER_ID:GNU>:-fcoroutines>` |
|
|
100
|
+
| Writing coroutine code for a Boost that predates it | Do Step 1 first |
|
|
101
|
+
|
|
102
|
+
## Boost.Asio vs standalone Asio
|
|
103
|
+
|
|
104
|
+
Same author, same API — namespace and includes differ.
|
|
105
|
+
|
|
106
|
+
| Aspect | Boost.Asio | Standalone Asio |
|
|
107
|
+
|--------|-----------|-----------------|
|
|
108
|
+
| Namespace / include | `boost::asio` / `<boost/asio.hpp>` | `asio` / `<asio.hpp>` |
|
|
109
|
+
| Error code | `boost::system::error_code` | `asio::error_code` (or `std::error_code`) |
|
|
110
|
+
| Install (brew) | `brew install boost` | `brew install asio` |
|
|
111
|
+
| CMake | `Boost::headers` | manual include path |
|
|
112
|
+
| Version (2025) | 1.87–1.90 (with Boost) | 1.30–1.36 (independent) |
|
|
113
|
+
| Macro prefix | `BOOST_ASIO_` | `ASIO_` |
|
|
114
|
+
|
|
115
|
+
Support both with a shim, then use `net::` throughout:
|
|
116
|
+
```cpp
|
|
117
|
+
#ifdef USE_STANDALONE_ASIO
|
|
118
|
+
#include <asio.hpp>
|
|
119
|
+
namespace net = asio;
|
|
120
|
+
using error_code = asio::error_code;
|
|
121
|
+
#else
|
|
122
|
+
#include <boost/asio.hpp>
|
|
123
|
+
namespace net = boost::asio;
|
|
124
|
+
using error_code = boost::system::error_code;
|
|
125
|
+
#endif
|
|
126
|
+
namespace ssl = net::ssl;
|
|
127
|
+
using tcp = net::ip::tcp;
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Before you call it done
|
|
131
|
+
|
|
132
|
+
Check the code you just wrote against this list:
|
|
133
|
+
|
|
134
|
+
- [ ] Style matches the target Boost version and C++ standard (Step 1), and every API used clears its floor (Step 2).
|
|
135
|
+
- [ ] Every buffer passed to an async op outlives that op — no callback locals, no dangling `string_view`.
|
|
136
|
+
- [ ] At most one `async_write` per socket in flight, enforced by a queue + flag, if anything writes concurrently with reading.
|
|
137
|
+
- [ ] Every async chain on a shared object runs on the same strand; `self` captured in every handler and `co_spawn`.
|
|
138
|
+
- [ ] Framing / delimited reads use composed `async_read` / `async_read_until`.
|
|
139
|
+
- [ ] Errors are handled, not swallowed: `as_tuple(use_awaitable)` destructured, or the callback's `ec` checked, on every op.
|
|
140
|
+
- [ ] `operation_aborted` distinguished from real errors wherever a timer is re-armed or an op is cancelled.
|
|
141
|
+
- [ ] Acceptor sets `reuse_address`; shutdown path closes the acceptor and drains sessions.
|
|
142
|
+
- [ ] CMake has the standard, `-fcoroutines` for GCC (C++20 only), `BOOST_ERROR_CODE_HEADER_ONLY` in one place, and `Boost::coroutine` only if using stackful `spawn`.
|
|
143
|
+
- [ ] It compiles. Build it — most of the mistakes above are compile-time, and the version floors are only real once tested.
|
|
144
|
+
|
|
145
|
+
## Worked examples
|
|
146
|
+
|
|
147
|
+
Three CI-verified implementations of the same full-duplex framed-protocol server, one per style — copy from the one matching Step 1. Paths are relative to this skill directory; if only the skill was installed, they are at https://github.com/alexprivalov/boost-asio-skill/tree/main/examples.
|
|
148
|
+
|
|
149
|
+
- `../../examples/market-data-feed/` — C++20 coroutines (Boost 1.77+; verified 1.83–1.90)
|
|
150
|
+
- `../../examples/market-data-feed-precpp20/` — callbacks, C++11-clean (verified Boost 1.74+, incl. Windows/MSVC)
|
|
151
|
+
- `../../examples/market-data-feed-classic/` — classic `io_service` (verified back to Boost 1.62 / Debian 9)
|
|
152
|
+
|
|
153
|
+
## Official documentation
|
|
154
|
+
|
|
155
|
+
- Overview: https://www.boost.org/doc/libs/latest/doc/html/boost_asio/overview.html
|
|
156
|
+
- Reference: https://www.boost.org/doc/libs/latest/doc/html/boost_asio/reference.html
|
|
157
|
+
- Examples: https://www.boost.org/doc/libs/latest/doc/html/boost_asio/examples.html
|
|
158
|
+
|
|
159
|
+
## Limitations
|
|
160
|
+
|
|
161
|
+
- This skill does not replace compiling and testing against the target toolchain. The version floors it documents are only real once built — build the code.
|
|
162
|
+
- It does not cover Boost.Beast (HTTP/WebSocket), io_uring backends, or UDP multicast specifics.
|
|
163
|
+
- Stop and ask when the Boost version and C++ standard cannot be determined; the style choice depends on them.
|
|
164
|
+
|
|
165
|
+
## Security & Safety Notes
|
|
166
|
+
|
|
167
|
+
- Read-only guidance: this skill contains no shell commands, network fetches, credentials, or mutation instructions. The commands it names (`dpkg -l libboost-dev`, `brew info boost`) are local version queries.
|
|
168
|
+
- Networking code it produces accepts untrusted input. Validate length prefixes before allocating (`std::string body(n, 0)` with an attacker-controlled `n` is a memory-exhaustion vector — cap it), and verify peer certificates when using TLS rather than disabling verification to make a handshake pass.
|
|
169
|
+
|
|
170
|
+
## Related Skills
|
|
171
|
+
|
|
172
|
+
- `@cpp-pro` — general modern C++ idioms; this skill assumes them and adds the Asio-specific rules.
|