Summary
为Flutter页面添加路由上下文记录功能,支持日期等参数的AI上下文识别。当需要让AI助手通过"询问当前上下文"功能获取页面状态(如日期、ID等参数)时使用。适用场景:(1) 日期驱动的页面(日记、活动、日历等),(2) ID驱动的页面(用户详??
smithery.ai
为Flutter页面添加路由上下文记录功能,支持日期等参数的AI上下文识别。当需要让AI助手通过"询问当前上下文"功能获取页面状态(如日期、ID等参数)时使用。适用场景:(1) 日期驱动的页面(日记、活动、日历等),(2) ID驱动的页面(用户详?
为Flutter页面添加路由上下文记录功能,支持日期等参数的AI上下文识别。当需要让AI助手通过"询问当前上下文"功能获取页面状态(如日期、ID等参数)时使用。适用场景:(1) 日期驱动的页面(日记、活动、日历等),(2) ID驱动的页面(用户详??
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Generate a map of all files relevant to a task before making changes
9.7K installsAsk Copilot what files it needs to see before answering a question
9K installsUse the ctx7 CLI to fetch library documentation, manage AI coding skills, and configure Context…
6.2K installsThis skill should be used when the user asks about libraries, frameworks, API references, or ne…
4.8K installsGenerate or improve a company-specific data analysis skill by extracting tribal knowledge from …
2.8K installsLong-context MoE training guidance for Megatron Bridge. Covers CP sizing, selective recompute, …
1.8K installsOther skills from smithery.ai · top by installs.
npx skills add https://smithery.ai
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
Files included with this skill beyond the listing page.
SKILL.md
3,767 B
SUMMARY.md
422 B
为Flutter页面添加路由上下文记录,使AI助手能理解用户当前查看的页面参数。
Read the target file and identify:
selectedDate, userId)_onDateChanged)initState, _initializeService)import 'package:Memento/core/route/route_history_manager.dart';
For DateTime parameter:
/// 更新路由上下文,使"询问当前上下文"功能能获取到当前日期
void _updateRouteContext(DateTime date) {
final dateStr = '${date.year}-${date.month.toString().padLeft(2, '0')}-${date.day.toString().padLeft(2, '0')}';
RouteHistoryManager.updateCurrentContext(
pageId: "/route_name",
title: '页面标题 - $dateStr',
params: {'date': dateStr},
);
}
For custom parameter:
/// 更新路由上下文
void _updateRouteContext(String paramValue) {
RouteHistoryManager.updateCurrentContext(
pageId: "/route_name",
title: '页面标题 - $paramValue',
params: {'paramName': paramValue},
);
}
Add call at end of initialization method:
Future<void> _initializeService() async {
// ... existing code ...
// 初始化时设置路由上下文
_updateRouteContext(_initialParam);
}
Add call in parameter change handler:
void _onParamChanged(ParamType newParam) {
if (newParam == _currentParam) return;
setState(() {
_currentParam = newParam;
});
// ... existing code ...
// 更新路由上下文
_updateRouteContext(newParam);
}
Add route template to lib/core/action/builtin/askcontextaction/routeparser.dart:
static const Map<String, String> _routeTemplates = {
// ... existing routes ...
// 插件名称
'/route_name': '用户正在查看 {paramName} 的XXX',
};
DateTime parameter example:
'/activity_timeline': '用户正在查看 {date} 的活动时间轴',
Custom parameter example:
'/user_profile': '用户正在查看 {userId} 的用户资料',
Look for variables matching:
selectedDate, currentDate, _focusedDay, dateDateTimeLook for methods matching:
onDateChanged, onDayChanged, _selectDateDateTimeLook for variables matching the --param argument name.
After execution:
在页面加载时:
用户正在查看 2025-12-22 的活动时间轴在参数变化时:
用户正在查看 2025-12-21 的活动时间轴YYYY-MM-DD for consistencyRegExp(r'\{(\w+)\}') for placeholder replacementflutter analyze after changes