# Implementing Cpp

> Implements C++17 desktop GUI code with wxWidgets, GTK3, or Qt framework patterns and CMake build system. Use when writing C++ desktop application code, creating GUI components, or implementing framework-specific features.

- **Type:** Skill
- **Install:** `agentstack add skill-qte77-claude-code-plugins-implementing-cpp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [qte77](https://agentstack.voostack.com/s/qte77)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [qte77](https://github.com/qte77)
- **Source:** https://github.com/qte77/claude-code-plugins/tree/main/plugins/cpp-desktop/skills/implementing-cpp
- **Website:** https://qte77.github.io/claude-code-plugins/

## Install

```sh
agentstack add skill-qte77-claude-code-plugins-implementing-cpp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# C++ Desktop Implementation

**Target**: $ARGUMENTS

Implement C++ desktop GUI code following framework conventions, C++17 standards,
and CMake best practices. No over-engineering.

## Workflow

1. **Detect framework:**
   - `wxWidgets` in CMakeLists.txt or `wx/` includes -> wxWidgets
   - `gtk` in pkg-config or CMakeLists.txt -> GTK3
   - `Qt` in CMakeLists.txt or `.pro` file -> Qt
   - None detected -> ask user which framework
2. **Study existing patterns** in `src/` and `include/` structure
3. **Implement minimal solution** matching stated functionality
4. **Build and validate** with CMake
5. **Report** — list created files, build status

## C++ Standards

- **C++17 minimum** — use `std::optional`, `std::variant`, structured bindings
- **RAII** — acquire resources in constructors, release in destructors
- **Smart pointers** — `std::unique_ptr` by default, `std::shared_ptr` only when shared ownership required
- **Const-correctness** — `const` on methods, parameters, and locals where possible
- **No raw `new`/`delete`** — use smart pointers or container types

## Framework Patterns

### wxWidgets

- Use `wxBEGIN_EVENT_TABLE`/`wxEND_EVENT_TABLE` or `Bind()` for events
- Derive frames from `wxFrame`, dialogs from `wxDialog`
- Use sizers (`wxBoxSizer`, `wxGridSizer`) for layout, never absolute positioning
- Parent windows own children (no manual delete)

### GTK3

- Use `g_signal_connect` for signal/slot wiring
- Follow GObject conventions for custom widgets
- Use `GtkBuilder` with `.ui` files for complex layouts
- Proper `g_object_unref` / `g_free` for C API resources

### Qt

- Use signals/slots with `Q_OBJECT` macro and MOC
- Derive from `QWidget`, `QMainWindow`, `QDialog` as appropriate
- Use layouts (`QVBoxLayout`, `QHBoxLayout`, `QGridLayout`)
- Parent-child ownership model — parent deletes children

## CMake Best Practices

- **Target-based** — use `target_link_libraries`, `target_include_directories`
- **No global state** — avoid `include_directories()`, `link_libraries()`
- **Modern find** — `find_package()` with imported targets
- **Minimum version** — `cmake_minimum_required(VERSION 3.16)`
- **Platform conditionals:**

  ```cmake
  if(WIN32)
    # Windows-specific
  elseif(APPLE)
    # macOS-specific
  else()
    # Linux/Unix
  endif()
  ```

## Platform Compilation

Use preprocessor guards for platform-specific code:

```cpp
#ifdef _WIN32
  // Windows
#elif __APPLE__
  // macOS
#else
  // Linux/Unix
#endif
```

## Quality Checks

Before completing any task:

```bash
cmake --build build/ && ctest --test-dir build/ --output-on-failure
```

## Rules

- Follow existing code style (indentation, naming) in the project
- Create header declarations alongside implementations
- Use forward declarations to minimize include dependencies
- Prefer `#pragma once` over include guards
- Keep GUI logic separate from business logic

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [qte77](https://github.com/qte77)
- **Source:** [qte77/claude-code-plugins](https://github.com/qte77/claude-code-plugins)
- **License:** Apache-2.0
- **Homepage:** https://qte77.github.io/claude-code-plugins/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-qte77-claude-code-plugins-implementing-cpp
- Seller: https://agentstack.voostack.com/s/qte77
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
