polyglot-production-code
Skill1 starsChanged 3 months agoMITView on GitHub
Use when coding in a supported production language.
In this repository17 other files it gives its agents.
- bounded-task-specificationSkill
- decision-record-traceabilitySkill
- safe-tool-actionsSkill
- skill-authoringSkill
- change-review-triageSkill
- deployment-readinessSkill
- final-code-reviewSkill
- repository-access-boundarySkill
- verified-deliverySkill
- accessibility-review-planningSkill
- verification-charter-designSkill
- evidence-first-researchSkill
- lightweight-threat-modelingSkill
- untrusted-content-triageSkill
- consented-voice-calibrationSkill
- final-prose-reviewSkill
- genre-aware-proseSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
37 rules. About 0 are common, 21 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill to make production changes in a supported language without imposing an alien house style.
- Distinctive: line 21
Do not use to reformat unrelated code, replace a documented local style, or transplant rules from one language ecosystem into another.
- Distinctive: line 26
Read repository instructions and inspect adjacent production code, tests, and recent similar changes.
- Distinctive: line 34
Honor local authority: Use committed formatter, linter, type policy, language version, dependency policy, and CI commands before applying …
- Distinctive: line 38
Make contracts explicit: Use the language's natural types, schemas, doc comments, headers, and error mechanisms to state caller-relevant …
- Distinctive: line 40
Choose recoverable failure paths deliberately: Do not use a panic, assertion, exception, or process exit for an ordinary user-triggerable …
- Distinctive: line 42
Use the native quality loop: Run the configured formatter, static analysis, focused tests, relevant integration/contract tests, and build …
- Distinctive: line 44
Avoid mechanical churn: Do not combine a feature or repair with unrelated formatting, import-order, or style edits.
- Very specific: line 51
Use four spaces; modules/functions/values are snake_case.
- Distinctive: line 52
Keep modules focused. Prefer absolute imports.
- Distinctive: line 55
Keep tests discoverable in an explicit test tree.
- Distinctive: line 57
Document public and non-obvious APIs.
- Distinctive: line 61
Run one committed formatter configuration.
- Very specific: line 62
Use UpperCamelCase for types, classes, interfaces, enums, and decorators.
- Distinctive: line 63
Keep modules focused and imports explicit when named imports improve clarity.
- Very specific: line 65
Use purpose-built Error subclasses when the domain needs them.
- Distinctive: line 66
Use JSDoc for exported or non-obvious APIs.
- Distinctive: line 67
Keep unit, integration/end-to-end, type-check, and build commands independently runnable.
- Very specific: line 71
Run gofmt or go fmt for changed packages and goimports when imports change.
- Very specific: line 72
Use short, clear package names.
- Very specific: line 73
Keep packages cohesive and public APIs small.
- Distinctive: line 75
Document every exported package, type, function, method, and sentinel error with identifier-leading comments.
- Very specific: line 76
Keep *_test.go tests with the package, cover success/failure/edge cases, and use race detection for concurrent code.
- Very specific: line 77
Run go test ./..., go vet ./..., formatting/import checks, and intentional module-hygiene checks.
- Very specific: line 81
Use default rustfmt output and enforce cargo fmt --check.
- Very specific: line 82
Use snake_case for modules, functions, methods, and locals.
- Very specific: line 83
Use as_ for cheap borrowed views, to_ for potentially costly conversions, and into_ for ownership-consuming conversions.
- Very specific: line 85
Use Result<T, E> for recoverable failure.
- Very specific: line 86
Document public APIs with examples and material # Errors, # Panics, or safety sections.
- Very specific: line 87
Run cargo fmt --check, configured Clippy checks, cargo test, and relevant documentation checks.
- Very specific: line 91
Use the committed formatter/analyzer and build wrapper.
- Very specific: line 95
Keep unit tests deterministic and infrastructure-free.
- Distinctive: line 103
Use build-system test targets and explicit compiler warnings.
- Distinctive: line 115
Formatter warfare: Do not manually undo the formatter or merge format-only changes into behavioral work.
- Distinctive: line 117
Exception misuse: Do not make routine user-triggerable failure fatal when an explicit recoverable path exists.
- Distinctive: line 120
Dependency drift: Do not introduce a formatter, linter, framework, or runtime merely because this skill mentions it.
- Distinctive: line 124
Before reporting completion, verify that:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Polyglot Production Code
Use this skill to make production changes in a supported language without imposing an alien house style. It is self-contained: inspect the target repository first, then apply the relevant defaults below only where the repository's own configuration is silent.
When to Use
- Adding, changing, reviewing, or repairing code in Python, JavaScript/TypeScript, Go, Rust, Java, Kotlin, C#, C, C++, Swift, Ruby, PHP, or Scala.
- Establishing a minimal production quality gate in a repository that lacks one.
- Reviewing whether a change follows its language's established naming, error, testing, API, and tooling conventions.
Do not use to reformat unrelated code, replace a documented local style, or transplant rules from one language ecosystem into another.
Prerequisites
- Identify the language version, build tool, package/dependency manifest, formatter, linter/analyzer, type checker, test runner, and CI workflow.
- Read repository instructions and inspect adjacent production code, tests, and recent similar changes.
- Classify the change: feature, defect repair, refactor, contract change, migration, or dependency update.
- Name the observable behavior and the narrowest relevant checks before editing.
Completion: local authority and the change's verification target are known before implementation begins.
Procedure
- Honor local authority. Use committed formatter, linter, type policy, language version, dependency policy, and CI commands before applying the defaults below.
- Completion: the change follows existing configuration or records why a missing configuration needs a declared baseline.
- Preserve native structure. Match the ecosystem's package, module, crate, namespace, header, or source-set conventions. Keep every changed unit cohesive.
- Completion: imports/includes, public boundaries, and source/test layout match the repository pattern.
- Make contracts explicit. Use the language's natural types, schemas, doc comments, headers, and error mechanisms to state caller-relevant inputs, outputs, failure modes, ownership, lifecycle, concurrency, or nullability.
- Completion: a caller can use the changed interface without reading implementation internals.
- Choose recoverable failure paths deliberately. Do not use a panic, assertion, exception, or process exit for an ordinary user-triggerable condition when the language has an explicit recoverable mechanism.
- Completion: failure behavior is diagnosable, preserves material cause/context, and has tests where it is material.
- Use the native quality loop. Run the configured formatter, static analysis, focused tests, relevant integration/contract tests, and build or documentation checks.
- Completion: actual command results are recorded; failed checks are not concealed.
- Avoid mechanical churn. Do not combine a feature or repair with unrelated formatting, import-order, or style edits.
- Completion: the diff is behaviorally focused and reviewable.
Language Defaults
Python
- Use four spaces; modules/functions/values are
snake_case; classes areCapWords; failure exception classes end inError. - Keep modules focused. Prefer absolute imports; use explicit relative imports only when they materially clarify package locality.
- Type public functions and cross-module boundaries. Treat the repository's strict type check as a quality gate, not decorative documentation.
- Configure format, lint, type, tests, coverage, and dependencies coherently, ordinarily in
pyproject.tomlwhen supported. - Keep tests discoverable in an explicit test tree; add regression tests for defects and relevant failure behavior.
- Raise specific errors and use named loggers for production diagnostics rather than
print. - Document public and non-obvious APIs; use schemas and signatures as the canonical contract where possible.
JavaScript and TypeScript
- Run one committed formatter configuration. Do not hand-tune whitespace against its output.
- Use
UpperCamelCasefor types, classes, interfaces, enums, and decorators; uselowerCamelCasefor values, parameters, functions, methods, properties, and modules. - Keep modules focused and imports explicit when named imports improve clarity.
- Validate network, file, environment, and user input at runtime boundaries. TypeScript declarations do not validate untrusted runtime data.
- Use purpose-built
Errorsubclasses when the domain needs them; preserve cause and context and test failure behavior. - Use JSDoc for exported or non-obvious APIs. Let TypeScript declarations carry routine type details.
- Keep unit, integration/end-to-end, type-check, and build commands independently runnable.
Go
- Run
gofmtorgo fmtfor changed packages andgoimportswhen imports change. Do not hand-format against them. - Use short, clear package names; avoid repeating the package name in exported identifiers; preserve standard initialisms such as
URL,HTTP, andID. - Keep packages cohesive and public APIs small. Pass
context.Contextas the first parameter for request-scoped cancellation, deadlines, authorization, or tracing. Do not store it in a struct. - Return and handle errors. Do not
panicfor normal operational failures. Wrap errors with operation context while preservingerrors.Is/errors.Asinspection. - Document every exported package, type, function, method, and sentinel error with identifier-leading comments.
- Keep
*_test.gotests with the package, cover success/failure/edge cases, and use race detection for concurrent code. - Run
go test ./...,go vet ./..., formatting/import checks, and intentional module-hygiene checks.
Rust
- Use default
rustfmtoutput and enforcecargo fmt --check. Do not customize formatting without a repository reason. - Use
snake_casefor modules, functions, methods, and locals;UpperCamelCasefor types, traits, and enum variants;SCREAMING_SNAKE_CASEfor constants/statics. - Use
as_for cheap borrowed views,to_for potentially costly conversions, andinto_for ownership-consuming conversions. - Organize focused modules/crates and expose an intentional public API. Prefer standard traits and conversions before bespoke wrappers.
- Use
Result<T, E>for recoverable failure; reservepanic!for violated invariants. Do not use productionunwraporexpectunless impossibility is explicit and justified. - Document public APIs with examples and material
# Errors,# Panics, or safety sections. Keep unit tests near source and integration tests intests/. - Run
cargo fmt --check, configured Clippy checks,cargo test, and relevant documentation checks.
Java, Kotlin, and C#
- Use the committed formatter/analyzer and build wrapper. Keep packages/namespaces/source sets and test projects aligned with production structure.
- Java: use
UpperCamelCasetypes,lowerCamelCasemethods/fields,UPPER_SNAKE_CASEconstants, no wildcard imports, deliberate exception wrapping, and Javadoc for material public/protected contracts. - Kotlin: use
UpperCamelCasetypes/files andlowerCamelCasefunctions/properties; favor nullability and sealed/result-style outcomes for expected states; do not use!!as routine control flow; use KDoc for non-obvious public contracts. - C#: version
.editorconfig; use PascalCase types/members, camelCase locals/parameters,I-prefixed interfaces, andAsync-suffixed asynchronous methods. Catch only to recover, preserve stacks withthrow;, and use XML docs for public API where material. - Keep unit tests deterministic and infrastructure-free; separate integration tests. Run the normal Maven/Gradle or
dotnet testlifecycle with the project analyzers.
C and C++
- Match local formatter and language baseline first. Do not mix styles or make format-only churn.
- C: use descriptive
lower_snake_case; reserve uppercase for macros and enum constants. Keep public headers self-sufficient and document ownership, input constraints, output validity, and explicit failure states. Use location-aware diagnostics where relevant. - C++: keep include dependencies explicit; make ownership and lifetime visible with RAII and appropriate smart pointers. Choose and document the exception policy. Assertions are for internal invariant failures, not user-triggerable failure.
- Explain contracts and rationale, not syntax. Put API-use comments at declarations and implementation rationale at definitions.
- Use build-system test targets and explicit compiler warnings. Run sanitizer, fuzz, coverage, and pedantic configurations when supported and relevant.
Swift, Ruby, PHP, and Scala
- Swift: optimize APIs for call-site clarity with precise labels and domain terms; document public declarations concisely; use typed errors and committed
swift-formatconfiguration with corresponding test targets. - Ruby: use
snake_casemethods/values/files,CamelCaseclasses/modules,?predicates, and!only for dangerous or raising counterparts. Align files and constants, rescue narrowly, use RDoc for material public API, and enforce the committed RuboCop/test commands. - PHP: use LF, four spaces, explicit visibility, namespaces/imports, PascalCase classes, camelCase methods, and cohesive files. Enable strict types in new code unless compatibility says otherwise. Use strict test assertions and static analysis; catch
Throwablesubclasses narrowly with preserved context. - Scala: commit and use
scalafmt; package by domain; avoidnull; useOptionfor absence,Eitherfor expected domain failure, andTryat exception-wrapping boundaries. Use Scaladoc for material public APIs and run the configuredsbttest/format/lint checks.
Pitfalls
- Universal-style fantasy: A generic default never overrides an established repository convention.
- Formatter warfare: Do not manually undo the formatter or merge format-only changes into behavioral work.
- Type-only trust: Static types do not validate external runtime data.
- Exception misuse: Do not make routine user-triggerable failure fatal when an explicit recoverable path exists.
- Documentation theater: Public documentation explains contract and failure behavior, not line-by-line implementation.
- Test monoculture: Unit tests alone may not protect builds, type checks, integrations, concurrency, sanitizers, or generated documentation.
- Dependency drift: Do not introduce a formatter, linter, framework, or runtime merely because this skill mentions it; use the project's current toolchain unless change scope authorizes adoption.
Verification
Before reporting completion, verify that:
- local language/tooling configuration and adjacent code were inspected;
- changed code follows local conventions or an explicitly declared language baseline;
- public contracts and recoverable error paths are appropriate to the language;
- relevant formatting, static analysis, build, and test commands ran with actual results; and
- the final diff contains no unrelated style churn.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

