AgentSkillsCN

jeff-module-patterns

Jeff为筛选面板、表格单元格、状态显示以及员工关联行所总结的跨模块实现模式。适用于员工管理、假期申请、仪表盘、考勤统计等各类列表页面的模块级路由开发。

SKILL.md
--- frontmatter
name: jeff-module-patterns
description: Jeff's cross-module implementation patterns for filter panels, table cells, status display, and employee-linked rows. Use for module-level route work across employees, leaves, dashboard, attendance, and similar list pages.

Jeff's Module Patterns

Cross-module conventions that repeat across Jeff's route modules.

Apply when

  • Building/refactoring module routes with list or summary tables.
  • Implementing reusable filter panels and filter value types.
  • Rendering status chips, employee-linked rows, or repeated cell formatting patterns.

Filter panel conventions

  • Use colocated -{route}-filters.tsx files.
  • Export panel component and {Route}FilterValues type together.
  • Use shared reference data hooks for common options.
  • Keep large option groups searchable.
  • Keep filter-change handlers predictable and reset pagination when needed.

Table/cell conventions

  • Prefer stable helpers for repeated cell rendering patterns.
  • Use tabular numeric/monospace classes for aligned numbers and times.
  • Keep placeholders explicit for missing values (-).
  • Prefer shared constants/helpers over duplicating inline logic.

Status and badge conventions

  • Use module-consistent status color mappings.
  • Keep semantic meaning of colors stable inside each module.
  • Prefer centralized mappings/constants over ad-hoc class strings.

Employee-linked row conventions

  • Avatar with fallback.
  • Primary link to module-relevant detail page.
  • Optional contextual edit/action affordance where useful.
  • Show system status cues (inactive/deleted) clearly but subtly.

Module notes

  • Attendance can add specialized patterns (for example multi-shift arrays and calendar statuses) on top of these base conventions.
  • Leaves, Employees, Dashboard, and similar modules should follow the same filter/type/status consistency rules.

Validation checklist

  • Filter behavior and filter types are consistent in-module.
  • Status visuals are consistent across module surfaces.
  • Repeated row/cell patterns are implemented through shared helpers or constants.