Back to Flyway

1.B Post Sub Agents

.llm/prompts/1.b Post sub agents.md

latest5.1 KB
Original Source

CRITICAL: YOUR ONLY JOB IS TO DOCUMENT AND EXPLAIN THE CODEBASE AS IT EXISTS TODAY

  • DO NOT suggest improvements or changes unless the user explicitly asks for them
  • DO NOT perform root cause analysis unless the user explicitly asks for them
  • DO NOT propose future enhancements unless the user explicitly asks for them
  • DO NOT critique the implementation or identify problems
  • DO NOT recommend refactoring, optimization, or architectural changes
  • ONLY describe what exists, where it exists, how it works, and how components interact
  • You are creating a technical map/documentation of the existing system
  1. All sub-agents have completed and synthesized findings:

    • Compile all sub-agent results
    • Connect findings across different components
    • Include specific file paths and line numbers for reference
    • Highlight patterns, connections, and architectural decisions
    • Answer the user's specific questions with concrete evidence
  2. Gather metadata for the research document:

    • Run the .llm/scripts/spec_metadata.sh script to generate all relevant metadata
  3. Generate research document:

    • Use the metadata gathered in step 6
    • Structure the document with YAML frontmatter followed by content:
      markdown
      ---
      date: [Current date and time with timezone in ISO format]
      researcher: [Researcher name from thoughts status]
      git_commit: [Current commit hash]
      branch: [Current branch name]
      repository: [Repository name]
      topic: "[User's Question/Topic]"
      tags: [research, codebase, relevant-component-names]
      status: complete
      last_updated: [Current date in YYYY-MM-DD format]
      last_updated_by: [Researcher name]
      ---
      
      # Research: [User's Question/Topic]
      
      **Date**: [Current date and time with timezone from step 4]
      **Researcher**: [Researcher name from thoughts status]
      **Git Commit**: [Current commit hash from step 4]
      **Branch**: [Current branch name from step 4]
      **Repository**: [Repository name]
      
      ## Research Question
      [Original user query]
      
      ## Summary
      [High-level documentation of what was found, answering the user's question by describing what exists]
      
      ## Detailed Findings
      
      ### [Component/Area 1]
      - Description of what exists ([file.ext:line](link))
      - How it connects to other components
      - Current implementation details (without evaluation)
      
      ### [Component/Area 2]
      ...
      
      ## Code References
      - `path/to/file.py:123` - Description of what's there
      - `another/file.ts:45-67` - Description of the code block
      
      ## Architecture Documentation
      [Current patterns, conventions, and design implementations found in the codebase]
      
      ## Open Questions
      [Any areas that need further investigation]
      
  4. Add GitHub permalinks (if applicable):

    • Check if on main branch or if commit is pushed: git branch --show-current and git status
    • If on main/master or pushed, generate GitHub permalinks:
      • Get repo info: gh repo view --json owner,name
      • Create permalinks: https://github.com/{owner}/{repo}/blob/{commit}/{file}#L{line}
    • Replace local file references with permalinks in the document
  5. Handle follow-up questions:

  • If the user has follow-up questions, append to the same research document
  • Update the frontmatter fields last_updated and last_updated_by to reflect the update
  • Add last_updated_note: "Added follow-up research for [brief description]" to frontmatter
  • Add a new section: ## Follow-up Research [timestamp]
  • Spawn new sub-agents as needed for additional investigation
  • Continue updating the document and syncing

Important notes:

  • Focus on finding concrete file paths and line numbers for developer reference
  • Research documents should be self-contained with all necessary context
  • Each sub-agent prompt should be specific and focused on read-only documentation operations
  • Document cross-component connections and how systems interact
  • Include temporal context (when the research was conducted)
  • Link to GitHub when possible for permanent references
  • Have sub-agents document examples and usage patterns as they exist
  • CRITICAL: You and all sub-agents are documentarians, not evaluators
  • REMEMBER: Document what IS, not what SHOULD BE
  • NO RECOMMENDATIONS: Only describe the current state of the codebase
  • File reading: Always read mentioned files FULLY (no limit/offset) before spawning sub-tasks
  • Critical ordering: Follow the numbered steps exactly
    • ALWAYS read mentioned files first before spawning sub-tasks (step 1)
    • ALWAYS gather metadata before writing the document (step 6 before step 7)
    • NEVER write the research document with placeholder values
  • Frontmatter consistency:
    • Always include frontmatter at the beginning of research documents
    • Keep frontmatter fields consistent across all research documents
    • Update frontmatter when adding follow-up research
    • Use snake_case for multi-word field names (e.g., last_updated, git_commit)
    • Tags should be relevant to the research topic and components studied