config-export

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

config-export

config-export

Exports CLAUDE.md and ai-context/ to tool-native instruction files for GitHub Copilot, Google Gemini, and Cursor.
Triggers:
/config-export
, export config, copilot instructions, gemini config, cursor rules

将CLAUDE.md和ai-context/导出为适用于GitHub Copilot、Google Gemini和Cursor的工具原生指令文件。
触发词:/config-export、export config、copilot instructions、gemini config、cursor rules

Purpose

用途

config-export
reads the project's Claude configuration (
CLAUDE.md
and any present
ai-context/
files) into an in-context bundle, lets the user select one or more target AI assistants, generates tool-specific instruction files via LLM transformation, shows a dry-run preview, and writes the confirmed files to their canonical locations. It never modifies source files and never writes without explicit user confirmation.

config-export
会将项目的Claude配置(
CLAUDE.md
及所有存在的
ai-context/
文件)读取为上下文包,允许用户选择一个或多个目标AI助手,通过LLM转换生成工具专属的指令文件,展示预演预览,并将确认后的文件写入其标准路径。它绝不会修改源文件,且未经用户明确确认绝不会写入文件。

Process

流程

Step 1 — Source collection

步骤1 — 源文件收集

Guard — no CLAUDE.md: If no
CLAUDE.md
exists in the current working directory, present the user with two paths:
No CLAUDE.md found in the current directory.

Choose an option:
  1. project-setup first  — run /project-setup to scaffold CLAUDE.md + ai-context/ in this project,
                            then re-run /config-export (recommended for new projects with SDD workflow)
  2. SDD bootstrap         — generate a minimal .github/copilot-instructions.md from the global SDD
                            template only (no project-specific stack or conventions)

Enter 1 or 2 (or press Enter to cancel):
  • If the user selects 1: emit
    Run /project-setup, then re-run /config-export
    and stop. No files are written.
  • If the user selects 2: proceed using the global SDD methodology as the sole source bundle (skip ai-context/ collection; note "No project CLAUDE.md — bootstrap mode" in transformation context).
  • If the user cancels: emit
    Export cancelled — no files written
    and stop.
Guard — no ai-context/: If no
ai-context/
directory is present, emit:
WARNING: ai-context/ not found — export quality will be lower; only CLAUDE.md will be used as source
Continue;
CLAUDE.md
alone is sufficient.
Read and bundle source files in priority order:
#FileRequired?Behavior when absent
1
CLAUDE.md
YesHalt (see guard above)
2
ai-context/stack.md
NoSkip; note "stack.md not available" in transformation context
3
ai-context/architecture.md
NoSkip; note "architecture.md not available" in transformation context
4
ai-context/conventions.md
NoSkip; note "conventions.md not available" in transformation context
5
ai-context/known-issues.md
NoSkip silently if absent
All present files are read into the in-context bundle before any transformation begins.

防护机制 - 无CLAUDE.md文件: 如果当前工作目录中不存在
CLAUDE.md
,则为用户提供两个选项:
当前目录未找到CLAUDE.md文件。

请选择一个选项:
  1. 先执行project-setup  — 运行/project-setup在当前项目中搭建CLAUDE.md + ai-context/,
                            然后重新运行/config-export(推荐给使用SDD工作流的新项目)
  2. SDD引导模式         — 仅从全局SDD模板生成最小化的.github/copilot-instructions.md
                            (不包含项目专属的技术栈或约定)

输入1或2(或按回车键取消):
  • 如果用户选择1:输出
    请运行/project-setup,然后重新运行/config-export
    并终止流程,不写入任何文件。
  • 如果用户选择2:使用全局SDD方法作为唯一源包继续执行(跳过ai-context/文件收集;在转换上下文中标注"无项目CLAUDE.md — 引导模式")。
  • 如果用户取消:输出
    导出已取消 — 未写入任何文件
    并终止流程。
防护机制 - 无ai-context/目录: 如果不存在
ai-context/
目录,输出:
警告:未找到ai-context/目录 — 导出质量会降低;仅将CLAUDE.md作为源文件使用
继续执行;仅
CLAUDE.md
也可满足需求。
按优先级读取并打包源文件:
序号文件路径是否必填文件不存在时的处理方式
1
CLAUDE.md
终止流程(见上述防护机制)
2
ai-context/stack.md
跳过;在转换上下文中标注"stack.md不可用"
3
ai-context/architecture.md
跳过;在转换上下文中标注"architecture.md不可用"
4
ai-context/conventions.md
跳过;在转换上下文中标注"conventions.md不可用"
5
ai-context/known-issues.md
若不存在则静默跳过
在开始任何转换之前,所有存在的文件都会被读取到上下文包中。

