agentleFS
strands-agentsstrands-agents/harness-sdk/harness-ts/AGENTS.md

harness-sdk / harness-ts

AGENTS.md8.7k starsChanged 59 days agoApache-2.0View on GitHub

This document provides context and conventions for AI coding assistants working on the Strands harness TypeScript package (harness-ts/). For human contributors, see CONTRIBUTING.md. Cross-package rules live in the root AGENTS.md. Public-surface parity with harness-py/, the shared defaults, the single system-prompt artifact, and the evergreen-comment rule apply to both packages and are stated once there. This file shows only the TypeScript-idiomatic form and the rules unique to TypeScript. When a rule applies to both packages, edit the root, not this file.

  • Reads credentials

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 5 mentionsJul 2026: 3 mentionsAug 2026: 8 mentionsSep 2026: 23 mentionsOct 2026: 12 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the strands-agents/harness-sdk repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about strands-agents/harness-sdk

The biggest 5 of 51 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 51

Talked about on GitHub and Bluesky (51 times).

On GitHub · 47

42 more on GitHub

The file

We split this AGENTS.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the checks before opening a pull request (from harness-ts/, or via npm run <script> -w harness-ts from the root):

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Agent Development Guide - TypeScript Package

This document provides context and conventions for AI coding assistants working on the Strands harness TypeScript package (harness-ts/). For human contributors, see CONTRIBUTING.md.

Cross-package rules live in the root AGENTS.md. Public-surface parity with harness-py/, the shared defaults, the single system-prompt artifact, and the evergreen-comment rule apply to both packages and are stated once there. This file shows only the TypeScript-idiomatic form and the rules unique to TypeScript. When a rule applies to both packages, edit the root, not this file.

Overview

@strands-agents/harness is a preconfigured Strands agent in one call. It is a thin composition layer over @strands-agents/sdk: it wires a resolved model, the vended system prompt, built-in tools, context management, and optional session persistence into a plain Agent. Every option is overridable and the return value is a regular Agent, so consumers can change, extend, or replace anything the harness sets up.

This package is library-only: no CLI. The strands terminal command lives in strands-cli/, which depends on this package.

Directory Structure

harness-ts/
├── src/
│   ├── agent.ts       # createHarness(): the one-call factory
│   ├── models.ts      # resolveModel(): "provider/name" -> Model, per-provider effort config
│   ├── prompt.ts      # HARNESS_CONTRACT + buildSystemPrompt()
│   ├── defaults.ts    # default model, effort, context manager, tools, session dir
│   ├── config.ts      # JSON config bridge: normalizeHarnessAgentConfig(), harnessAgentOptionsFromConfig()
│   ├── builtin-tools.ts  # resolveBuiltinTools(): list (pin) or mapping (edits) -> one resolved record
│   ├── tools/         # harness-authored built-in tools: file-tools.ts (read/write/edit), web-fetch.ts
│   ├── plugins/       # built-in feature plugins: todos.ts, environment.ts
│   ├── index.ts       # public barrel export
│   ├── internal.ts    # `@strands-agents/harness/internal`: plumbing for the CLI (resolve*, normalize*)
│   └── tsconfig.json  # build project config (emits to ../dist)
├── test/              # vitest suite
├── package.json
└── vitest.config.ts

Development

Install from the repo root so the npm workspace is linked:

npm ci               # from the repo root

Run the checks before opening a pull request (from harness-ts/, or via npm run <script> -w harness-ts from the root):

npm run build        # tsc build
npm run type-check   # tsc --noEmit
npm run lint         # eslint
npm run format       # prettier --write
npm test             # vitest
npm run check        # lint + format:check + type-check + test:coverage

Conventions

  • createHarness and resolveModel are async. The SDK's model-provider entry points (@strands-agents/sdk/models/*) require their peer dependency at import time, so they are loaded with dynamic import() to keep each provider optional: a consumer only installs the peer for the provider they use, and Bedrock needs none. Loading on demand makes resolution async; preserve that. Import the always-needed pieces (Agent, Model, types, and the core plugins/session: AgentSkills, SessionManager, FileStorage) statically at the top of the file. The model providers are dynamic, and so is @strands-agents/sdk/telemetry (in telemetry.ts): it statically pulls in the OTel trace SDK and exporters, and a run with no collector configured must not pay to load them.
  • Options object, explicit-wins passthrough. HarnessAgentOptions extends AgentConfig (minus the keys the harness controls) plus the harness-specific keys. Any AgentConfig field the harness doesn't name is spread straight onto Agent, and an explicit value wins over the harness default it corresponds to (e.g. a passed conversationManager or systemPrompt). This mirrors Python's **agent_kwargs. Where an SDK object exists, the harness option is boolean | <Config> | <SDK instance> | null (session, memory, contextManager, skills); an instance passes straight through.
  • Provider effort config. models.ts maps one effort level to each provider's own config fields and validates it against that provider's supported levels, so an unsupported level fails in the harness rather than as a downstream request error. Keep the validation local.
  • Built-in tools. builtinTools is a list (exact pin) or a mapping of edits to the defaults; builtin-tools.ts normalizes both to one { name: true | false | config } record, which is what the factory selects from and what a subagent child inherits — never a list or "*". Per-tool config keys live in one table, BUILTIN_TOOL_CONFIG_KEYS (config.ts), shared with the JSON validator and mirrored by Python; add a key there, not in agent.ts. web_search resolves per model — a provider flag where the model has native search, the Exa tool only with 'exa' (WebSearchSetting, the one string-valued setting), see the root AGENTS.md.
  • Style: eslint + prettier (no semicolons, single quotes, width 120). explicit-function-return-type and no-explicit-any are errors in src/; relaxed in test/.
  • Verifying model resolution in tests needs dummy API keys for the non-Bedrock providers. test/setup.ts sets OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY because those SDK constructors read them at construction time.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.