prime-frontend
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrime Frontend: Load Frontend Context
Prime Frontend:加载前端上下文
Objective
目标
Build targeted understanding of the frontend codebase by analyzing its structure, components, and conventions. Loading only frontend context keeps the context window light on complex full-stack codebases. If external task references are provided, load them first so the analysis is anchored to the actual work.
通过分析前端代码库的结构、组件和约定,建立针对性的理解。仅加载前端上下文可在复杂的全栈代码库中保持上下文窗口轻量化。如果提供了外部任务参考,请先加载它们,以便分析锚定到实际工作。
Process
流程
Step 0: Load External Context
步骤0:加载外部上下文
Run this step BEFORE the codebase analysis. It accepts optional arguments: .
[jira-issue-keys] [confluence-page-ids]- Jira keys may be a single key () or comma-separated (
ACC-2).ACC-2,ACC-3 - Confluence page ids are numeric page ids.
If Jira issue keys are provided:
- Call to obtain the
mcp__atlassian__getAccessibleAtlassianResources.cloudId - For each Jira key, call with that
mcp__atlassian__getJiraIssue, the issue key, andcloudId.responseContentFormat: "markdown" - Treat the returned issue summary, description, and acceptance criteria as the task context for everything that follows.
If Confluence page ids are provided:
- Call for each page id with
mcp__atlassian__getConfluencePage(use thecontentFormat: "markdown"from above, fetching it viacloudIdif it was not already retrieved).mcp__atlassian__getAccessibleAtlassianResources - Treat the returned page content as supporting context (specs, design docs, requirements).
If no arguments are provided: Skip this step entirely and proceed to Step 1.
Briefly summarize any external context loaded before continuing — this frames the rest of the priming.
在代码库分析之前运行此步骤。 它接受可选参数:。
[jira-issue-keys] [confluence-page-ids]- Jira密钥可以是单个密钥()或逗号分隔的多个密钥(
ACC-2)。ACC-2,ACC-3 - Confluence页面ID为数字页面ID。
如果提供了Jira问题密钥:
- 调用获取
mcp__atlassian__getAccessibleAtlassianResources。cloudId - 对于每个Jira密钥,调用,传入
mcp__atlassian__getJiraIssue、问题密钥以及cloudId。responseContentFormat: "markdown" - 将返回的问题摘要、描述和验收标准作为后续所有操作的任务上下文。
如果提供了Confluence页面ID:
- 为每个页面ID调用,并设置
mcp__atlassian__getConfluencePage(如果尚未获取contentFormat: "markdown",则通过cloudId获取)。mcp__atlassian__getAccessibleAtlassianResources - 将返回的页面内容作为支持上下文(规范、设计文档、需求)。
如果未提供参数: 完全跳过此步骤,直接进入步骤1。
继续前简要总结已加载的任何外部上下文——这将为后续的准备工作奠定框架。
1. Locate the Frontend
1. 定位前端目录
List all tracked files to find the frontend root:
!
git ls-filesCommon frontend roots: , , , (when project is frontend-only), (Next.js). Identify the correct root before proceeding.
frontend/client/web/src/app/列出所有被追踪的文件以找到前端根目录:
!
git ls-files常见的前端根目录:、、、(当项目仅为前端时)、(Next.js项目)。继续之前先确定正确的根目录。
frontend/client/web/src/app/2. Read Frontend Documentation
2. 阅读前端文档
- Read CLAUDE.md or similar global rules file (for project-wide conventions)
- Read any README inside the frontend root
- Read if it exists — it contains project-specific component conventions
.claude/references/frontend-component-best-practices.md
- 阅读CLAUDE.md或类似的全局规则文件(了解项目范围内的约定)
- 阅读前端根目录内的任何README文件
- 如果存在,请阅读它——其中包含项目特定的组件约定
.claude/references/frontend-component-best-practices.md
3. Identify Key Frontend Files
3. 识别关键前端文件
Based on the structure, read:
- Main entry point (,
main.tsx,index.tsx,app/layout.tsx, etc.)pages/_app.tsx - Routing configuration (,
router.tsx,routes.tsdirectory for Next.js)app/ - Global state setup (store, context providers)
- Shared component library root (,
components/)ui/ - Core configuration (,
package.json,tsconfig.json,vite.config.ts)next.config.ts - One or two representative feature components to internalize the established patterns
Skip files outside the frontend root unless they define a shared type or contract the frontend depends on.
根据结构,阅读以下文件:
- 主入口文件(、
main.tsx、index.tsx、app/layout.tsx等)pages/_app.tsx - 路由配置文件(、
router.tsx,Next.js的routes.ts目录)app/ - 全局状态设置(store、上下文提供者)
- 共享组件库根目录(、
components/)ui/ - 核心配置文件(、
package.json、tsconfig.json、vite.config.ts)next.config.ts - 一到两个具有代表性的功能组件,以熟悉已确立的模式
除非外部文件定义了前端依赖的共享类型或契约,否则跳过前端根目录外的文件。
4. Understand Current Frontend State
4. 了解当前前端状态
Check recent frontend-relevant activity:
!
git log -10 --oneline!
git statusNote any open changes in the frontend directory.
查看近期与前端相关的活动:
!
git log -10 --oneline!
git status记录前端目录中的任何未提交更改。
Output Report
输出报告
Provide a concise summary covering:
提供一份简洁的总结,涵盖以下内容:
External Task Context (if loaded)
外部任务上下文(若已加载)
- Jira issue(s): key, title, one-line goal, acceptance criteria
- Confluence page(s): title and what they specify
- Jira问题:密钥、标题、一行描述的目标、验收标准
- Confluence页面:标题及其内容说明
Frontend Overview
前端概述
- Framework and major libraries (React, Vue, Next.js, Tailwind, etc.)
- Component patterns observed (atomic design, feature folders, etc.)
- State management approach
- 框架和主要库(React、Vue、Next.js、Tailwind等)
- 观察到的组件模式(原子设计、功能文件夹等)
- 状态管理方案
Directory Map
目录结构
- Frontend root and key sub-directories with one-line purpose each
- 前端根目录和关键子目录,每个目录附带一行用途说明
Conventions
约定规范
- Naming conventions, file co-location rules
- Styling approach
- Testing framework and conventions observed
- 命名约定、文件共存规则
- 样式方案
- 观察到的测试框架和约定
Current State
当前状态
- Active branch, recent frontend changes
- Any immediate concerns (missing types, deprecated patterns, etc.)
Make this summary easy to scan - use bullet points and clear headers.
- 当前分支、近期前端变更
- 任何即时问题(缺失类型、已弃用模式等)
请让这份总结易于浏览——使用项目符号和清晰的标题。