agentleFS
agodianelagodianel/esp32-claude-workbench/.claude/skills/esp32_pin_audit/SKILL.md

esp32_pin_audit

Skill79 starsChanged 8 months agoMITView on GitHub

Audit ESP32 GPIO usage for conflicts, reserved pin violations, and documentation drift.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before adding new peripheral code.

    line 12
  2. Distinctive:

    When debugging mysterious hardware behavior.

    line 14
  3. Distinctive:

    Search the project for pin definitions:

    line 21
  4. Distinctive:

    Verify pull-up or pull-down is configured to avoid floating pins.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ESP32 Pin Audit

Systematically audit GPIO pin usage across the project to detect conflicts, reserved pin misuse, and undocumented assignments.

When to Use

  • Before adding new peripheral code.
  • During architecture review.
  • When debugging mysterious hardware behavior.
  • Before release.

Steps

1. Collect All Pin Declarations

Search the project for pin definitions:

# Macro definitions
grep -rn "#define.*GPIO\|#define.*PIN\|#define.*SDA\|#define.*SCL\|#define.*MOSI\|#define.*MISO\|#define.*CS\|#define.*CLK" --include="*.h" --include="*.c"

# GPIO_NUM usage
grep -rn "GPIO_NUM_" --include="*.c" --include="*.h"

# Kconfig GPIO options
grep -rn "CONFIG_.*GPIO\|CONFIG_.*PIN" sdkconfig.defaults sdkconfig 2>/dev/null

2. Check Reserved Pins

Flag violations against these reserved pins:

GPIORestrictionReason
0Boot strappingMust be HIGH for normal boot, LOW for download
1UART0 TXDefault serial output
2Boot strappingMust be LOW during flash
3UART0 RXDefault serial input
6–11FORBIDDENConnected to internal SPI flash
12Boot strappingMTDI — affects flash voltage
15Boot strappingMTDO — affects debug output
34–39Input-onlyNo output capability, no pull-up/pull-down

3. Detect Conflicts

Build a pin allocation table and check for:

  • Double assignment: Same GPIO used by two different peripherals.
  • Bus conflicts: I2C and SPI sharing the same pins.
  • ADC/DAC conflicts: ADC2 channels unusable when Wi-Fi is active.
  • Strapping conflicts: Boot pins used without awareness.

4. Verify Pull-Up/Pull-Down Configuration

For I2C lines:

  • External pull-ups are required. Internal pull-ups are too weak for reliable I2C.
  • Flag if only internal pull-ups are configured for I2C.

For inputs with no external circuitry:

  • Verify pull-up or pull-down is configured to avoid floating pins.

5. Check Documentation

Compare actual code pin usage against:

  • Pin map comments in source files.
  • README or documentation references.
  • Schematic references if available.

Flag any drift between documented and actual usage.

6. Generate Audit Report

# Pin Audit Report

## Pin Allocation Table
| GPIO | Function | Component | Direction | Pull | Notes |
|------|----------|-----------|-----------|------|-------|

## Violations
- [ ] [Description of violation]

## Conflicts
- [ ] [Description of conflict]

## Warnings
- [ ] [Potential issues to investigate]

## Documentation Drift
- [ ] [Documented vs. actual usage]

ADC2 Wi-Fi Warning

Critical: ADC2 channels (GPIO 0, 2, 4, 12, 13, 14, 15, 25, 26, 27) cannot be used while Wi-Fi is active. Always flag ADC2 usage in Wi-Fi-enabled projects.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.