/autocode:redteam-hackingfrom autocode
Red-teams competitive programming test data by constructing adversarial hacks and verifying statement-solution consistency. Useful for problem authors validating test coverage.
Ships in autocode. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill to move beyond trivial regex single-point mutations and verify that test data defeats realistic competitive programming mistakes while the statement and standard solution agree on every edge case.
Goal: Catch shared "std + jury answers both wrong" errors and statement ambiguities that answer_consistency cannot detect on its own.
statements/README.md (title, constraints, I/O spec, samples, protocol). Do not inspect solutions/sol.cpp, files/gen.cpp, or tests/*.ans.solutions/alt_blind.cpp in scratch/temp or registered as role: "reference", expected: "pass").tests/ (or small random inputs via files/gen + files/val):
statements/README.md omitted an assumption (e.g., $u = v$ self-loops, $m = 0$, negative weights, tie-breaking order) or whether solutions/sol.cpp + .ans share a bug.sol.cpp.Goal: Construct realistic Near-AC wrong solutions (solutions/wrong_*.cpp) informed by solutions/sol.cpp, files/val.cpp, and problem_verify_tests(verify_types=["coverage"]).
Register each wrong solution in .autocode/manifest.json under solutions[] with role: "wrong", expected: "fail", and an explicit expected_verdict ("WA", "TLE", "MLE", "RE", or "PE").
| Family | Typical Implementation Bug | Expected Verdict | Hack / Coverage Focus |
|---|---|---|---|
| Fake greedy | Sorts by wrong key or takes local optimum without exchange-argument proof | WA | Small counterexamples where optimal needs non-greedy swap |
| Missing DP state | Drops a dimension/flag (e.g. parity, last-chosen, carry, component root) | WA | Multi-step dependency chains triggering collapsed state conflict |
32-bit int overflow | Accumulates sum/product in int or casts too late (1LL * a * b missing) | WA | Extreme type=3 values near $10^9$ producing products $> 2^{31}-1$ |
| Uncleaned multi-test | Forgets to reset vis[], dp[], adj[], or ans between $T$ test cases | WA | Multi-test case with large test #1 followed by tiny test #2 |
unordered_map collision | Uses std::unordered_map<int, ...> / <long long, ...> with identity hash | TLE | jngen::anti_unordered_map_sequence(...) targeting GCC prime buckets (107897, 126271, 108649, 216617) |
| Single-mod string hash | Rolling polynomial hash with single 30-bit mod (1e9+7 / 998244353) or ull overflow | WA | jngen::thue_morse_collision_pair(11) (ull) or jngen::anti_single_mod_hash_pair(mod, base) |
| Graph edge-case omissions | Assumes simple connected graph; misses self-loops, multi-edges, isolated nodes, disconnected components | WA / RE | jngen::edge_case_graph(...) matching validator constraints |
| Suboptimal complexity | $O(n^2)$ / $O(n\sqrt{n})$ with full $n_{\max}$ buffers (must NOT crash via small arrays!) | TLE | Anti-sort / star / broom / worst-case DAG at full $n_{\max}$ |
| Hybrid brute + degenerate fast branch | Exact brute/DP below an inflated cheat threshold $B_{\text{cheat}}$ ($\approx 2.5\text{–}3\times$ sol.cpp cutoff for -O2 constant bonus), degenerate missing-edge-fix formula above it | WA / TLE | type=3/4 cases strictly $> B_{\text{cheat}}$ exercising multi-reflection / deep-layer fast-branch boundaries |
| Shortest-path SPFA 4-pack | SLF + Swap, LLL + SLF, mcfx hybrid, and randomized adjacency-list order SPFA | TLE | Smooth-gradient grids / layered anti-SLF-Swap chains |
| Short odd-cycle / structural truncation | Bipartite / parity checker that only detects short odd cycles ($\le 3, \le 5, \le 7$) | WA | Long minimal odd-cycle ($\ge 9$) NO test cases |
Bidirectional Beam Search (W=64/128) | Fixed-width uniform-sampling + endpoint-preserving bidirectional beam search | WA | High-branching decoy states around narrow unique valid paths |
| Protocol legal boundary probes | Positive probes injecting $[L, L+1, R]$ (e.g. 0, 2^32-1) into interactive/communication judge | AC (judge check) | Confirm judge accepts all legal protocol boundary values |
role="wrong" solution for a divide-and-conquer / hybrid-threshold problem, NEVER copy the threshold constant from solutions/sol.cpp (e.g., THRESHOLD = 600 or 4000). Escalate the cheat threshold by at least $2.5\times\text{–}3\times$ (up to $B_{\text{cheat}}$ within 1-2s under -O2) and truncate the fast branch (e.g., $|j| \le 2$ reflections or $2n+4$ DP steps) so tests strictly probe beyond -O2 constant-factor advantages.expected_verdict ambiguous when constructing a targeted failure mode:
wrong_tle_*.cpp solution MUST allocate buffers large enough for $n_{\max}$ so it fails by TLE, never RE (SIGSEGV) or MLE.verify_wrong_kill verifies killing_verdict == expected_verdict and marks expected_verdict_matched: false (failing wrong_solution_kill) whenever an unintended verdict occurs (e.g., expected_verdict="TLE" killed by "RE").Run:
problem_verify_tests(problem_dir=..., verify_types=["coverage"])
or configure "min_branch_coverage" in .autocode/manifest.json (audit_gates.min_branch_coverage).
line_coverage, branch_coverage, mcdc_coverage (when supported), uncovered_line_ranges, and uncovered_branches.solutions/sol.cpp indicates either dead code in sol.cpp or a missing boundary/branch scenario in tests/. Add targeted test cases until critical decision branches are covered.TemporaryDirectory; .gcda, .gcno, .profraw, and .profdata are never written inside problem_dir.When any wrong solution survives (killed: false), mismatches expected_verdict, or misses an important branch:
#include "jngen.h" alongside #include "testlib.h" (e.g. anti_unordered_map_sequence, thue_morse_collision_pair, anti_single_mod_hash_pair, broom_tree, random_dag) or hand-craft minimal counterexamples.val and sol:
files/val on the hack .in (exit_code == 0); never bypass validator constraints..ans using solutions/sol and cross-check with your black-box oracle (and files/checker / files/interactor when applicable).problem_verify_tests(verify_types=["wrong_solution_kill"]) now reports killed: true and expected_verdict_matched: true..in/.ans under tests/hack/ (automatically preserved by problem_generate_tests(mode="replace")) or append via mode="append".solutions/wrong_*.cpp files and their expected_verdict entries in .autocode/manifest.json so every subsequent autocode-audit --standalone or problem_verify_tests run exercises them deterministically with zero LLM cost.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
autocode@autocode-marketplace is listed by summeronetwo/autocode-marketplace — review the source before installing
npx claudepluginhub summeronetwo/autocode-marketplace --plugin autocode11 skills in this plugin
/agent-skill-governanceDefine and enforce project-wide quality standards for agent and skill documents. Use when creating, reviewing, or refactoring files under agents/ and skills/ to keep structure, terminology, and output contracts consistent./autocode-workflowUse when creating competitive programming problems with AutoCode MCP tools. Enforces the plugin workflow for problem statements, std/brute solutions, validators, generators, stress tests, final data verification, and Polygon packaging./evolutionary-testdataOptimize test generators using ShinkaEvolve-inspired multi-island evolution, behavioral novelty filtering, and composite wrong-kill/coverage/runtime fitness via scripts/evolve_generator.py.Other plugins' skills for the same job