cpp-string-api-review
Skill697 starsChanged 18 days agoApache-2.0View on GitHub
Review C++ changes for string parameter and call-site efficiency conventions (`std::string_view`, `std::string&&`, `const std::string&`, `const char*`, and TransparentStringMap lookup). Use when reviewing C++ code, refactoring addon interfaces, or invoking /cpp-string-api-review.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
read-only const std::string& where std::string_view is sufficient,
- Distinctive: line 43
Check for requirement propagation ("requirements bubble up"):
- Very specific: line 44
if a wrapper takes std::string_view but must call a const std::string& API, surface the trade-off and propose the correct boundary.
- Distinctive: line 73
Prefer explicit ownership intent over hidden conversions.
- Very specific: line 74
Prefer leaf-first migration to std::string_view through call chains.
- Very specific: line 75
If downstream requires const std::string&, do not hide that cost behind wrapper layers.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
C++ String API Review
Review C++ code for string API convention compliance and produce actionable fixes.
When to use this skill
Use when:
- User asks for a review of C++ string parameter choices.
- User asks to migrate existing code toward string API conventions.
- User invokes
/cpp-string-api-review.
Do NOT use for:
- Non-C++ changes.
- Broad performance review unrelated to string interfaces.
Scope and source of truth
- Primary reference:
docs/conventions/string-api-conventions.md - Supporting implementation reference:
packages/inference-addon-cpp/src/inference-addon-cpp/TransparentStringMap.hpp
Review workflow
- Identify touched C++ files (
*.h,*.hpp,*.cc,*.cpp,*.cxx) in scope. - Inspect string parameters and classify each as:
- read-only non-owning (
std::string_view), - sink ownership transfer (
std::string&&), - downstream compatibility (
const std::string&), - C boundary (
const char*).
- read-only non-owning (
- Flag cost/correctness issues:
- read-only
const std::string&wherestd::string_viewis sufficient, - sink modeled as
const std::string&+ copy instead ofstd::string&&+ move, - hidden temporary conversions (
std::string{view}) on hot paths, - unsafe
view.data()usage where null termination is not guaranteed, - avoidable temporary key materialization in map lookups.
- read-only
- Check for requirement propagation ("requirements bubble up"):
- if a wrapper takes
std::string_viewbut must call aconst std::string&API, surface the trade-off and propose the correct boundary.
- if a wrapper takes
- Produce findings grouped by severity:
- High: correctness/lifetime/null-termination issues,
- Medium: hidden alloc/copy churn in common paths,
- Low: style/consistency improvements.
- Propose precise edits with before/after snippets. Only apply code changes after explicit user confirmation.
Output format
Use this structure:
## C++ String API Review
### Findings
- [High|Medium|Low] <short title> — <file/symbol>
- Why it matters: <cost/correctness impact>
- Suggested change: <concise fix>
### Recommended edits
1. <edit 1>
2. <edit 2>
### Notes
- <boundary trade-offs, if any>Quick heuristics
- Prefer explicit ownership intent over hidden conversions.
- Prefer leaf-first migration to
std::string_viewthrough call chains. - If downstream requires
const std::string&, do not hide that cost behind wrapper layers.
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/agent-integrations.mdcCursor rule
- .cursor/rules/cpp/string-api-conventions.mdcCursor rule
- .cursor/rules/devops/main.mdcCursor rule
- .cursor/rules/no-remote-code-execution.mdcCursor rule
- .cursor/rules/qip-triage.mdcCursor rule
- .cursor/rules/sdk/commit-and-pr-format.mdcCursor rule
- .cursor/rules/sdk/error-handling.mdcCursor rule
- .cursor/rules/sdk/first-class-product-parity.mdcCursor rule
- .cursor/rules/sdk/main.mdcCursor rule
- .cursor/rules/sdk/public-constants-contract.mdcCursor rule
- .cursor/rules/sdk/request-lifecycle-primitives.mdcCursor rule
- .cursor/rules/sdk/sdk-pod-packages.mdcCursor rule
- .cursor/rules/sdk/skill-authoring-guidelines.mdcCursor rule
- qv-addon-changelogSkill
- qv-addon-pr-createSkill
- qv-addon-release-notesSkill
- qv-agent-stack-syncSkill
- qv-asana-syncSkill
- qv-daily-work-updateSkill
- qv-dev-diary-setupSkill
- qv-dev-diarySkill
- qv-devops-daily-updateSkill
- qv-devops-pr-createSkill
- qv-devops-pr-reviewSkill
- qv-devops-pr-statusSkill
- qv-devops-runner-queueSkill
- qv-devops-why-my-pr-notSkill
- qv-docs-solution-createSkill
- qv-docs-updateSkill
- qv-holepunch-devSkill
- qv-merge-guard-wireSkill
- qv-mobile-test-dispatchSkill
- qv-notice-generateSkill
- qv-pr-mineSkill
- qv-pr-reviewSkill
- qv-pr-testSkill
- qv-qip-createSkill
- qv-qip-reviewSkill
- qv-qip-triageSkill
- qv-quality-reportingSkill
- qv-registry-autobase-patternsSkill
- qv-release-trainSkill
- qv-sdk-backmergeSkill
- qv-sdk-changelogSkill
- qv-sdk-e2e-createSkill
- qv-sdk-inference-versionSkill
- qv-sdk-pr-createSkill
- qv-sdk-pr-statusSkill
- qv-sdk-update-modelsSkill
- qv-skill-listSkill
- setupSkill
- setupSkill
- qv-nx-ciSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

