home / skills / codyswanngt / lisa / lisa-review-project

lisa-review-project skill

/.claude/skills/lisa-review-project

This skill helps compare Lisa's templates to a target project, identify drift, and propose adopting improvements back into Lisa.

npx playbooks add skill codyswanngt/lisa --skill lisa-review-project

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
6.6 KB
---
name: lisa-review-project
description: This skill should be used when comparing Lisa's source templates against a target project's implementation to identify drift. It validates the Lisa directory, detects project types, reads the manifest, compares files, categorizes changes, and offers to adopt improvements back into Lisa. This is the inverse of lisa:review-implementation.
---

# Lisa Project Review

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?"

## 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).

## Instructions

### Step 1: Validate Lisa Directory

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
```

### Step 2: Validate Arguments

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}
```

### Step 3: Detect Project Types

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]`.

### Step 4: Read Manifest and Map Source Files

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

### Step 5: Compare Files

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

### Step 6: Analyze and Categorize

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)

### Step 7: Generate Report

Create a markdown report:

```markdown
# 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}

## Summary

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

## Drifted Files

### {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]

## 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

## Intentionally Customized

These files use `create-only` or `merge` strategies and are meant to be customized:

- {file1}
- {file2}

## In Sync Files

<details>
<summary>X files match Lisa templates exactly</summary>

- {file1}
- {file2}

</details>
```

### Step 8: Offer to Adopt Changes

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

### 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)

Overview

This skill compares Lisa's source templates against a target project that already has Lisa applied to identify drift and opportunities to adopt project improvements back into Lisa. It validates that you are running from the Lisa repository, reads the target project's .lisa-manifest, detects project types, compares template files, and generates a clear report of findings. It can optionally help copy approved improvements from the project into Lisa with user confirmation.

How this skill works

The skill first confirms it is running from the Lisa repository (checks for src/core/lisa.ts) and validates the provided project path and presence of .lisa-manifest. It detects project types by inspecting package.json and key files (cdk.json, tsconfig.json, expo files, etc.), reads the manifest line-by-line, and maps each manifest entry to the most specific Lisa source template. For copy-overwrite and copy-contents files it computes diffs, categorizes drift (improvement, customization, bug fix, divergence), and produces a markdown report. If requested, it interactively copies selected project files back into the appropriate Lisa type directory with explicit user confirmation.

When to use it

  • You want to see what a specific project changed after Lisa was applied.
  • You need to identify template drift and decide whether to merge improvements into Lisa.
  • Before releasing updates to Lisa, to capture project-driven fixes or enhancements.
  • When auditing multiple projects to consolidate best practices back into Lisa.

Best practices

  • Run this from the Lisa repository root to ensure correct mapping of source templates.
  • Always review diffs and classifications before adopting any changes into Lisa.
  • Prefer adopting changes into the most specific type directory where the source currently lives.
  • Skip auto-adoption; require explicit confirmation for every file copy.
  • Consider platform-specific differences (line endings, env vars) and avoid blindly adopting those.

Example use cases

  • Detect a CI workflow improvement in a project and adopt the improved pipeline into Lisa's templates.
  • Identify project-specific customizations that should remain local and mark them as create-only.
  • Find and accept a bug fix a project made to a Lisa template.
  • Generate a report for maintainers summarizing drift across managed files before a Lisa release.

FAQ

What happens if the target project is missing .lisa-manifest?

The skill stops and reports that Lisa is not applied to the project, instructing you to run lisa {project-path} first.

Can the skill auto-adopt changes into Lisa?

No. The skill will offer to adopt specific files but requires explicit confirmation for each file before writing into Lisa.