Skip to content

which-fixer skill#19

Merged
alexander-yevsyukov merged 9 commits into
masterfrom
which-fixer-skill
Jun 16, 2026
Merged

which-fixer skill#19
alexander-yevsyukov merged 9 commits into
masterfrom
which-fixer-skill

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

Adds a new shared skill, which-fixer, that fixes the restrictive
"which/that" grammar error in source-code comments and documentation. It
rewrites a restrictive "which" (no preceding comma) to "that" and leaves
non-restrictive ", which" clauses alone. The mistake recurs across the Spine
codebase because the Russian relative pronoun который covers both English
senses indiscriminately, so it warrants a dedicated, repeatable fixer rather
than ad-hoc cleanup.

How it works

  • Two modes, auto-detected. On the first run in a repo (no
    .agents/memory/which-fixer-applied.md marker) it sweeps the whole codebase
    (tracked files only, so submodules and generated paths are skipped), then
    records completion. Every later run reads that marker and switches to
    incremental mode — only the files changed on the current branch, taking
    the union of git diff --diff-filter=ACMR origin/master...HEAD and the
    working-tree diff so uncommitted edits are covered too.
  • Fix in place. It edits files and produces a concrete diff for review,
    rather than printing a list of complaints.
  • Scope discipline. In .kt/.kts/.java/.proto it touches comment
    text only — never code tokens, string literals, or code embedded in doc
    comments ({@code}, <pre>, @sample, KDoc backticks); in .md/.adoc it
    skips fenced, indented, inline, and AsciiDoc delimited code so documented
    samples are never altered.
  • Conservative skip set to avoid false positives: comma-preceded and other
    non-restrictive markers (parenthesis- or dash-introduced), any preposition +
    "which", interrogative/determiner (including embedded), sentence-initial
    "Which", hyphenated identifiers (e.g. which-fixer), and the fixed phrases
    "that which" / "which is which". An ambiguous case is left unchanged and
    reported under Skipped[] — a missed fix is preferred over a wrong one.

Rollout

Run which-fixer once per repo for the initial sweep; the recorded marker —
kept permanently in .agents/memory/ — then keeps later invocations in
incremental mode. Run it again on each branch afterward to catch new
occurrences in changed comments and docs.

Files

  • skills/which-fixer/SKILL.md — the skill definition.
  • skills/which-fixer/agents/openai.yaml — Codex/OpenAI interface metadata.

Verification

  • Three English-focused review rounds (self-consistency on which/that, rule
    correctness, grammar, US-spelling consistency, false-positive coverage):
    HAS FINDINGS → HAS FINDINGS → CLEAN; subsequent Copilot and Codex review
    comments were addressed in the Address review comments commits.
  • author-skill checklist passes: directory name matches name, description
    583 chars (< 1024), 180 lines (< 500), $which-fixer prompt present, no
    task-plan references.
  • The skill's own prose obeys the rule it teaches — no misused restrictive
    "which".

@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review June 15, 2026 20:20
Copilot AI review requested due to automatic review settings June 15, 2026 20:20
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jun 15, 2026
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new which-fixer skill to standardize “restrictive which → that” fixes in source-code comments and repository documentation, with guidance for bulk vs incremental operation and an agent entrypoint configuration.

Changes:

  • Introduces skills/which-fixer/SKILL.md defining scope, workflow, and reporting format for the fixer.
  • Adds skills/which-fixer/agents/openai.yaml to register the skill with a default prompt and UI metadata.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
skills/which-fixer/SKILL.md Documents the skill’s grammar rule, scanning constraints, and bulk/incremental workflow including completion recording.
skills/which-fixer/agents/openai.yaml Registers the skill’s display name, short description, and default prompt for the OpenAI agent interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/SKILL.md
Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/agents/openai.yaml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00200e74b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/which-fixer/SKILL.md
Comment thread skills/which-fixer/SKILL.md
Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/SKILL.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 15, 2026 22:40
alexander-yevsyukov and others added 2 commits June 15, 2026 23:41
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@alexander-yevsyukov alexander-yevsyukov marked this pull request as draft June 15, 2026 22:43
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review June 15, 2026 22:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread skills/which-fixer/agents/openai.yaml Outdated
Comment thread skills/which-fixer/SKILL.md Outdated
@alexander-yevsyukov alexander-yevsyukov marked this pull request as draft June 15, 2026 22:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fe189058a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/which-fixer/SKILL.md
Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/SKILL.md Outdated
Comment thread skills/which-fixer/SKILL.md Outdated

@armiol armiol left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-yevsyukov LGTM in general. I can see a lot of comments from reviewers, and also this is still a draft, so just commenting for now.

