Class MarkdownReviewer

java.lang.Object
org.machanism.machai.gw.reviewer.MarkdownReviewer
All Implemented Interfaces:
Reviewer

public class MarkdownReviewer extends Object implements Reviewer
Reviewer implementation for Markdown files (.md).

Guidance is expected to be embedded in an HTML comment block that contains the @guidance tag.

  • Constructor Details

    • MarkdownReviewer

      public MarkdownReviewer()
  • Method Details

    • getSupportedFileExtensions

      public String[] getSupportedFileExtensions()
      Returns the file extensions supported by this reviewer.
      Specified by:
      getSupportedFileExtensions in interface Reviewer
      Returns:
      an array containing "md"
    • perform

      public String perform(File projectDir, File guidancesFile) throws IOException
      Reviews the given Markdown file and returns a formatted prompt fragment when guidance is present.
      Specified by:
      perform in interface Reviewer
      Parameters:
      projectDir - the project root directory used to compute a project-relative path for context
      guidancesFile - the Markdown file to analyze
      Returns:
      a formatted prompt fragment, or null when the file does not contain guidance
      Throws:
      IOException - if an error occurs while reading the file