# Feature: Debug Attribute
### Scope
- **Purpose**: Enables inspection of all code generated by the macro by emitting a structured diagnostic to the compiler output at compile time.
- **Responsibility**: Documents the debug attribute feature — activation, output phases, and feature flag gating.
- **In Scope**: The debug item-level attribute, the four diagnostic phases emitted, and the feature flag that gates output.
- **Out of Scope**: The generated code architecture itself (→ feature/001_struct_former.md, feature/002_enum_former.md), attribute contracts (→ api/001_item_attributes.md).
### Design
The debug attribute is a development-time diagnostic tool. When applied to a type annotation, the macro emits four phases of information to the compiler output during macro expansion:
1. **Input analysis**: target type identity, generic parameters, field or variant inventory, and full attribute configuration
2. **Generic classification**: how the macro categorizes the generic parameters and what generation strategy that implies
3. **Component breakdown**: summary of each generated component, trait implementations, and the formation workflow
4. **Complete generated code**: the full token stream output that will be compiled
All output is gated behind a feature flag. When the flag is disabled, the debug attribute has zero effect on compilation time or output — the diagnostic paths are compiled out entirely. This ensures no penalty for production builds.
The debug attribute may appear standalone on the type or inside the former attribute container alongside other item-level attributes.
### Cross-References
| source | `src/lib.rs` | Crate entry point |
| doc | [api/001_item_attributes.md](../api/001_item_attributes.md) | Item-level attribute reference including debug |
### Sources
| [../../spec.md](../../spec.md) | Primary source — section 2.6 Debug Attribute: four diagnostic phases, feature-flag gating, and zero-cost guarantee; also produced 12 sibling instances — see entities.md |