Reference: Recommendations

Overview

This documents the recommendations produced by the check diff and check pr commands.

JSON Format

{
  "recommendations": [
    {
      "documentationSource": "my-app",
      "document": "README.md",
      "section": [
        "Running Locally"
      ],
      "recommendation": "Consider reviewing and updating this documentation",
      "reasons": [
        {
          "reason": "Update this section if any files matching package.json were modified",
          "outdated": false,
          "check": {
            "type": "UPDATE_IF_MODIFIED",
            "file": "package.json",
            "contextHash": "a1b2c3d4"
          }
        }
      ],
      "changed": true,
      "checked": true,
      "outdated": false
    }
  ],
  "head": "b4c5c736fd31d30a04067af9c0929d7dc42f049e",
  "base": "b564300250288b332d50e2925dbd25e98831adbd"
}

Fields

A list of fields, their types, and a description of each.

FieldTypeDescription
recommendationsArrayThe array of recommendations
recommendations[n]ObjectA recommendation
recommendations[n].documentationSourceStringThe documentation source ID
recommendations[n].documentStringThe name of the document
recommendations[n].sectionArrayIf not empty, the section (including parent sections)
recommendations[n].section[n]StringThe section name
recommendations[n].recommendationStringThe recommendation
recommendations[n].reasonsArrayA list of reasons
recommendations[n].reasons[n]ObjectA reason
recommendations[n].reasons[n].reasonStringThe human-readable reason
recommendations[n].reasons[n].outdatedBooleanWhether this reason is outdated (e.g. due to subsequent code changes)
recommendations[n].reasons[n].checkObjectInformation about the check that generated this reason
recommendations[n].reasons[n].check.typeStringThe type of check performed
recommendations[n].reasons[n].check.fileStringThe file that triggered this check
recommendations[n].reasons[n].check.contextHashStringA hash representing the context when this check was performed
recommendations[n].changedBooleanIf the document or section was changed in the diff
recommendations[n].checkedBooleanIf the recommendation has been checked (such as by updating the recommended document or section)
recommendations[n].outdatedBooleanWhether this entire recommendation is outdated (true if all reasons are outdated)
headStringThe commit hash used as the head reference in the diff
baseStringThe commit hash used as the base reference in the diff

Check Types

The list of available check types, their associated config property, what goes into the context hash, and a description of each.

Check TypeConfig PropertyContext HashDescription
LLMN/A (automatic)Hash of the promptUses an LLM to analyze code changes and determine if documentation should be updated
UPDATE_IF_TOUCHEDcheck.options.updateIf.touchedHash of the check typeTriggers when a file matching the configured pattern is modified in any way (added, modified, deleted, or renamed)
UPDATE_IF_ADDEDcheck.options.updateIf.addedHash of the check typeTriggers when a file matching the configured pattern is added
UPDATE_IF_MODIFIEDcheck.options.updateIf.modifiedHash of the check typeTriggers when a file matching the configured pattern is modified
UPDATE_IF_DELETEDcheck.options.updateIf.deletedHash of the check typeTriggers when a file matching the configured pattern is deleted
UPDATE_IF_RENAMEDcheck.options.updateIf.renamedHash of the check typeTriggers when a file matching the configured pattern is renamed