scientific-code-style
Skill1 starsChanged 6 months agoApache-2.0View on GitHub
Apply reusable coding, validation, documentation, and compiler
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- developer-tool-installation-policySkill
- git-refactor-hygieneSkill
- project-repository-setupSkill
- scientific-accelerator-portabilitySkill
- scientific-build-systemsSkill
- scientific-ciSkill
- scientific-cli-benchmarkSkill
- scientific-cli-designSkill
- scientific-container-workflowsSkill
- scientific-data-analysis-and-visualizationSkill
- scientific-data-managementSkill
- scientific-documentationSkill
- scientific-io-and-data-formatsSkill
- scientific-notebook-workflowsSkill
- scientific-numerics-reviewSkill
- scientific-package-managementSkill
- scientific-parallel-debuggingSkill
- scientific-performance-portabilitySkill
- scientific-profilingSkill
- scientific-release-and-publicationSkill
- scientific-reproducibilitySkill
- scientific-reviewSkill
- scientific-testingSkill
- scientific-workflow-automationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
51 rules. About 0 are common, 35 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈35
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 10
Use this skill when editing scientific-computing or HPC code and the repository does not already define stricter conventions in AGENTS.md.
- Distinctive: line 27
Use this skill when:
- Distinctive: line 33
Do not use this skill to override explicit repository conventions.
- Distinctive: line 37
When this skill applies:
- Distinctive: line 39
Read the repository AGENTS.md first, if present.
- Distinctive: line 40
Follow repository-specific rules where they exist.
- Distinctive: line 41
Use this skill only for gaps that are still unspecified.
- Distinctive: line 42
Keep changes pragmatic and aligned with the existing codebase.
- Distinctive: line 46
Prefer modern coding styles, idioms, and best practices.
- Distinctive: line 47
Keep source lines to 79 characters when practical.
- Distinctive: line 49
Avoid unnecessary dependencies, imports, and includes.
- Distinctive: line 50
Prefer straightforward code that is easy to benchmark, validate, and review.
- Distinctive: line 54
Use type hints and docstrings for functions and classes.
- Very specific: line 56
Prefer f-strings over % formatting and str.format().
- Distinctive: line 57
Prefer list comprehensions and generator expressions when they improve clarity.
- Distinctive: line 59
Prefer context managers for resource management.
- Very specific: line 60
Prefer pathlib over os.path.
- Distinctive: line 61
Use descriptive snake case for variables and functions.
- Distinctive: line 63
Prefer single quotes for string literals unless the string contains a single quote.
- Distinctive: line 70
Prefer C++20 or later when practical.
- Distinctive: line 71
Prefer smart pointers over raw owning pointers.
- Very specific: line 72
Prefer range-based for loops when they improve clarity.
- Very specific: line 73
Prefer auto when it removes redundant type noise.
- Very specific: line 74
Use nullptr instead of NULL or 0.
- Very specific: line 75
Prefer constexpr for compile-time constants.
- Very specific: line 76
Prefer std::string over C-style strings.
- Distinctive: line 77
Use descriptive snake case names.
- Very specific: line 86
Prefer -Wall -Wextra -Wpedantic as a practical default when supported.
- Distinctive: line 87
Treat new warnings as defects to fix, not noise to ignore.
- Very specific: line 88
Use -Werror only when the repository already relies on it or the toolchain is stable enough that it will not create avoidable churn.
- Distinctive: line 90
If a warning must be suppressed, prefer the narrowest possible suppression and document why it is necessary.
- Distinctive: line 92
Avoid disabling broad warning groups just to silence one issue.
- Very specific: line 96
Start with -Wall -Wextra -Wpedantic for GCC and Clang.
- Very specific: line 97
Consider adding -Wshadow when variable shadowing is likely to hide defects.
- Very specific: line 98
Consider adding -Wconversion and -Wsign-conversion for numerically sensitive code, but expect some cleanup effort before enabling them …
- Very specific: line 100
Consider adding -Wdouble-promotion for floating-point-heavy code when the toolchain supports it.
- Very specific: line 102
Consider adding -Wformat=2 for stricter format-string checking in C code.
- Distinctive: line 103
Prefer enabling additional warnings incrementally and fixing the resulting issues rather than turning on a large set all at once.
- Distinctive: line 112
Do not weaken warnings in release builds merely to keep optimized builds quiet.
- Very specific: line 114
If -Werror is used, prefer enabling it in CI or in well-controlled toolchains rather than assuming it is safe everywhere.
- Distinctive: line 119
Use a target-scoped warning helper rather than global flags when the repository uses CMake:
- Distinctive: line 155
Run static analysis tools appropriate to the language when available.
- Distinctive: line 160
If tools are unavailable, state that explicitly rather than assuming compliance.
- Very specific: line 163
Use developer-tool-installation-policy when deciding whether formatters, linters, or static-analysis tools should be project-pinned through …
- Distinctive: line 169
Add automated tests for major functionality when feasible.
- Distinctive: line 170
Keep tests independent of execution order.
- Distinctive: line 177
Document nontrivial functions, classes, and modules.
- Distinctive: line 178
Add usage examples when they materially help understanding.
- Distinctive: line 180
Prefer single quotes for Python docstrings.
- Distinctive: line 181
Use doctest format for Python examples when examples are useful.
- Distinctive: line 186
When using this skill, briefly note:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Scientific Code Style
Use this skill when editing scientific-computing or HPC code and the repository
does not already define stricter conventions in AGENTS.md.
Repository AGENTS.md instructions take precedence over this skill.
Purpose
Apply a consistent reusable default for:
- coding style
- language features to prefer or avoid
- validation habits
- testing expectations
- documentation quality
When To Use
Use this skill when:
- the task is in a scientific, numerical, or HPC codebase
- the user wants reusable scientific-computing conventions applied
- repository instructions are absent, minimal, or intentionally high-level
Do not use this skill to override explicit repository conventions.
Working Approach
When this skill applies:
- Read the repository
AGENTS.mdfirst, if present. - Follow repository-specific rules where they exist.
- Use this skill only for gaps that are still unspecified.
- Keep changes pragmatic and aligned with the existing codebase.
General Conventions
- Prefer modern coding styles, idioms, and best practices.
- Keep source lines to 79 characters when practical.
- Use descriptive names.
- Avoid unnecessary dependencies, imports, and includes.
- Prefer straightforward code that is easy to benchmark, validate, and review.
Python Conventions
- Use type hints and docstrings for functions and classes.
- Follow PEP 8.
- Prefer f-strings over
%formatting andstr.format(). - Prefer list comprehensions and generator expressions when they improve clarity.
- Prefer context managers for resource management.
- Prefer
pathliboveros.path. - Use descriptive snake case for variables and functions.
- Define constants at module scope with uppercase names.
- Prefer single quotes for string literals unless the string contains a single quote.
- Group imports as standard library, third-party, and local imports.
- Separate import groups with a blank line and alphabetize within each group.
C++ Conventions
- Prefer C++20 or later when practical.
- Prefer smart pointers over raw owning pointers.
- Prefer range-based
forloops when they improve clarity. - Prefer
autowhen it removes redundant type noise. - Use
nullptrinstead ofNULLor0. - Prefer
constexprfor compile-time constants. - Prefer
std::stringover C-style strings. - Use descriptive snake case names.
- Define constants with
constexprorconstusing uppercase names. - Group headers as corresponding header, standard library, third-party, and project headers.
- Separate header groups with a blank line and alphabetize within each group.
Compiler Warnings
- Enable a useful baseline of compiler warnings for C and C++ builds.
- Prefer
-Wall -Wextra -Wpedanticas a practical default when supported. - Treat new warnings as defects to fix, not noise to ignore.
- Use
-Werroronly when the repository already relies on it or the toolchain is stable enough that it will not create avoidable churn. - If a warning must be suppressed, prefer the narrowest possible suppression and document why it is necessary.
- Avoid disabling broad warning groups just to silence one issue.
Recommended Warning Flags
- Start with
-Wall -Wextra -Wpedanticfor GCC and Clang. - Consider adding
-Wshadowwhen variable shadowing is likely to hide defects. - Consider adding
-Wconversionand-Wsign-conversionfor numerically sensitive code, but expect some cleanup effort before enabling them broadly. - Consider adding
-Wdouble-promotionfor floating-point-heavy code when the toolchain supports it. - Consider adding
-Wformat=2for stricter format-string checking in C code. - Prefer enabling additional warnings incrementally and fixing the resulting issues rather than turning on a large set all at once.
Build-Type Guidance
- In debug builds, prefer strong warnings and debug symbols so problems are easy to diagnose.
- In release builds, keep the same warning baseline unless there is a repository-specific reason to differ.
- Do not weaken warnings in release builds merely to keep optimized builds quiet.
- If
-Werroris used, prefer enabling it in CI or in well-controlled toolchains rather than assuming it is safe everywhere.
CMake Pattern
Use a target-scoped warning helper rather than global flags when the repository uses CMake:
function(enable_project_warnings target_name)
target_compile_options(${target_name} PRIVATE
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:GNU,Clang>>:
-Wall
-Wextra
-Wpedantic
-Wshadow
-Wformat=2
>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU,Clang>>:
-Wall
-Wextra
-Wpedantic
-Wshadow
>
)
endfunction()Then apply it per target:
add_executable(example example.cpp)
enable_project_warnings(example)For numerically sensitive targets, consider a second stricter helper that adds
flags such as -Wconversion, but only after the repository is ready to address
the extra findings.
Validation Defaults
- Run static analysis tools appropriate to the language when available.
- For Python, prefer
pylint,flake8, andmypy. - For C++, prefer
clang-tidyandcppcheck. - For compiled languages, check whether warning flags are enabled and add them when the build system does not already define a reasonable baseline.
- If tools are unavailable, state that explicitly rather than assuming compliance.
Use developer-tool-installation-policy when deciding whether formatters,
linters, or static-analysis tools should be project-pinned through repository
configuration or installed globally for ad hoc inspection.
Testing Defaults
- Add automated tests for major functionality when feasible.
- Keep tests independent of execution order.
- Cover normal behavior and meaningful edge cases.
- For Python, prefer
pytest. - For C++, prefer Google Test.
Documentation Defaults
- Document nontrivial functions, classes, and modules.
- Add usage examples when they materially help understanding.
- For Python docstrings, prefer
numpyorscipystyle. - Prefer single quotes for Python docstrings.
- Use doctest format for Python examples when examples are useful.
- For C++, prefer Doxygen-style comments.
Output Expectations
When using this skill, briefly note:
- whether repository rules overrode any part of this skill
- which validation or test steps were run
- which checks could not be run
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.

