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

feature_contract

Skill79 starsChanged 8 months agoMITView on GitHub

Generate a structured implementation contract before making any code changes to an ESP32 project.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before implementing any feature or bug fix.

    line 12
  2. Distinctive:

    Before refactoring existing code.

    line 13
  3. Distinctive:

    Before making any architecture changes.

    line 14
  4. Very specific:

    Write the contract to the active mission file or as a standalone document using the template at …

    line 61

≈ “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

Feature Contract

Generate an implementation contract that must be reviewed and approved before any code changes begin.

When to Use

  • Before implementing any feature or bug fix.
  • Before refactoring existing code.
  • Before making any architecture changes.
  • Always. No exceptions.

Steps

1. Gather Requirements

Ask or determine:

  • What is the requested change?
  • What is the expected behavior after the change?
  • What board/target is this for?
  • Are there hardware constraints?

2. Define Scope

Document:

  • Summary: One-paragraph description of the change.
  • Non-goals: What this change explicitly does NOT do.
  • Affected files: List every file that will be created, modified, or deleted.
  • APIs touched: Public functions or interfaces that will change.

3. Assess Risks

Evaluate:

  • Concurrency risks: Shared state, race conditions, task interactions.
  • Peripheral risks: Pin conflicts, bus contention, timing issues.
  • Memory risks: Heap impact, stack requirements, DMA buffers.
  • Boot risks: Changes that affect boot sequence or strapping pins.
  • Backward compatibility: Breaking changes to APIs or protocols.

4. Define Test Plan

Specify:

  • New tests to add: Unit tests, integration tests, or validation scripts.
  • Existing tests to update: Tests affected by the change.
  • Manual verification: Steps for hardware testing if applicable.
  • Test evidence required: What output proves the change works.

5. Define Rollback Strategy

Document:

  • How to revert the change.
  • What state needs to be restored.
  • Any data migration or NVS implications.

6. Generate Contract Document

Write the contract to the active mission file or as a standalone document using the template at missions/templates/implementation_contract.md.

Contract Template

# Implementation Contract

## Change Summary
[One-paragraph description]

## Non-Goals
- [What this does NOT include]

## Affected Files
| File | Action | Description |
|------|--------|-------------|
| path/to/file.c | MODIFY | [What changes] |
| path/to/new.h | CREATE | [Purpose] |

## APIs Touched
- `function_name()` — [How it changes]

## Risk Assessment
### Concurrency: [LOW/MED/HIGH]
[Details]

### Peripheral: [LOW/MED/HIGH]
[Details]

### Memory: [LOW/MED/HIGH]
[Details]

## Test Plan
- [ ] [Test case description]

## Rollback Strategy
[Steps to revert]

## Acceptance Criteria
- [ ] [Criterion]

Rules

  1. Never skip the contract. Even small changes need a contract.
  2. Get approval before coding. The contract must be accepted first.
  3. Update the contract if scope changes. Scope creep must be documented.
  4. Reference the contract in the PR. Link it for reviewers.

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.