Skip to content

Use Garry Tan's exact Claude Code setup: 23 opinionated tools that serve as CEO, Designer, Eng Manager, Release Manager, Doc Engineer, and QA

TypeScript
2.8 KB
Raw Blame
/**
 * Result codes for the plain-English title check (lib/plain-title.ts,
 * bin/gstack-plain-title, the "Plain title" CI check; R76). Kept beside
 * lib/result-codes.ts (which spreads this table into RESULT_CODES) so the owner
 * module stays within the module-size ratchet; the same rules apply: one stable
 * docs/troubleshooting.md anchor, a summary and a fix clause each.
 */
import type { ResultCode } from './result-codes';

export const PLAIN_RESULT_CODES = {
  PLAIN_TITLE_REFUSED: {
    anchor: 'plain-title-refused',
    summary: 'the PR title has a tracker code, a project-only word or a type(scope): prefix before its trailing reference group',
    fix: 'rewrite the title as a plain sentence about what changed for someone using the project; keep at most one trailing group like (ABC-123)',
  },
  PLAIN_BRANCH_REFUSED: {
    anchor: 'plain-branch-refused',
    summary: 'the branch name has a tracker code or a project-only word before its last segment',
    fix: 'name the branch in plain words, with at most one tracker code at the very end (owner/what-changed-abc-123)',
  },
  PLAIN_OPENING_REFUSED: {
    anchor: 'plain-opening-refused',
    summary: 'the PR body does not open with a plain paragraph of at most three lines',
    fix: 'start the body with up to three plain lines: what changed for a user, why, and anything the reader has to do; move codes and records to the Agent notes section at the end',
  },
  PLAIN_BODY_REFUSED: {
    anchor: 'plain-body-refused',
    summary: 'the PR body, once folded, shows more than three lines or 600 characters before its first fold, leaves text outside a fold, uses a listed word above the Agent notes section, or does not end with that section',
    fix: 'keep the opening to three plain lines, put everything else under ## headings (gstack-post folds them), say listed words in everyday words, and let gstack place the receipt in the Agent notes section at the end',
  },
  PLAIN_CHANGELOG_REFUSED: {
    anchor: 'plain-changelog-refused',
    summary: 'the changelog entry has a tracker code, or a project-only word in its bold lead',
    fix: 'drop tracker codes from the entry and rewrite the bold lead in everyday words',
  },
  PLAIN_COMMIT_REFUSED: {
    anchor: 'plain-commit-refused',
    summary: 'a commit subject has a tracker code, a project-only word or a type(scope): prefix before its trailing reference group',
    fix: 'write later commit subjects as plain sentences; the squash commit takes the PR title, so this is a warning only',
  },
  PLAIN_POLICY_INVALID: {
    anchor: 'plain-policy-invalid',
    summary: '.gstack/plain-titles.json is not valid JSON or breaks the schema; the line names the key',
    fix: 'fix the named key (codes, terms, allow, since, exempt_branch_prefixes), then run gstack-plain-title validate',
  },
} as const satisfies Record<string, ResultCode>;