agents/skills/evm/fork-ancestry/SKILL.md
Trigger Pattern Always (run during recon TASK 0, not breadth) - Inject Into Recon agent only (meta_buffer.md enrichment)
npx skillsauth add plamentsv/plamen fork-ancestryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Trigger Pattern: Always (run during recon TASK 0, not breadth) Inject Into: Recon agent only (meta_buffer.md enrichment) Purpose: Detect known parent codebases and inherit their historical vulnerability patterns.
Grep the codebase for known parent signatures:
| Parent Project | Detection Patterns | Common Forks |
|---------------|-------------------|--------------|
| Synthetix | SNX\|synthetix\|StakingRewards\|RewardsDistribution\|Issuer | Staking rewards forks |
| Compound | CToken\|Comptroller\|cToken\|comptroller\|InterestRateModel | Lending protocol forks |
| Uniswap V2 | UniswapV2\|PairFactory\|getReserves\|MINIMUM_LIQUIDITY | DEX forks |
| Uniswap V3 | UniswapV3\|TickMath\|SqrtPriceMath\|NonfungiblePositionManager | Concentrated liquidity forks |
| Aave | aToken\|LendingPool\|flashLoan.*initiator\|AAVE | Lending forks |
| MasterChef | MasterChef\|poolInfo\|userInfo\|pendingReward\|massUpdatePools | Yield farming forks |
| Curve | StableSwap\|get_dy\|A_PRECISION\|get_virtual_price\|ramp_A\|stop_ramp_A\|calc_withdraw_one_coin\|remove_liquidity_imbalance\|admin_fee\|commit_new_fee | Stableswap forks — set STABLESWAP_FORK flag if MEDIUM+ confidence |
| OpenZeppelin | Ownable\|AccessControl\|Pausable\|ERC20Upgradeable | Most projects (check version) |
| Basis/Tomb | Boardroom\|Treasury\|seigniorage\|epoch\|TWAP.*peg | Algorithmic stablecoin forks |
| Olympus | OHM\|gOHM\|staking.*rebase\|bond.*discount | Rebase token forks |
| Balancer | BPool\|WeightedPool\|BVault\|flashLoan.*userData | Weighted pool forks |
| Yearn | Vault\|Strategy\|harvest\|totalDebt\|debtRatio | Yield vault forks |
Git-based detection (complements code-pattern matching — catches forks that renamed all identifiers).
Skip if REPO_SHAPE: squashed_import in build_status.md — single-commit repos have no meaningful git metadata.
.gitmodules for submodule URLs pointing to known parent reposgit remote -v for origin URLs matching known parent organizations (compound-finance, Uniswap, aave, sushiswap, curvefi, yearn, OlympusDAO, balancer)GIT_ONLY_FORK — the fork likely renamed all identifiers, which warrants deeper divergence analysisOutput: List of detected parents with confidence level (HIGH: 3+ patterns, MEDIUM: 2 patterns, LOW: 1 pattern, GIT_ONLY: git URL match but no code patterns).
For each detected parent (confidence MEDIUM or HIGH):
// Query 1: Known high-quality issues
search_solodit_live(
protocol="{parent_name}",
impact=["HIGH", "CRITICAL"],
language="Solidity",
quality_score=3,
sort_by="Quality",
max_results=15
)
// Query 2: Rare/unusual patterns specific to fork divergences
search_solodit_live(
keywords="{parent_name} fork modified divergence",
impact=["HIGH", "MEDIUM"],
language="Solidity",
sort_by="Rarity",
max_results=10
)
tavily_search(query="{parent_name} smart contract vulnerability exploit audit finding 2024 2025 2026")
Compile results into:
| Parent | Known Issue | Severity | Root Cause | Solodit Ref | Applicable to Fork? | |--------|-----------|----------|------------|-------------|---------------------| | {parent} | {issue title} | {severity} | {brief root cause} | {link/ID} | YES / NO / CHECK |
Applicability criteria:
If Solodit AND Tavily BOTH fail, use this minimum catalog -- check EACH applicable parent:
| Parent | Critical Known Issue | Root Cause | Search Keywords |
|--------|---------------------|------------|-----------------|
| Synthetix/StakingRewards | Reward rate manipulation via notifyRewardAmount timing | Reward duration reset on notify | staking reward notify duration |
| Compound/CToken | First-depositor exchange rate manipulation | Empty market rounding | ctoken exchange rate first deposit |
| Aave/LendingPool | Flash loan + oracle manipulation for unfair liquidation | Spot price dependency | aave flash liquidation oracle |
| Uniswap V2 | First LP inflation attack (MINIMUM_LIQUIDITY bypass) | LP share rounding at low liquidity | uniswap v2 minimum liquidity first |
| Basis/Tomb/Boardroom | Epoch-boundary seigniorage front-running + stake timing | Discrete epoch distribution | boardroom seigniorage epoch timing |
| Klondike/Tomb V2 | Epoch-boundary timing + treasury allocation fairness + role privilege scope | Extended seigniorage model with additional operator roles and cooldown mechanisms | klondike tomb v2 seigniorage treasury operator |
| MasterChef V2 | Reward rate manipulation via deposit(0) + unfair early-user dilution | Checkpoint timing + zero-amount deposit triggers reward update | masterchef deposit zero reward rate timing |
| Curve StableSwap | Reentrancy via raw ETH transfer in remove_liquidity + read-only reentrancy | ETH callback before state update, view function reads stale state | curve reentrancy remove liquidity read-only |
| Balancer V2 Vault | Flash loan + price oracle manipulation via pool balance change | Spot price manipulation within single transaction | balancer vault flash loan oracle manipulation |
| Yearn V2 Vault | Share price manipulation via strategy report timing + first depositor | Donation before first deposit inflates pricePerShare | yearn vault share price first deposit strategy |
For each detected parent:
Compare fork vs parent in security-critical paths:
| Component | Parent Behavior | Fork Behavior | Security Impact | |-----------|----------------|---------------|-----------------| | {component} | {original} | {modified or SAME} | {new risk or NONE} |
Focus on:
For each modification:
Append to {SCRATCHPAD}/meta_buffer.md:
## Fork Ancestry Analysis
### Detected Parents
| Parent | Confidence | Patterns Found |
|--------|-----------|---------------|
### Inherited Vulnerabilities to Verify
| # | Parent Issue | Severity | Location in Fork | Status |
|---|-------------|----------|------------------|--------|
| 1 | {issue} | {severity} | {fork location} | CHECK / VERIFIED_SAFE / VULNERABLE |
### Fork Divergences (Security-Critical)
| # | Component | Change | New Risk? |
|---|-----------|--------|-----------|
### Questions for Breadth Agents
1. {derived from inherited vulnerabilities}
2. {derived from divergence analysis}
| Section | Required | Completed? | Notes | |---------|----------|------------|-------| | 1. Detect Fork Indicators | YES | Y/N/? | | | 2. Query Known Parent Issues | IF parent detected | Y/N(no parent)/? | | | 3. Divergence Analysis | IF parent detected | Y/N(no parent)/? | | | 4. Output to meta_buffer.md | YES | Y/N/? | |
development
Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project documentation checks. Generates a scored Audit Readiness Report and optionally runs static analysis. Trigger on: "prepare for audit", "audit readiness", "pre-audit check", "audit prep", "NatSpec check", or any request to review a Solidity codebase before a security review.
development
Launch the Plamen deterministic Web3 security audit pipeline
development
Run the Plamen smart-contract audit wizard in Codex
testing
Launch the Plamen deterministic L1 infrastructure audit pipeline