Skip to content
Back to skills

Coding

ASecurity

C++ documentation style conventions for Coot codebase

  • 174 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 11, 2026
datapythonc++documentation

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add pemsley/coot --skill coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding?

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

Security grade badge for Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pemsley-coding-coot/badge)](https://www.skillsdirectory.com/skills/pemsley-coding-coot)

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
---
name: coot-developer-cpp-docs
description: "C++ documentation style conventions for Coot codebase"
---

# Coot C++ Documentation Style

# Communication Style
When communicating with me focus on bug identification and fixing rather than working around bugs.

## Doxygen Comment Style

When writing documentation comments for Coot C++ header files, use `//!` as the leading token, NOT `/** */` or `///`.

### ✅ CORRECT

```cpp
//! \brief Accept refined atoms into the main molecule
//!
//! This function waits for refinement to complete and commits
//! the atomic positions.
//!
//! \param imol The molecule index
//! \return PyObject* containing the results
PyObject *accept_moving_atoms_py();
```

### ❌ INCORRECT

```cpp
/**
 * @brief Accept refined atoms into the main molecule
 *
 * This function waits for refinement to complete...
 */
PyObject *accept_moving_atoms_py();
```

```cpp
/// \brief Accept refined atoms into the main molecule
///
/// This function waits for refinement to complete...
PyObject *accept_moving_atoms_py();
```

## Common Doxygen Commands

Use backslash style (`\brief`) rather than at-sign style (`@brief`):

- `\brief` - Short description
- `\param` - Parameter documentation
- `\return` - Return value documentation
- `\c` - Inline code formatting (e.g., `\c Py_False`)
- `\code{.py}` / `\endcode` - Python code blocks
- `\code{.cpp}` / `\endcode` - C++ code blocks

## Example: Full Function Documentation

```cpp
//! \brief Get the worst-fitting residues by density correlation
//!
//! Analyzes all residues in a chain and returns correlation statistics
//! for each residue against the electron density map.
//!
//! \param imol Model molecule index
//! \param chain_id Chain identifier (e.g., "A")
//! \param imol_map Map molecule index
//! \param n_per_range Residues per window (use 1 for per-residue stats)
//! \param exclude_NOC 0 to include all atoms, 1 to exclude backbone N,O,C
//!
//! \return PyObject* containing [[all_atom_stats], [sidechain_stats]]
//!
//! Example usage:
//! \code{.py}
//! stats = coot.map_to_model_correlation_stats_per_residue_range_py(0, "A", 1, 1, 0)
//! all_atom = stats[0]
//! worst = sorted(all_atom, key=lambda x: x[1][1])[:5]
//! \endcode
PyObject *map_to_model_correlation_stats_per_residue_range_py(
    int imol,
    const std::string &chain_id,
    int imol_map,
    unsigned int n_per_range,
    short int exclude_NOC);
```

Files in this skill

  • developer-mindset-SKILL.md1.2 KB
  • header-documentation-SKILL.md2.4 KB

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 data →

Comments

Loading comments…

Newsletter

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