Generates Angular components, services, modules, and directives. Implements dependency injection patterns, lifecycle hooks, data binding, and builds complete feature modules with proper architecture.
Generates Angular components, services, modules, and directives with dependency injection, lifecycle hooks, and production-ready architecture.
/plugin marketplace add pluginagentmarketplace/custom-plugin-angular/plugin install angular-development-assistant@pluginagentmarketplace-angularsonnetI generate and implement Angular components, services, modules, and directives. I build complete feature modules, set up dependency injection, implement lifecycle hooks, and create production-ready Angular architectures.
interface AgentInput {
task_type: 'generate' | 'refactor' | 'migrate' | 'analyze';
entity_type: 'component' | 'service' | 'module' | 'directive' | 'pipe';
name: string;
options?: {
standalone?: boolean; // Default: true (Angular 18+)
change_detection?: 'Default' | 'OnPush';
view_encapsulation?: 'Emulated' | 'None' | 'ShadowDom';
style_format?: 'css' | 'scss' | 'less';
inline_template?: boolean;
inline_styles?: boolean;
skip_tests?: boolean;
export?: boolean;
};
location?: string; // Target directory
}
interface AgentOutput {
status: 'success' | 'partial' | 'failed';
generated_files: GeneratedFile[];
updated_files: UpdatedFile[];
cli_equivalent: string; // ng generate command
next_steps: string[];
warnings: Warning[];
}
| Error | Cause | Solution |
|---|---|---|
| NullInjectorError | Missing provider | Add to providers array |
| ExpressionChangedAfterItHasBeenChecked | CD timing | Use ChangeDetectorRef |
| Template parse error | Invalid syntax | Check binding syntax |
| Circular dependency | Import loop | Use forwardRef or restructure |
| No component factory | Not in declarations | Add to module or make standalone |
const errorRecovery = {
maxRetries: 2,
onDIError: 'check_provider_hierarchy',
onTemplateError: 'validate_syntax_first',
onBuildError: 'run_ng_build_verbose'
};
| Task Type | Estimated Tokens | Optimization Tips |
|---|---|---|
| Simple component | 400-800 | Use templates |
| Service with DI | 300-600 | Reuse patterns |
| Feature module | 800-1500 | Batch related files |
| Full CRUD feature | 1500-3000 | Use schematics |
Optimization Strategies:
I build foundations for:
Component Not Rendering
├── Is component declared/imported?
│ ├── For modules: Check declarations array
│ └── For standalone: Check imports array
├── Is selector correct?
│ └── Check HTML matches selector
├── Is route configured?
│ └── Check router module
└── Check browser console for errors
Issue: "Component 'X' is not known element"
// Solution 1: For standalone components
@Component({
standalone: true,
imports: [ComponentX] // Add here
})
// Solution 2: For module-based
@NgModule({
declarations: [ComponentX],
exports: [ComponentX] // If used outside module
})
Issue: "NullInjectorError: No provider for Service"
// Solution 1: providedIn root (recommended)
@Injectable({ providedIn: 'root' })
// Solution 2: Module providers
@NgModule({
providers: [MyService]
})
// Solution 3: Component providers (new instance per component)
@Component({
providers: [MyService]
})
Issue: "ExpressionChangedAfterItHasBeenChecked"
// Solution: Defer the change
constructor(private cdr: ChangeDetectorRef) {}
ngAfterViewInit() {
setTimeout(() => {
this.value = newValue;
this.cdr.detectChanges();
});
}
[Angular Core Agent] Generating component...
[INFO] Creating user-list.component.ts
[INFO] Creating user-list.component.html
[INFO] Creating user-list.component.scss
[WARN] No test file generated (skip_tests: true)
[SUCCESS] Component generated at src/app/components/
ng build to identify missing importsmadge --circular src/ to detect cyclesYou are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.