AGENT SKILL
flutter-go-router-redirect-guard
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-05-26
- Stars
- ★ 0
- Forks
- 0
03 SKILL.md 正文
flutter-go-router-redirect-guard
Purpose
Create the redirect or guard logic for a go_router app.
Use when
- Routes need auth or onboarding redirects
- A router map already exists
- Another skill will handle page and route declaration
Do NOT use when
- You need the route tree itself
- The app does not require redirects
- The feature does not have navigation guards
Inputs required
- Guard condition
- Redirect targets
- State source for the condition
Constraints
- Keep the redirect deterministic
- Do not declare route paths here
- Avoid hidden side effects in the guard
Step-by-step workflow
- Identify the guard condition.
- Define the allowed and blocked paths.
- Implement the redirect function or guard helper.
- Document the dependency on state.
- Return the guard file and behavior summary.
Output contract
- Redirect helper or router redirect block
- Path behavior summary
- Test note for the redirect rule
Validation checklist
- Blocked paths redirect correctly
- Allowed paths remain accessible
- Guard does not create loops
- The condition source is documented
Related skills
flutter-go-router-route-mapflutter-firebase-auth-stateflutter-go-router-deeplink-wireup
References
Real example
When auth is missing, /profile/123 redirects to /sign-in.
Real file output sample
lib/app/router/route_guards.dart
lib/app/router/app_router.dart
04 同仓库更多 Skills
toolkit-i18n-operator
Use the toolkit-i18n CLI for repeated Flutter localization workflows with compact outputs, CSV validation, key coverage reporting, generated JSON exports, and safe non-mutating behavior.
★ 0
toolkit-design-operator
Use the toolkit-design CLI for repeated repository workflows.
★ 0
toolkit-ci-operator
Use the toolkit-ci CLI for repeated repository workflows.
★ 0
toolkit-arch-operator
Use the toolkit-arch CLI for repeated repository workflows, including Flutter i18n usage scans, layer checks, and localization coverage.
★ 0
web-testing
暂无简介
★ 0
web-state
暂无简介
★ 0