Skip to content

Improve Router and Start agent skills - #7867

Merged
tannerlinsley merged 4 commits into
mainfrom
taren/improve-router-start-agent-skills
Jul 26, 2026
Merged

Improve Router and Start agent skills#7867
tannerlinsley merged 4 commits into
mainfrom
taren/improve-router-start-agent-skills

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • make Router Core and Start entry skills select one primary workflow instead of loading overlapping manuals
  • replace SSR-unsafe relative loader fetch guidance with direct server-function calls and cache-coherent mutation patterns
  • add end-to-end auth disclosure, runtime schema, route refactor, session, and virtual route checks
  • refresh package skill versions and generated skill artifacts
  • add the missing Start Server test aliases exposed by the validation run

Why

Protocol-v4 assisted Start runs used more context than baseline, repeatedly rediscovered skills, and still missed SSR, auth, cache, and runtime schema failures. These changes encode those failure modes at the package boundary that owns them.

Validation

  • Router Core, Start Client Core, Start Server Core, and Router Plugin unit tests
  • package type tests across supported TypeScript versions
  • ESLint for packages with lint targets (no errors; existing warnings remain)
  • React Start and Virtual File Routes builds
  • @tanstack/intent@0.0.34 validate --github-summary — 31 skills passed
  • git diff --check

Summary by CodeRabbit

  • Documentation
    • Updated skill guidance across Router, Start, plugin, and virtual routing to newer version references.
    • Expanded full-stack workflow checklists for server functions, loaders, mutations, cache invalidation, and runtime response/schema validation.
    • Strengthened auth and guard boundaries to prevent protected-data disclosure, including improved anonymous-access scenarios.
    • Added SSR-safe loading/fetching recommendations and broader common failure-mode coverage (awaiting request parsing, avoiding self-fetching, and correct handler-level protection).
    • Enhanced session and request-scoped rules, plus virtual route refactor auditing guidance.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Documentation and skill metadata were refreshed for newer Router and Start versions. Guidance now covers SSR-safe loaders, server-function boundaries, cache invalidation, runtime response validation, authentication boundaries, request-scoped sessions, generated route trees, and virtual route audits.

Changes

Skill catalogs and metadata

Layer / File(s) Summary
Version and failure-mode catalogs
_artifacts/skill_tree.yaml, packages/*/skills/_artifacts/*
Package versions, dependencies, and failure-mode inventories were updated across Router, Start, Router Plugin, and Virtual File Routes skills.

React Start and Start Client workflows

Layer / File(s) Summary
Full-stack workflow guidance
packages/react-start/skills/..., packages/start-client-core/skills/start-core/*
Skills now document route and component workflows, server-function usage, authentication, cache invalidation, SSR-safe loading, response validation, and server-route data sharing.

Router guidance

Layer / File(s) Summary
Loading, authentication, and type-safety guidance
packages/router-core/skills/router-core/*
Router skills add focused sub-skill selection, SSR-safe loader examples, coordinated invalidation, anonymous-data protection, runtime schema checks, and updated version metadata.

Server sessions

Layer / File(s) Summary
Request-scoped session guidance
packages/start-server-core/skills/start-server-core/*, packages/start-server-core/vite.config.ts
Session examples now validate secrets and configure cookies per request, with added production rules and request-state warnings; Vite aliases point to local fake modules.

Generated and virtual routes

Layer / File(s) Summary
Route generation and refactor audits
packages/router-plugin/skills/..., packages/virtual-file-routes/skills/...
Documentation now covers route-tree regeneration, generated-file restrictions, virtual route applicability, duplicate mounts, and post-refactor validation.

Cross-framework metadata

Layer / File(s) Summary
Skill frontmatter normalization
packages/react-router/skills/..., packages/solid-*/skills/..., packages/vue-*/skills/...
Skill names and frontmatter metadata were normalized across React Router, Solid, and Vue skill documents.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: documentation

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main focus on improving Router and Start agent skills and is concise enough for history scanning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch taren/improve-router-start-agent-skills

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 111f193

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 4m 29s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 24s View ↗

