jint

Rules

A rule is a question about your code, written in plain English. It contains the questions you want to ask, what to target with that question, and how to handle a failure or warning for that specific question.

A rule is stronger than a rubric. A rubric is text the agent reads and applies by its own judgment, and nothing checks that it did. A rule is run by jint after generation, in CI or in a pre-commit hook.

You can target anything as long as it’s text. Given that it’s built on top of treesitter, you can bring your own language grammar, allowing you to capture the exact part of your code you want to classify.

export default {
  rules: {
    use: [
      {
        name: "is_name_purposeful",
        instructions: "Does this function's name say what the function does?",
        criteria: {
          true: "The name states the function's purpose.",
          false: "The name is generic, or names a different job from the one the body does.",
        },
        target: "functions",
        handle: {
          warn: { less_than: 0.6 },
          error: { less_than: 0.3, message: "Rename this function after what it does." },
        },
      },
    ],
  },
};