adversarial code critic

    by aholic-liberation

    1

    Adversarial critic for code and system designs that uses evidence-based auditing to hunt for P0/P1 defects.

    Free

    Security scanned

    Works with the AI Agents you already use

    adversarial code critic

    Example session with this skill installed

    核查这个 MSPM0 的电机驱动函数,它在高负载下偶尔会停转。代码如下:[代码片段]

    • Read your context and instructions
    • Compiled the adversarial code critic

    评审结论(第 1 轮)

    总体判断:不达标

    现状(这份代码现在是什么)

    当前实现是一个基于 PWM 的基础直流电机开环控制器。它通过 GPIO 翻转实现换向,并在主循环内通过延迟函数处理简单的加减速逻辑。

    P0 致命(必须改)

    • driver.c:42 — delay_ms(100) 在中断服务程序(ISR)中被调用。
      为什么是问题:阻塞式延迟在 ISR 中运行会锁死系统总线,导致看门狗超时复位或丢失关键传感器脉冲,这是高负载停转的直接诱因。
      建议:移除 ISR 内的延迟,改用定时器中断或状态机轮询逻辑。

    P1 重要(应该改)

    • driver.c:12 — PWM_Duty 变量未加 volatile 修饰且无临界区保护。
      为什么是问题:主循环修改占空比时若被中断打断,可能导致写入半字错误,造成占空比瞬间跳变至非法值。
      建议:增加 __disable_irq() 保护或声明为原子操作。

    P2 待验证(不确定但隐患较大,需你实测/查证确认)

    • 硬件层 — 电机反向电动势(BEMF)可能超过了驱动芯片的耐压值。
      需验证:请用示波器测量电机堵转/急停时的 Vout 引脚峰值,确认续流二极管选型是否满足功率要求。

    P3 可选(建议放过)

    • driver.c:5 — 宏定义 SPEED_MAX 建议改为 const uint16_t 以增强类型安全。
      建议:仅为风格优化,建议优先修复 P0/P1。

    下一步

    等你改代码 / 等你反驳 / 等你验收(说「pass」)

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Code reviews often fail because reviewers are too polite or miss deep architectural flaws. This skill adopts an adversarial stance to stress-test your code, documentation, or system designs. It assumes your work has defects until proven otherwise, hunting for P0 fatal errors and P1 critical bugs that others miss.

    What it does

    • Evidence-based auditing identifies specific flaws with exact file:line references to prevent vague feedback.
    • Dimensional analysis evaluates hard errors, promise-fulfillment gaps, and real-world environmental risks.
    • Severity grading prioritizes P0 (fatal) and P1 (important) issues while flagging P2 items for manual verification.
    • Iterative feedback loop drives a "criticize-rework-recriticize" cycle until the work meets high-reliability standards.
    • Baseline alignment forces a clear definition of intent versus reality to ensure the final product matches its claims.

    How it works

    1. Set the Baseline: You provide the context of what the artifact is meant to achieve.
    2. Adversarial Review: The agent scans the artifact using specialized checklists and web-retrieved best practices.
    3. Structured Reporting: You receive a categorized list of P0 to P3 issues with clear evidence and advice.
    4. Iterative Refinement: You submit fixes or rebuttals; the agent validates the fix and scans for new regressions.

    Frameworks & tools

    Built for Embedded C (MSPM0, K230), PCB design, mathematical modeling (CUMCM/MathModel), and general technical documentation. It utilizes WebSearch to supplement static checklists with live industry standards.

    Why this beats prompting it yourself

    Standard prompts tend to be agreeable or generic. This skill is hardcoded to be stubborn and evidence-driven, refusing to "pass" work that contains P0 or P1 risks. It prevents over-engineering by explicitly rejecting unnecessary P3 changes once core reliability is achieved.

    Use cases

    • Auditing embedded firmware for race conditions, deadlocks, or resource leaks.
    • Validating PCB layout and schematic design against manufacturing constraints.
    • Reviewing technical proposals to ensure claims match the actual implementation.
    • Stress-testing mathematical models for boundary condition failures.

    Known limitations

    Does not accept P0/P1 claims without specific code or document evidence. P2 items require manual user verification as they represent unverified high-risk hypotheses.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 17 days ago

    • Free with an Agensi account

    Software
    Git

    Permissions

    Terminal / Shell
    Listed17 days ago

    What's inside

    Creator

    aholic-liberation

    aholic-liberation

    thanks

    Frequently Asked Questions

    Unlike standard AI assistants that tend to be agreeable, this skill is hardcoded with an adversarial persona that assumes defects exist until proven otherwise, specifically focusing on P0/P1 fatal flaws that human reviewers often miss due to 'politeness' or oversight.

    The skill is optimized for Embedded C (specifically MSPM0 and K230 architectures), PCB design schematics, mathematical modeling, and complex technical documentation where high reliability is non-negotiable.

    A 'P0' indicates a fatal error or system-breaking defect, while 'P1' denotes a critical bug; the skill provides exact file and line references for these to ensure your feedback is evidence-based rather than subjective.

    Yes, the skill is designed for an iterative 'criticize-rework-recriticize' cycle where it validates your fixes and performs regression checks to ensure new changes haven't introduced fresh vulnerabilities.

    While the agent is highly accurate at identifying hard errors, 'P2' items are flagged as high-risk hypotheses that require your manual verification to confirm if they apply to your specific environmental constraints.

    You receive the full Adversarial Code Critic skill package, which includes specialized auditing checklists, dimensional analysis frameworks, and integrated web-search capabilities for real-time industry standard cross-referencing.

    New in Testing & Debugging

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.

    Free