☁️ Nx Cloud last updated this comment at 2026-07-26 06:24:18 UTC

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 1 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/react-start-rsc 0.1.31 → 0.1.32 Changeset
@tanstack/react-start 1.168.32 → 1.168.33 Dependent

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

This pull request does not affect bundle size in any measured scenario.

@pkg-pr-new

pkg-pr-new Bot commented Jul 21, 2026

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@7867

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@7867

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@7867

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@7867

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@7867

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@7867

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@7867

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@7867

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@7867

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@7867

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@7867

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@7867

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@7867

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@7867

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@7867

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@7867

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@7867

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@7867

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@7867

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@7867

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@7867

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@7867

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@7867

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@7867

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@7867

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@7867

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@7867

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@7867

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@7867

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@7867

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@7867

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@7867

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@7867

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@7867

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@7867

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@7867

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@7867

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@7867

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@7867

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@7867

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@7867

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@7867

commit: 111f193

@codspeed-hq

codspeed-hq Bot commented Jul 21, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 12.73%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 5 improved benchmarks
❌ 4 regressed benchmarks
✅ 171 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory mem server peak-large-page (react) 953.9 KB 2,384.3 KB -59.99%
Memory mem server error-paths redirect (vue) 397.5 KB 876.7 KB -54.66%
Memory mem server serialization-payload (solid) 3.5 MB 6 MB -42.57%
Simulation client-mount loop (solid) 58.5 ms 60.7 ms -3.61%
Memory mem server error-paths unmatched (react) 519.6 KB 274.5 KB +89.29%
Memory mem server peak-large-page (solid) 953 KB 774.8 KB +23%
Memory mem server error-paths not-found (solid) 491.8 KB 422.4 KB +16.45%
Memory mem server server-fn-churn (solid) 273.6 KB 263 KB +4.03%
Memory mem server error-paths not-found (react) 276.5 KB 266.7 KB +3.66%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing taren/improve-router-start-agent-skills (111f193) with main (fc83c03)

Open in CodSpeed

