lisa-review-project
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLisa 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 file).
.lisa-manifest本Skill必须在Lisa仓库目录下运行。目标项目必须已应用Lisa(即存在文件)。
.lisa-manifestInstructions
操作步骤
Step 1: Validate Lisa Directory
步骤1:验证Lisa目录
Confirm running from Lisa by checking for .
src/core/lisa.tsIf 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通过检查是否存在来确认当前处于Lisa目录中。
src/core/lisa.ts如果不在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-projectStep 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:
- Check the path exists and is a directory
- Check exists in the project root
.lisa-manifest - 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]验证项目路径:
- 检查路径是否存在且为目录
- 检查项目根目录下是否存在文件
.lisa-manifest - 如果缺失,抛出错误:
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 and filesystem to detect its type(s):
package.json- npm-package: without
package.jsonAND has"private": true,main,bin, orexportsfiles - cdk: exists OR
cdk.jsonin package.json dependenciesaws-cdk - nestjs: exists OR
nest-cli.jsonin package.json dependencies@nestjs - expo: exists OR
app.jsonexists OReas.jsonin package.json dependenciesexpo - typescript: exists OR
tsconfig.jsonin package.json dependenciestypescript
Build the type hierarchy. Example: if detected, types =
expo[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.jsonaws-cdk - nestjs:存在文件,或
nest-cli.json依赖中包含package.json@nestjs - expo:存在或
app.json文件,或eas.json依赖中包含package.jsonexpo - typescript:存在文件,或
tsconfig.json依赖中包含package.jsontypescript
构建类型层级。示例:如果检测到类型,则类型列表为
expo[all, typescript, expo]如果未检测到任何类型,使用。
[all]Step 4: Read Manifest and Map Source Files
步骤4:读取清单文件并映射源文件
Read the project's file line by line:
.lisa-manifestFor each line:
- Skip lines starting with (comments) and empty lines
# - Parse format:
strategy|relative/path/to/file - Extract and
strategyrelativePath - 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):
- Check - if found, record it
{type}/copy-overwrite/{relativePath} - Check - if found, record it
{type}/copy-contents/{relativePath} - Continue to next type
Example for an Expo project with manifest entry :
copy-overwrite|.github/workflows/ci.yml- Check - found, use it
expo/copy-overwrite/.github/workflows/ci.yml - (don't check further)
If no source found, record as "source-not-found".
Skip these strategies (they're intentionally customized):
- - meant to be customized by project
create-only - - already merged into project's file
merge
逐行读取项目的文件:
.lisa-manifest对于每一行:
- 跳过以开头的注释行和空行
# - 解析格式:
strategy|relative/path/to/file - 提取和
strategyrelativePath - 针对每种策略类型,在Lisa中查找对应的源文件
源文件查找顺序:
按照检测到的类型层级反向查找(从最具体的类型开始):
- 检查- 如果存在,记录该路径
{type}/copy-overwrite/{relativePath} - 检查- 如果存在,记录该路径
{type}/copy-contents/{relativePath} - 继续查找下一个类型
示例:对于Expo项目,清单文件条目为:
copy-overwrite|.github/workflows/ci.yml- 检查- 找到后使用该路径
expo/copy-overwrite/.github/workflows/ci.yml - (无需继续查找)
如果未找到源文件,记录为"source-not-found"。
跳过以下策略(这些策略为自定义设计):
- - 用于项目自定义
create-only - - 已合并到项目文件中
merge
Step 5: Compare Files
步骤5:对比文件
For files with source found and strategy is or :
copy-overwritecopy-contents- Read both the Lisa source and project version
- If identical, mark as "in-sync"
- If different:
- Generate diff using:
diff -u "{lisa-source}" "{project-file}" || true - Mark as "drifted"
- Store diff for report
- Generate diff using:
对于找到源文件且策略为或的文件:
copy-overwritecopy-contents- 读取Lisa源文件和项目中的对应文件
- 如果完全一致,标记为"in-sync"
- 如果存在差异:
- 使用命令生成差异:
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
undefinedLisa 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 or strategies and are meant to be customized:
create-onlymerge- {file1}
- {file2}
These files use or strategies and are meant to be customized:
create-onlymerge- {file1}
- {file2}
In Sync Files
In Sync Files
<details>
<summary>X files match Lisa templates exactly</summary>
- {file1}
- {file2}
<details>
<summary>X files match Lisa templates exactly</summary>
- {file1}
- {file2}
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 changesIf user wants to adopt improvements:
- Ask which files to adopt (let them select multiple)
- 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如果用户选择回采改进内容:
- 询问用户要回采哪些文件(支持多选)
- 对于每个选中的文件:
- 确定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 and
typescript/, adopt to where it currently exists in Lisaall/ - 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/中,回采到Lisa中当前存在的目录all/ - 优雅处理缺失文件 - 如果项目中文件缺失但存在于清单文件中,需记录该情况(可能已删除或被git忽略)
- 仔细对比 - 部分差异可能是平台特定的(如换行符、环境变量),此类差异不应回采
- 差异内容展示的是"Lisa <- Project"(即项目相对于Lisa模板的变更内容)