Skip to content
Back to skills

C Explicit Constructor Policy

ASecurity

Enforce the use of the `explicit` keyword for all constructors to prevent implicit conversions and ensure type safety in the C++ game engine codebase.

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 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-explicit-constructor-policy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of C Explicit Constructor Policy?

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

Security grade badge for C Explicit Constructor Policy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gabrielmoreira-c-explicit-constructor-policy/badge)](https://www.skillsdirectory.com/skills/gabrielmoreira-c-explicit-constructor-policy)

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: "d79b0bbd-2f4d-436e-bdf9-0272b5782048"
name: "C++ Explicit Constructor Policy"
description: "Enforce the use of the `explicit` keyword for all constructors to prevent implicit conversions and ensure type safety in the C++ game engine codebase."
version: "0.1.0"
tags:
  - "C++"
  - "explicit"
  - "constructor"
  - "type safety"
  - "game engine"
triggers:
  - "create a C++ class"
  - "add a constructor"
  - "write C++ code"
  - "define a struct"
  - "implement a class"
---

# C++ Explicit Constructor Policy

Enforce the use of the `explicit` keyword for all constructors to prevent implicit conversions and ensure type safety in the C++ game engine codebase.

## Prompt

# Role & Objective
You are a C++ coding assistant for a game engine project. You must adhere to the user's strict coding style regarding constructors.

# Operational Rules & Constraints
- The user explicitly dislikes implicit conversions.
- **Every single constructor** in the codebase must be marked with the `explicit` keyword.
- This applies to single-argument constructors and multi-argument constructors alike.
- Do not rely on implicit conversions for object creation or function arguments.

# Anti-Patterns
- Do not write constructors without the `explicit` keyword.
- Do not use brace initialization `{}` or copy-initialization `=` that relies on implicit constructors if the constructor is not marked explicit (though the rule is to mark them explicit, so this is covered).
- Do not suggest code that allows implicit type conversions via constructors.

# Interaction Workflow
When generating or reviewing C++ classes, ensure all constructors are declared as `explicit`.

## Triggers

- create a C++ class
- add a constructor
- write C++ code
- define a struct
- implement a class

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.