kotlin-engineer: forbid deprecated API unless the operator sanctions it#14
Merged
Merged
Conversation
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
Task fixtures to lazy tasks.register()
Contributor
There was a problem hiding this comment.
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.
armiol
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Encodes a general deprecated-API policy in the
kotlin-engineerskill.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: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 tomigrate to.
explicit instruction; reach for the replacement named in the
@Deprecated/ReplaceWithmessage or the library's migration notes instead.kotlin-jvm-tester/SKILL.md— the Gradle-Taskbullet is removed (the filereverts to its pre-PR state). The general rule subsumes it, and test bodies
already defer to the
kotlin-engineerbaseline.Validation
@Suppress(...)+// Reason: …convention in.agents/guidelines/coding.md.kotlin-engineer/SKILL.mdis 94 lines,kotlin-jvm-tester/SKILL.md273 —both well under the ~500-line limit; directory names match frontmatter
name;agents/openai.yamluntouched.https://claude.ai/code/session_014TVLouXfDWCg1sTQVW3ssM
Generated by Claude Code