360 Secure SkillHub
360 安全技能中心

Frontend Backend Flow Test

审计优先的前后端契约检查 Skill:用 Python 脚本提取前端请求调用与后端端点、DTO 契约,比对方法、路径、查询、请求体与鉴权提示,输出 Markdown 与 JSON 不匹配报告;支持 Spring 风格 Java/Kotlin、Node/Express、PHP/Laravel,实时验证仅为有限补充。

分类:开发
dlawnsdk
dlawnsdk
热度 31.41
最近更新 2026-05-11 17:37:12

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add dlawnsdk/frontend-backend-flow-test
兼容性
通用兼容
联网要求
不联网
数据出网
可选出网
Metadata
name
frontend-backend-flow-test
description
Audit-first frontend-backend contract analyzer for static API compatibility checks. Compare frontend request behavior with backend endpoint contracts, DTO hints, query/body/auth expectations, and produce actionable mismatch reports. Supports Spring-style Java/Kotlin backends, baseline Node/Express route extraction, and baseline PHP/Laravel route extraction. Use when validating whether web/mobile/admin clients still match backend APIs after refactors, release prep, or regression review. Live API verification is secondary and limited; do not use this skill as a production-safe write tester or full E2E framework.

Frontend-Backend Flow Test

Use this skill as an audit-first contract checker.

Primary purpose:

  • extract frontend API calls
  • extract backend endpoint contracts
  • compare method/path/query/body/auth hints
  • generate actionable audit reports

Secondary purpose:

  • generate limited experimental live-check helpers only when static audit is insufficient and the environment is explicitly safe

Default workflow

  1. Run static audit first with scripts/audit_contracts.py
  2. Read the generated Markdown and JSON reports
  3. Fix high-severity contract mismatches before considering live checks
  4. Use live verification only for narrow follow-up validation in dev/staging

Core command

python3 scripts/audit_contracts.py \
  --frontend /path/to/frontend \
  --backend /path/to/backend \
  --output-dir ./out/audit \
  --exclude .dart_tool,coverage \
  --format both \
  --fail-on high

What this skill is good at

  • finding missing backend endpoints referenced by frontend code
  • detecting HTTP method drift
  • detecting path drift and base-path mismatches
  • comparing query/body/auth hints between frontend and backend
  • summarizing likely breakpoints before release or QA
  • auditing multiple surfaces against the same backend

What this skill is not

  • not a real API regression framework
  • not a replacement for workspace QA tests
  • not a full E2E test framework
  • not a production-safe write tester
  • not guaranteed rollback tooling
  • not comprehensive support for arbitrary frameworks/languages
  • not a replacement for manual QA or runtime observability

Current extraction coverage

Frontend

  • Axios-style calls
  • fetch(...)
  • some Dart/Dio direct calls and wrapper patterns
  • basic alias/baseURL/header inference

Backend

  • Spring controller mappings
  • Java/Kotlin DTO field hints
  • selected Spring Security route hints
  • Express app/router mappings
  • same-file Express router mount prefix inference
  • Laravel route file mappings
  • Laravel resource/apiResource expansion
  • basic request body / query / multipart inference

Reporting expectations

Expect findings such as:

  • missing-backend-endpoint
  • method-mismatch
  • path-mismatch
  • query-hint-mismatch
  • body-hint-mismatch
  • response-hint-mismatch
  • auth-hint-mismatch
  • backend-only-endpoint

Treat the report as a prioritized contract-audit output, not as runtime proof that a user flow succeeds.

References

Read these only when needed: