All jobs

Migrate an Angular App to Signal Inputs and Outputs

Yes. An agent runs the Angular signal migrations, converts the setter inputs, subjects and async pipes the schematic skips, keeps the tests green and opens a PR.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent first measures how far along the app already is, because most Angular apps are half migrated. In realworld-apps/angular-realworld-example-app, package.json pins Angular 21.2.12, app.config.ts calls provideZonelessChangeDetection(), every component is standalone with OnPush, and routes in app.routes.ts lazy-load with loadComponent. Pages such as article.component.ts and home.component.ts already hold their state in signal(). What remains on the decorator API is 15 declarations across 8 files: article-list.component.ts has four @Input fields (limit, config, currentPage, isFollowingFeed) and a pageChange output, article-comment.component.ts has comment and delete, favorite-button.component.ts and follow-button.component.ts each have one input and a toggle output, article-meta.component.ts has article, and three are setters: article-preview.component.ts takes @Input({ required: true }) set articleInput and writes it into a local signal, list-errors.component.ts turns an errors setter into a string array, and if-authenticated.directive.ts sets a signal from its setter. On the observable side, UserService keeps two BehaviorSubjects behind currentUser, authState and isAuthenticated, header.component.html reads both with | async, article-comment derives canModify$ from currentUser, and app.routes.ts guards with isAuthenticated.pipe(map(...)). Tests are Vitest 4 through @analogjs/vite-plugin-angular over six service spec files, with a test-setup.ts that still imports zone.js; CI runs Prettier in lint.yml and Playwright end-to-end tests from the realworld submodule in playwright.yml with bun run test:e2e.

The agent runs the official schematics first, ng generate @angular/core:signals, which rewrites the plain decorators: @Input() limit!: number becomes limit = input.required<number>(), @Input() currentPage = 1 becomes input(1), outputs become output<number>(), and every template read gains its call parentheses, so isFollowingFeed in the article-list template becomes isFollowingFeed(). The schematic leaves the three setter inputs alone, and those are where the hand work is. article-preview mutates its input locally when a favourite toggles, so it becomes articleInput = input.required<Article>() with article = linkedSignal(() => this.articleInput()), which tracks the parent's value until the component overrides it. list-errors becomes errors = input<Errors | null>(null) with errorList = computed(...). The directive takes ifAuthenticated = input.required<boolean>() and replaces its ngOnInit subscription with an effect reading toSignal(userService.isAuthenticated). article-list keeps its ngOnChanges, which still fires for signal inputs, and the pull request notes an effect as a follow-up rather than changing behaviour twice in one diff.

Then the service. UserService moves its two subjects to signal<User | null>(null) and signal<AuthState>('loading') with isAuthenticated = computed(() => !!this.currentUser()), and exposes currentUser$ and authState$ through toObservable so the route guards, the combineLatest calls in the article and home pages and the retry timer keep working unchanged in this pull request. getCurrentUserSync() becomes a one-line wrapper over currentUser(), header.component.html drops AsyncPipe and reads authState() and currentUser() directly, article-comment replaces canModify$ | async with a computed over the comment input and the user signal, and the debug interface in app.config.ts reads the signals instead of subscribing.

Each step is checked before the next. bun run build runs ng build with strictTemplates, which is what catches a missing () in a template; bun run test runs the six Vitest specs, and the agent updates the user.service.spec.ts cases that subscribe to the old subjects; bun run format:check runs Prettier as lint.yml does. For the end-to-end tests it initialises the realworld submodule, installs Chromium with bunx playwright install --with-deps chromium, and runs bun run test:e2e the way playwright.yml does, reporting the counts it saw. It also removes the zone.js imports from test-setup.ts, since the app runs zoneless, and says so.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Migrate this Angular app from decorator inputs and outputs to signal inputs, outputs and signal-based services. Read package.json, app.config.ts, app.routes.ts, every component, directive and service under src/app, the Vitest and Playwright configs and the workflows first, and list every @Input, @Output, BehaviorSubject and async pipe you find. Run the Angular signals migration schematic, then convert by hand what it skips: setter inputs (use linkedSignal where a component overrides its input locally, computed where it derives), the directive's subscription (an effect over toSignal), and the user service's subjects (signals plus computed, with toObservable exports so the route guards and combineLatest callers keep working in this change). Replace async pipes that read the service with direct signal reads. Keep ngOnChanges where it still works and note follow-ups. Run the production build, the Vitest specs, the Prettier check and the Playwright end-to-end tests after initialising the submodule and installing Chromium, fix what breaks, and open a pull request that lists every converted declaration and what each check reported.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

What comes back is a pull request over the eight component and directive files, user.service.ts and its spec, header.component.html, app.config.ts and test-setup.ts. The description lists all 15 converted declarations with before and after, names the three setters it rewrote by hand and the linkedSignal it used for the article preview, and states what the build, the Vitest run, the Prettier check and the Playwright run reported.

The run's record keeps the schematic's output, every ng build and bun run test invocation with its result, and the Playwright summary, so a reviewer can see which failure the agent hit and what it changed in response.

Before merging, a reviewer reads the linkedSignal and effect sites, since those are the two places behaviour could differ from the subscription they replace, runs the end-to-end suite once more on the pull request through playwright.yml, and decides whether the noted follow-up on article-list's ngOnChanges goes in now or next.

Run it on every feature folder

An app larger than this one is migrated one feature at a time. A script lists the folders under src/app/features and starts one run per folder with this body, the prompt's first line naming the folder to convert and the branch to base on, with a request_id that is a UUID v5 of the folder name so a rerun returns the run already started. Each run opens its own pull request; the shared service goes first, in a run of its own, so the others build on it.

The key's webhook reports each run.completed with the session URL, and GET /o/{org}/p/{project}/sessions/{id}/changes lists the files each run touched, which is a quick way to confirm no two pull requests edit the same component.

The use case this job follows, with its automation and trigger: Hand off a long task.

Why run it on Rush?

A signals migration is a long tail of small decisions, which component overrides its input, which subscription is really a derived value, which spec was asserting on a subject, and the only way to know each one is right is to build and test after it. The agent does that loop in its own sandbox, with the schematic, the strict template compiler, the unit specs and a real browser run of the end-to-end suite, and keeps every result.

Started from a terminal before leaving for the day, the run finishes on its own, and the pull request that is waiting in the morning says exactly which declarations moved, which were left with a reason, and what each check reported, which is the brief a reviewer wants for a change that touches most of the app.

Frequently asked questions

Why keep toObservable exports on the user service?

The route guards in app.routes.ts, the combineLatest calls in the article and home pages and the retry timer all consume observables today. Exporting currentUser$ and authState$ through toObservable lets this pull request change the service's storage without rewriting every consumer at once; the consumers can move to signals in later, smaller changes.

What does linkedSignal do for the article preview?

The preview receives an article from its parent and updates the favourite count locally when the button toggles. A plain signal input cannot be written, so linkedSignal gives a writable signal that follows the input whenever the parent sends a new article and otherwise keeps the local override, which is the same behaviour the setter plus local signal had.

Does the schematic handle setter inputs?

No. The signals migration converts field inputs and outputs and updates templates, but leaves @Input() set x(...) declarations in place, which is why article-preview, list-errors and if-authenticated are rewritten by hand and called out in the pull request.

Why remove zone.js from the test setup?

The app bootstraps with provideZonelessChangeDetection(), so the production code runs without Zone. The test setup still imported zone.js and zone.js/testing, which made specs run under a different change-detection model than the app. Removing it keeps the two aligned, and the Vitest run confirms the specs still pass.

More Angular jobs

More jobs like this: Hand off a long task

Keep reading