| name | developing-features-with-tdd |
| description | Use when developing features with tdd is required during implementation work, especially when the result must be traceable, independently reviewable, and safe to hand to another agent. |
| license | MIT |
| compatibility | ForgeOS-compatible Agent Skills hosts; no provider-specific model required. |
| metadata | {"author":"forgeos-community","version":"0.2.0","pack":"implementation","kind":"core","status":"stable"} |
Developing Features With Tdd
Overview
This skill owns one bounded responsibility: developing features with tdd. Its focus is implement one externally observable feature through a verified red-green-refactor cycle. It converts declared inputs into typed artifacts and reproducible evidence without silently changing product scope.
Trigger
Activate only when the project is in one of these stages: implementation, all contract preconditions pass, and the router identifies a missing output this skill can produce. Do not activate merely because the skill name resembles the user request.
Required Inputs
execution-plan
acceptance-contracts
- Current gate result, open findings, artifact hashes, and invalidation state
- Required tools:
filesystem, shell
- Optional tools: none
- Confirmed human decisions relevant to this scope
Method-Specific Protocol
- Write the smallest behavior test from the acceptance contract before production code.
- Run it and confirm it fails for the intended missing behavior rather than setup or syntax.
- Implement only enough behavior to pass, then run the focused and relevant regression suites.
- Refactor only while all tests remain green and no behavior changes.
- Record the red output, green output, diff review, and remaining risks.
Procedure
- Load one task, its direct contracts, and its failing test.
- Verify the test fails for the intended missing behavior.
- Write the smallest behavior test from the acceptance contract before production code.
- Run it and confirm it fails for the intended missing behavior rather than setup or syntax.
- Implement only enough behavior to pass, then run the focused and relevant regression suites.
- Refactor only while all tests remain green and no behavior changes.
- Record the red output, green output, diff review, and remaining risks.
- Implement the minimum sufficient change.
- Run focused tests, then relevant regression tests.
- Review the diff for complexity, security, and contract drift.
- Commit evidence and hand off to independent review.
Verification Questions
- Was the failure observed before implementation?
- Does the test assert behavior rather than mocks or internals?
- Did implementation add anything not demanded by the test?
- Are warnings and unrelated regressions zero?
Evidence Packet
Produce or reference all applicable evidence:
red test log
green test log
diff review
commit hash
Evidence must identify the current artifact hash, command or method used, result, reviewer identity, timestamp, and limitations.
Output Contract
Produce:
The primary artifact must include schema version, provenance, consumed artifact IDs, decisions, evidence references, residual risks, validation state, and invalidation targets. Narrative explanation may accompany the artifact but cannot replace it.
Quality Gate
Reviewer: independent-reviewer
- The output directly and completely performs developing features with tdd within its declared boundary.
- Was the failure observed before implementation?
- Does the test assert behavior rather than mocks or internals?
- Did implementation add anything not demanded by the test?
- Are warnings and unrelated regressions zero?
- Every material claim is traceable to an input, decision, executable check, or evidence item.
- Required fields are complete and machine-readable.
- The producing agent is not the approving reviewer.
- Open uncertainty and residual risk are explicit; critical findings are never hidden by an aggregate score.
Pass only when: All mandatory rules pass, evidence targets the current artifact hash, and no unresolved critical finding applies.
Forbidden Shortcuts
- Do not infer a material requirement that the user has not confirmed.
- Do not replace a typed artifact with a long explanation.
- Do not approve work produced by the same agent identity.
- Do not hide a critical failure behind a high aggregate score.
- Do not load unrelated project history, files, references, or skill bodies.
- Do not mark evidence complete when it targets a different artifact hash or version.
Failure Modes
- guessing a material requirement
- producing prose without the contracted artifact
- self-approving the output
- expanding scope without a decision record
- tests written after code
- broad mocks hiding integration behavior
- speculative options and abstractions
Escalation and Invalidation
Stop and request a human decision when scope, risk acceptance, irreversible action, cost ceiling, privacy boundary, or product direction is materially ambiguous. When this artifact changes, invalidate only descendants named by the artifact graph; preserve unaffected verified branches.
Handoff
- Next transition: the graph router selects a real consumer of
implemented-increment.
- Required evidence:
contract-validation, independent-review, red test log, green test log, diff review, commit hash.
- Required envelope fields:
artifactId, schemaVersion, sha256, producingSkill, producingAgent, consumedArtifacts, decisionIds, evidenceIds, residualRisks, validationState, invalidationTargets, stopCondition.
- Stop condition: Output contract is satisfied, a blocker is recorded, or a material human decision is required.
Token and Context Policy
Load at most 8 direct artifacts and reference depth 1. Use stable IDs, hashes, signatures, and deltas instead of repeating full history. Use established domain terminology, state each requirement once, and spend context on decisions, code, tests, or evidence rather than narration.
Reference Playbook
Load skills/references/core/implementation.md only when this skill needs pack-wide decision tables, evidence patterns, or cross-skill handoff rules.
See contract.json for the machine-readable contract.