Claude-skill-registry-data migrate-page-gitlab
Migrate Angular page from GitLab source following DDD architecture. Use when migrating pages from GitLab repository (Angular 16) to Angular 20 with domain-driven design patterns.
git clone https://github.com/majiayu000/claude-skill-registry-data
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/migrate-page-gitlab" ~/.claude/skills/majiayu000-claude-skill-registry-data-migrate-page-gitlab && rm -rf "$T"
data/migrate-page-gitlab/SKILL.mdPage Migration Command (GitLab Source)
Migrate a page from GitLab repository (Angular 16) to new one-ui monorepo (Angular 20) following DDD architecture.
Arguments
- Format:$ARGUMENTS--page <page_name>
: Page folder name in GitLab (e.g.,--page
,time
,account
)ddns
Target Path Convention
Target path is automatically derived as
libs/mxsecurity/{page_name}-page
Example: --page time → libs/mxsecurity/time-page
GitLab Source Base URL
https://gitlab.com/moxa/sw/f2e/networking/f2e-networking/-/tree/main/apps/mxsecurity-web/src/app/pages/{page_name}
GitLab Access Token
Set environment variable
GITLAB_TOKEN or use private_token=${GITLAB_TOKEN} for authenticated access.
Security Note: Never hardcode tokens in skill files. Use environment variables instead.
Workflow
Phase 1: Fetch Source from GitLab & Analysis
GitLab URLs (with token):
- Tree API:
https://gitlab.com/api/v4/projects/moxa%2Fsw%2Ff2e%2Fnetworking%2Ff2e-networking/repository/tree?path=apps/mxsecurity-web/src/app/pages/{page_name}&ref=main&private_token=${GITLAB_TOKEN} - Raw file:
https://gitlab.com/api/v4/projects/moxa%2Fsw%2Ff2e%2Fnetworking%2Ff2e-networking/repository/files/{url_encoded_path}/raw?ref=main&private_token=${GITLAB_TOKEN}
Use WebFetch to fetch source files (
*.component.ts, *.component.html, *.component.scss, *.service.ts, *.model.ts).
Analyze the fetched source and create a migration analysis document in
{target}/domain/src/lib/docs/MIGRATION-ANALYSIS.md:
-
File Structure Analysis
- List all files fetched from GitLab
- Categorize by type: components, services, models, templates, styles
-
Component Analysis
- Identify all components and their relationships
- Note parent/child relationships
- Identify dialog components
- Identify table/form components
-
Form Validation Analysis
- List all form controls and their validators
- Identify
usage that needsValidators.*
replacementOneValidators.* - Document custom validators
-
API Calls Analysis
- List all HTTP calls (endpoints, methods, request/response types)
- Identify API services being used
- Document data flow
-
Dependencies Analysis
- Third-party libraries used
- Angular Material components used
- Shared services/utils used
-
Translation Keys Analysis (CRITICAL)
- DO NOT create new translation keys
- DO NOT modify existing translation keys
- List all translation keys used in source HTML templates
- Copy exact keys for use in migrated components
-
Form Layout Analysis (CRITICAL)
- DO NOT change form field row groupings
- Analyze
patterns in source templatesfxLayout="row" - Document which fields appear on same row
- Use
class in migrated components to preserve layout.form-row
Phase 2: DDD Structure Migration
Reference documents from
one-ui-migration skill's rules/ directory:
Reference Docs (
rules/reference/):
- DDD layers, helper filesddd-architecture.md
- API types, def filesapi-types.md
- Full compliance checklistchecklist.md
- Common migration mistakespitfalls/
Tool Docs (
rules/tools/):
- OneValidators usage, pattern constantsforms/validators.md
- Template errors, custom errorsforms/error-handling.md
- Page layout, breadcrumbui/page-layout.md
- Form layout, validationui/forms.md
- Button types, loading statesui/buttons.md
- File upload, form patternsui/components.md
- Dialog config, viewContainerRefui/dialogs.md
- CommonTableComponenttables/basics.md
- Column API, custom templatestables/columns.md
- Paginator configtables/advanced.md
Guides (
rules/guides/):
- Page creation guidecreate-page.md
- Dialog creation guidecreate-dialog.md
- Table creation guidecreate-table.md
Generate libraries using the Nx plugin:
# Generate all library types at once nx g @one-ui/one-plugin:library mxsecurity {page-name} all # Or generate individually if needed nx g @one-ui/one-plugin:library mxsecurity {page-name} domain nx g @one-ui/one-plugin:library mxsecurity {page-name} features nx g @one-ui/one-plugin:library mxsecurity {page-name} ui nx g @one-ui/one-plugin:library mxsecurity {page-name} shell
Phase 3: Layer-by-Layer Migration
-
Domain Layer (
) - seedomain/rules/reference/ddd-architecture.md- API response types → use existing types from
(e.g.,@one-ui/mxsecurity/shared/domain
)SRV_USER_ACCOUNT - If API type missing → create in
libs/mxsecurity/shared/domain/src/lib/models/api/ - Page-specific models (view models, form models) →
*.model.ts - Migrate API service →
*.api.ts - Create SignalStore →
*.store.ts - Migrate constants →
*.def.ts - Extract pure functions →
(data transformations, serialization)*.helper.ts - Keep
inMIGRATION-ANALYSIS.md
folderdomain/src/lib/docs/
- API response types → use existing types from
-
UI Layer (
) - seeui/rules/tools/tables/basics.md- Migrate tables → use
patternCommonTableComponent - Migrate forms → use
,input()
patternoutput() - Table toolbar → use
withmat-stroked-button
/general.button.createdelete - Keep components dumb (no store injection, no HTTP)
- Migrate tables → use
-
Features Layer (
) - seefeatures/
,rules/tools/ui/forms.md
andbuttons.mddialogs.md- Migrate page component → smart component pattern
- Migrate dialogs → use
,smallDialogConfig
,mediumDialogConfiglargeDialogConfig - Form tooltips → use
instead ofmxLabelTooltip
withmat-iconmatTooltip - Inject store, pass data to UI via inputs
-
Shell Layer (
)shell/- Create routes with resolver pattern
- Provide store and services
-
App Routes Registration (see
)rules/tools/ui/page-layout.md- Add route to
apps/mxsecurity/mxsecurity/src/app/app.routes.ts - Register in
children array with breadcrumb resolverappRoutes
- Add route to
Phase 4: Syntax Modernization
Apply Angular 20 syntax updates (see
rules/reference/angular-20-syntax.md):
→*ngIf@if
→*ngFor@for (item of items; track item.id)
→constructor(private service: Service)inject()
→@Input()input()
→@Output()output()
→BehaviorSubjectsignal()
Form Validation (see
rules/tools/forms/validators.md):
→Validators.required
(no parentheses)OneValidators.required
→Validators.email
(no parentheses)OneValidators.email
→Validators.minLength(n)OneValidators.minLength(n)- Import from
@one-ui/mxsecurity/shared/domain
UI Patterns:
-
Buttons (see
):buttons.md
→mat-raised-buttonmat-flat-button- Form tooltips: Use
instead ofmxLabelTooltip
withmat-iconmatTooltip - Loading states: Use
withMxLoadingButtonDirective[mxButtonIsLoading]="loading()"
-
Page Layout (see
):ui/page-layout.md
→mat-card<div class="content-wrapper">
-
Dialogs (see
):dialogs.md- Dialog sizing: Use
,smallDialogConfig
,mediumDialogConfiglargeDialogConfig - Dialog API calls: Call API inside dialog, close only on success via
callbacknext - Dialog viewContainerRef: Set
when dialog uses storeviewContainerRef: this.#viewContainerRef
- Dialog sizing: Use
-
Tables (see
):basics.md- Table toolbar buttons: Use
withmat-stroked-button
/general.button.creategeneral.button.delete
- Table toolbar buttons: Use
Translation Keys (see
rules/reference/pitfalls/translation-layout.md):
- MUST use exact same translation keys as source
- Read source HTML templates to find correct keys
- DO NOT create new keys or modify existing ones
- Example:
→{{ 'general.common.name' | translate }}{{ t('general.common.name') }}
Number-Only Input Directive (see
rules/reference/pitfalls/forms-services.md):
- MUST replace
withappNumberOnlyoneUiNumberOnly - Import
fromNumberOnlyDirective@one-ui/mxsecurity/shared/domain
Phase 5: Verification
# Type check npx tsc --noEmit --project libs/mxsecurity/{page-name}/domain/tsconfig.lib.json # Lint nx lint mxsecurity-{page-name}-domain nx lint mxsecurity-{page-name}-features nx lint mxsecurity-{page-name}-ui nx lint mxsecurity-{page-name}-shell # Build nx build mxsecurity-web
Output Format
After completing migration analysis (Phase 1), save the analysis to:
{target}/domain/src/lib/docs/MIGRATION-ANALYSIS.md
Example Usage
/migrate-page-gitlab --page time /migrate-page-gitlab --page account /migrate-page-gitlab --page ddns
These will automatically migrate to:
libs/mxsecurity/time-pagelibs/mxsecurity/account-pagelibs/mxsecurity/ddns-page
Reference Examples
- MAF Account Settings:
libs/maf/act-account/ - Switch L3 Interface:
libs/switch/l3-interface/ - MXsecurity Login:
libs/mxsecurity/login-page/