check-cross-layer

GitHub

实施后跨维度验证技能,检查跨层数据流、代码复用、导入路径及一致性。识别遗漏更新点、类型不匹配和重复常量。适用于变更跨越3+架构层、修改共享配置或批量文件后。

.agents/skills/check-cross-layer/SKILL.md zhukunpenglinyutong/desktop-cc-gui

Trigger Scenarios

变更涉及3个以上架构层 修改共享常量或配置文件 进行批量文件修改 创建新的工具函数

Install

npx skills add zhukunpenglinyutong/desktop-cc-gui --skill check-cross-layer -g -y
More Options

Non-standard path

npx skills add https://github.com/zhukunpenglinyutong/desktop-cc-gui/tree/main/.agents/skills/check-cross-layer -g -y

Use without installing

npx skills use zhukunpenglinyutong/desktop-cc-gui@check-cross-layer

指定 Agent (Claude Code)

npx skills add zhukunpenglinyutong/desktop-cc-gui --skill check-cross-layer -a claude-code -g -y

安装 repo 全部 skill

npx skills add zhukunpenglinyutong/desktop-cc-gui --all -g -y

预览 repo 内 skill

npx skills add zhukunpenglinyutong/desktop-cc-gui --list

SKILL.md

Frontmatter
{
    "name": "check-cross-layer",
    "description": "Post-implementation verification across multiple code dimensions: cross-layer data flow, code reuse analysis, import path validation, and same-layer consistency checks. Identifies missed update sites, type mismatches, and duplicated constants. Use when changes span 3+ architectural layers, after modifying shared constants or configs, after batch file modifications, or when creating new utility functions."
}

Cross-Layer Check

Check if your changes considered all dimensions. Most bugs come from "didn't think of it", not lack of technical skill.

Note: This is a post-implementation safety net. Before writing code, read the Cross-Layer Thinking Guide.


Related Documents

Document Purpose Timing
Cross-Layer Thinking Guide End-to-end contract questions Before writing code
Code Reuse Thinking Guide Pattern recognition During implementation
$check-cross-layer (this skill) Verification check After implementation

Execution Steps

1. Identify Change Scope

git status
git diff --name-only

2. Select Applicable Check Dimensions

Based on your change type, execute relevant checks below:


Dimension A: Cross-Layer Data Flow (Required when 3+ layers)

Trigger: Changes involve 3 or more layers

Layer Common Locations
API/Routes routes/, api/, handlers/, controllers/
Service/Business Logic services/, lib/, core/, domain/
Database/Storage db/, models/, repositories/, schema/
UI/Presentation components/, views/, templates/, pages/
Utility utils/, helpers/, common/

Checklist:

  • Read flow: Database -> Service -> API -> UI
  • Write flow: UI -> API -> Service -> Database
  • Types/schemas correctly passed between layers?
  • Errors properly propagated to caller?
  • Loading/pending states handled at each layer?

Detailed Guide: Cross-Layer Thinking Guide


Dimension B: Code Reuse (Required when modifying constants/config)

Trigger:

  • Modifying UI constants (label, icon, color)
  • Modifying any hardcoded value
  • Seeing similar code in multiple places
  • Creating a new utility/helper function
  • Just finished batch modifications across files

Checklist:

  • Search first: How many places define this value?
    # Search in source files (adjust extensions for your project)
    rg "value-to-change" src/
    
  • If 2+ places define same value -> Should extract to shared constant
  • After modification, all usage sites updated?
  • If creating utility: Does similar utility already exist?

Detailed Guide: Code Reuse Thinking Guide


Dimension B2: New Utility Functions

Trigger: About to create a new utility/helper function

Checklist:

  • Search for existing similar utilities first
    rg "functionNamePattern" src/
    
  • If similar exists, can you extend it instead?
  • If creating new, is it in the right location (shared vs domain-specific)?

Dimension B3: After Batch Modifications

Trigger: Just modified similar patterns in multiple files

Checklist:

  • Did you check ALL files with similar patterns?
    rg "patternYouChanged" src/
    
  • Any files missed that should also be updated?
  • Should this pattern be abstracted to prevent future duplication?

Dimension C: Import/Dependency Paths (Required when creating new files)

Trigger: Creating new source files

Checklist:

  • Using correct import paths (relative vs absolute)?
  • No circular dependencies?
  • Consistent with project's module organization?

Dimension D: Same-Layer Consistency

Trigger:

  • Modifying display logic or formatting
  • Same domain concept used in multiple places

Checklist:

  • Search for other places using same concept
    rg "ConceptName" src/
    
  • Are these usages consistent?
  • Should they share configuration/constants?

Common Issues Quick Reference

Issue Root Cause Prevention
Changed one place, missed others Didn't search impact scope grep before changing
Data lost at some layer Didn't check data flow Trace data source to destination
Type/schema mismatch Cross-layer types inconsistent Use shared type definitions
UI/output inconsistent Same concept in multiple places Extract shared constants
Similar utility exists Didn't search first Search before creating
Batch fix incomplete Didn't verify all occurrences grep after fixing

Output

Report:

  1. Which dimensions your changes involve
  2. Check results for each dimension
  3. Issues found and fix suggestions

Version History

  • cb4962a Current 2026-07-24 22:04

Same Skill Collection

.agents/skills/before-dev/SKILL.md
.agents/skills/brainstorm/SKILL.md
.agents/skills/break-loop/SKILL.md
.agents/skills/check/SKILL.md
.agents/skills/create-command/SKILL.md
.agents/skills/deploy-to-vercel/SKILL.md
.agents/skills/finish-work/SKILL.md
.agents/skills/improve-ut/SKILL.md
.agents/skills/integrate-skill/SKILL.md
.agents/skills/onboard/SKILL.md
.agents/skills/record-session/SKILL.md
.agents/skills/start/SKILL.md
.agents/skills/update-spec/SKILL.md
.agents/skills/vercel-cli-with-tokens/SKILL.md
.agents/skills/vercel-composition-patterns/SKILL.md
.agents/skills/vercel-react-best-practices/SKILL.md
.agents/skills/vercel-react-native-skills/SKILL.md
.agents/skills/web-design-guidelines/SKILL.md
.agents/skills/writing-guidelines/SKILL.md
.codex/skills/parallel/SKILL.md
.agents/skills/coss/SKILL.md
.agents/skills/huashu-design/SKILL.md
.agents/skills/vercel-optimize/SKILL.md
.agents/skills/vercel-react-view-transitions/SKILL.md

Metadata

Files
0
Version
cb4962a
Hash
10dbfaad
Indexed
2026-07-24 22:04

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 01:03
浙ICP备14020137号-1 $mapa de visitantes$