Skip to content

chore(agents): add the vitaminc skill for agents working on the repo - #1777

Open
coderdan wants to merge 1 commit into
nextfrom
chore/vitaminc-agent-skill
Open

coderdan wants to merge 1 commit into
nextfrom
chore/vitaminc-agent-skill

Conversation

@coderdan

@coderdan coderdan commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Vitamin C is CipherStash's library of cryptographic building blocks. It has an agent skill: a short guide that tells a coding agent which Vitamin C type to use for each task that touches a secret, with working code for each.

That skill was not installed in this repository. Agents writing Rust here did not read it, and wrote by hand what Vitamin C already has. The latest case is the TypeScript SDK work in #1774, which hand-writes impl Debug five times to hide a value, where the engine derives OpaqueDebug.

This pull request installs the skill and tells agents when to read it.

Changes

  • .claude/skills/vitaminc/SKILL.md and RECIPES.md: a copy of the skill from cipherstash/vitaminc, at commit 5dbbafaa1 on main. RECIPES.md is unchanged. SKILL.md gains one note at the top that says it is a copy and how to update it, as the misuse-resistance copy does.
  • .claude/skills/misuse-resistance/SKILL.md: its last section said the vitaminc skill "is not installed here". It now points at the installed copy.
  • AGENTS.md: a "vitaminc" section under "Working on the Rust crates". It says to read the skill before writing or reviewing Rust that holds a secret. It also states two rules the skill does not have yet:
    • a type that holds a secret derives OpaqueDebug, and does not hand-write Debug;
    • use a type the engine or Vitamin C already has before wrapping it in a new one.

The skill is in .claude/skills/, not skills/, so it does not ship to customers in the stash package.

Verification

  • I ran no test locally. No script or test in this repository reads .claude/skills/: git grep 'claude/skills' -- scripts .github finds only a comment about what a customer's install copies. CI on this pull request is the check.
  • I compared the two copied files with the source by eye. Nothing compiles the Rust in the recipes here; in cipherstash/vitaminc the skill-doctests package does.
  • No changeset: the change touches no published package.

Review notes

  • The upstream skill does not mention OpaqueDebug. I put that rule in AGENTS.md and left the copy unchanged, so the two copies stay the same. The rule should also go into the skill in cipherstash/vitaminc.
  • No other open pull request adds this skill. chore: release candidate for EQL v4 and Stack Encrypt Rust and Go support #1229 touches the misuse-resistance copy, so its last section may conflict with this one.

The vitaminc skill maps each task that touches a secret to the vitaminc
type for it, with working recipes. It was not installed here, so agents
writing Rust in this repository hand-rolled what vitaminc already has.

It is a copy from cipherstash/vitaminc at 5dbbafaa1, beside the
misuse-resistance copy, in .claude/skills/ so it does not ship to
customers. AGENTS.md says when to read it, and adds two rules the skill
does not state yet: derive OpaqueDebug for a type that holds a secret,
and reuse an engine or vitaminc type before wrapping it.
@coderdan
coderdan requested a review from a team as a code owner November 24, 2026 00:55
@changeset-bot

changeset-bot Bot commented Nov 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5329ca3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI; Enforced overrides: Organization
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 50d1f21e-e03c-4585-b3ad-1bc143c89601

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

@cipherstash-agent cipherstash-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review attestation

Reviewed 5329ca3 · posted from Claude Code (scheduled routine) · claude-opus-5-5 · effort medium
Sources: code-review · claude-opus-5-5; mattpocock-skills:code-review Standards and Spec sub-agents · model not reported
Skills: code-review, company-skills:rust-security, mattpocock-skills:code-review, company-skills:review-cross-check

Findings (5): 1 major, 4 minor — 4 inline, 1 below.

  • general (PR description) minor The body says #1774 "hand-writes impl Debug five times". #1774 has one commit, and it has three: Cipher in crates/core/src/cipher.rs, and Plaintext and Ciphertext in crates/core/src/value.rs. Change it to "three".

Every finding was checked against 5329ca3 before posting. The copies hold up: RECIPES.md matches vitaminc 5dbbafaa1 byte for byte, SKILL.md differs only by its note, and ValueFrame derives OpaqueDebug.

