Code Verification Procedure
When writing or auditing documentation, verify every code example against the actual SDK source. Plausible-but-wrong code erodes developer trust faster than missing documentation.
The docs site lives under site/ in this repo. All paths in this guide — including those in skill procedures that reference it — are written relative to the repo root, so they include the site/ prefix where applicable. Run shell commands like npm run sdk:clone from inside site/ (where package.json lives).
Use the first tier available in your environment. Fall back only when the preferred tier is unavailable.
Tier 1: Local SDK Clones (preferred)
If you have the local clones populated by npm run sdk:clone, read directly from disk — it's faster than network calls and avoids API rate limits:
site/.build/sdk-python/src/strands/[path]
site/.build/sdk-typescript/strands-ts/src/[path]If the clones aren't present, run npm run sdk:clone from site/, or fall back to Tier 2.
Key Python modules (under src/strands/):
agent/agent.py—Agentclass, constructor signature,__call__/stream_asyncagent/agent_result.py—AgentResultshape (final response, metrics, stop reason)agent/conversation_manager/—ConversationManager,SlidingWindowConversationManager,SummarizingConversationManageragent/state.py—AgentState(per-agent key/value store)tools/decorator.py—@tooldecorator and signature inferencetools/tool_provider.py—ToolProviderbase for grouped toolstools/mcp/— MCP client/server tool integrationtools/structured_output/— Structured-output tool helpershooks/registry.py—HookRegistry, hook callback registrationhooks/events.py— Hook event types (BeforeInvocationEvent,AfterInvocationEvent, etc.)models/— Model provider implementations (Bedrock, Anthropic, OpenAI, etc.)multiagent/graph.py,multiagent/swarm.py,multiagent/a2a/— Multi-agent orchestrationsession/—SessionManager,FileSessionManager,S3SessionManager,RepositorySessionManagerevent_loop/— Core event loop and streamingtelemetry/— Tracing, metrics, OTEL integrationinterrupt.py,types/interrupt.py— Interrupt/resume primitivestypes/exceptions.py— Error classestypes/content.py,types/tools.py,types/streaming.py— Public message/tool/stream shapes
Key TypeScript modules (under strands-ts/src/):
agent/—Agentclass, agent result, configurationtools/—tool()factory, tool registration, MCP tool supportconversation-manager/—ConversationManagerimplementationshooks/— Hook registry and event typesmodels/— Model provider implementationsmultiagent/— Graph, swarm, agent-to-agent orchestrationsession/— Session managers and persistenceplugins/,vended-plugins/— Plugin system and built-in pluginsinterventions/,vended-interventions/— Intervention hooksretry/— Retry policiestelemetry/— Tracing and metricserrors.ts— Error classestypes/— Public type definitions (content, tools, streaming, etc.)index.ts— Public exports (canonical entry point for what's exported)
TypeScript supporting paths:
strands-ts/test/andstrands-ts/src/__tests__/— Unit tests (good for usage patterns)strands-ts/examples/— Runnable examples
What to verify:
- Import paths resolve to real modules
- Parameter names, types, and defaults match class definitions
- Referenced methods exist on the classes shown
- For pages with both languages: verify each independently
Tier 2: GitHub API
If the local clones aren't available, fetch source through the GitHub API:
# Python SDK (now local at strands-py/src/strands/)
gh api repos/strands-agents/harness-sdk/contents/strands-py/src/strands/[path]
# TypeScript SDK (now local at strands-ts/src/)
gh api repos/strands-agents/harness-sdk/contents/strands-ts/src/[path]Tier 3: Installed Package Introspection
# Python
python -c "from strands.agent.agent import Agent; help(Agent.__init__)"
# TypeScript (check exports)
node -e "const sdk = require('@strands-agents/sdk'); console.log(Object.keys(sdk))"Useful for spot-checking parameter names and types, but doesn't show internal module structure.
Tier 4: Stop and Surface
If none of the tiers above are available, do not ship unverified code. Reviewers are not the verification step, and unverified blocks must not reach a PR description as a TODO list for someone else to resolve.
Instead, surface the gap in the output of the calling skill:
- From
docs-audit: list each unverifiable item under### Accuracy Issues(e.g., "Agent.stream_asyncsignature — no SDK source available to verify") and add a corresponding### Recommended Actionsentry to acquire a verification source before re-auditing. - From
docs-writer: omit the affected code block from the draft and report the unverifiable item alongside the finished page — naming the specific class/method and the tier that failed. Do not emit a guessed example.
The expectation is that the next iteration of the skill resolves the gap, not that a reviewer takes it on.