@tannerlinsley
tannerlinsley marked this pull request as ready for review July 25, 2026 03:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/react-start/skills/_artifacts/domain_map.yaml`:
- Around line 207-239: Regenerate the failure-mode artifacts from one canonical
source so counts and entries remain consistent: update
packages/react-start/skills/_artifacts/domain_map.yaml at lines 207-239,
390-397, and 431-454 by adding the missing server-functions, execution-model,
and server-routes entries, or consistently reduce the specification instead.
Then update packages/react-start/skills/_artifacts/skill_spec.md at lines 21-24,
40-51, 61-70, and 71-79 so inventory counts and all three domain tables exactly
match the canonical domain map.

In `@packages/router-core/skills/router-core/auth-and-guards/SKILL.md`:
- Around line 412-413: Align the direct-request attack and test guidance with
the method declared in the createServerFn example: use a direct anonymous GET
request, or change the example method to POST if POST is intended. Keep the
redirect-following and protected-data assertions unchanged.

In `@packages/router-core/skills/router-core/data-loading/SKILL.md`:
- Around line 218-223: Update the Route example’s beforeLoad callback to receive
fetchPosts from its context and return that binding, preserving the loader’s
existing context-based fetchPosts usage.

In `@packages/start-client-core/skills/start-core/server-functions/SKILL.md`:
- Around line 104-108: Replace the type-only validator in createIssue with a
real runtime validation using Zod or an explicit check before db.issues.create.
Apply the same runtime-validation fix at
packages/start-client-core/skills/start-core/server-functions/SKILL.md lines
104-108 and packages/start-server-core/skills/start-server-core/SKILL.md lines
183-184, including the credential-validation example, while preserving the
documented input and authentication behavior.

In `@packages/start-server-core/skills/start-server-core/SKILL.md`:
- Around line 185-188: Update the credential check around db.users.findByEmail
and verifyPassword so unknown users still invoke verifyPassword using the fixed
dummy hash required by the auth-server-primitives guidance. Preserve the real
user passwordHash for known users and continue throwing the same generic
“Invalid credentials” error for either failure case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7193e579-f878-4399-a226-0fcf0b30f5ee

📥 Commits

Reviewing files that changed from the base of the PR and between edf5575 and 289dd2d.

📒 Files selected for processing (40)
  • _artifacts/skill_tree.yaml
  • packages/react-start/skills/_artifacts/domain_map.yaml
  • packages/react-start/skills/_artifacts/skill_spec.md
  • packages/react-start/skills/_artifacts/skill_tree.yaml
  • packages/react-start/skills/lifecycle/migrate-from-nextjs/SKILL.md
  • packages/react-start/skills/react-start/SKILL.md
  • packages/react-start/skills/react-start/server-components/SKILL.md
  • packages/router-core/skills/router-core/SKILL.md
  • packages/router-core/skills/router-core/auth-and-guards/SKILL.md
  • packages/router-core/skills/router-core/code-splitting/SKILL.md
  • packages/router-core/skills/router-core/data-loading/SKILL.md
  • packages/router-core/skills/router-core/navigation/SKILL.md
  • packages/router-core/skills/router-core/not-found-and-errors/SKILL.md
  • packages/router-core/skills/router-core/path-params/SKILL.md
  • packages/router-core/skills/router-core/search-params/SKILL.md
  • packages/router-core/skills/router-core/ssr/SKILL.md
  • packages/router-core/skills/router-core/type-safety/SKILL.md
  • packages/router-plugin/skills/_artifacts/domain_map.yaml
  • packages/router-plugin/skills/_artifacts/skill_spec.md
  • packages/router-plugin/skills/_artifacts/skill_tree.yaml
  • packages/router-plugin/skills/router-plugin/SKILL.md
  • packages/start-client-core/skills/_artifacts/domain_map.yaml
  • packages/start-client-core/skills/_artifacts/skill_spec.md
  • packages/start-client-core/skills/_artifacts/skill_tree.yaml
  • packages/start-client-core/skills/start-core/SKILL.md
  • packages/start-client-core/skills/start-core/auth-server-primitives/SKILL.md
  • packages/start-client-core/skills/start-core/deployment/SKILL.md
  • packages/start-client-core/skills/start-core/execution-model/SKILL.md
  • packages/start-client-core/skills/start-core/middleware/SKILL.md
  • packages/start-client-core/skills/start-core/server-functions/SKILL.md
  • packages/start-client-core/skills/start-core/server-routes/SKILL.md
  • packages/start-server-core/skills/_artifacts/domain_map.yaml
  • packages/start-server-core/skills/_artifacts/skill_spec.md
  • packages/start-server-core/skills/_artifacts/skill_tree.yaml
  • packages/start-server-core/skills/start-server-core/SKILL.md
  • packages/start-server-core/vite.config.ts
  • packages/virtual-file-routes/skills/_artifacts/domain_map.yaml
  • packages/virtual-file-routes/skills/_artifacts/skill_spec.md
  • packages/virtual-file-routes/skills/_artifacts/skill_tree.yaml
  • packages/virtual-file-routes/skills/virtual-file-routes/SKILL.md
💤 Files with no reviewable changes (1)
  • _artifacts/skill_tree.yaml

Comment thread packages/react-start/skills/_artifacts/domain_map.yaml
Comment thread packages/router-core/skills/router-core/auth-and-guards/SKILL.md
Comment thread packages/router-core/skills/router-core/data-loading/SKILL.md
Comment thread packages/start-server-core/skills/start-server-core/SKILL.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/router-core/skills/router-core/data-loading/SKILL.md (1)

231-233: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Define the db dependency in the server-function example.

The snippet references db.posts.findMany() without declaring or importing db, so it is not copyable as written. Add a representative import/definition or explicitly mark the database access as pseudocode.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/router-core/skills/router-core/data-loading/SKILL.md` around lines
231 - 233, Update the createServerFn example around getPosts to declare or
import a representative db dependency before calling db.posts.findMany(), making
the snippet copyable; alternatively, explicitly label the database access as
pseudocode.
packages/start-server-core/skills/start-server-core/SKILL.md (1)

