prime-codebase

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Prime: Load Project Context

Prime:加载项目上下文

Objective

目标

Build comprehensive understanding of the codebase by analyzing structure, documentation, and key files. If external task references are provided, load them first so the codebase 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 (
    ACC-2
    ) or comma-separated (
    ACC-2,ACC-3
    ).
  • Confluence page ids are numeric page ids.
If Jira issue keys are provided:
  1. Call
    mcp__atlassian__getAccessibleAtlassianResources
    to obtain the
    cloudId
    .
  2. For each Jira key, call
    mcp__atlassian__getJiraIssue
    with that
    cloudId
    , the issue key, and
    responseContentFormat: "markdown"
    .
  3. Treat the returned issue summary, description, and acceptance criteria as the task context for everything that follows.
If Confluence page ids are provided:
  1. Call
    mcp__atlassian__getConfluencePage
    for each page id with
    contentFormat: "markdown"
    (use the
    cloudId
    from above, fetching it via
    mcp__atlassian__getAccessibleAtlassianResources
    if it was not already retrieved).
  2. 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问题密钥:
  1. 调用
    mcp__atlassian__getAccessibleAtlassianResources
    获取
    cloudId
  2. 针对每个Jira密钥,调用
    mcp__atlassian__getJiraIssue
    ,传入
    cloudId
    、问题密钥以及
    responseContentFormat: "markdown"
  3. 将返回的问题摘要、描述和验收标准作为后续所有操作的任务上下文。
如果提供了Confluence页面ID:
  1. 针对每个页面ID调用
    mcp__atlassian__getConfluencePage
    ,并设置
    contentFormat: "markdown"
    (如果尚未获取
    cloudId
    ,可通过
    mcp__atlassian__getAccessibleAtlassianResources
    获取)。
  2. 将返回的页面内容作为支持上下文(如规格说明、设计文档、需求)。
如果未提供任何参数: 直接跳过此步骤,进入步骤1。
在继续之前,简要总结已加载的外部上下文——这将为后续的准备工作奠定框架。

1. Analyze Project Structure

1. 分析项目结构

List all tracked files: !
git ls-files
Show directory structure: On Linux, run:
tree -L 3 -I 'node_modules|__pycache__|.git|dist|build'
列出所有被追踪的文件: !
git ls-files
展示目录结构: 在Linux系统上运行:
tree -L 3 -I 'node_modules|__pycache__|.git|dist|build'

2. Read Core Documentation

2. 阅读核心文档

  • Read CLAUDE.md or similar global rules file
  • Read README files at project root and major directories
  • Read any architecture documentation
  • 阅读CLAUDE.md或类似的全局规则文件
  • 阅读项目根目录及主要目录下的README文件
  • 阅读任何架构文档

3. Identify Key Files

3. 识别关键文件

Based on the structure, identify and read:
  • Main entry points (main.py, index.ts, app.py, etc.)
  • Core configuration files (pyproject.toml, package.json, tsconfig.json)
  • Key model/schema definitions
  • Important service or controller files
根据结构,识别并阅读:
  • 主入口文件(main.py、index.ts、app.py等)
  • 核心配置文件(pyproject.toml、package.json、tsconfig.json)
  • 关键模型/模式定义文件
  • 重要的服务或控制器文件

4. Understand Current State

4. 了解当前状态

Check recent activity: !
git log -10 --oneline
Check current branch and status: !
git status
查看近期活动: !
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页面:标题及其内容说明

Project Overview

项目概述

  • Purpose and type of application
  • Primary technologies and frameworks
  • Current version/state
  • 应用的用途和类型
  • 主要技术和框架
  • 当前版本/状态

Architecture

架构

  • Overall structure and organization
  • Key architectural patterns identified
  • Important directories and their purposes
  • 整体结构和组织方式
  • 识别出的关键架构模式
  • 重要目录及其用途

Tech Stack

技术栈

  • Languages and versions
  • Frameworks and major libraries
  • Build tools and package managers
  • Testing frameworks
  • 语言及版本
  • 框架和主要库
  • 构建工具和包管理器
  • 测试框架

Core Principles

核心原则

  • Code style and conventions observed
  • Documentation standards
  • Testing approach
  • 观察到的代码风格和约定
  • 文档标准
  • 测试方法

Current State

当前状态

  • Active branch
  • Recent changes or development focus
  • Any immediate observations or concerns
Make this summary easy to scan - use bullet points and clear headers.
  • 活跃分支
  • 近期变更或开发重点
  • 任何即时观察到的问题或关注点
让这份总结易于浏览——使用项目符号和清晰的标题。