Skip to content

kotlin-engineer: forbid deprecated API unless the operator sanctions it#14

Merged
alexander-yevsyukov merged 2 commits into
masterfrom
claude/ecstatic-hopper-uDPvy
Jun 8, 2026
Merged

kotlin-engineer: forbid deprecated API unless the operator sanctions it#14
alexander-yevsyukov merged 2 commits into
masterfrom
claude/ecstatic-hopper-uDPvy

Conversation

@alexander-yevsyukov

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

Copy link
Copy Markdown
Contributor

Summary

Encodes a general deprecated-API policy in the kotlin-engineer skill.
The deprecation problem is generic, not specific to the deprecated Gradle API that
motivated it (cleaned up in SpineEventEngine/tool-base#177).

kotlin-engineer/SKILL.md — two parallel bullets, mirroring the existing !! split:

  • MUST DODeprecated API only on the operator's explicit instruction. When
    a human operator directs you to use a deprecated API, confine the call to the
    narrowest scope and suppress the warning right there —
    @Suppress("DEPRECATION") ("DEPRECATION_ERROR" for error-level) with a
    // Reason: … comment naming the sanctioning instruction and the replacement to
    migrate to.
  • MUST NOT DONo deprecated API in new or changed code without that
    explicit instruction; reach for the replacement named in the @Deprecated /
    ReplaceWith message or the library's migration notes instead.

kotlin-jvm-tester/SKILL.md — the Gradle-Task bullet is removed (the file
reverts to its pre-PR state). The general rule subsumes it, and test bodies
already defer to the kotlin-engineer baseline.

Validation

  • Suppression wording aligns with the repo's existing @Suppress(...) +
    // Reason: … convention in .agents/guidelines/coding.md.
  • kotlin-engineer/SKILL.md is 94 lines, kotlin-jvm-tester/SKILL.md 273 —
    both well under the ~500-line limit; directory names match frontmatter name;
    agents/openai.yaml untouched.
  • No task-plan references introduced; agent-neutral wording preserved.

https://claude.ai/code/session_014TVLouXfDWCg1sTQVW3ssM


Generated by Claude Code

claude added 2 commits June 8, 2026 15:40
Add a `kotlin-jvm-tester` Repo Note: a test that needs a real Gradle `Task` must build it with `project.tasks.register(name).get()`, not the deprecated eager `project.tasks.create(name)`. Gradle deprecated the `create(String): Task` overload, so the eager form makes `compileTestKotlin` emit a deprecation warning. This keeps newly authored tests off the deprecated API.

https://claude.ai/code/session_014TVLouXfDWCg1sTQVW3ssM
Encode a general rule in `kotlin-engineer`: do not use deprecated APIs in
new or changed code unless a human operator explicitly directs it. When
sanctioned, confine the call to the narrowest scope and `@Suppress` the
warning at the site with a `// Reason:` comment naming the instruction and
the replacement to migrate to.

Drop the Gradle-`Task`-specific bullet from `kotlin-jvm-tester`: the
general rule now covers it, and test bodies already defer to the
`kotlin-engineer` baseline. The deprecation problem is generic, not
specific to the deprecated Gradle API that motivated it.

https://claude.ai/code/session_014TVLouXfDWCg1sTQVW3ssM
@alexander-yevsyukov alexander-yevsyukov changed the title kotlin-jvm-tester: steer Gradle Task fixtures to lazy tasks.register() kotlin-engineer: forbid deprecated API unless the operator sanctions it Jun 8, 2026
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review June 8, 2026 17:43
Copilot AI review requested due to automatic review settings June 8, 2026 17:43
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jun 8, 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

This PR updates the kotlin-engineer skill to encode a general repository policy around deprecated API usage: deprecated APIs should only be used when explicitly sanctioned by a human operator, and such usage should be tightly scoped and locally suppressed with an explanatory reason.

Changes:

  • Add a MUST-DO rule requiring explicit operator instruction before using any deprecated API, including guidance on localized suppression and documenting the reason and intended migration target.
  • Add a MUST-NOT rule forbidding deprecated API usage in new/changed code unless explicitly instructed, directing engineers to preferred replacements.

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

@alexander-yevsyukov alexander-yevsyukov merged commit 7bd2d9e into master Jun 8, 2026
1 check passed
@alexander-yevsyukov alexander-yevsyukov deleted the claude/ecstatic-hopper-uDPvy branch June 8, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants