diff --git a/examples/document-review.yaml b/examples/document-review.yaml deleted file mode 100644 index 677f195..0000000 --- a/examples/document-review.yaml +++ /dev/null @@ -1,498 +0,0 @@ -# Document Review & Refinement Workflow -# -# This example demonstrates a multi-agent, multi-provider workflow that -# reviews and refines a markdown document for clarity, readability, and -# accuracy. It shows: -# - Parallel review agents specializing in different quality dimensions -# - Multi-provider usage (Claude for analysis, Copilot for refinement) -# - MCP server integration (web-search, context7, ms-learn) -# - Human-in-the-loop gate for clarification and approval -# - Iterative refinement loop with quality scoring -# - Context passing between agents with explicit mode -# -# Usage: -# conductor run examples/document-review.yaml \ -# --input document="$(cat my-document.md)" \ -# --input audience="developers" -# -# Requirements: -# - GitHub Copilot CLI configured (for copilot agents) -# - ANTHROPIC_API_KEY set (for claude agents) -# - Node.js installed (for MCP servers) - -workflow: - name: document-review - description: > - Review and refine a markdown document using parallel specialist agents - across multiple providers, with human-in-the-loop approval. - version: "1.0.0" - entry_point: document_analyzer - - input: - document: - type: string - required: true - description: The markdown document content to review and refine - audience: - type: string - required: false - default: "general" - description: Target audience (e.g., developers, executives, general) - - runtime: - provider: copilot - default_model: claude-opus-4.6 - mcp_servers: - web-search: - command: npx - args: ["-y", "open-websearch@latest"] - env: - MODE: stdio - DEFAULT_SEARCH_ENGINE: duckduckgo - ALLOWED_SEARCH_ENGINES: duckduckgo,brave,exa - tools: ["*"] - context7: - command: npx - args: ["-y", "@upstash/context7-mcp@latest"] - tools: ["*"] - ms-learn: - type: http - url: https://learn.microsoft.com/api/mcp - tools: ["*"] - work-iq: - command: npx - args: [ "-y", "@microsoft/workiq", "mcp" ] - tools: ["*"] - - context: - mode: explicit - - limits: - max_iterations: 100 - - cost: - show_per_agent: true - show_summary: true - -agents: - # ── Step 1: Analyze the document structure and content ────────────── - - name: document_analyzer - model: claude-opus-4.6 - description: Analyzes the document structure, identifies topics, and flags areas for review - input: - - workflow.input.document - - workflow.input.audience - tools: [] - prompt: | - You are a senior technical editor. Analyze the following markdown document - and provide a structured assessment to guide parallel reviewers. - - **Target Audience:** {{ workflow.input.audience }} - - **Document:** - {{ workflow.input.document }} - - Provide: - 1. A brief summary of the document's purpose and scope - 2. An outline of the document structure (headings, sections) - 3. A list of key topics and technical claims that need fact-checking - 4. Initial observations about tone, formatting, and organization - 5. Any terms, acronyms, or references that may need clarification - output: - summary: - type: string - description: Brief summary of the document's purpose - structure: - type: array - description: Document structure outline (sections/headings) - claims_to_verify: - type: array - description: Technical claims and facts that need verification - initial_observations: - type: string - description: Observations about tone, formatting, organization - terms_to_clarify: - type: array - description: Terms, acronyms, or references needing clarification - routes: - - to: parallel_reviewers - - # ── Step 2: Parallel specialist reviewers ─────────────────────────── - - - name: clarity_reviewer - model: claude-opus-4.6 - description: Reviews the document for clarity, logical flow, and structure - input: - - workflow.input.document - - workflow.input.audience - - document_analyzer.output - tools: [] - prompt: | - You are a clarity and structure specialist. Review this document for - logical flow, clear communication, and effective structure. - - **Target Audience:** {{ workflow.input.audience }} - **Document Purpose:** {{ document_analyzer.output.summary }} - - **Document:** - {{ workflow.input.document }} - - **Structure Analysis:** - {{ document_analyzer.output.structure | json }} - - Evaluate and provide specific feedback on: - 1. **Logical Flow** — Do sections follow a logical progression? - 2. **Clarity** — Are ideas expressed clearly and unambiguously? - 3. **Structure** — Are headings, paragraphs, and lists used effectively? - 4. **Transitions** — Do sections connect smoothly? - 5. **Completeness** — Are there gaps or missing explanations? - - For each issue found, provide: - - The specific text or section with the problem - - What the problem is - - A suggested improvement - output: - score: - type: number - description: Clarity score from 1-10 - issues: - type: array - description: List of clarity issues with suggested fixes - strengths: - type: array - description: What the document does well in terms of clarity - recommendations: - type: string - description: Overall recommendations for clarity improvements - - - name: readability_reviewer - description: Reviews the document for readability, tone, and audience fit - model: claude-sonnet-4.5 - input: - - workflow.input.document - - workflow.input.audience - - document_analyzer.output.summary - tools: [] - prompt: | - You are a readability and tone specialist. Review this document for - readability, appropriate tone, and audience suitability. - - **Target Audience:** {{ workflow.input.audience }} - **Document Purpose:** {{ document_analyzer.output.summary }} - - **Document:** - {{ workflow.input.document }} - - Evaluate and provide specific feedback on: - 1. **Readability** — Is the language accessible to the target audience? - 2. **Tone** — Is the tone consistent and appropriate? - 3. **Sentence Structure** — Are sentences concise and varied? - 4. **Jargon** — Is technical language used appropriately for the audience? - 5. **Formatting** — Are markdown features (headings, lists, code blocks, - bold/italic) used effectively for scannability? - - For each issue found, provide: - - The specific text or section - - What the problem is - - A rewritten version - output: - score: - type: number - description: Readability score from 1-10 - issues: - type: array - description: List of readability issues with rewrites - tone_assessment: - type: string - description: Assessment of the document's tone - recommendations: - type: string - description: Overall recommendations for readability improvements - - - name: accuracy_checker - model: claude-opus-4.6 - description: Verifies factual claims, technical accuracy, and references using web search and documentation - input: - - workflow.input.document - - document_analyzer.output.claims_to_verify - - document_analyzer.output.terms_to_clarify - tools: null - system_prompt: | - You are a fact-checker and technical accuracy reviewer. You have access to - web search, Context7 documentation lookup, and Microsoft Learn tools. - Use these tools to verify claims, check technical details, and validate - references found in the document. - prompt: | - Verify the factual accuracy and technical correctness of this document. - - **Document:** - {{ workflow.input.document }} - - **Claims to Verify:** - {% for claim in document_analyzer.output.claims_to_verify %} - - {{ claim }} - {% endfor %} - - **Terms to Clarify:** - {% for term in document_analyzer.output.terms_to_clarify %} - - {{ term }} - {% endfor %} - - For each claim or technical statement: - 1. Use your tools to verify the accuracy - 2. Check if referenced APIs, libraries, or tools are current - 3. Validate any version numbers, URLs, or code examples - 4. Look up official documentation where relevant - - Provide: - - A list of verified facts (confirmed accurate) - - A list of inaccuracies with corrections and sources - - A list of outdated information with current alternatives - - Any claims that could not be verified - output: - score: - type: number - description: Accuracy score from 1-10 - verified_facts: - type: array - description: Claims confirmed as accurate - inaccuracies: - type: array - description: Incorrect claims with corrections and sources - outdated_info: - type: array - description: Outdated information with current alternatives - unverifiable: - type: array - description: Claims that could not be verified - recommendations: - type: string - description: Overall accuracy recommendations - - # ── Step 3: Synthesize all reviewer feedback ──────────────────────── - - name: review_synthesizer - model: claude-opus-4.6 - description: Consolidates feedback from all reviewers into a prioritized action plan - input: - - workflow.input.audience - - document_analyzer.output.summary - - parallel_reviewers.outputs - tools: [] - prompt: | - You are a senior editor synthesizing feedback from three specialist - reviewers. Consolidate their findings into a clear, prioritized action plan. - - **Document Purpose:** {{ document_analyzer.output.summary }} - **Target Audience:** {{ workflow.input.audience }} - - **Clarity Review (Score: {{ parallel_reviewers.outputs.clarity_reviewer.score }}/10):** - Issues: {{ parallel_reviewers.outputs.clarity_reviewer.issues | json }} - Recommendations: {{ parallel_reviewers.outputs.clarity_reviewer.recommendations }} - - **Readability Review (Score: {{ parallel_reviewers.outputs.readability_reviewer.score }}/10):** - Issues: {{ parallel_reviewers.outputs.readability_reviewer.issues | json }} - Tone: {{ parallel_reviewers.outputs.readability_reviewer.tone_assessment }} - Recommendations: {{ parallel_reviewers.outputs.readability_reviewer.recommendations }} - - **Accuracy Review (Score: {{ parallel_reviewers.outputs.accuracy_checker.score }}/10):** - Inaccuracies: {{ parallel_reviewers.outputs.accuracy_checker.inaccuracies | json }} - Outdated: {{ parallel_reviewers.outputs.accuracy_checker.outdated_info | json }} - Unverifiable: {{ parallel_reviewers.outputs.accuracy_checker.unverifiable | json }} - Recommendations: {{ parallel_reviewers.outputs.accuracy_checker.recommendations }} - - Create a consolidated review with: - 1. An overall quality score (average of the three scores) - 2. A prioritized list of changes (critical → minor) - 3. Any items that need human clarification before proceeding - 4. A summary suitable for presenting to the document author - output: - overall_score: - type: number - description: Average quality score from 1-10 - critical_changes: - type: array - description: Must-fix issues (inaccuracies, major clarity problems) - important_changes: - type: array - description: Should-fix issues (readability, structure improvements) - minor_changes: - type: array - description: Nice-to-fix issues (formatting, style tweaks) - needs_clarification: - type: array - description: Items requiring human input or clarification - review_summary: - type: string - description: Human-readable summary of the review - - routes: - - to: human_review - - # ── Step 4: Human-in-the-loop review gate ─────────────────────────── - - name: human_review - type: human_gate - description: Present review findings to the author for approval or clarification - prompt: | - ## Document Review Complete - - **Overall Score:** {{ review_synthesizer.output.overall_score }}/10 - - ### Review Summary - {{ review_synthesizer.output.review_summary }} - - ### Critical Changes (must fix) - {% for change in review_synthesizer.output.critical_changes %} - - {{ change }} - {% endfor %} - - ### Important Changes (should fix) - {% for change in review_synthesizer.output.important_changes %} - - {{ change }} - {% endfor %} - - ### Minor Changes (nice to fix) - {% for change in review_synthesizer.output.minor_changes %} - - {{ change }} - {% endfor %} - - {% if review_synthesizer.output.needs_clarification | length > 0 %} - ### ⚠️ Items Needing Clarification - {% for item in review_synthesizer.output.needs_clarification %} - - {{ item }} - {% endfor %} - {% endif %} - options: - - label: Apply All Changes - value: apply_all - route: document_refiner - - label: Apply with Guidance - value: apply_with_guidance - route: document_refiner - prompt_for: feedback - - label: Reject & Keep Original - value: reject - route: $end - - # ── Step 5: Refine the document based on review feedback ──────────── - - name: document_refiner - model: claude-sonnet-4.5 - description: Applies all approved changes to produce the refined document - input: - - workflow.input.document - - workflow.input.audience - - review_synthesizer.output - - human_review.output - - parallel_reviewers.outputs.accuracy_checker - tools: [] - system_prompt: | - You are an expert technical writer and editor. Your task is to apply - review feedback to produce a polished, refined version of a document. - Preserve the author's voice and intent while improving quality. - prompt: | - Refine the following document by applying the review feedback. - - **Target Audience:** {{ workflow.input.audience }} - - **Original Document:** - {{ workflow.input.document }} - - **Review Score:** {{ review_synthesizer.output.overall_score }}/10 - - **Critical Changes to Apply:** - {{ review_synthesizer.output.critical_changes | json }} - - **Important Changes to Apply:** - {{ review_synthesizer.output.important_changes | json }} - - **Minor Changes to Apply:** - {{ review_synthesizer.output.minor_changes | json }} - - **Accuracy Corrections:** - Inaccuracies: {{ parallel_reviewers.outputs.accuracy_checker.inaccuracies | json }} - Outdated Info: {{ parallel_reviewers.outputs.accuracy_checker.outdated_info | json }} - - {% if human_review.output.feedback is defined and human_review.output.feedback %} - **Author Guidance:** - {{ human_review.output.feedback }} - {% endif %} - - Instructions: - 1. Apply ALL critical changes (especially factual corrections) - 2. Apply important changes that improve clarity and readability - 3. Apply minor changes where they improve polish - 4. Preserve the author's voice and overall structure - 5. If the author provided guidance, follow it carefully - 6. Ensure the document is well-formatted markdown - 7. Output the complete refined document — not a summary of changes - output: - refined_document: - type: string - description: The complete refined markdown document - changes_made: - type: array - description: Summary of changes applied - changes_skipped: - type: array - description: Changes not applied and why - routes: - - to: final_quality_check - - # ── Step 6: Final quality check ───────────────────────────────────── - - name: final_quality_check - model: claude-opus-4.6 - description: Final quality check to ensure the refined document meets standards - input: - - workflow.input.audience - - document_refiner.output.refined_document - - review_synthesizer.output.overall_score - tools: [] - prompt: | - Perform a final quality check on this refined document. - - **Target Audience:** {{ workflow.input.audience }} - **Pre-Refinement Score:** {{ review_synthesizer.output.overall_score }}/10 - - **Refined Document:** - {{ document_refiner.output.refined_document }} - - Evaluate: - 1. Were the critical issues from the review addressed? - 2. Is the document clear, readable, and accurate? - 3. Is the markdown formatting correct and consistent? - 4. Is the tone appropriate for the target audience? - - Provide a final quality score and indicate whether the document passes. - output: - final_score: - type: number - description: Final quality score from 1-10 - passed: - type: boolean - description: Whether the document meets quality standards - remaining_issues: - type: array - description: Any remaining issues (should be minimal) - routes: - - to: $end - when: "{{ output.passed }}" - - to: document_refiner - when: "context.iteration < 3" - - to: $end - -parallel: - - name: parallel_reviewers - description: Run clarity, readability, and accuracy reviews in parallel - agents: - - clarity_reviewer - - readability_reviewer - - accuracy_checker - failure_mode: continue_on_error - routes: - - to: review_synthesizer - -output: - refined_document: "{{ document_refiner.output.refined_document }}" - changes_made: "{{ document_refiner.output.changes_made | json }}" - original_score: "{{ review_synthesizer.output.overall_score }}" - final_score: "{{ final_quality_check.output.final_score }}" - review_summary: "{{ review_synthesizer.output.review_summary }}"