Step 2 — Target selection

步骤2 — 目标选择

If the user provided a target as a CLI argument (e.g.,
/config-export copilot
), skip the interactive menu and proceed directly to Step 3 with that target.
Otherwise, present the target menu:
Available export targets:

  1. copilot  →  .github/copilot-instructions.md
  2. gemini   →  GEMINI.md
  3. cursor   →  .cursor/rules/conventions.mdc
               →  .cursor/rules/stack.mdc
               →  .cursor/rules/architecture.mdc

Enter targets (comma-separated numbers or names, or "all"):
Claude target rejection: If the user requests target
claude
or
CLAUDE.md
, respond with:
The Claude target is not supported in V1 — use /project-update to refresh CLAUDE.md
Do not write any files; re-present the menu or halt based on user choice.

如果用户通过CLI参数指定了目标(例如
/config-export copilot
),则跳过交互式菜单,直接使用该目标进入步骤3。
否则,展示目标选择菜单:
可用导出目标:

  1. copilot  →  .github/copilot-instructions.md
  2. gemini   →  GEMINI.md
  3. cursor   →  .cursor/rules/conventions.mdc
               →  .cursor/rules/stack.mdc
               →  .cursor/rules/architecture.mdc

请输入目标(以逗号分隔的数字或名称,或输入"all"选择全部):
拒绝Claude目标: 如果用户请求
claude
CLAUDE.md
作为目标,回复:
V1版本不支持Claude目标 — 请使用/project-update来刷新CLAUDE.md
不写入任何文件;根据用户选择重新展示菜单或终止流程。

Step 3 — Dry-run generation and confirmation

步骤3 — 预演生成与确认

For each selected target, apply the corresponding transformation prompt (see sub-sections below). Then:
  1. Display the full generated content for each file and its destination path.
  2. If a target output file already exists at its canonical path, emit a warning before the confirmation prompt:
    WARNING: Overwriting existing file: <path>
  3. Prompt the user:
    Write these files? [y/N]
    Default is N.
  4. If the user responds with anything other than
    y
    , exit cleanly:
    Export cancelled — no files written
    No files are written.
  5. If the user responds
    y
    , proceed to Step 4.
These transformation prompts are self-instructions executed by the agent using its own in-context LLM reasoning. No external API call, subprocess, or tool invocation is required to apply them — the agent reads the prompt and generates the output directly.
对于每个选中的目标,应用对应的转换提示(见下方子章节)。然后:
  1. 展示每个文件的完整生成内容及其目标路径。
  2. 如果目标输出文件已存在于其标准路径中,在确认提示之前发出警告:
    警告:将覆盖现有文件:<路径>
  3. 提示用户:
    是否写入这些文件?[y/N]
    默认选项为N
  4. 如果用户回复不是
    y
    ,则干净退出:
    导出已取消 — 未写入任何文件
    不写入任何文件。
  5. 如果用户回复
    y
    ,进入步骤4。
这些转换提示是Agent使用自身上下文LLM推理执行的自指令。应用这些提示无需调用外部API、子进程或工具 — Agent直接读取提示并生成输出。

Shared STRIP Preamble

通用剥离规则(Shared STRIP Preamble)

The following items MUST be stripped from ALL target outputs. Each transformation prompt below references this block — apply it in addition to any target-specific delta listed in that prompt.
  • All slash commands used as executable triggers (any
    /<word>
    pattern that is a Claude Code meta-tool or SDD phase command)
  • Task tool references and sub-agent delegation patterns (
    "Task tool:"
    ,
    "subagent_type:"
    ,
    "Launch sub-agent"
    ,
    "Sub-agent launch pattern"
    )
  • install.sh and sync.sh references
  • Claude Code-specific identity statements ("I am an expert development assistant…")
  • The
    ## Skills Registry
    section of
    CLAUDE.md
    (lines beginning with
    ~/.claude/skills/
    or
    .claude/skills/
    )
  • Any section whose content is enclosed between
    <!-- [auto-updated]
    and
    <!-- [/auto-updated] -->
    comment markers in
    ai-context/
    files

以下内容必须从所有目标输出中剥离。下方每个转换提示都会引用此规则块 — 除了目标专属的增量规则外,还需应用此通用规则。
  • 所有用作可执行触发词的斜杠命令(任何属于Claude Code元工具或SDD阶段命令的
    /<单词>
    模式)
  • 任务工具引用和子Agent委托模式(
    "Task tool:"
    "subagent_type:"
    "Launch sub-agent"
    "Sub-agent launch pattern"
  • install.sh和sync.sh的引用
  • Claude Code专属的身份声明("我是专业开发助手…")
  • CLAUDE.md
    中的
    ## Skills Registry
    章节(以
    ~/.claude/skills/
    .claude/skills/
    开头的行)
  • ai-context/
    文件中位于
    <!-- [auto-updated]
    <!-- [/auto-updated] -->
    注释标记之间的任何章节内容

Copilot transformation prompt

Copilot转换提示

Apply the following prompt to the source bundle to generate
.github/copilot-instructions.md
:

You are transforming a Claude Code project configuration into a GitHub Copilot instruction file.
Source bundle: CLAUDE.md + any available ai-context/ files provided above.
STRIP:
Apply the Shared STRIP Preamble above, then additionally strip:
  • Plan Mode rules section (Claude Code-specific)
ADAPT — do NOT strip; rewrite for Copilot:
  1. SDD phase DAG and workflow → Convert to a
    ## SDD Development Workflow
    section written in declarative prose:
    • Describe each phase (explore, propose, spec, design, tasks, apply, verify, archive) and its artifacts
    • Include the artifact types (proposal, spec, design, tasks, verify-report, archive-report) and explain they are persisted to engram
    • Do NOT include any slash command syntax — describe the phases as steps the developer initiates
  2. SDD available commands table → Replace with a
    ## Active SDD Coaching Instructions
    section containing Copilot behavioral instructions:
    When a developer mentions implementing a new feature, change, or fix:
    - Proactively ask: "Would you like to follow the SDD workflow for this change?"
    - If yes, guide them step by step: propose → (spec + design in parallel) → tasks → apply → verify → archive
    - Before starting apply, confirm that proposal, design, and tasks artifacts exist in the project's engram
    - Remind the developer to run verify after implementation and archive once confirmed
    Adapt the phrasing to be Copilot-idiomatic (imperative instructions telling Copilot how to behave).
  3. Project memory layer (ai-context/) → Retain the table and description verbatim; it applies directly to projects using Copilot too.
RETAIN and adapt:
  • Tech stack (language, framework, key tools, versions)
  • Coding conventions (naming, style, patterns) — rephrase as direct instructions to the AI assistant in imperative voice
  • Architecture decisions and rationale
  • Known issues and gotchas relevant to a developer working in the project
  • Key working principles (clean code, no over-engineering, tests as first-class citizens, etc.)
  • SDD artifact types and engram topic key patterns
FORMAT:
  • Single flat Markdown file
  • UTF-8, no BOM
  • H2 sections (no YAML frontmatter)
  • Start with a top-level heading:
    # Project Instructions
  • Required H2 sections in this order:
    1. ## Tech Stack
      (if stack data available)
    2. ## Architecture
      (if architecture data available)
    3. ## Conventions
    4. ## SDD Development Workflow
      ← always present, even in bootstrap mode
    5. ## Active SDD Coaching Instructions
      ← always present
    6. ## Working Principles
    7. ## Known Issues
      (if known-issues.md available)
    8. ## Source Notes
      (only if any source file was absent)
  • Begin with the generated-file banner (verbatim, before the H1):
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    Replace
    YYYY-MM-DD
    with today's date.
  • In bootstrap mode (no project CLAUDE.md), the
    ## SDD Development Workflow
    and
    ## Active SDD Coaching Instructions
    sections MUST still be fully generated from the global SDD methodology; all project-specific sections are omitted and noted under
    ## Source Notes
    .
  • Output path:
    .github/copilot-instructions.md

对源包应用以下提示以生成
.github/copilot-instructions.md

你正在将Claude Code项目配置转换为GitHub Copilot指令文件。
源包: CLAUDE.md + 上方提供的所有可用ai-context/文件。
剥离规则:
先应用上述通用剥离规则,然后额外剥离:
  • 计划模式规则章节(Claude Code专属)
适配规则 — 不要剥离;为Copilot重写:
  1. SDD阶段DAG与工作流 → 转换为采用声明式 prose 编写的
    ## SDD开发工作流
    章节:
    • 描述每个阶段(探索、提议、规格、设计、任务、实施、验证、归档)及其产物
    • 包含产物类型(提议、规格、设计、任务、验证报告、归档报告)并说明它们会被持久化到engram
    • 不要包含任何斜杠命令语法 — 将阶段描述为开发者发起的步骤
  2. SDD可用命令表 → 替换为包含Copilot行为指令的
    ## 主动SDD指导指令
    章节:
    当开发者提及要实现新功能、变更或修复时:
    - 主动询问:"是否要为此次变更遵循SDD工作流?"
    - 如果是,逐步引导他们:提议 → (规格 + 设计并行)→ 任务 → 实施 → 验证 → 归档
    - 在开始实施前,确认项目的engram中已存在提议、设计和任务产物
    - 提醒开发者在实施后运行验证,并在确认完成后进行归档
    调整措辞以符合Copilot的惯用风格(使用 imperative 指令告知Copilot如何表现)。
保留并适配:
  • 技术栈(语言、框架、关键工具、版本)
  • 编码约定(命名、风格、模式) — 改写为对AI助手的直接imperative指令
  • 架构决策与理由
  • 与项目开发者相关的已知问题与注意事项
  • 核心工作原则(整洁代码、不过度设计、测试优先等)
  • SDD产物类型和engram主题键模式
格式要求:
  • 单个扁平化Markdown文件
  • UTF-8编码,无BOM
  • 使用H2章节(无YAML前置元数据)
  • 以顶级标题开头:
    # 项目指令
  • 按以下顺序包含必填H2章节:
    1. ## 技术栈
      (如果有栈数据可用)
    2. ## 架构
      (如果有架构数据可用)
    3. ## 约定
    4. ## SDD开发工作流
      ← 始终存在,即使在引导模式下
    5. ## 主动SDD指导指令
      ← 始终存在
    6. ## 工作原则
    7. ## 已知问题
      (如果有known-issues.md可用)
    8. ## 源文件说明
      (仅当有源文件缺失时)
  • 在H1标题前开头添加生成文件横幅(原文保留):
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    YYYY-MM-DD
    替换为当前日期。
  • 在引导模式(无项目CLAUDE.md)下,
    ## SDD开发工作流
    ## 主动SDD指导指令
    章节仍必须完全从全局SDD方法生成;所有项目专属章节需省略并在
    ## 源文件说明
    中注明。
  • 输出路径:
    .github/copilot-instructions.md

Gemini transformation prompt

Gemini转换提示

Apply the following prompt to the source bundle to generate
GEMINI.md
:

You are transforming a Claude Code project configuration into a Google Gemini instruction file (GEMINI.md).
Source bundle: CLAUDE.md + any available ai-context/ files provided above.
STRIP:
Apply the Shared STRIP Preamble above, then additionally strip:
  • SDD phase DAG diagram
  • SDD artifact storage details specific to Claude Code
ADAPT (do not strip wholesale):
  • SDD command tables: remove the command table verbatim; you MAY include an adapted prose paragraph describing a structured development workflow if it adds value for Gemini users — but no slash commands
  • Claude-specific section headers (e.g., "How I Execute Commands", "SDD Orchestrator — Delegation Pattern"): rename to Gemini equivalents or remove if the content has no value outside Claude Code
RETAIN:
  • Tech stack, coding conventions, architecture decisions, known issues
  • Working principles and development philosophy
  • Project memory layer description (ai-context/ structure)
FORMAT:
  • Single Markdown file at project root
  • UTF-8, no BOM
  • Structure similar to CLAUDE.md (not flat — preserve H2/H3 hierarchy where content warrants it)
  • Start with a top-level heading (e.g.,
    # Gemini — Project Configuration
    )
  • Begin with the generated-file banner (verbatim, before the H1):
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    Replace
    YYYY-MM-DD
    with today's date.
  • Output path:
    GEMINI.md

对源包应用以下提示以生成
GEMINI.md

你正在将Claude Code项目配置转换为Google Gemini指令文件(GEMINI.md)。
源包: CLAUDE.md + 上方提供的所有可用ai-context/文件。
剥离规则:
先应用上述通用剥离规则,然后额外剥离:
  • SDD阶段DAG图
  • 专属于Claude Code的SDD产物存储细节
适配规则(不要完全剥离):
  • SDD命令表:直接移除命令表;如果对Gemini用户有价值,可添加一段适配后的prose段落描述结构化开发工作流 — 但不要包含斜杠命令
  • Claude专属章节标题(例如"我如何执行命令"、"SDD编排器 — 委托模式"):重命名为Gemini等效标题,或如果内容在Claude Code之外无价值则移除
保留:
  • 技术栈、编码约定、架构决策、已知问题
  • 工作原则与开发理念
  • 项目记忆层描述(ai-context/结构)
格式要求:
  • 单个Markdown文件,位于项目根目录
  • UTF-8编码,无BOM
  • 结构与CLAUDE.md类似(非扁平化 — 在内容需要时保留H2/H3层级)
  • 以顶级标题开头(例如
    # Gemini — 项目配置
  • 在H1标题前开头添加生成文件横幅(原文保留):
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    YYYY-MM-DD
    替换为当前日期。
  • 输出路径:
    GEMINI.md

Cursor transformation prompt

Cursor转换提示

Apply the following prompt to the source bundle to generate
.cursor/rules/*.mdc
files:

You are transforming a Claude Code project configuration into Cursor MDC rule files.
Source bundle: CLAUDE.md + any available ai-context/ files provided above.
STRIP the following from all output files:
Apply the Shared STRIP Preamble above, then additionally strip:
  • SDD phase DAG diagram
  • SDD artifact storage details specific to Claude Code
OUTPUT STRUCTURE — split into exactly three domain files:
  1. conventions.mdc
    — coding rules, naming conventions, style guidelines, error handling patterns
  2. stack.mdc
    — tech stack, language versions, key frameworks and tools, package manager
  3. architecture.mdc
    — architecture decisions, system design patterns, data flow, inter-component contracts
If source material is insufficient to produce meaningful content for a domain (e.g., no architecture.md and no architecture content in CLAUDE.md), produce a minimal file with the frontmatter and a one-line note rather than omitting the file.
MDC FRONTMATTER CONTRACT — every file MUST have:
yaml
---
description: "[one-line description of this rules domain]"
globs: "[glob pattern or empty string]"
alwaysApply: [true|false]
---
Domain defaults:
File
globs
alwaysApply
conventions.mdc
""
true
stack.mdc
""
false
architecture.mdc
""
false
CRITICAL — globs field: Use
""
when no meaningful file-pattern can be inferred. NEVER guess at glob patterns. The
globs
field MUST be a string (not YAML null).
FORMAT per file:
  • UTF-8, no BOM
  • YAML frontmatter block first (between
    ---
    delimiters)
  • Generated-file banner immediately after the closing
    ---
    of the frontmatter:
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    Replace
    YYYY-MM-DD
    with today's date.
  • File name: lowercase slug with
    .mdc
    extension (e.g.,
    conventions.mdc
    )
  • If source material was only CLAUDE.md (no ai-context/), set
    description
    to note it: e.g.,
    "Generated from CLAUDE.md — ai-context/ not found"
  • Output paths:
    .cursor/rules/conventions.mdc
    ,
    .cursor/rules/stack.mdc
    ,
    .cursor/rules/architecture.mdc

对源包应用以下提示以生成
.cursor/rules/*.mdc
文件:

你正在将Claude Code项目配置转换为Cursor MDC规则文件。
源包: CLAUDE.md + 上方提供的所有可用ai-context/文件。
从所有输出文件中剥离以下内容:
先应用上述通用剥离规则,然后额外剥离:
  • SDD阶段DAG图
  • 专属于Claude Code的SDD产物存储细节
输出结构 — 拆分为恰好三个领域文件:
  1. conventions.mdc
    — 编码规则、命名约定、风格指南、错误处理模式
  2. stack.mdc
    — 技术栈、语言版本、核心框架与工具、包管理器
  3. architecture.mdc
    — 架构决策、系统设计模式、数据流、组件间契约
如果源材料不足以生成某个领域的有意义内容(例如无architecture.md且CLAUDE.md中无架构内容),则生成一个包含前置元数据和单行说明的最小化文件,不要省略该文件。
MDC前置元数据约定 — 每个文件必须包含:
yaml
---
description: "[该规则领域的单行描述]"
globs: "[glob模式或空字符串]"
alwaysApply: [true|false]
---
领域默认值:
文件
globs
alwaysApply
conventions.mdc
""
true
stack.mdc
""
false
architecture.mdc
""
false
关键要求 — globs字段: 当无法推断出有意义的文件模式时使用
""
。绝不猜测glob模式。
globs
字段必须是字符串(不能是YAML null)。
单个文件格式要求:
  • UTF-8编码,无BOM
  • 开头为YAML前置元数据块(位于
    ---
    分隔符之间)
  • 前置元数据的闭合
    ---
    之后立即添加生成文件横幅:
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    YYYY-MM-DD
    替换为当前日期。
  • 文件名:小写短横线格式,带
    .mdc
    扩展名(例如
    conventions.mdc
  • 如果源材料仅为CLAUDE.md(无ai-context/),将
    description
    设置为说明:例如
    "Generated from CLAUDE.md — ai-context/ not found"
  • 输出路径:
    .cursor/rules/conventions.mdc
    .cursor/rules/stack.mdc
    .cursor/rules/architecture.mdc

Step 4 — File writing

步骤4 — 文件写入

For each confirmed target:
  1. Create required directories silently if they do not exist:
    • Copilot:
      .github/
    • Cursor:
      .cursor/rules/
    • Gemini: no directory required (file at project root)
    • Do NOT emit any output for directory creation unless it fails.
  2. Write the generated file to its canonical path, prepending the generated-file banner:
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    Replace
    YYYY-MM-DD
    with today's date.
  3. Overwrite any existing file at the canonical path — this is idempotent behavior. No error is raised when overwriting.

对于每个已确认的目标:
  1. 若所需目录不存在则静默创建:
    • Copilot:
      .github/
    • Cursor:
      .cursor/rules/
    • Gemini:无需创建目录(文件位于项目根目录)
    • 除非创建失败,否则不要输出任何目录创建相关信息。
  2. 将生成的文件写入其标准路径,开头添加生成文件横幅:
    <!-- GENERATED BY config-export — DO NOT EDIT MANUALLY -->
    <!-- Source: CLAUDE.md + ai-context/ | Generated: YYYY-MM-DD -->
    <!-- Re-generate: run /config-export in your Claude Code session -->
    YYYY-MM-DD
    替换为当前日期。
  3. 覆盖标准路径下的任何现有文件 — 这是幂等行为。覆盖时不报错。

Step 5 — Summary

步骤5 — 总结

After all confirmed files have been written, print a summary table:
Export complete — files written:

  File                                  Status
  ──────────────────────────────────    ───────
  .github/copilot-instructions.md       written
  GEMINI.md                             written
  .cursor/rules/conventions.mdc         written
  .cursor/rules/stack.mdc               written
  .cursor/rules/architecture.mdc        written
(Only include rows for targets that were written in this run.)
Then append the snapshot reminder:
Exported files are snapshots. Re-run /config-export after significant changes to CLAUDE.md or ai-context/

所有确认文件写入完成后,打印总结表格:
导出完成 — 已写入文件:

  文件路径                                  状态
  ──────────────────────────────────    ───────
  .github/copilot-instructions.md       已写入
  GEMINI.md                             已写入
  .cursor/rules/conventions.mdc         已写入
  .cursor/rules/stack.mdc               已写入
  .cursor/rules/architecture.mdc        已写入
(仅包含此次运行中已写入的目标对应的行。)
然后添加快照提醒:
导出的文件为快照版本。当CLAUDE.md或ai-context/发生重大变更后,请重新运行/config-export

Rules

规则

  • If no
    CLAUDE.md
    is found in CWD, the skill MUST present the two-path menu (project-setup or bootstrap) before any file write; the hard ERROR path is NOT the default
  • Bootstrap mode (option 2) MUST produce a valid Copilot instructions file containing the full SDD workflow and coaching instructions even when no project CLAUDE.md exists
  • The Copilot transformation MUST NOT strip the SDD phase workflow or artifact paths — it MUST adapt them to prose and Copilot coaching instructions
  • The
    ## SDD Development Workflow
    and
    ## Active SDD Coaching Instructions
    sections MUST always be present in the Copilot output (whether from project mode or bootstrap mode)
  • Dry-run preview MUST precede any file write — there is no flag to skip dry-run
  • Overwrite warnings MUST appear in the dry-run step (before user confirmation), not after
  • The skill MUST NOT modify
    CLAUDE.md
    or any
    ai-context/
    file — read-only with respect to all source files
  • Directory creation (
    .github/
    ,
    .cursor/rules/
    ) MUST be silent — no output for directory creation unless it fails
  • The Claude target (
    CLAUDE.md
    ) is NOT supported in V1 — respond with the defined rejection message; do not write any files for that target
  • All generated files MUST be UTF-8, no BOM
  • Each Cursor
    .mdc
    file MUST have valid YAML frontmatter with
    description
    ,
    globs
    , and
    alwaysApply
    fields
  • Cursor
    .mdc
    file names MUST be valid slugs: lowercase letters, digits, and hyphens only, with the
    .mdc
    extension
  • Copilot output MUST be a single file at
    .github/copilot-instructions.md
    — no splitting
  • Gemini output MUST be a single file at
    GEMINI.md
    at the project root — no subdirectories
  • The
    globs
    field in Cursor MDC files MUST use
    ""
    when no meaningful pattern can be inferred — never guess
  • All content in generated files MUST be free of Claude Code-specific execution syntax: no Task tool invocations, no sub-agent patterns, no
    ~/.claude/skills/
    file paths
  • Copilot MUST adapt SDD content (workflow, phases, artifacts) — stripping rules apply only to execution-layer Claude Code syntax; SDD methodology is RETAINED and adapted for all targets
  • No target receives a verbatim copy of
    CLAUDE.md
  • 如果当前工作目录中未找到
    CLAUDE.md
    ,该Skill必须在写入任何文件之前展示双选项菜单(project-setup或引导模式);默认不是直接报错
  • 引导模式(选项2)必须生成有效的Copilot指令文件,包含完整的SDD工作流和指导指令,即使不存在项目CLAUDE.md
  • Copilot转换不得剥离SDD阶段工作流或产物路径 — 必须将其适配为prose和Copilot指导指令
  • Copilot输出中必须始终包含
    ## SDD开发工作流
    ## 主动SDD指导指令
    章节(无论是项目模式还是引导模式)
  • 写入任何文件之前必须进行预演预览 — 没有跳过预演的标志
  • 覆盖警告必须出现在预演步骤中(用户确认之前),而不是之后
  • 该Skill不得修改
    CLAUDE.md
    或任何
    ai-context/
    文件 — 对所有源文件仅可读
  • 目录创建(
    .github/
    .cursor/rules/
    )必须静默执行 — 除非创建失败,否则不要输出任何目录创建相关信息
  • V1版本不支持Claude目标(
    CLAUDE.md
    ) — 回复定义好的拒绝消息;不为该目标写入任何文件
  • 所有生成的文件必须为UTF-8编码,无BOM
  • 每个Cursor
    .mdc
    文件必须包含有效的YAML前置元数据,带有
    description
    globs
    alwaysApply
    字段
  • Cursor
    .mdc
    文件名必须是有效的短横线格式:仅包含小写字母、数字和短横线,带
    .mdc
    扩展名
  • Copilot输出必须是位于
    .github/copilot-instructions.md
    的单个文件 — 不得拆分
  • Gemini输出必须是位于项目根目录的单个
    GEMINI.md
    文件 — 不得放在子目录中
  • 当无法推断出有意义的模式时,Cursor MDC文件中的
    globs
    字段必须使用
    ""
    — 绝不猜测
  • 生成文件中的所有内容必须不包含Claude Code专属的执行语法:无任务工具调用、无子Agent模式、无
    ~/.claude/skills/
    文件路径
  • Copilot必须适配SDD内容(工作流、阶段、产物) — 剥离规则仅适用于执行层的Claude Code语法;SDD方法必须保留并适配给所有目标
  • 任何目标都不会直接获得
    CLAUDE.md
    的逐字副本 ",