alexander-yevsyukov and others added 2 commits June 16, 2026 16:15
Skip parenthetical/dash non-restrictive clauses and hyphenated identifiers;
exclude code inside doc comments and indented/AsciiDoc blocks; broaden proto
scope and restore .adoc; scan tracked files only (skip submodules); include
working-tree edits and drop deleted paths from incremental diffs; soften the
pre-pr wording.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread skills/which-fixer/SKILL.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 16:24
@alexander-yevsyukov alexander-yevsyukov merged commit 1c9ca26 into master Jun 16, 2026
1 check passed
@alexander-yevsyukov alexander-yevsyukov deleted the which-fixer-skill branch June 16, 2026 16:26
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in v2.0 Jun 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment on lines +41 to +45
- `git diff --name-only --diff-filter=ACMR origin/master...HEAD` — committed
changes since the branch diverged from `origin/master` (three-dot, not a
plain tip-to-tip diff); and
- `git diff --name-only --diff-filter=ACMR HEAD` — staged and unstaged
working-tree edits.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 201223e6c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +44 to +45
- `git diff --name-only --diff-filter=ACMR HEAD` — staged and unstaged
working-tree edits.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include untracked files in incremental scans

When incremental mode is run before a newly created .md, .kt, or .proto file is staged, both commands in this union omit it: the three-dot diff only covers committed branch changes, and git diff --name-only ... HEAD reports tracked/staged changes but not untracked paths (I checked git status -h, where untracked files are surfaced separately via --untracked-files). Since this workflow explicitly targets agents working before an explicit commit, new documentation/comment files can be skipped entirely until the user stages them; add git ls-files --others --exclude-standard to the union or state that new files must be staged first.

Useful? React with 👍 / 👎.

Comment on lines +75 to +77
`{@code …}` / `{@literal …}` inline tags, `<pre>`/`<code>` HTML blocks,
`@sample` references, and Markdown backtick spans or fenced blocks inside
KDoc — so a documented snippet such as `which java` is never rewritten.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip indented KDoc code blocks

Fresh evidence after the earlier source-comment code-block fix: this exclusion covers inline tags, HTML blocks, @sample, and KDoc backticks/fences, but not Markdown indented code blocks. Because KDoc uses Markdown, a comment example written as a four-space- or tab-indented snippet inside /** ... */ can still be scanned and a command like which java can be rewritten to that java, corrupting the sample; add the same indented-block exclusion for KDoc comment text before replacements run.

Useful? React with 👍 / 👎.

Comment on lines +81 to +85
Skip every code form, not just the common ones:
- Markdown — fenced code blocks (triple-backtick and `~~~`), inline code
spans, and four-space-indented code blocks.
- AsciiDoc — delimited blocks: listing (`----`), literal (`....`), and
`[source]` blocks, plus inline code spans.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude Markdown link targets from rewrites

This Markdown/AsciiDoc exclusion list skips code forms but not link or image destinations, so a target such as [guide](which.md) or a reference URL containing /which can pass the later word checks and be rewritten to that, breaking the link even though the occurrence is not prose. Please exclude inline-link destinations, image destinations, and reference definitions from the scan while still allowing visible link text to be fixed.

Useful? React with 👍 / 👎.


# Which/that fixer

Fix the common "which/that" confusion in English documentation and code comments.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip quoted grammar terms before replacing

When this skill runs on docs that discuss the word itself, this quoted "which/that" term is not a relative pronoun, but it still passes the later guards and can be rewritten to "that/that"; the same applies to wording like "which" clauses elsewhere in this file. Add a guard for quoted/metalinguistic mentions of the word, or require those mentions to be marked as code before scanning.

Useful? React with 👍 / 👎.

Comment on lines +90 to +92
- **Comma check (mandatory):** the word "which" is *not* immediately preceded
by a comma (allowing for optional whitespace between the comma and "which").
If a comma precedes it, this is non-restrictive — leave it untouched.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve comma guards through Markdown markers

In Markdown prose, formatting can sit between the comma and which, such as the file, **which** is generated, or a blockquote continuation can insert > before the next-line which; this check only allows whitespace between the comma and the word, so those non-restrictive clauses pass and get rewritten to that. Strip or ignore Markdown emphasis/quote markers when checking the preceding punctuation so valid non-restrictive clauses stay unchanged.

Useful? React with 👍 / 👎.

Comment thread skills/which-fixer/SKILL.md Outdated
Comment on lines +127 to +129
Apply changes with the Edit tool, file by file. When a file has multiple
occurrences, batch them into one edit per file rather than one edit per
occurrence.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep edit instructions agent-neutral

AGENTS.md requires shared skills to stay agent-neutral for Claude, Codex, and Junie, but this hard-codes an Edit tool workflow. In runtimes that do not expose a tool with that name, the skill can become ambiguous or fail even though a normal file edit would work; phrase this as editing the file with the current agent's available mechanism instead of naming one runtime's tool.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants