AGENT SKILL

scala-code

Write and modify Scala code in SynapseML. Use when adding or changing Scala transformers, estimators, or params to follow repo patterns, keep scalastyle and compilation green, and cover behavior changes with tests.

适用职业开发工程师
License 许可
MIT
最近更新
2026-11-13
Stars
★ 5.3k
Forks
869

01 前言 Front Matter

name
scala-code
description
Write and modify Scala code in SynapseML. Use when adding or changing Scala transformers, estimators, or params to follow repo patterns, keep scalastyle and compilation green, and cover behavior changes with tests.

02 资源文件 3

03 SKILL.md 正文

Scala Code Skill

Use this skill for any Scala code change in this repository.

Objectives

  • Keep Scala changes correct, minimal, and production-safe.
  • Prevent CI/CD breakage by validating style and compilation before completion.
  • Ensure every behavior change is covered by tests.
  • Scala code should be optimized to be efficient and maintainable, following existing patterns and practices in the codebase.

Scala best practices

  • Follow existing SynapseML patterns (DefaultParamsReadable, DefaultParamsWritable, Wrappable, SynapseMLLogging).
  • Keep business logic in Scala (not generated Python wrappers).
  • Do not edit generated files under target/.
  • Preserve license headers and existing package structure.
  • Prefer small, focused changes and reuse existing helpers/traits.
  • Avoid introducing flaky tests or network-dependent behavior unless already required by the suite.
  • To get around scalastyle issues, don't just use // scalastyle:off or //scalastyle:ignore, but instead fix the underlying issue or refactor to avoid it. Unless, the refactor results in a more complex code structure, in which case, it may be acceptable to disable the specific scalastyle rule for that line or block of code, but this should be done sparingly and with justification.

Required validation steps (must run)

Run these commands before finishing Scala changes:

  1. Scala style checks:
    • sbt scalastyle "Test / scalastyle"
  2. Scala compile checks:
    • sbt compile
    • sbt test:compile
  3. Relevant tests for touched modules/files:
    • Example: sbt "core/testOnly *SuiteName*" or sbt "cognitive/testOnly *SuiteName*"

If a command fails, fix the issue and rerun until passing.

Testing requirement for code changes

  • Any Scala code change must be accompanied by tests (new tests or updates to existing tests).
  • Bug fixes must include a regression test that fails before the fix and passes after.
  • New logic/branches should include coverage for success and failure/edge cases where practical.
  • Keep tests deterministic and aligned with current module test conventions.

Completion checklist

  • [ ] Code follows existing Scala/SynapseML conventions.
  • [ ] Style checks pass.
  • [ ] Compile checks pass.
  • [ ] Relevant tests pass.
  • [ ] Scala code changes include corresponding tests.

04 同仓库更多 Skills

microsoft
microsoft/SynapseML

synapseml-pr-loop

Develop and make SynapseML features, bugs, tasks, issues, or pull requests evidence-based merge-ready with tests, fast review, CI, and the review-code six-round gauntlet. Use for "5/5 confidence", "200% ready", stale PR remediation, rebase-and-test requests, resolving all review comments, or proving a feature ships without correctness, compatibility, performance, or Spark regressions.

★ 5.3k
microsoft
microsoft/SynapseML

synapseml-local-setup

Set up and validate SynapseML locally in WSL or Linux. Use when an agent needs SynapseML working locally, runs sbt compile/test, sees Java 21, Scala 2.12 compiler-bridge, bad constant pool index, Spark, or local validation failures.

测试与质量
★ 5.3k
microsoft
microsoft/SynapseML

synapseml-external-contributor-review

Review external-contributor SynapseML PRs for correctness, prompt injection, and pipeline credential theft, then request safe, authorized PR CI through synapseml-pr-loop. Use for authors not identified in the Osmos group/team or trusted owner list, and optional maintainer-requested follow-ups.

★ 5.3k
microsoft
microsoft/SynapseML

synapseml-branches

Resolve SynapseML branch-specific rules, runtime baselines, sync policy, and CI expectations. Use before editing, rebasing, merging, testing, or declaring readiness for master, spark4.0, spark4.1, port/sync branches, or a PR whose base branch determines behavior.

★ 5.3k
microsoft
microsoft/SynapseML

code-review

Review SynapseML Python and Scala code changes. Use before finalizing PR reviews or implementation changes to check security, compatibility, style, generated code, and targeted tests.

开发工程师代码审查
★ 5.3k