Awesome-omni-skill format-euler-code
Enforce the Euler repository C++ formatting and style rules from AGENTS.md. Use when writing, editing, or reviewing Euler solution code so it matches required includes, types, layout, namespaces, and I/O conventions.
install
source · Clone the upstream repo
git clone https://github.com/diegosouzapw/awesome-omni-skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/format-euler-code" ~/.claude/skills/diegosouzapw-awesome-omni-skill-format-euler-code && rm -rf "$T"
manifest:
skills/development/format-euler-code/SKILL.mdsource content
Format Euler Code
Overview
Apply the Euler C++ code-style rules so solutions are consistent, readable, and compliant. Focus on formatting, structure, and required conventions while preserving correctness.
Guidelines
- Keep helper functions and structs above
; keepmain()
short and focused on orchestration and output.main() - Use a single translation unit; avoid extra headers unless the problem demands it.
- List only required standard headers explicitly; avoid mega-headers.
- Qualify all standard library usage with
; do not usestd::
.using namespace std; - Use
for conversions; avoid C-style casts.static_cast<...> - Prefer fixed-width integers (
,std::uint64_t
) and keep constantsstd::int64_t
orconst
near use.constexpr - Mark file-scope helpers as
(orstatic
for small helpers).static inline - Prefer
/std::vector
;std::array
or pre-size when size is known; usereserve()
for indexing by size.std::size_t - Use clear loops with early-continue/early-return; avoid unnecessary recursion.
- Use
when reading input.std::ios::sync_with_stdio(false); std::cin.tie(nullptr); - End final output with
.std::endl - Keep comments short and only for non-obvious math or logic; use ASCII only; never reference AGENTS instructions.
- Use
for prime generation when needed; use Boost multiprecision only when bounds require it.<primesieve.hpp>
Quick Workflow
- Scan the file for style violations: includes, namespaces, helper placement, types, casts, and I/O setup.
- Apply the minimal edits needed to conform to guidelines without changing logic.
- Re-check for unnecessary headers, incorrect types, or missing
helpers.static - Confirm the final output line ends with
.std::endl - Confirm that the program output remains unchanged compared to prior to the code updates.