Open question, not a defect: the new rule "Do not write impl Debug by hand" makes existing code non-conforming. That includes JsonPlaintext (packages/stack-encrypt/src/json/plaintext.rs:228), OpaqueBlob (packages/stack-encrypt/src/blob.rs:458) and the opaque_debug::implement! sites in packages/stack-kms. List them as known exceptions, or leave them for a follow-up?


Generated by Claude Code

Comment thread AGENTS.md
Comment on lines +875 to +877
Read `.claude/skills/vitaminc/SKILL.md` before you write or review Rust that
holds a key, a token, a plaintext or another secret. That covers the stack-*
crates, the Go guests and every language binding crate. The skill maps each

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

major This puts protect-ffi in scope, but protect-ffi pins vitaminc = "=0.1.0-pre4.2" (languages/typescript/packages/protect-ffi/crates/protect-ffi/Cargo.toml:52), and RECIPES.md targets 0.10: SafeRand::next_below and vitaminc_aead::{ContextPiece, IntoContext} do not exist at pre4.2, so a recipe copied "as written" into protect-ffi fails to compile. Say that the recipes do not apply to protect-ffi until its pin moves, and that the Go guests get vitaminc through stack-encrypt's re-exports and must not add their own vitaminc dependency (languages/golang/encrypt/guest/Cargo.toml:66-70).

Source: code-review · claude-opus-5-5


Generated by Claude Code

@@ -0,0 +1,287 @@
# vitaminc recipes

One recipe per task. Each is complete, compiles, and is the production path: copy it as written. Imports use the individual crates; with the facade crate, `vitaminc_protected::X` is `vitaminc::protected::X`, and so on.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor In this workspace, several recipes do not compile as written. The root Cargo.toml has no direct vitaminc-random or vitaminc-password, and the facade has no password feature. stack-encrypt and stack-guest-abi build futures without executor. #[derive(Generatable)] (line 93) needs vitaminc-random as a direct dependency, because the derive's generated code names that crate. Add a stack-specific mapping to the copy note in SKILL.md, the one part allowed to differ: vitaminc_random::X → vitaminc::random::X, password needs a reviewed feature addition, and the Generatable derive and block_on are not usable without new dependencies.

Source: code-review · claude-opus-5-5


Generated by Claude Code

Comment on lines +64 to +66
let a: Equatable<Protected<[u8; 32]>> = Equatable::new([7; 32]);
let b: Equatable<Protected<[u8; 32]>> = Equatable::new([7; 32]);
assert!(tag_matches(&a, &b));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor These statements sit outside any function, so pasting the block into a .rs file gives expected item, found keyword 'let', which contradicts "compiles … copy it as written" at line 3. The "Keyed hash" block at 281-286 has the same problem. Upstream only compiles them as rustdoc doctests (packages/skill-doctests). Wrap the statements in a fn or #[test] upstream in cipherstash/vitaminc, then copy the file again.

Source: code-review · claude-opus-5-5


Generated by Claude Code

For Rust techniques at each rung (newtypes, typestate, sealed traits, const generics, withheld traits, compile-fail tests, the assumptions behind "if it compiles, it is secure"), read [RUST.md](RUST.md).

In Rust, the vitaminc crates provide ready-made types for rules 3, 4 and 5: secret wrappers, randomness, encryption, key wrapping and keyed hashing. Reach for them before writing your own. The `vitaminc` skill shows how to use them. That skill is in the vitaminc repository, at `.claude/skills/vitaminc/`. It is not installed here.
In Rust, the vitaminc crates provide ready-made types for rules 3, 4 and 5: secret wrappers, randomness, encryption, key wrapping and keyed hashing. Reach for them before writing your own. The `vitaminc` skill shows how to use them. It is installed here, at `.claude/skills/vitaminc/`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor Upstream's last line at 5dbbafaa1 ("the vitaminc skill provides ready-made types … Reach for them before writing your own.") is now true here word for word, because this PR installs the skill. Take upstream's line, and change the note at line 10 to "differs in this note only", so a refresh no longer has to restore a rewritten section. While editing line 10, move its pin from 06861c1b9 to 5dbbafaa1; the content is the same, and both copies would then name one commit.

Source: mattpocock-skills:code-review (Standards) · model not reported


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants