Claude-skill-registry frontend-angular-api-service
Use when creating API services for backend communication with proper patterns for caching, error handling, and type safety.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/angular-api-service" ~/.claude/skills/majiayu000-claude-skill-registry-frontend-angular-api-service && rm -rf "$T"
manifest:
skills/data/angular-api-service/SKILL.mdsource content
Angular API Service Development Workflow
Use when creating/modifying API services extending PlatformApiService for backend communication.
Decision Tree
What kind of API service? ├── Standard CRUD → extend PlatformApiService + get/post/put/deleteRequest ├── With caching → + enableCache option in get() calls ├── File upload/download → + postFormData() / getBlob() ├── External API → + override getDefaultHeaders() ├── Search/autocomplete → + debounce in component, cache short-lived └── Validation endpoint → return Observable<boolean>
Workflow
- Search existing services:
grep "{Feature}ApiService" --include="*.ts" - Read references (see Read Directives below)
- Define DTOs: request interfaces, response interfaces, command interfaces
- Create service extending
withPlatformApiService@Injectable({ providedIn: 'root' }) - Implement
getter usingapiUrlenvironment.apiUrl + '/api/{Controller}' - Add query methods (get), command methods (post/put/delete), validation methods
- Verify checklist below
Key Rules
- Always extend
(never usePlatformApiService
directly)HttpClient - Use
for base URL (never hardcode)environment.apiUrl - All methods must have return type annotations:
Observable<T> - Define DTOs for all request/response types
- Use
for cacheable endpoints{ enableCache: true, cacheKey, cacheDurationMs } - File uploads use
, downloads usepostFormData()getBlob() - Error handling done in component via
, not in servicetapResponse()
File Location
src/Frontend/libs/apps-domains/src/lib/{domain}/services/{feature}-api.service.ts
⚠️ MUST READ Before Implementation
IMPORTANT: You MUST read these files before writing any code. Do NOT skip.
- ⚠️ MUST READ
— platform-core imports.claude/skills/shared/angular-design-system.md - ⚠️ MUST READ
— CRUD, caching, upload, search patterns.claude/skills/frontend-angular-api-service/references/api-service-patterns.md - ⚠️ MUST READ target app design system:
docs/design-system/07-technical-guide.md
Anti-Patterns
- must extendconstructor(private http: HttpClient)PlatformApiService- Hardcoded URLs:
- usethis.get('https://api.example.com/...')environment - Missing return type:
- must begetUser(id)getUser(id): Observable<UserDto> - Untyped response:
- must bethis.get('/users')this.get<UserDto[]>('/users') - Error handling in service - let component handle via
tapResponse()
Verification Checklist
- Extends
PlatformApiService -
getter returnsapiUrlenvironment.apiUrl + '/api/{Controller}' - All methods have
return typeObservable<T> - DTOs defined for request/response types
- Caching configured for stable lookup endpoints
- File operations use
/postFormDatagetBlob -
decorator@Injectable({ providedIn: 'root' })
IMPORTANT Task Planning Notes
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed