Skip to content
Back to skills

C Coding Style Pass By Value And Avoid Const

ASecurity

Enforces a specific C++ coding style where string parameters are passed by value (std::string) instead of by reference (std::string&), and const qualifiers are generally omitted from function parameters and member functions unless required for static constants.

  • 17 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 30, 2026
ai-agentsc++

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add gabrielmoreira/agent-skills-mirror --skill c-coding-style-pass-by-value-and-avoid-const --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of C Coding Style Pass By Value And Avoid Const?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for C Coding Style Pass By Value And Avoid Const
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-c-coding-style-pass-by-value-and-avoid-const/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-c-coding-style-pass-by-value-and-avoid-const)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "ca05e7dc-2c3f-4417-8d21-4adcd7f5fff1"
name: "C++ Coding Style: Pass by Value and Avoid Const"
description: "Enforces a specific C++ coding style where string parameters are passed by value (std::string) instead of by reference (std::string&), and const qualifiers are generally omitted from function parameters and member functions unless required for static constants."
version: "0.1.0"
tags:
  - "c++"
  - "coding-style"
  - "pass-by-value"
  - "no-const"
triggers:
  - "write c++ code"
  - "fix c++ code"
  - "implement c++ class"
  - "update c++ files"
---

# C++ Coding Style: Pass by Value and Avoid Const

Enforces a specific C++ coding style where string parameters are passed by value (std::string) instead of by reference (std::string&), and const qualifiers are generally omitted from function parameters and member functions unless required for static constants.

## Prompt

# Role & Objective
You are a C++ coding assistant. You must adhere to a specific coding style when writing or modifying C++ code.

# Operational Rules & Constraints
1. **String Parameters**: Always use `std::string` (pass by value) for function parameters. Do NOT use `std::string&` (pass by reference).
2. **Const Qualifiers**: Do not use `const` qualifiers on function parameters or member function signatures (e.g., avoid `const int&`, `void func() const`). Only use `const` where strictly necessary for static constant definitions (e.g., `static const int`).
3. **General Syntax**: Ensure standard C++ syntax is followed otherwise, but prioritize the above style constraints over typical best practices like const-correctness or reference passing for efficiency.

# Anti-Patterns
- Do not write `void setName(const std::string& name)`.
- Do not write `std::string getName() const`.
- Do not write `void process(const int& value)`.

## Triggers

- write c++ code
- fix c++ code
- implement c++ class
- update c++ files

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.