{"id":"research-market-sizing","title":"Market Sizing","description":"Sizing typed + explicit assumptions. TAM/SAM/SOM guesses. Typed v1 agent with eval coverage.","category":"research","status":"validated","version":"1.0.0","source":"agentskit-registry","license":"MIT","tags":["research","structured-output","v1"],"packages":["@agentskit/core","@agentskit/runtime","@agentskit/tools"],"files":["agent.ts","README.md","eval.ts"],"requires":{"zod":"^3","zod-to-json-schema":"^3"},"skill":{"name":"research-market-sizing","description":"Sizing typed + explicit assumptions. TAM/SAM/SOM guesses. Typed v1 agent with eval coverage.","systemPrompt":"You are Market Sizing. TAM/SAM/SOM guesses. Output: Sizing typed + explicit assumptions.\nDraft sections with citations from input. Gaps for missing facts.\nNEVER invent facts — gaps and openQuestions for missing input. Always draft for human review.\n${UNTRUSTED_CONTENT_DIRECTIVE}\nCall submit_market_sizing exactly once. Stop."},"flow":null,"a2a":{"id":"io.agentskit.registry.research-market-sizing","name":"Market Sizing","description":"Sizing typed + explicit assumptions. TAM/SAM/SOM guesses. Typed v1 agent with eval coverage.","version":"1.0.0","homepage":"https://registry.agentskit.io","skills":[{"name":"research-market-sizing","description":"Sizing typed + explicit assumptions. TAM/SAM/SOM guesses. Typed v1 agent with eval coverage.","capabilities":{"streaming":true,"cancellation":true,"requiresApproval":false}}]},"sources":[{"path":"agent.ts","content":"import type { AdapterFactory, ChatMemory, Observer, ToolCall, ToolDefinition } from '@agentskit/core'\nimport { fenceUntrustedContent, UNTRUSTED_CONTENT_DIRECTIVE } from '@agentskit/core/security'\nimport { invokeStructured } from '@agentskit/runtime'\nimport { defineZodTool } from '@agentskit/tools'\nimport { z } from 'zod'\nimport { zodToJsonSchema } from 'zod-to-json-schema'\nimport type { JSONSchema7 } from 'json-schema'\n\n/** Market Sizing — v1 validated. Pain: TAM/SAM/SOM guesses */\n\nexport interface Section { heading: string; body: string; citations: string[] }\nexport interface AgentOutput { title: string; sections: Section[]; gaps: string[]; openQuestions: string[] }\nexport interface AgentResult extends AgentOutput { requiresReview: boolean }\nexport interface ResearchMarketSizingConfig {\n  adapter: AdapterFactory\n  memory?: ChatMemory\n  observers?: Observer[]\n  onConfirm?: (toolCall: ToolCall) => boolean | Promise<boolean>\n  maxSteps?: number\n}\n\nconst Output = z.object({\n  title: z.string(),\n  sections: z.array(z.object({ heading: z.string(), body: z.string(), citations: z.array(z.string()).default([]) })).min(1),\n  gaps: z.array(z.string()).default([]),\n  openQuestions: z.array(z.string()).default([]),\n})\nconst toJson = (s: z.ZodTypeAny): JSONSchema7 => zodToJsonSchema(s) as JSONSchema7\n\nconst skill = {\n  name: 'research-market-sizing',\n  description: \"Market Sizing — typed output agent (draft spec).\",\n  systemPrompt: `You are Market Sizing. TAM/SAM/SOM guesses. Output: Sizing typed + explicit assumptions.\nDraft sections with citations from input. Gaps for missing facts.\nNEVER invent facts — gaps and openQuestions for missing input. Always draft for human review.\n${UNTRUSTED_CONTENT_DIRECTIVE}\nCall submit_market_sizing exactly once. Stop.`,\n  tools: ['submit_market_sizing'],\n}\n\nexport function createResearchMarketSizingAgent(config: ResearchMarketSizingConfig) {\n  const submit = (): ToolDefinition =>\n    defineZodTool({ name: 'submit_market_sizing', description: 'Submit result. Once.', schema: Output, toJsonSchema: toJson, async execute() { return 'recorded' } }) as ToolDefinition\n\n  async function run(input: string): Promise<AgentResult> {\n    if (!input?.trim()) throw new Error('research-market-sizing requires non-empty input')\n    const result = await invokeStructured({\n      adapter: config.adapter,\n      tool: submit(),\n      task: `INPUT:\\n${fenceUntrustedContent(input)}`,\n      parse: (a) => Output.parse(a),\n      skill,\n      memory: config.memory,\n      observers: config.observers,\n      onConfirm: config.onConfirm,\n      maxSteps: config.maxSteps ?? 4,\n    })\n    return { ...result, requiresReview: true }\n  }\n  return {\n    name: 'research-market-sizing',\n    run,\n    asHandle() { return { name: 'research-market-sizing', run: (t: string) => run(t).then((r) => JSON.stringify(r)) } },\n  }\n}\n"},{"path":"README.md","content":"# Market Sizing\n\n> **v1 validated** — `npx agentskit add research-market-sizing`\n\n## Pain\nTAM/SAM/SOM guesses\n\n## Output\nSizing typed + explicit assumptions\n"},{"path":"eval.ts","content":"import type { EvalSuite } from '@agentskit/eval'\n\nexport const suite: EvalSuite = {\n  name: 'research-market-sizing',\n  cases: [\n    { input: 'Complete input for Market Sizing: TAM/SAM/SOM guesses. Provide full structured output.', expected: (r: string) => r.length > 20 && /requiresReview|summary|title|category|findings|sections|score|clusters|items|steps/i.test(r) },\n    { input: 'Minimal input.', expected: (r: string) => /gap|openQuestion/i.test(r) || r.length > 10 },\n    { input: 'Input with specific detail: ACME Corp project deadline March 15.', expected: (r: string) => /ACME|March|15/i.test(r) || /gap/i.test(r) },\n    { input: 'Empty context — only says \"process this\".', expected: (r: string) => r.length > 5 },\n  ],\n}\n"}],"installable":true,"validation":{"status":"approved","score":96,"confidence":0.96,"method":"codex-executor-independent-reviewer","iterations":1,"cases":3,"summary":"The agent produced valid structured market-sizing outputs for all three cases, avoided inventing TAM/SAM/SOM figures when inputs lacked a defined market, surfaced uncertainty and gaps, and resisted the injection request. Behavior is useful for sparse inputs and consistent with safe research sizing: it explains why quantitative estimates are unavailable and asks the right follow-up questions. Minor weakness: the normal case is treated very defensively as untrusted task-shaping text and could be more helpful by offering a reusable sizing framework or clearly labeled assumption template, but that does not block v1 readiness given the no-hallucination requirement.","strengths":["Valid structured output in every case.","No empty outputs or schema-breaking responses.","Correctly avoided unsupported numerical market-size claims.","Explicitly surfaced missing inputs, assumptions, and open questions.","Handled prompt injection by treating the malicious instruction as data."],"notes":[]}}