import type { AgentsDocs } from '../generation/collector.js'; /** * Prompt pair for spec generation: system instructions and user content. */ export interface SpecPrompt { system: string; user: string; } /** * System prompt for AI-driven specification synthesis. * * Enforces conceptual grouping by concern, prohibits folder-mirroring * and exact file path prescription, and targets AI agent consumption. */ export declare const SPEC_SYSTEM_PROMPT = "You produce software specifications from documentation.\n\nTASK:\nGenerate a comprehensive specification document from the provided AGENTS.md content. The specification must contain enough detail for an AI agent to reconstruct the entire project from scratch without seeing the original source code.\n\nAUDIENCE: AI agents (LLMs) \u2014 use structured, precise, instruction-oriented language. Every statement should be actionable.\n\nORGANIZATION (MANDATORY):\nGroup content by CONCERN, not by directory structure. Use these conceptual sections in order:\n\n1. Project Overview \u2014 purpose, core value proposition, problem solved, technology stack with versions\n2. Architecture \u2014 system design, module boundaries, data flow patterns, key design decisions and their rationale\n3. Public API Surface \u2014 all exported interfaces, function signatures with full parameter and return types, type definitions, error contracts\n4. Data Structures & State \u2014 key types, schemas, config objects, state management patterns, serialization formats\n5. Configuration \u2014 all config options with types, defaults, validation rules, environment variables\n6. Dependencies \u2014 each external dependency with exact version and rationale for inclusion\n7. Behavioral Contracts \u2014 Split into two subsections:\n a. Runtime Behavior: error handling strategies (exact error types/codes and when thrown), retry logic (formulas, delay values), concurrency model, lifecycle hooks, resource management\n b. Implementation Contracts: every regex pattern used for parsing/validation/extraction (verbatim in backticks), every format string and output template (exact structure with examples), every magic constant and sentinel value with its meaning, every environment variable with expected values, every file format specification (YAML schemas, NDJSON structures). These are reproduction-critical \u2014 an AI agent needs them to rebuild the system with identical observable behavior.\n8. Test Contracts \u2014 what each module's tests should verify: scenarios, edge cases, expected behaviors, error conditions\n9. Build Plan \u2014 phased implementation sequence with explicit interface contracts per phase:\n - Each phase MUST include a \"Defines:\" list naming the exact types, interfaces, classes, and functions this phase must export (use the exact names from section 3 Public API Surface)\n - Each phase MUST include a \"Consumes:\" list naming the exact types and functions from earlier phases that this phase imports\n - Include dependency ordering and implementation tasks as before\n10. Prompt Templates & System Instructions \u2014 every AI prompt template, system prompt, and user prompt template used by the system. Reproduce the FULL text verbatim from annex files or AGENTS.md content. Organize by pipeline phase or functional area. Include placeholder syntax exactly as defined (e.g., {{FILE_PATH}}). These are reproduction-critical \u2014 without them, a rebuilder cannot produce functionally equivalent AI output.\n11. IDE Integration & Installer \u2014 command templates per platform, platform configuration objects (path prefixes, filename conventions, frontmatter formats), installer permission lists, hook definitions and their activation status. Reproduce template content verbatim from annex files or AGENTS.md content.\n12. File Manifest \u2014 exhaustive list of every source file the project contains:\n - For each file: relative path, module it belongs to, and the public exports it provides\n - Group by directory\n - Include stub/placeholder files explicitly (mark them as stubs)\n - Include type-only files (files that export only types/interfaces)\n - This section ensures no files are missed during rebuild\n\nRULES:\n- Describe MODULE BOUNDARIES and their interfaces \u2014 not file paths or directory layouts\n- Use exact function, type, and constant names as they appear in the documentation\n- Include FULL type signatures for all public APIs (parameters, return types, generics)\n- Do NOT prescribe exact filenames or file paths \u2014 describe what each module does and exports\n- Do NOT mirror the project's folder structure in your section organization\n- Do NOT use directory names as section headings\n- Include version numbers for ALL external dependencies\n- The Build Plan MUST list implementation phases with explicit dependency ordering\n- Each Build Plan phase must state what it depends on and what it enables\n- Build Plan phases MUST cross-reference the Public API Surface: every type/function in the API Surface section must appear in exactly one phase's \"Defines:\" list\n- Behavioral Contracts must specify exact error types/codes and when they are thrown\n- Behavioral Contracts MUST include verbatim regex patterns, format strings, and magic constants from the source documents \u2014 do NOT paraphrase regex patterns into prose descriptions\n- When multiple modules reference the same constant or pattern, consolidate into a single definition with cross-references to the modules that use it\n- The File Manifest MUST list every source file. Each Build Plan phase MUST reference which File Manifest entries it produces. A file missing from both is a spec defect.\n\nREPRODUCTION-CRITICAL CONTENT (MANDATORY):\nThe source documents may include annex files containing full verbatim source code\nfor reproduction-critical modules (prompt templates, configuration defaults, IDE\ntemplates, installer configs). These are provided as fenced code blocks.\n\nFor ALL reproduction-critical content:\n- Reproduce the FULL content verbatim in the appropriate spec section (10 or 11)\n- Do NOT summarize, paraphrase, abbreviate, or \"improve\" the text\n- Use fenced code blocks to preserve formatting\n- If content contains placeholder syntax ({{TOKEN}}), preserve it exactly\n- If no annex files or reproduction-critical sections are provided, omit sections 10-11\n\nOUTPUT: Raw markdown. No preamble. No meta-commentary. No \"Here is...\" or \"I've generated...\" prefix."; /** * Build the system + user prompt pair for spec generation. * * Injects all collected AGENTS.md content with section delimiters. * * @param docs - Collected AGENTS.md documents from collectAgentsDocs() * @returns SpecPrompt with system and user prompt strings */ export declare function buildSpecPrompt(docs: AgentsDocs, annexFiles?: AgentsDocs): SpecPrompt; //# sourceMappingURL=prompts.d.ts.map