Skip to content

Releases

v0.6.2

Choose a tag to compare

@gagoar gagoar released this 14 Nov 00:58
a5eeb34

v0.6.2 (2026-11-14)

  • Stop hook no longer reports files under .claude, and caps the length of its message (gagoar/gago-plugins#17, #41)

    The Stop hook checks .ts and .tsx files that changed since the session started. It catches files written through a shell, which the edit hook never sees. The hook shipped in version 0.6.0.

    Previously the hook walked every directory under the working directory except node_modules, .git and a few build folders. When a session started in the home directory, the walk entered ~/.claude/plugins/marketplaces. A marketplace sync changes the modification time of those files. The hook then reported violations in third-party plugin code that you did not write. One session received a 230 KB message.

    This happened because .claude was not in the hook's list of skipped directories. The hook also selects files by modification time, not by what the session wrote.

    With this release, the hook will now skip every .claude directory. It also limits its message to about 20,000 characters. When the report is longer, the hook keeps the lines that fit and ends the message with ... N more lines omitted.

    Old output (a bad file under ~/.claude/plugins/marketplaces/m/external_plugins/discord/server.ts, created after the session started):

    ts-patterns: mechanical violations in TypeScript files changed this session (the edit hook does not see files written through a shell):
    ~/.claude/plugins/marketplaces/m/external_plugins/discord/server.ts:
      L1:17  no-explicit-any  Unexpected any. Specify a different type.  → SKILL.md Core Rule 1 — use unknown + narrow, or a precise type
    

    New output (the same file):

    (no output, exit code 0)
    

    The hook checks files in your own projects as before.

    Affects: anyone who keeps their own TypeScript code inside a directory named .claude. The Stop hook no longer checks those files.

    To check: find . -path '*/.claude/*' -name '*.ts' -not -path '*/node_modules/*'

    Thanks to @norlandoPDDS for reporting this issue.

v0.6.1

Choose a tag to compare

@gagoar gagoar released this 06 Nov 17:27
b9a18cd
  • Stop the review agent from matching ordinary TypeScript writing (#39)

    The typescript-patterns-enforcer:review agent runs as an Opus subagent. Previously typescript-patterns-enforcer described it as the agent to use when "writing, reviewing, or refactoring" TypeScript. Its first example handed "create a new validation module" to it.

    This happened because the description matched any TypeScript task. In theory, Claude could send ordinary writing to an Opus subagent.

    With this release, typescript-patterns-enforcer will now match the agent for three jobs only:

    • Review of a pull request or a set of files
    • Large multi-file refactors
    • Large JavaScript-to-TypeScript migrations

    Writing new code, small edits and single-file conversions go to the check skill. It applies the same rules inline in the main session. The check skill now names the agent as typescript-patterns-enforcer:review. The agent keeps its instructions and its model.

    The change is to the first line of the agent file. The description is 487 characters shorter (1,967 to 1,480), about 120 tokens in the Agent tool listing:

    # Old output (git show v0.6.0:agents/review.md | sed -n 3p | cut -c1-125)
    description: "Use this agent when writing, reviewing, or refactoring TypeScript code to ensure it adheres to established patt
    
    # New output (git show v0.6.1:agents/review.md | sed -n 3p | cut -c1-125)
    description: "Use this agent for a delegated, pattern-focused review or refactor of existing TypeScript code: reviewing a pul

    A headless test of the first draft of this change picked the agent in 1 of 16 review runs, against 0 of 16 on v0.6.0. It never picked the agent in the 16 writing runs on either version, so the old misrouting did not reproduce. That is too few runs to measure the effect on routing.

    Affects: anyone who asked Claude to write new TypeScript and relied on the review agent to do it. The check skill covers that case inline.

v0.6.0

Choose a tag to compare

@gagoar gagoar released this 02 Nov 20:35
d90edb5

v0.6.0 (2026-11-01)

Versions 0.5.12 to 0.5.15 were never tagged, so this release covers everything since v0.5.11.

  • Add six syntactic checks from the audit (#34, #35)

    Issue #34 audits a module of about a thousand lines that an agent wrote with the skill installed. The code passed tsc --strict and ESLint, and it still broke more than a dozen rules. Previously the engine checked ten rules. Now it runs sixteen. The six new checks need only syntax, not types:

    • no-zero-comparison flags .length compared with zero.
    • repeated-literal flags a string or template of 8 or more characters that appears three times in one file.
    • colon-annotated-lookup flags a non-empty lookup object typed with a colon annotation, such as const x: Record<K, V> = { ... }. It asks for as const satisfies.
    • fail-open-default flags ?? "" or ?? 0 after a call.
    • string-of-optional-chain flags String(a?.b).
    • void-guard flags a function named guard or assert* that returns void.

    The engine has no type information, so the checks that need types stay in the skill's prose.

    Original code:

    export const hasItems = (items: readonly string[]): boolean => items.length > 0;
    

    New output:

    L1:64  no-zero-comparison  `.length` compared with zero: coerce it (`!!x.length`, `!x.length`) (see SKILL.md Core Rule 10).  → SKILL.md Core Rule 10 — coerce: `!!x.length` / `!x.length`
    

    Original code:

    export const read = (files: ReadonlyMap<string, string>, path: string): string => files.get(path) ?? "";
    

    New output:

    L1:83  fail-open-default  `?? ""` turns absence or failure into a valid value: return a tagged result or throw (see SKILL.md Make Illegal States Unrepresentable).  → SKILL.md Make Illegal States Unrepresentable — return a tagged result or throw
    
  • Check TypeScript files written through a shell with an advisory Stop hook (#33)

    Previously the edit hook ran only after the Edit, Write, MultiEdit and NotebookEdit tools. A file that Claude wrote through a shell heredoc or a script never reached it. In the audit in #34, that is how a whole module skipped every check. Now a Stop hook runs when Claude stops. It finds the .ts and .tsx files in the working directory that changed since the session began, and it runs the same checks on them. It shows the findings as a message. It only reports and exits with code 0, so it never blocks the session. It skips node_modules, .git, dist, build, out, coverage, .next, .turbo and .d.ts files, and it looks at most eight directory levels deep.

    Original code (written with a shell heredoc to proj/helper.ts):

    export const hasItems = (items: readonly string[]): boolean => items.length > 0;
    

    New output:

    {"systemMessage":"ts-patterns: mechanical violations in TypeScript files changed this session (the edit hook does not see files written through a shell):\nproj/helper.ts:\n  L1:64  no-zero-comparison  `.length` compared with zero: coerce it (`!!x.length`, `!x.length`) (see SKILL.md Core Rule 10).  → SKILL.md Core Rule 10 — coerce: `!!x.length` / `!x.length`"}
    
  • Fold the audit findings into the skill and the review agent (#34, #32)

    The skill now covers more of what the audit found. It has new illegal-state smells: a tied nullable, a derivable field, a sentinel, a non-empty collection, a fail-open default and an unread return field. It also covers string boundaries, String(x) on a nullable value and asserts guards. Rule 9 now covers repeated literals and test code. Rule 11 states the accepted difference between tester flags and requires a literal input. The Review Checklist is now a list that Claude prints with each item marked checked or n/a, and it has a stopping rule for correctness. The trigger text now covers new modules and script ports. The review agent gets checklist items 18 to 24 and labels each finding as correctness or style.

  • Stop the magic-number check from flagging numbers inside a named constant (#34, #35)

    Previously no-magic-numbers flagged every number in const MS_PER_DAY = 24 * 60 * 60 * 1000 and every number in an as const literal. When the audit in #34 ran the hook by hand, its two findings were numbers inside named constants. Now the check skips the arithmetic of a named const and the inside of an as const literal. A bare number elsewhere, such as the 42 in export const getLimit = (): number => 42;, is still flagged.

    Original code:

    const MS_PER_DAY = 24 * 60 * 60 * 1000;
    export const LIMITS = { retries: 3, timeoutMs: 5000 } as const;
    export const days = (ms: number): number => ms / MS_PER_DAY;
    

    Old output (v0.5.11, exit code 2):

    ts-patterns: 6 mechanical violation(s) in .../named.ts:
      L1:20  no-magic-numbers  No magic number: 24.  → SKILL.md Core Rule 9 — extract to a named const
      L1:25  no-magic-numbers  No magic number: 60.  → SKILL.md Core Rule 9 — extract to a named const
      L1:30  no-magic-numbers  No magic number: 60.  → SKILL.md Core Rule 9 — extract to a named const
      L1:35  no-magic-numbers  No magic number: 1000.  → SKILL.md Core Rule 9 — extract to a named const
      L2:34  no-magic-numbers  No magic number: 3.  → SKILL.md Core Rule 9 — extract to a named const
      L2:48  no-magic-numbers  No magic number: 5000.  → SKILL.md Core Rule 9 — extract to a named const
    Fix these to satisfy the TypeScript patterns before continuing.
    

    New output (v0.6.0, exit code 0):

    (no output)
    

    Affects: projects that rely on the hook to flag numbers inside named constants. They now get fewer findings.

v0.5.11

Choose a tag to compare

@github-actions github-actions released this 12 Oct 13:33
0ed9793

v0.5.11 (2026-10-12)

No change for users. This release keeps the new CI gate rules from tripping the upload scanner themselves (#26).

v0.5.10

Choose a tag to compare

@github-actions github-actions released this 11 Oct 23:35
8d22144

v0.5.10 (2026-10-12)

No change for users. This release rewords one comment in the build script and adds two rules to the repository's CI safety gate (#25).

v0.5.9

Choose a tag to compare

@github-actions github-actions released this 11 Oct 23:31
e475ba4

v0.5.9 (2026-10-12)

No change for users. This release renames one local variable in the bundled parser so that a bare (declare && no longer reads as a shell command (#24).

v0.5.8

Choose a tag to compare

@github-actions github-actions released this 11 Oct 23:25
96e949c

v0.5.8 (2026-10-12)

No change for users. This release splits lone command words in the parsers' keyword calls so that the shell-command check on the upload no longer blocks the engine (#23).

v0.5.7

Choose a tag to compare

@github-actions github-actions released this 11 Oct 23:12
6283693

v0.5.7 (2026-10-12)

No change for users. This release removes template placeholders that looked like credentials from the build and from the generated bundle (#22).

v0.5.6

Choose a tag to compare

@github-actions github-actions released this 11 Oct 23:08
06c4d15

v0.5.6 (2026-10-12)

No change for users. This release replaces the error messages of the bundled parsers to clear another upload hold (#21).

v0.5.5

Choose a tag to compare

@github-actions github-actions released this 11 Oct 23:04
84c108d

v0.5.5 (2026-10-12)

No change for users. This release changes one line of the generated engine bundle so that a shell-tokenizer scan stops flagging it. The engine output does not change (#20).

⌂ 换网址