feature_contract
Skill79 starsChanged 8 months agoMITView on GitHub
Generate a structured implementation contract before making any code changes to an ESP32 project.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- esp32_arch_reviewSkill
- esp32_crash_reviewSkill
- esp32_log_triageSkill
- esp32_pin_auditSkill
- esp32_test_planSkill
- esp32_hardware_checkSkill
- pr_prepareSkill
- repo_scoutSkill
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
- Distinctive: line 12
Before implementing any feature or bug fix.
- Distinctive: line 13
Before refactoring existing code.
- Distinctive: line 14
Before making any architecture changes.
- Very specific: line 61
Write the contract to the active mission file or as a standalone document using the template at …
≈ “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.
Files
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
- Never skip the contract. Even small changes need a contract.
- Get approval before coding. The contract must be accepted first.
- Update the contract if scope changes. Scope creep must be documented.
- Reference the contract in the PR. Link it for reviewers.
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
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.

