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 (Sui 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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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/sui/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 (Sui 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 (Sui Move) -- Move VM aborts on shift = bit width - Inject Into Breadth agents, depth-edge-case
Its SKILL.md is about 2.2k 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.
6 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 move and 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.2k tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 846 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). 846 words, ~2,207 tokens.
.claude/skills/bit-shift-safety/SKILL.md (or your agent's skills folder).Trigger Pattern: Always (Sui Move) -- Move VM aborts on shift >= bit width Inject Into: Breadth agents, depth-edge-case
For every bit shift operation in the protocol:
BACKGROUND: The Move VM (shared by Sui and Aptos) aborts the entire transaction if a bit shift operand equals or exceeds the bit width of the type. For u64, shifting by 64 or more aborts. For u128, shifting by 128 or more aborts. This is NOT a revert with an error code -- it is a VM abort that cannot be caught. On Sui, a PTB (Programmable Transaction Block) abort means ALL commands in the PTB fail, and shared objects that were locked for the transaction are released without state changes.
Enumerate ALL bit shift operations (<< and >>) across all modules:
| Module | Function | Line | Operation | Type | Bit Width | Shift Amount Source | Validated? |
|---|---|---|---|---|---|---|---|
| {mod} | {func} | {L} | << / >> | u8/u64/u128/u256 | 8/64/128/256 | {literal/parameter/computed} | YES/NO |
Grep pattern: Search all .move files for << and >> operators.
Type-to-width mapping:
| Type | Max Safe Shift |
|---|---|
u8 | 7 |
u64 | 63 |
u128 | 127 |
u256 | 255 |
For each shift operation, classify the shift amount source:
let x = value << 32; // Literal: always safe if < bit widthCheck: Is the literal < bit width of the type? If yes -> SAFE. If no -> compilation may succeed but runtime aborts.
public fun shift_by(value: u64, amount: u8): u64 {
value << (amount as u8) // Parameter: caller controls shift amount
}Check: Is the amount parameter validated before the shift? Common patterns:
assert!(amount < 64, E_SHIFT_OVERFLOW) -- explicit validationamount % 64 -- wrapping (changes semantics but prevents abort)let shift = calculate_precision(decimals); // Computed: depends on runtime state
let result = base << shift;Check: Can the computation ever produce a value >= bit width? Trace the computation to its inputs. If any input is user-controlled or state-derived -> HIGH RISK.
For each unvalidated shift operation, assess the abort impact:
| Function | Called By | Shared Objects Locked? | PTB Context | Abort Impact |
|---|---|---|---|---|
| {func} | {callers} | YES/NO | {typical PTB} | {impact} |
Sui-specific abort consequences:
&mut reference), those objects are temporarily unavailable during consensus. Repeated aborts can cause transient unavailability. This is NOT permanent locking -- Sui releases locks after the transaction fails.For each unvalidated shift in a public/entry function:
Scenario: Shift Abort Griefing
1. Attacker calls {FUNCTION} with shift amount = {BIT_WIDTH}
2. Move VM aborts the transaction
3. Impact on other users: {IMPACT}
- If function modifies shared state: other PTBs depending on that state must retry
- If function is part of a multi-step user flow: user loses gas + must restart
4. Attacker cost: gas for one failed transaction
5. Severity: {based on impact}// VULNERABLE: decimals comes from token metadata, could be >= 64
let scale = 1u64 << decimals;Fix pattern: assert!(decimals < 64, E_INVALID_DECIMALS) or use math::pow(10, decimals) instead.
// VULNERABLE if position is not bounds-checked
let field = (packed >> position) & mask;Check: Is position derived from user input or configuration? If yes and no validation -> FINDING.
// Common in DeFi: fixed-point multiplication with shift
let result = (a * b) >> PRECISION_BITS;Check: Is PRECISION_BITS a constant? If yes and < bit width -> SAFE. If computed -> trace source.
let mut i = 0;
while (i < n) {
value = value << 1; // Safe per iteration, but after 64 iterations value = 0 (not abort)
i = i + 1;
};Note: Shifting by 1 repeatedly does NOT abort (shift amount is always 1). But the value overflows silently to 0 after bit-width iterations. Check if this silent overflow causes logic errors.
For each shift operation that IS validated, verify the validation is correct:
| Function | Validation | Correct? | Edge Case |
|---|---|---|---|
| {func} | assert!(n < 64) | YES | n=63 is max safe |
| {func} | assert!(n <= 64) | NO | n=64 aborts |
| {func} | n % 64 | SAFE but semantic change | shift by 0 when n=64 |
Common validation errors:
<= bit_width instead of < bit_widthu128 shift (allows 64-127 to abort)amount is u64 but shift operand must be u8 -- does the cast truncate?Trace shift amounts across function boundaries:
entry_function(user_input: u64)
-> helper_a(derived_value) // derived_value = user_input * 2
-> helper_b(shift_amount) // shift_amount = derived_value + offset
-> actual_shift: value << shift_amount // Is shift_amount < bit_width?For each chain: Can ANY combination of valid inputs to the entry function produce a shift amount >= bit width at the actual shift site? Document the full trace.
**ID**: [BS-N]
**Severity**: [HIGH if public function, MEDIUM if restricted caller, LOW if constant shift]
**Step Execution**: check1,2,3,4,5,6 | X(reasons) | ?(uncertain)
**Rules Applied**: [R4:Y, R10:Y, ...]
**Depth Evidence**: [BOUNDARY:shift=bit_width], [TRACE:user_input->shift_amount->abort]
**Location**: module::function:LineN
**Title**: Unvalidated bit shift in [function] causes VM abort on [condition]
**Description**: [Specific shift operation, source of shift amount, why it can reach bit width]
**Impact**: [Transaction abort, shared object locking, griefing potential, gas waste]CRITICAL: You MUST report completion status for ALL sections. Findings with incomplete sections will be flagged for depth review.
| Section | Required | Completed? | Notes |
|---|---|---|---|
| 1. Shift Operation Inventory | YES | Y/X/? | Grep all .move files |
| 2. Shift Amount Source Classification | YES | Y/X/? | For each shift |
| 3. Abort Impact Analysis | IF unvalidated shifts found | Y/X(N/A)/? | |
| 3a. Griefing Scenario Modeling | IF unvalidated in public fn | Y/X(N/A)/? | |
| 4. Common Vulnerable Patterns | YES | Y/X/? | Check all 4 sub-patterns |
| 5. Validation Pattern Verification | IF validated shifts exist | Y/X(N/A)/? | Off-by-one check |
| 6. Cross-Function Shift Propagation | IF shift amount crosses functions | Y/X(N/A)/? |
After Section 1 (Shift Inventory):
After Section 3 (Abort Impact):
After Section 6 (Cross-Function Propagation):
[BOUNDARY:shift={bit_width}], [TRACE:input_path->abort_site]© 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/sui/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.2k | Automated safety check: Pass | MIT | |
| Python Patternsaffaan-m/ECC | 275k | — | ~2.3k | Automated safety check: Pass | MIT | |
| Memory Safety Patternswshobson/agents | 40k | 9 repos | ~646 | Automated safety check: Pass | MIT | |
| Golang Patternsaffaan-m/ECC | 275k | — | ~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 | 275k | 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 (Sui 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 (Sui 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/sui/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/sui/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.2k tokens (SKILL.md is roughly 8.8k 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, 275k stars), Memory Safety Patterns (wshobson/agents, 40k stars), Golang Patterns (affaan-m/ECC, 275k 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.