218-220: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Create a fresh session before setting userId. updateSession only mutates the current session data; it doesn’t rotate the session identifier, so reusing the pre-login cookie here leaves room for session fixation. Clear the old session and issue a new one at login.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/start-server-core/skills/start-server-core/SKILL.md` around lines
218 - 220, Update the login flow around updateSession so it clears the pre-login
session and creates a fresh session identifier before assigning userId. Preserve
the existing getSessionConfig() and SessionData usage while ensuring the
authenticated session cannot reuse the original login cookie.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/start-server-core/skills/start-server-core/SKILL.md`:
- Around line 172-178: Update getDummyPasswordHash and its
startup/authentication flow so an unset DUMMY_PASSWORD_HASH is validated during
startup, or its failure is mapped to the same generic Invalid credentials
response used for unknown users. Ensure the unknown-user path never exposes the
distinct DUMMY_PASSWORD_HASH is required error.

---

Outside diff comments:
In `@packages/router-core/skills/router-core/data-loading/SKILL.md`:
- Around line 231-233: Update the createServerFn example around getPosts to
declare or import a representative db dependency before calling
db.posts.findMany(), making the snippet copyable; alternatively, explicitly
label the database access as pseudocode.

In `@packages/start-server-core/skills/start-server-core/SKILL.md`:
- Around line 218-220: Update the login flow around updateSession so it clears
the pre-login session and creates a fresh session identifier before assigning
userId. Preserve the existing getSessionConfig() and SessionData usage while
ensuring the authenticated session cannot reuse the original login cookie.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 639bbe71-d329-446b-b416-f03cae91bae6

📥 Commits

Reviewing files that changed from the base of the PR and between 289dd2d and 21c0e8b.

📒 Files selected for processing (12)
  • packages/react-start/skills/_artifacts/domain_map.yaml
  • packages/react-start/skills/_artifacts/skill_spec.md
  • packages/router-core/skills/router-core/auth-and-guards/SKILL.md
  • packages/router-core/skills/router-core/data-loading/SKILL.md
  • packages/router-core/skills/router-core/type-safety/SKILL.md
  • packages/router-plugin/skills/_artifacts/skill_spec.md
  • packages/start-client-core/skills/_artifacts/domain_map.yaml
  • packages/start-client-core/skills/_artifacts/skill_spec.md
  • packages/start-client-core/skills/start-core/server-functions/SKILL.md
  • packages/start-server-core/skills/_artifacts/skill_spec.md
  • packages/start-server-core/skills/start-server-core/SKILL.md
  • packages/virtual-file-routes/skills/_artifacts/skill_spec.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/router-core/skills/router-core/auth-and-guards/SKILL.md
  • packages/start-client-core/skills/start-core/server-functions/SKILL.md
  • packages/react-start/skills/_artifacts/skill_spec.md
  • packages/router-plugin/skills/_artifacts/skill_spec.md
  • packages/start-client-core/skills/_artifacts/skill_spec.md

Comment on lines +172 to +178
function getDummyPasswordHash() {
// Precompute this with the same algorithm and cost as real password hashes.
const hash = process.env.DUMMY_PASSWORD_HASH
if (!hash) {
throw new Error('DUMMY_PASSWORD_HASH is required')
}
return hash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- file list ---\n'
git ls-files 'packages/start-server-core/skills/start-server-core/SKILL.md' || true

printf '\n--- search ---\n'
rg -n "DUMMY_PASSWORD_HASH|getDummyPasswordHash|Invalid credentials|updateSession|session" packages/start-server-core -S

printf '\n--- relevant excerpt ---\n'
sed -n '150,220p' packages/start-server-core/skills/start-server-core/SKILL.md

Repository: TanStack/router

Length of output: 244


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- file list ---'
git ls-files 'packages/start-server-core/skills/start-server-core/SKILL.md' || true

echo
echo '--- search ---'
rg -n "DUMMY_PASSWORD_HASH|getDummyPasswordHash|Invalid credentials|updateSession|session" packages/start-server-core -S || true

echo
echo '--- relevant excerpt ---'
sed -n '150,220p' packages/start-server-core/skills/start-server-core/SKILL.md

Repository: TanStack/router

Length of output: 9867


Fail closed without a distinct unknown-user error

If DUMMY_PASSWORD_HASH is unset, the unknown-user path throws DUMMY_PASSWORD_HASH is required before the generic Invalid credentials response. Validate this at startup, or map the failure to the same authentication error.

🧰 Tools
🪛 SkillSpector (2.3.11)

[error] 24: [YR1] YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]: YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Remediation: Remove the malware payload or compromised file entirely. Investigate how it entered the skill and audit all other artifacts for additional indicators of compromise.

(YARA Match (YR1))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/start-server-core/skills/start-server-core/SKILL.md` around lines
172 - 178, Update getDummyPasswordHash and its startup/authentication flow so an
unset DUMMY_PASSWORD_HASH is validated during startup, or its failure is mapped
to the same generic Invalid credentials response used for unknown users. Ensure
the unknown-user path never exposes the distinct DUMMY_PASSWORD_HASH is required
error.

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We fix the EADDRINUSE error by adding a module-level _allocatedPorts set in derivePort.ts that tracks every port assigned within the current process. When rm -rf port*.txt clears all cached port files before each test run, both getTestServerPort and getDummyServerPort called getRandomPort() in rapid succession and consistently received the same port (43099), because getRandomPort temporarily binds then immediately releases a port — leaving it free for the very next call. The do/while loop now retries until a port not already in the set is returned, guaranteeing unique ports across all derivePort invocations in the same process.

Tip

We verified this fix by re-running tanstack-react-start-e2e-basic-react-query:test:e2e.

Suggested Fix changes
diff --git a/e2e/e2e-utils/src/derivePort.ts b/e2e/e2e-utils/src/derivePort.ts
index 3ecb86cb..2220203f 100644
--- a/e2e/e2e-utils/src/derivePort.ts
+++ b/e2e/e2e-utils/src/derivePort.ts
@@ -1,6 +1,8 @@
 import fs from 'node:fs'
 import { getRandomPort } from 'get-port-please'
 
+const _allocatedPorts = new Set<number>()
+
 /**
  * Check if a port has been allocated, if it hasn't generate a random port and save it.
  * @param {string} input - port test allocation
@@ -10,10 +12,16 @@ export async function derivePort(input: string): Promise<number> {
   const portFile = `port-${input}.txt`
 
   if (!fs.existsSync(portFile)) {
-    fs.writeFileSync(portFile, (await getRandomPort()).toString())
+    let port: number
+    do {
+      port = await getRandomPort()
+    } while (_allocatedPorts.has(port))
+    _allocatedPorts.add(port)
+    fs.writeFileSync(portFile, port.toString())
   }
 
   const portNumber = parseInt(await fs.promises.readFile(portFile, 'utf-8'))
+  _allocatedPorts.add(portNumber)
   console.info(`Mapped "${input}" to port ${portNumber}`)
   return portNumber
 }

Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally sPYQ-BwLa

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
packages/start-server-core/skills/start-server-core/SKILL.md (1)

173-179: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not expose the dummy-hash configuration error to unknown users.

When DUMMY_PASSWORD_HASH is unset, the unknown-user path throws DUMMY_PASSWORD_HASH is required before returning the generic authentication failure. Validate this configuration before serving requests, or map the failure to the same generic Invalid credentials response; this is the same unresolved issue from the previous review.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/start-server-core/skills/start-server-core/SKILL.md` around lines
173 - 179, Update getDummyPasswordHash so a missing DUMMY_PASSWORD_HASH cannot
surface its configuration error to unknown users: validate the variable during
server startup before requests are served, or catch and map the failure to the
existing generic “Invalid credentials” response. Preserve identical
authentication behavior for unknown and invalid users.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@packages/start-server-core/skills/start-server-core/SKILL.md`:
- Around line 173-179: Update getDummyPasswordHash so a missing
DUMMY_PASSWORD_HASH cannot surface its configuration error to unknown users:
validate the variable during server startup before requests are served, or catch
and map the failure to the existing generic “Invalid credentials” response.
Preserve identical authentication behavior for unknown and invalid users.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 30f787ea-8951-487a-a5d3-93e973ef1420

📥 Commits

Reviewing files that changed from the base of the PR and between 21c0e8b and 111f193.

📒 Files selected for processing (30)
  • packages/react-router/skills/compositions/router-query/SKILL.md
  • packages/react-router/skills/lifecycle/migrate-from-react-router/SKILL.md
  • packages/react-router/skills/react-router/SKILL.md
  • packages/react-start/skills/lifecycle/migrate-from-nextjs/SKILL.md
  • packages/react-start/skills/react-start/SKILL.md
  • packages/react-start/skills/react-start/server-components/SKILL.md
  • packages/router-core/skills/router-core/SKILL.md
  • packages/router-core/skills/router-core/auth-and-guards/SKILL.md
  • packages/router-core/skills/router-core/code-splitting/SKILL.md
  • packages/router-core/skills/router-core/data-loading/SKILL.md
  • packages/router-core/skills/router-core/navigation/SKILL.md
  • packages/router-core/skills/router-core/not-found-and-errors/SKILL.md
  • packages/router-core/skills/router-core/path-params/SKILL.md
  • packages/router-core/skills/router-core/search-params/SKILL.md
  • packages/router-core/skills/router-core/ssr/SKILL.md
  • packages/router-core/skills/router-core/type-safety/SKILL.md
  • packages/router-plugin/skills/router-plugin/SKILL.md
  • packages/solid-router/skills/solid-router/SKILL.md
  • packages/solid-start/skills/solid-start/SKILL.md
  • packages/start-client-core/skills/start-core/SKILL.md
  • packages/start-client-core/skills/start-core/auth-server-primitives/SKILL.md
  • packages/start-client-core/skills/start-core/deployment/SKILL.md
  • packages/start-client-core/skills/start-core/execution-model/SKILL.md
  • packages/start-client-core/skills/start-core/middleware/SKILL.md
  • packages/start-client-core/skills/start-core/server-functions/SKILL.md
  • packages/start-client-core/skills/start-core/server-routes/SKILL.md
  • packages/start-server-core/skills/start-server-core/SKILL.md
  • packages/virtual-file-routes/skills/virtual-file-routes/SKILL.md
  • packages/vue-router/skills/vue-router/SKILL.md
  • packages/vue-start/skills/vue-start/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (11)
  • packages/router-core/skills/router-core/ssr/SKILL.md
  • packages/react-start/skills/react-start/server-components/SKILL.md
  • packages/router-core/skills/router-core/not-found-and-errors/SKILL.md
  • packages/router-core/skills/router-core/code-splitting/SKILL.md
  • packages/start-client-core/skills/start-core/auth-server-primitives/SKILL.md
  • packages/start-client-core/skills/start-core/server-functions/SKILL.md
  • packages/router-core/skills/router-core/navigation/SKILL.md
  • packages/virtual-file-routes/skills/virtual-file-routes/SKILL.md
  • packages/router-core/skills/router-core/data-loading/SKILL.md
  • packages/start-client-core/skills/start-core/server-routes/SKILL.md
  • packages/router-core/skills/router-core/auth-and-guards/SKILL.md

@tannerlinsley
tannerlinsley merged commit 179d9b9 into main Jul 26, 2026
27 of 28 checks passed
@tannerlinsley
tannerlinsley deleted the taren/improve-router-start-agent-skills branch July 26, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant