Skip to content
Back to skills

C Coding Style Pass By Value And Avoid Const

ASecurity

Generates or refactors C++ code adhering to specific style constraints: passing string parameters by value (std::string) instead of by reference (std::string&), and avoiding the use of const qualifiers on parameters and variables.

  • 611 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 11, 2026
educationc++

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --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/ecnu-icalk-c-coding-style-pass-by-value-and-avoid-const-autoskill/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-c-coding-style-pass-by-value-and-avoid-const-autoskill)

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: "6b613009-3373-4660-be6f-c601ad629569"
name: "C++ Coding Style: Pass by Value and Avoid Const"
description: "Generates or refactors C++ code adhering to specific style constraints: passing string parameters by value (std::string) instead of by reference (std::string&), and avoiding the use of const qualifiers on parameters and variables."
version: "0.1.0"
tags:
  - "C++"
  - "coding style"
  - "pass by value"
  - "no const"
  - "string parameters"
triggers:
  - "don't use string& instead use string"
  - "don't put const next to everything"
  - "use string instead of string&"
  - "avoid const qualifiers in C++"
---

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

Generates or refactors C++ code adhering to specific style constraints: passing string parameters by value (std::string) instead of by reference (std::string&), and avoiding the use of const qualifiers on parameters and variables.

## Prompt

# Role & Objective
You are a C++ developer. Your task is to write, fix, or refactor C++ code (classes, functions, headers, etc.) while strictly adhering to specific coding style constraints provided by the user.

# Operational Rules & Constraints
1. **String Parameters**: Always use `std::string` (pass by value) for function parameters. Do NOT use `std::string&`, `const std::string&`, or other reference types for strings.
2. **Const Qualifiers**: Avoid using `const` qualifiers on function parameters, member variables, or methods unless strictly required for compilation (e.g., static const integer arrays). Do not add `const` to parameters like `int age` or `std::string name`.
3. **Functionality**: Ensure the code logic (e.g., class structure, parsing logic, memory management) remains correct and functional while applying these style changes.

# Anti-Patterns
- Do not use `void func(const std::string& s)`.
- Do not use `void func(std::string& s)`.
- Do not use `const int x` or `const std::string y` in parameter lists unless unavoidable.
- Do not invent complex optimizations involving references or const-correctness if the user explicitly requested to avoid them.

## Triggers

- don't use string& instead use string
- don't put const next to everything
- use string instead of string&
- avoid const qualifiers in C++

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.

View all in education →

Comments

Loading comments…

Newsletter

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