AGENT SKILL

search-params

URL search param and hash state management. Use when adding or modifying URL search params, `useSearchParams`, `setSearchParams`, `useSearchParamState`, or hash-based navigation, especially when back-button behavior matters.

License 许可
MIT
最近更新
2026-04-14
Stars
★ 2
Forks
0

01 前言 Front Matter

name
search-params
license
MIT
description
URL search param and hash state management. Use when adding or modifying URL search params, `useSearchParams`, `setSearchParams`, `useSearchParamState`, or hash-based navigation, especially when back-button behavior matters.

03 SKILL.md 正文

Search Params

Use this skill for:

  • /Users/wendyly/.local/share/agent-skills/external/promptfoo
  • other React apps with URL-driven state

Decision Rule

Choose history behavior based on whether the change is in-page state or a user-navigable step:

  • In-page state:
    • filters
    • sort
    • pagination
    • tabs
    • search queries
    • Use replace
  • Navigable step:
    • wizard progression
    • multi-step forms
    • Use push

If unclear, ask rather than guessing.

Preferred Patterns

Single param

Use a validated helper like useSearchParamState when available.

Multiple params

Use setSearchParams(..., { replace: true }) for in-page state changes.

Hash navigation

  • Use push for actual step progression.
  • Use replace for non-navigational in-page state.

URL normalization after save

When updating the URL after a create/save side effect, use replace.

Anti-Patterns

  • Pushing every filter or tab change into browser history
  • Managing a single param manually without validation when a helper hook exists
  • Using empty strings instead of null when clearing params in typed helpers

Review Focus

  • back/forward button behavior
  • param validation
  • consistent replace vs push semantics
  • avoiding history clutter for in-page state

04 同仓库更多 Skills

gerald-ica
gerald-ica/opencode-config-snapshot

web-design-guidelines

Web platform design and accessibility guidelines. Use when building web interfaces, auditing accessibility, implementing responsive layouts, or reviewing web UI code. Triggers on tasks involving HTML, CSS, web components, WCAG compliance, responsive design, or web performance.

★ 2
gerald-ica
gerald-ica/opencode-config-snapshot

watchos-design-guidelines

Apple Human Interface Guidelines for Apple Watch. Use when building watchOS apps, complications, or workout features. Triggers on tasks involving Watch UI, Digital Crown, glanceable interfaces, or wrist-based interactions.

★ 2
gerald-ica
gerald-ica/opencode-config-snapshot

visionos-design-guidelines

Apple Human Interface Guidelines for Apple Vision Pro. Use when building spatial computing apps, implementing eye/hand input, or designing immersive experiences. Triggers on tasks involving visionOS, RealityKit, spatial UI, or mixed reality.

★ 2
gerald-ica
gerald-ica/opencode-config-snapshot

tvos-design-guidelines

Apple Human Interface Guidelines for Apple TV. Use when building tvOS apps with focus-based navigation, Siri Remote input, or living room viewing experiences. Triggers on tasks involving Apple TV, tvOS, 10-foot UI, or media playback.

★ 2
gerald-ica
gerald-ica/opencode-config-snapshot

timesfm-forecasting

Zero-shot time series forecasting with Google's TimesFM foundation model. Use this skill when forecasting ANY univariate time series — sales, sensor readings, stock prices, energy demand, patient vitals, weather, or scientific measurements — without training a custom model. Supports both basic forecasting and advanced covariate forecasting (XReg) with dynamic and static exogenous variables. Automatically checks system RAM/GPU before loading the model, validates dataset fit before processing, supports CSV/DataFrame/array inputs, and returns point forecasts with calibrated prediction intervals. Includes a preflight system checker script that MUST be run before first use to verify the machine can load the model and handle your specific dataset.

★ 2
gerald-ica
gerald-ica/opencode-config-snapshot

sqlmap-defensive-audit

Use when working with sqlmap for defensive SQL injection research, local lab validation, code reading, or safe remediation guidance around SQLi testing workflows.

★ 2