xiaohongshu
xiaohongshu
migration-lint
Comprehensive Angular migration compliance checker with auto-fix capabilities. Use when reviewing migrated code for DDD architecture, Angular 20 syntax, and UI pattern compliance.
Full skill instructions
Review and fix migrated Angular code for compliance. This command reads ALL migration guidelines and performs a comprehensive checklist review.
$ARGUMENTS - Target path to review (e.g., libs/mxsecurity/connection-management-page)IMPORTANT: Read the core SKILL.md first, then reference documents as needed from ``.
Core: one-ui-migration skill
| # | Topic | File | Category |
|---|---|---|---|
| 1 | Migration Context | rules/reference/migration-context.md | Foundation |
| 2 | Angular 20 Syntax | rules/reference/angular-20-syntax.md | Foundation |
| 3 | DDD Architecture | rules/reference/ddd-architecture.md | Architecture |
| 4 | State Management | rules/reference/state-management.md | Architecture |
| 5 | Authentication | rules/tools/auth.md | Architecture |
| 6 | Migration Checklist | rules/reference/migration-checklist.md | Foundation |
| 7 | Pitfalls Index | rules/reference/pitfalls/index.md | Pitfalls |
| 7a | Pitfalls: Translation & Layout | rules/reference/pitfalls/translation-layout.md | Pitfalls |
| 7b | Pitfalls: DDD Violations | rules/reference/pitfalls/ddd-violations.md | Pitfalls |
| 7c | Pitfalls: Angular Syntax | rules/reference/pitfalls/angular-syntax.md | Pitfalls |
| 7d | Pitfalls: Forms & Services | rules/reference/pitfalls/forms-services.md | Pitfalls |
| 8 | Validators | rules/tools/forms/validators.md | Forms |
| 9 | Error Handling | rules/tools/forms/error-handling.md | Forms |
| 10 | Form Patterns | rules/tools/forms/patterns.md | Forms |
| 11 | Page Layout | rules/tools/ui/page-layout.md | UI Patterns |
| 12a | Forms | rules/tools/ui/forms.md | UI Patterns |
| 12b | Buttons | rules/tools/ui/buttons.md | UI Patterns |
| 12c | Components | rules/tools/ui/components.md | UI Patterns |
| 13 | Dialogs | rules/tools/ui/dialogs.md | UI Patterns |
| 14 | Table Basics | rules/tools/tables/basics.md | Tables |
| 15 | Table Columns | rules/tools/tables/columns.md | Tables |
| 16 | Table Advanced | rules/tools/tables/advanced.md | Tables |
| 17 | API Type Definitions | rules/reference/api-types.md | API |
| 18 | Shared Stores | rules/reference/shared-stores.md | State |
Read all .ts, .html, and .scss files in the target path:
{target}/domain/src/lib/**/*.ts{target}/features/src/lib/**/*.ts{target}/features/src/lib/**/*.html{target}/features/src/lib/**/*.scss{target}/ui/src/lib/**/*.ts{target}/ui/src/lib/**/*.html{target}/ui/src/lib/**/*.scss{target}/shell/src/lib/**/*.tsCheck EVERY item from EVERY migration file:
scope:mxsecurity)domain, features, ui, shell)@if instead of *ngIf@for (item of items; track item.id) instead of *ngFor@switch instead of ngSwitchinject() instead of constructor injectioninput() instead of @Input()output() instead of @Output()viewChild() / viewChildren() instead of @ViewChild() / @ViewChildren()contentChild() / contentChildren() instead of @ContentChild() / @ContentChildren()model() for two-way binding where appropriateChangeDetectionStrategy.OnPushindex.ts) are properly configuredgl-page-content class (not ng-container)*ngIf with @for)@for loops have tracklangChanged() called at field level (not in computed)inject() instead of constructor injectionmutationMethod/queryMethod imported from @one-ui/mxsecurity/shared/domain (NOT shared/util).def.ts files for constantsMxSnackbarService (not MatSnackBar)controls.xxx (not .get('xxx'))toSignal() in effectsEMPTY_DASH constant (not utils.emptyDash)oneUiNumberOnly (not appNumberOnly)mx-password-input for password fieldsmx-key-value for readonly displaysTRANSLOCO_SCOPE provider (use global translation keys)#ENDPOINTS = {}) - inline URLs directly in API methodsXxxStore)withEntities() for entity managementwithRequestStatus() for loading stateswithDataService() for API integrationpatchState() correctlyAuthStore for authentication stateOneValidators.required (not Validators.required)OneValidators.email (not Validators.email)OneValidators.minLength(n) (not Validators.minLength)OneValidators.maxLength(n) (not Validators.maxLength)OneValidators.min(n) (not Validators.min)OneValidators.max(n) (not Validators.max)OneValidators.pattern(x) (not Validators.pattern)@one-ui/mxsecurity/shared/domain<mat-error>MxSnackbarService for notificationsNonNullableFormBuilder (not FormBuilder)controls.xxx (not .get('xxx'))getRawValue() used for form submissionFormArray correctlyinput()/output() for data flowclass="gl-page-content"<one-ui-breadcrumb /> at top<mx-page-title [title]="t('...')"> for page titleclass="content-wrapper" (NOT mat-card)*transloco="let t" patternclass="gl-title-md"mat-flat-button color="primary"mat-buttonmat-stroked-buttonmat-raised-button (use mat-flat-button)[mxButtonIsLoading] directivenoPermission()<div class="form-row"><div class="form-row">smallDialogConfig, mediumDialogConfig, largeDialogConfig)viewContainerRef: this.#viewContainerRef when dialog uses storeConfirmDialogComponent result checked as boolean (NOT result?.confirm)afterClosed() subscription cleaned up properly<mx-table> componentMxColumnDef[]data-testid attributesMatTableModule and MatSortModulemat-stroked-button#ENDPOINTS = {...}) - inline URL strings directly in methodsTimeZoneStore)*transloco="let t" or @let t = translocoTtranslate pipet()oneUiNumberOnly (not appNumberOnly)one-ui prefixMxSnackbarService (not MatSnackBar)snackBar.open(msg) (not snackBar.open(msg, '', { duration: 3000 }))EMPTY_DASH from @one-ui/mxsecurity/shared/domain (not utils.emptyDash)<mx-password-input> for password fields<mx-key-value> for readonly key-value displaysAuto-fix the following issues:
| Issue | Fix |
|---|---|
mat-raised-button | → mat-flat-button |
*ngIf | → @if |
*ngFor | → @for (item of items; track item.id) |
Validators.required | → OneValidators.required |
Validators.email | → OneValidators.email |
Validators.minLength(n) | → OneValidators.minLength(n) |
Validators.maxLength(n) | → OneValidators.maxLength(n) |
.get('xxx') | → controls.xxx |
class="section-title" | → class="gl-title-md" |
appNumberOnly | → oneUiNumberOnly |
this.utils.emptyDash | → EMPTY_DASH |
readonly #ENDPOINTS = { | → Remove constant, inline URLs directly in each method |
from '@one-ui/mxsecurity/shared/util' (for mutationMethod/queryMethod) | → from '@one-ui/mxsecurity/shared/domain' |
Output a compliance report:
## Migration Lint Report
**Path:** {target_path}
**Date:** {current_date}
### Checklist Summary
| Category | Files Checked | Pass | Fail | N/A |
|----------|---------------|------|------|-----|
| Foundation (01, 02, 06) | 3 | Pass | Fail | - |
| Architecture (03, 04, 05) | 3 | Pass | Fail | - |
| Pitfalls (08, 08a, 08b, 08c, 08d) | 5 | Pass | Fail | - |
| Forms (09a, 09b, 09c) | 3 | Pass | Fail | - |
| UI Patterns (10a, 10b, 10c) | 3 | Pass | Fail | - |
| Tables (11a, 11b, 11c) | 3 | Pass | Fail | - |
| API & Services (12, 13) | 2 | Pass | Fail | - |
| **Total** | **22** | **X** | **Y** | **Z** |
### Issues Fixed
| File | Line | Issue | Fix Applied |
|------|------|-------|-------------|
| component.html | 15 | mat-raised-button | Changed to mat-flat-button |
### Issues Found (Manual Review Needed)
| File | Line | Issue | Recommendation | Guide Ref |
|------|------|-------|----------------|-----------|
| component.ts | 42 | Missing viewContainerRef | Add viewContainerRef to dialog config | dialogs.md |
| store.ts | 20 | Store in UI layer | Move to features layer | ddd-architecture.md |
### Detailed Checklist Results
#### migration-context.md (Pass)
- [x] Project follows one-ui monorepo structure
- [x] Uses correct scope tags
#### angular-syntax.md (Warning)
- [x] Uses @if instead of *ngIf
- [ ] Uses inject() instead of constructor injection (line 45)
... (continue for all files)
### Summary
- **Migration Files Checked:** 22/22
- **Auto-fixed:** X issues
- **Manual review needed:** Y issues
- **Passed checks:** Z items
- **Failed checks:** W items
<!-- Form submit button -->
<button mat-flat-button color="primary" type="submit">Apply</button>
<!-- Table toolbar button -->
<button mat-stroked-button>Create</button>
<!-- Cancel/secondary button -->
<button mat-button type="button">Cancel</button>
<div *transloco="let t" class="gl-page-content">
<one-ui-breadcrumb />
<mx-page-title [title]="t('page.title')" />
<div class="content-wrapper">
<!-- content here, NO mat-card -->
</div>
</div>
<!-- Single field - NO form-row wrapper -->
<mat-form-field>
<mat-label>{{ t('label') }}</mat-label>
<input matInput formControlName="field" />
</mat-form-field>
<!-- Multiple fields on same row - USE form-row wrapper -->
<div class="form-row">
<mat-form-field>...</mat-form-field>
<mat-form-field>...</mat-form-field>
</div>
import { mediumDialogConfig } from '@one-ui/mxsecurity/shared/domain';
this.#dialog.open(MyDialog, {
...mediumDialogConfig,
data: dialogData,
viewContainerRef: this.#viewContainerRef // Required if dialog uses store
});
import { OneValidators } from '@one-ui/mxsecurity/shared/domain';
this.#fb.group({
name: ['', [OneValidators.required, OneValidators.maxLength(32)]],
email: ['', [OneValidators.required, OneValidators.email]],
port: ['', [OneValidators.required, OneValidators.min(1), OneValidators.max(65535)]]
});
// ConfirmDialogComponent returns boolean, NOT { confirm: boolean }
const dialogRef = this.#dialog.open<ConfirmDialogComponent, ConfirmDialogData, boolean>(
ConfirmDialogComponent,
{
...mediumDialogConfig,
viewContainerRef: this.#viewContainerRef,
data: { title: '...', desc: '...' }
}
);
dialogRef.afterClosed().subscribe((result) => {
if (result) { // result is boolean
this.doSomething();
}
});
// Use MxSnackbarService instead of MatSnackBar
import { MxSnackbarService } from '@moxa/formoxa/mx-snackbar';
readonly #snackBar = inject(MxSnackbarService);
// Simple usage
this.#snackBar.open('Success message');
// Persistent message (no auto-dismiss)
this.#snackBar.open('Saving...', { duration: 0 });
<!-- Use gl-title-md class (global style) -->
<h3 class="gl-title-md">{{ t('section.title') }}</h3>
<!-- NOT section-title (requires custom SCSS) -->
<h3 class="section-title">{{ t('section.title') }}</h3>
// .get() - no type safety
const value = this.form.get('username')?.value;
// controls.xxx - type safe
const value = this.form.controls.username.value;
// In ValidatorFn - use type assertion
#myValidator(): ValidatorFn {
return (formGroup: AbstractControl): null => {
const controls = (formGroup as typeof this.form).controls;
const fieldValue = controls.fieldName.value;
return null;
};
}
<!-- Use mx-password-input for password fields -->
<mx-password-input
formControlName="password"
[maxlength]="32"
></mx-password-input>
<!-- Use mx-key-value for readonly displays -->
<mx-key-value [key]="t('label')" [value]="displayValue"></mx-key-value>
// UI components use input()/output() ONLY - NO store injection
export class MyUiComponent {
readonly data = input<MyData>();
readonly isLoading = input<boolean>(false);
readonly save = output<MyData>();
readonly cancel = output<void>();
}
// Features components can inject stores
export class MyFeatureComponent {
readonly #store = inject(MyStore);
readonly data = this.#store.data;
readonly isLoading = this.#store.isLoading;
}
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience