lisa-review-project

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lisa Project Review

Lisa项目审查

This skill compares Lisa's source templates against a target project that has Lisa applied, identifying what the project has changed from Lisa and offering to adopt those improvements back into Lisa.
This is the inverse of
/lisa-review-implementation
:
  • lisa:review-implementation: Run FROM project → "What did I change from Lisa?"
  • lisa:review-project: Run FROM Lisa → "What has this project changed?"
本Skill会将Lisa的源模板与已应用Lisa的目标项目进行对比,识别项目相对于Lisa的变更内容,并支持将这些改进内容回采到Lisa中。
这是
/lisa-review-implementation
的反向操作:
  • lisa:review-implementation:从项目目录运行 → "What did I change from Lisa?"
  • lisa:review-project:从Lisa目录运行 → "What has this project changed?"

Prerequisites

前置条件

This skill must be run FROM the Lisa repository directory. The target project must have Lisa already applied (must have a
.lisa-manifest
file).
本Skill必须在Lisa仓库目录下运行。目标项目必须已应用Lisa(即存在
.lisa-manifest
文件)。

Instructions

操作步骤

Step 1: Validate Lisa Directory

步骤1:验证Lisa目录

Confirm running from Lisa by checking for
src/core/lisa.ts
.
If not in Lisa, error with:
This command must be run FROM the Lisa repository.

Current directory does not contain src/core/lisa.ts.

Usage: /lisa-review-project /path/to/target-project
通过检查是否存在
src/core/lisa.ts
来确认当前处于Lisa目录中。
如果不在Lisa目录中,抛出错误:
This command must be run FROM the Lisa repository.

Current directory does not contain src/core/lisa.ts.

Usage: /lisa-review-project /path/to/target-project

Step 2: Validate Arguments

步骤2:验证参数

If no project path provided, ask the user:
Which project would you like to review?

Path: [user provides path]
Validate the project path:
  1. Check the path exists and is a directory
  2. Check
    .lisa-manifest
    exists in the project root
  3. If missing, error with:
Project does not have Lisa applied.

Expected to find: {project-path}/.lisa-manifest

Did you apply Lisa to this project? Run: lisa {project-path}
如果未提供项目路径,询问用户:
Which project would you like to review?

Path: [user provides path]
验证项目路径:
  1. 检查路径是否存在且为目录
  2. 检查项目根目录下是否存在
    .lisa-manifest
    文件
  3. 如果缺失,抛出错误:
Project does not have Lisa applied.

Expected to find: {project-path}/.lisa-manifest

Did you apply Lisa to this project? Run: lisa {project-path}

Step 3: Detect Project Types

步骤3:检测项目类型

Parse the project's
package.json
and filesystem to detect its type(s):
  • npm-package:
    package.json
    without
    "private": true
    AND has
    main
    ,
    bin
    ,
    exports
    , or
    files
  • cdk:
    cdk.json
    exists OR
    aws-cdk
    in package.json dependencies
  • nestjs:
    nest-cli.json
    exists OR
    @nestjs
    in package.json dependencies
  • expo:
    app.json
    exists OR
    eas.json
    exists OR
    expo
    in package.json dependencies
  • typescript:
    tsconfig.json
    exists OR
    typescript
    in package.json dependencies
Build the type hierarchy. Example: if
expo
detected, types =
[all, typescript, expo]
If no types detected, use
[all]
.
解析项目的
package.json
和文件系统以检测其类型:
  • npm-package
    package.json
    中没有
    "private": true
    ,且包含
    main
    bin
    exports
    files
    字段
  • cdk:存在
    cdk.json
    文件,或
    package.json
    依赖中包含
    aws-cdk
  • nestjs:存在
    nest-cli.json
    文件,或
    package.json
    依赖中包含
    @nestjs
  • expo:存在
    app.json
    eas.json
    文件,或
    package.json
    依赖中包含
    expo
  • typescript:存在
    tsconfig.json
    文件,或
    package.json
    依赖中包含
    typescript
构建类型层级。示例:如果检测到
expo
类型,则类型列表为
[all, typescript, expo]
如果未检测到任何类型,使用
[all]

Step 4: Read Manifest and Map Source Files

步骤4:读取清单文件并映射源文件

Read the project's
.lisa-manifest
file line by line:
For each line:
  1. Skip lines starting with
    #
    (comments) and empty lines
  2. Parse format:
    strategy|relative/path/to/file
  3. Extract
    strategy
    and
    relativePath
  4. For each strategy type, find the corresponding source in Lisa
Lookup Order for Source Files:
For each detected type in reverse hierarchy order (most specific first):
  1. Check
    {type}/copy-overwrite/{relativePath}
    - if found, record it
  2. Check
    {type}/copy-contents/{relativePath}
    - if found, record it
  3. Continue to next type
Example for an Expo project with manifest entry
copy-overwrite|.github/workflows/ci.yml
:
  1. Check
    expo/copy-overwrite/.github/workflows/ci.yml
    - found, use it
  2. (don't check further)
If no source found, record as "source-not-found".
Skip these strategies (they're intentionally customized):
  • create-only
    - meant to be customized by project
  • merge
    - already merged into project's file
逐行读取项目的
.lisa-manifest
文件:
对于每一行:
  1. 跳过以
    #
    开头的注释行和空行
  2. 解析格式:
    strategy|relative/path/to/file
  3. 提取
    strategy
    relativePath
  4. 针对每种策略类型,在Lisa中查找对应的源文件
源文件查找顺序:
按照检测到的类型层级反向查找(从最具体的类型开始):
  1. 检查
    {type}/copy-overwrite/{relativePath}
    - 如果存在,记录该路径
  2. 检查
    {type}/copy-contents/{relativePath}
    - 如果存在,记录该路径
  3. 继续查找下一个类型
示例:对于Expo项目,清单文件条目为
copy-overwrite|.github/workflows/ci.yml
  1. 检查
    expo/copy-overwrite/.github/workflows/ci.yml
    - 找到后使用该路径
  2. (无需继续查找)
如果未找到源文件,记录为"source-not-found"。
跳过以下策略(这些策略为自定义设计):
  • create-only
    - 用于项目自定义
  • merge
    - 已合并到项目文件中

Step 5: Compare Files

步骤5:对比文件

For files with source found and strategy is
copy-overwrite
or
copy-contents
:
  1. Read both the Lisa source and project version
  2. If identical, mark as "in-sync"
  3. If different:
    • Generate diff using:
      diff -u "{lisa-source}" "{project-file}" || true
    • Mark as "drifted"
    • Store diff for report
对于找到源文件且策略为
copy-overwrite
copy-contents
的文件:
  1. 读取Lisa源文件和项目中的对应文件
  2. 如果完全一致,标记为"in-sync"
  3. 如果存在差异:
    • 使用命令生成差异:
      diff -u "{lisa-source}" "{project-file}" || true
    • 标记为"drifted"
    • 保存差异内容用于生成报告

Step 6: Analyze and Categorize

步骤6:分析与分类

For each drifted file, provide brief analysis:
  • Improvement: Change that makes the file better (better CI config, cleaner code, etc.)
  • Customization: Change specific to this project (environment config, custom paths, etc.)
  • Bug fix: Fixing an issue in Lisa's template
  • Divergence: Change that's neither an improvement nor needed customization (concerning)
对于每个存在差异的文件,提供简要分析:
  • Improvement(改进):使文件更优的变更(如更完善的CI配置、更简洁的代码等)
  • Customization(自定义):项目特有的变更(如环境配置、自定义路径等)
  • Bug fix(Bug修复):修复Lisa模板中的问题
  • Divergence(偏离):既不属于改进也不属于必要自定义的变更(需注意)

Step 7: Generate Report

步骤7:生成报告

Create a markdown report:
markdown
undefined
创建Markdown报告:
markdown
undefined

Lisa Project Review

Lisa Project Review

Lisa Directory: {lisa-path} Target Project: {project-path} Project Types: {types} Project Name: {from package.json name or basename} Generated: {current date/time ISO}
Lisa Directory: {lisa-path} Target Project: {project-path} Project Types: {types} Project Name: {from package.json name or basename} Generated: {current date/time ISO}

Summary

Summary

  • Total managed files: X
  • In sync: X
  • Drifted: X
  • Intentionally customized (create-only/merge): X
  • Source not found: X
  • Total managed files: X
  • In sync: X
  • Drifted: X
  • Intentionally customized (create-only/merge): X
  • Source not found: X

Drifted Files

Drifted Files

{relative/path/to/file}

{relative/path/to/file}

Source: {type}/copy-overwrite/{path} Strategy: copy-overwrite Category: Improvement
<details> <summary>View diff (Lisa <- Project)</summary>
```diff {diff output} ```
</details>
Analysis: {Brief analysis of the change and why it matters}

[Repeat for each drifted file]
Source: {type}/copy-overwrite/{path} Strategy: copy-overwrite Category: Improvement
<details> <summary>View diff (Lisa <- Project)</summary>
```diff {diff output} ```
</details>
Analysis: {Brief analysis of the change and why it matters}

[Repeat for each drifted file]

Files Not Found in Lisa

Files Not Found in Lisa

These files are in the manifest but their source templates couldn't be located in Lisa:
  • {file1}
  • {file2}
This might mean:
  • The file was manually added after Lisa was applied
  • A Lisa template was removed in an update
  • The file is project-specific
These files are in the manifest but their source templates couldn't be located in Lisa:
  • {file1}
  • {file2}
This might mean:
  • The file was manually added after Lisa was applied
  • A Lisa template was removed in an update
  • The file is project-specific

Intentionally Customized

Intentionally Customized

These files use
create-only
or
merge
strategies and are meant to be customized:
  • {file1}
  • {file2}
These files use
create-only
or
merge
strategies and are meant to be customized:
  • {file1}
  • {file2}

In Sync Files

In Sync Files

<details> <summary>X files match Lisa templates exactly</summary>
  • {file1}
  • {file2}
</details> ```
<details> <summary>X files match Lisa templates exactly</summary>
  • {file1}
  • {file2}
</details> ```

Step 8: Offer to Adopt Changes

步骤8:支持回采变更

After the report, present the findings:
I found X files that have drifted from Lisa's templates.

[List files with categories]

Would you like to:
1. Review specific drifted files in detail
2. Adopt improvements from this project back into Lisa
3. Just view the full report
4. Done - no changes
If user wants to adopt improvements:
  1. Ask which files to adopt (let them select multiple)
  2. For each selected file:
    • Determine the target path in Lisa (preserve type directory)
    • Confirm: "Copy project version to
      {type}/copy-overwrite/{path}
      ?"
    • If confirmed, use Write tool to copy project file to Lisa
    • Report success
生成报告后,展示结果:
I found X files that have drifted from Lisa's templates.

[List files with categories]

Would you like to:
1. Review specific drifted files in detail
2. Adopt improvements from this project back into Lisa
3. Just view the full report
4. Done - no changes
如果用户选择回采改进内容:
  1. 询问用户要回采哪些文件(支持多选)
  2. 对于每个选中的文件:
    • 确定Lisa中的目标路径(保留类型目录结构)
    • 确认:"Copy project version to
      {type}/copy-overwrite/{path}
      ?"
    • 如果用户确认,使用Write工具将项目文件复制到Lisa中
    • 报告操作成功

Important Notes

重要说明

  • Never auto-adopt without confirmation - always ask the user first
  • Preserve the most specific type directory - if a file exists in both
    typescript/
    and
    all/
    , adopt to where it currently exists in Lisa
  • Handle missing files gracefully - if project file is missing but in manifest, note it (possible deletion or git-ignored)
  • Compare carefully - some differences may be platform-specific (line endings, env vars) and should NOT be adopted
  • The diff shows "Lisa <- Project" (what project changed FROM Lisa)
  • 禁止自动回采 - 必须先获得用户确认
  • 保留最具体的类型目录 - 如果文件同时存在于
    typescript/
    all/
    中,回采到Lisa中当前存在的目录
  • 优雅处理缺失文件 - 如果项目中文件缺失但存在于清单文件中,需记录该情况(可能已删除或被git忽略)
  • 仔细对比 - 部分差异可能是平台特定的(如换行符、环境变量),此类差异不应回采
  • 差异内容展示的是"Lisa <- Project"(即项目相对于Lisa模板的变更内容)