Python Patterns
affaan-m/ECC
Python-specific design patterns and best practices including protocols, dataclasses, context managers, decorators, async/await, type hints, and package organization.
Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into Breadth agents, depth-edge-case
$ npx skills add PlamenTSV/plamen --skill bit-shift-safety -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install PlamenTSV/plamen bit-shift-safety --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agents/skills/aptos/bit-shift-safety .claude/skills/bit-shift-safety && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "bit-shift-safety" agent skill from https://github.com/PlamenTSV/plamen/tree/main/agents/skills/aptos/bit-shift-safety into .claude/skills/bit-shift-safety/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bit-shift-safety", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/PlamenTSV/plamen/tree/main/agents/skills/aptos/bit-shift-safetyType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add PlamenTSV/plamen --skill bit-shift-safety -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install PlamenTSV/plamen bit-shift-safety --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .agents/skills && cp -r skills-src/agents/skills/aptos/bit-shift-safety .agents/skills/bit-shift-safety && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bit-shift-safety" agent skill from https://github.com/PlamenTSV/plamen/tree/main/agents/skills/aptos/bit-shift-safety into .agents/skills/bit-shift-safety/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bit-shift-safety", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PlamenTSV/plamen --skill bit-shift-safety -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install PlamenTSV/plamen bit-shift-safety --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/agents/skills/aptos/bit-shift-safety .cursor/skills/bit-shift-safety && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bit-shift-safety" agent skill from https://github.com/PlamenTSV/plamen/tree/main/agents/skills/aptos/bit-shift-safety into .cursor/skills/bit-shift-safety/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bit-shift-safety", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/PlamenTSV/plamen.git --path agents/skills/aptos/bit-shift-safety--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add PlamenTSV/plamen --skill bit-shift-safety -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install PlamenTSV/plamen bit-shift-safety --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/agents/skills/aptos/bit-shift-safety .gemini/skills/bit-shift-safety && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bit-shift-safety" agent skill from https://github.com/PlamenTSV/plamen/tree/main/agents/skills/aptos/bit-shift-safety into .gemini/skills/bit-shift-safety/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bit-shift-safety", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install PlamenTSV/plamen bit-shift-safetyInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add PlamenTSV/plamen --skill bit-shift-safety -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .github/skills && cp -r skills-src/agents/skills/aptos/bit-shift-safety .github/skills/bit-shift-safety && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bit-shift-safety" agent skill from https://github.com/PlamenTSV/plamen/tree/main/agents/skills/aptos/bit-shift-safety into .github/skills/bit-shift-safety/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bit-shift-safety", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PlamenTSV/plamen --skill bit-shift-safety -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install PlamenTSV/plamen bit-shift-safety --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PlamenTSV/plamen.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/agents/skills/aptos/bit-shift-safety .opencode/skills/bit-shift-safety && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bit-shift-safety" agent skill from https://github.com/PlamenTSV/plamen/tree/main/agents/skills/aptos/bit-shift-safety into .opencode/skills/bit-shift-safety/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bit-shift-safety", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
bit-shift-safetyTrigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into Breadth agents, depth-edge-case
Bit Shift Safety is an agent skill from PlamenTSV/plamen. Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into Breadth agents, depth-edge-case
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
The repository describes itself as: Autonomous Web3 security audit agent for Claude Code. The licence is MIT.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 795962b. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Bit Shift Safety loads about 2.4k tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 1,083 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from PlamenTSV/plamen at commit 795962b, republished under its MIT licence (© PlamenTSV). 1,083 words, ~2,433 tokens.
.claude/skills/bit-shift-safety/SKILL.md (or your agent's skills folder).Trigger Pattern: Always (Aptos Move) --- Move VM aborts on shift >= bit width Inject Into: Breadth agents, depth-edge-case
The Move VM performs a runtime check on every bit shift operation: if the shift amount is greater than or equal to the bit width of the operand type, the transaction aborts. This is not a silent wraparound --- it is a hard abort that reverts the entire transaction. Any user-controllable or computed shift amount that can reach the bit width threshold is a denial-of-service vector.
MANDATORY GREP: Search all .move files for << and >> operators.
For each shift operation found:
| Location (file:line) | Operand Type | Bit Width | Shift Amount Source | User-Controllable? | Bounded? |
|---|---|---|---|---|---|
| {file}:{line} | u8/u16/u32/u64/u128/u256 | 8/16/32/64/128/256 | constant / parameter / computed | YES/NO | YES/NO --- {how} |
Classification of shift amount sources:
1 << 64). Safe if < bit width, abort if >= bit width. Check constants that equal or exceed the bit width --- this is a compile-time-detectable bug but Move does not always catch it.1 << (decimals - offset)). Requires boundary analysis.For each shift operation where the shift amount is NOT a safe constant:
| Type | Bit Width | Max Safe Shift | Abort Condition |
|---|---|---|---|
| u8 | 8 | 7 | shift >= 8 |
| u16 | 16 | 15 | shift >= 16 |
| u32 | 32 | 31 | shift >= 32 |
| u64 | 64 | 63 | shift >= 64 |
| u128 | 128 | 127 | shift >= 128 |
| u256 | 256 | 255 | shift >= 256 |
For each non-constant shift:
| Location | Shift Amount Expression | Minimum Value | Maximum Value | Exceeds Bit Width? | Guard Present? |
|---|---|---|---|---|---|
| {location} | {expression} | {min} | {max} | YES/NO | YES --- {assert/min/if} / NO |
Verification method: Trace the shift amount back to its origin. For each variable in the expression:
assert!() that bounds it before the shift?min() or if guard?Tag: [BOUNDARY:shift_amount={val} → abort at bit_width={W}]
For shift amounts derived from arithmetic, perform boundary value analysis:
Pattern: 1 << (a - b) where both a and b are unsigned integers.
| Location | Expression | Can b > a? | Underflow Result | Impact |
|---|---|---|---|---|
| {location} | 1 << (decimals - 6) | YES if decimals < 6 | Wraps to large u8/u64 → abort | DoS |
Check: Move unsigned subtraction aborts on underflow (no wraparound). So a - b where b > a aborts BEFORE the shift. This is a separate DoS vector (arithmetic underflow). Document both:
b > aa - b >= bit_widthPattern: value << (a + b) or value << (a * b)
| Location | Expression | Can Sum/Product >= Bit Width? | Impact |
|---|---|---|---|
| {location} | {expression} | YES/NO --- {boundary values} | {DoS / safe} |
Even if the shift amount is safe, the RESULT of the shift may overflow the type:
| Location | Expression | Operand Max Value | Shift Amount | Result Exceeds Type Max? | Impact |
|---|---|---|---|---|---|
| {location} | amount << decimals | {max} | {amount} | YES/NO | {silent truncation / abort} |
Note: Move does NOT abort on shift result overflow --- the result is silently truncated (high bits discarded). This is a correctness bug, not a DoS bug, but can cause incorrect calculations (e.g., 1u64 << 63 = 9223372036854775808, but 3u64 << 63 = 9223372036854775808 due to truncation).
Tag: [BOUNDARY:shift_result=truncated at type_max]
For each shift operation that can abort:
| Location | Function | Entry Point? | Who Calls This? | Abort Blocks What? | Severity |
|---|---|---|---|---|---|
| {location} | {function} | YES/NO | {callers} | {blocked operations} | {H/M/L} |
Trace from the aborting shift outward:
Severity guide:
For shifts that can abort and are in shared/critical paths:
1. Attacker calls entry function F with parameter P
2. P flows through {trace} to shift operation at {location}
3. Shift amount becomes {expression} which equals {value} >= {bit_width}
4. Transaction aborts
5. Impact: {what is blocked for other users}
6. Cost to attacker: {gas cost only / requires tokens / requires role}
7. Persistence: {one-time / repeatable / permanent state corruption}Tag: [TRACE:attacker input P={val} → shift abort → {blocked_operation} DoS]
Document which shifts in the codebase follow safe patterns (for completeness and to confirm analysis coverage):
| Pattern | Example | Why Safe |
|---|---|---|
| Constant shift < bit width | 1u64 << 32 | 32 < 64, always safe |
| Bounded by min() | 1 << min(amount, 63) | Capped below bit width |
| Guarded by assert | assert!(shift < 64, E_INVALID); val << shift | Explicit pre-check |
| Type-constrained | (x as u8) << 4 where x comes from a u8 field | u8 max = 255, but shift amount 4 is constant |
| Bounded by protocol invariant | decimals is always 6 or 8 (set once, immutable) | Document the invariant and verify immutability |
RULE: A shift is only "safe by protocol invariant" if the invariant is ENFORCED on-chain (assert, type constraint, immutable field set in constructor). Documentation-only invariants do NOT qualify.
When this skill identifies an issue:
**ID**: [BS-N]
**Severity**: [based on DoS scope and attacker controllability]
**Step Execution**: check1,2,3,4,5 | X(reasons) | ?(uncertain)
**Rules Applied**: [R2:Y, R4:Y, R10:Y]
**Depth Evidence**: [BOUNDARY:shift_amount={val}], [TRACE:input→abort→impact]
**Location**: module::function (source_file.move:LineN)
**Title**: Unbounded bit shift in [function] enables [DoS/incorrect calculation]
**Description**: [Trace from input to shift operation to abort/truncation to impact]
**Impact**: [What is blocked or miscalculated, who is affected, persistence]CRITICAL: You MUST report completion status for ALL sections. Sections 1-2 are mechanical and must never be skipped.
| Section | Required | Completed? | Notes |
|---|---|---|---|
| 1. Shift Operation Inventory | YES | Y/X/? | MANDATORY --- grep ALL .move files |
| 2. Shift Amount Bound Verification | YES | Y/X/? | For each non-constant shift |
| 3. Computed Shift Analysis | IF computed shifts found | Y/X(N/A)/? | Subtraction underflow + result overflow |
| 3c. Shift Result Overflow | IF shifts with variable operands | Y/X(N/A)/? | Silent truncation check |
| 4. DoS Impact Assessment | IF any shift can abort | Y/X(N/A)/? | Trace to user impact |
| 4b. Attacker-Triggerable Analysis | IF abort in shared/critical path | Y/X(N/A)/? | Full attack trace |
| 5. Safe Shift Patterns | YES | Y/X/? | Confirm safe shifts for coverage |
After Section 1 (Shift Operation Inventory):
After Section 4 (DoS Impact Assessment):
After Section 5 (Safe Shift Patterns):
© PlamenTSV, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in agents/skills/aptos/bit-shift-safety of PlamenTSV/plamen.
Open the folder on GitHubat commit 795962b
Bit Shift Safety next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Bit Shift Safety this skillPlamenTSV/plamen | 303 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Python Patternsaffaan-m/ECC | 276k | — | ~2.3k | Automated safety check: Pass | MIT | |
| Memory Safety Patternswshobson/agents | 40k | 9 repos | ~646 | Automated safety check: Pass | MIT | |
| Golang Patternsaffaan-m/ECC | 276k | — | ~1.1k | Automated safety check: Pass | MIT | |
| RTK Rust Design Patternsrtk-ai/rtk | 83k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Kotlin Exposed Patternsaffaan-m/ECC | 276k | 4 repos | ~5.5k | Automated safety check: Pass | MIT |
affaan-m/ECC
Python-specific design patterns and best practices including protocols, dataclasses, context managers, decorators, async/await, type hints, and package organization.
wshobson/agents
Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C.
affaan-m/ECC
Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization.
rtk-ai/rtk
Describes seven Rust design patterns for the RTK CLI filter modules, with when to use each, RTK examples, and notes on when a pattern is overkill.
affaan-m/ECC
JetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.
affaan-m/ECC
Idiomatic C and .NET patterns, conventions, dependency injection, async/await, and best practices for building robust, maintainable .NET applications.
PlamenTSV/plamen
Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project…
PlamenTSV/plamen
Trigger Pattern Always (used by all verifier agents) - Inject Into security-verifier agents (Phase 5)
PlamenTSV/plamen
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth agents, depth agents
PlamenTSV/plamen
Trigger Pattern Always (Sui Move) -- foundational security check - Inject Into Breadth agents, depth agents
PlamenTSV/plamen
Trigger Pattern ACCOUNTCLOSING flag detected (close/CloseAccount usage) - Inject Into Breadth agents, depth agents
PlamenTSV/plamen
Trigger Pattern Always required for Solana audits - Inject Into Breadth agents, depth agents
Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into Breadth agents, depth-edge-case. Bit Shift Safety is an agent skill from PlamenTSV/plamen.
Bit Shift Safety fits situations like: pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into Breadth agents; depth-edge-case.
Run `npx skills add PlamenTSV/plamen --skill bit-shift-safety -a claude-code`. Or copy the skill folder (agents/skills/aptos/bit-shift-safety in PlamenTSV/plamen) into .claude/skills/bit-shift-safety in your project. Claude Code loads it when a task matches its description.
Run `npx skills add PlamenTSV/plamen --skill bit-shift-safety -a codex`. Or copy the skill folder (agents/skills/aptos/bit-shift-safety in PlamenTSV/plamen) into .agents/skills/bit-shift-safety in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PlamenTSV/plamen --skill bit-shift-safety -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bit-shift-safety, .gemini/skills/bit-shift-safety, .github/skills/bit-shift-safety and .opencode/skills/bit-shift-safety in your project.
SKILL.md names no scripts, command-line tools or credentials: Bit Shift Safety is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Bit Shift Safety is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Bit Shift Safety: Python Patterns (affaan-m/ECC, 276k stars), Memory Safety Patterns (wshobson/agents, 40k stars), Golang Patterns (affaan-m/ECC, 276k stars) and RTK Rust Design Patterns (rtk-ai/rtk, 83k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
PlamenTSV (a GitHub user) maintains it in PlamenTSV/plamen, which has 303 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on September 26, 2026.
Source: PlamenTSV/plamen on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.