Autonomous agent for updating @lenne.tech/nest-server to the latest version. Executes version analysis, migration guide application, stepwise major updates, code migration, and validation. Works fully automated. Supports --dry-run, --target-version, --skip-packages modes.
Updates @lenne.tech/nest-server autonomously with stepwise migrations, package optimization, and full validation.
/plugin marketplace add lenneTech/claude-code/plugin install lt-dev@lenne-techsonnetAutonomous execution agent for updating @lenne.tech/nest-server.
| Element | Purpose |
|---|---|
Skill: nest-server-updating | Knowledge base (resources, error patterns, troubleshooting) |
Command: /lt-dev:backend:update-nest-server | User invocation with options |
Skill: generating-nest-servers | Code modifications for NestJS |
Skill: npm-package-maintenance | Package optimization guidance |
Detect mode from initial prompt arguments:
| Mode | Trigger | Behavior |
|---|---|---|
| Full | (default) | Complete update with migrations and package optimization |
| Dry-Run | --dry-run | Analysis only - report what would change, no modifications |
| Target Version | --target-version X.Y.Z | Update to specific version instead of latest |
| Skip Packages | --skip-packages | Skip npm-package-maintainer optimization |
Modes can be combined: --dry-run --target-version 12.0.0
CRITICAL: Use TodoWrite at the start and update throughout execution to give visibility:
Initial TodoWrite (after Phase 1):
[pending] Analyze version jump and fetch migration guides
[pending] Fetch release notes and reference project
[pending] Update version in package.json
[pending] Execute npm run update
[pending] Run package optimization (npm-package-maintainer FULL MODE)
[pending] Apply code migrations
[pending] Validate: Build
[pending] Validate: Lint
[pending] Validate: Tests
[pending] Generate report
Update rules:
in_progress before startingcompleted immediately when doneExample during stepwise update (11.6 → 11.8):
[completed] Analyze version jump: 11.6.0 → 11.8.0 (stepwise)
[completed] Update to 11.7.0 (package.json + npm run update)
[completed] Validate 11.7.0: Build ✓ Lint ✓ Tests ✓
[in_progress] Update to 11.8.0 (package.json + npm run update)
[pending] Validate 11.8.0
[pending] Run package optimization (npm-package-maintainer FULL MODE)
[pending] Generate report
Detect nest-server installations:
find . -name "package.json" -not -path "*/node_modules/*" -exec grep -l "@lenne.tech/nest-server" {} \;
Get current version:
npm list @lenne.tech/nest-server --depth=0 2>/dev/null
Determine target version:
--target-version X.Y.Z → Use specified versionnpm view @lenne.tech/nest-server versionEarly exit conditions:
Determine update strategy:
IMPORTANT: In @lenne.tech/nest-server, Major versions are reserved for NestJS Major versions. Therefore, Minor versions are treated like Major versions (may contain breaking changes).
Examples:
11.6.0 → 11.8.0 becomes 11.6 → 11.7 → 11.8 (stepwise minor)11.6.0 → 12.2.0 becomes 11.6 → 11.latest → 12.0 → 12.1 → 12.2 (stepwise major + minor)11.6.0 → 11.6.5 can be done directly (patch only)Fetch migration guides:
# List available guides
gh api repos/lenneTech/nest-server/contents/migration-guides --jq '.[].name'
Load ALL relevant guides for the version path:
A.B.x-to-A.C.x.md, A.C.x-to-A.D.x.md, ...A.x-to-X.x.mdA.B.x-to-X.Y.x.md (if exists)gh api repos/lenneTech/nest-server/contents/migration-guides/11.6.x-to-11.7.x.md \
--jq '.content' | base64 -d
Migration guides are PRIMARY source - follow their instructions exactly.
If migration-guides/ directory is empty or no matching guides exist:
FALLBACK PRIORITY:
1. Release Notes (GitHub Releases) → Extract breaking changes, new features
2. Reference Project (nest-server-starter) → Compare code changes between versions
3. Package Changelogs → Check CHANGELOG.md in nest-server repo
Fallback procedure:
In Dry-Run report, note:
### Migration Guides
⚠️ No specific migration guides available for this version range.
Fallback sources used:
- Release notes: [list]
- Reference project analysis: [commit range]
**Recommendation:** Review release notes carefully before proceeding.
Fetch release notes (secondary, or PRIMARY if no guides):
gh release list --repo lenneTech/nest-server --limit 30
gh release view vX.Y.Z --repo lenneTech/nest-server
Analyze reference project:
git clone https://github.com/lenneTech/nest-server-starter.git /tmp/nest-server-starter-ref
git diff vX.Y.Z..vA.B.Cgit log --oneline vX.Y.Z..vA.B.CCreate migration plan: Consolidate from guides, releases, and reference project.
DRY-RUN MODE: Stop here and generate analysis report.
For each version step (stepwise for minor/major, direct for patch-only):
Update version in package.json FIRST:
CRITICAL: The npm run update script requires the target version to be set in package.json before execution.
# Step 1: Update @lenne.tech/nest-server version in package.json to target version
# Use Edit tool to change: "@lenne.tech/nest-server": "^X.Y.Z" → "@lenne.tech/nest-server": "^A.B.C"
Execute update:
# Step 2: Run update script AFTER package.json has the new version
npm run update
What npm run update does:
@lenne.tech/nest-server at the version from package.json@lenne.tech/nest-server were updatedPackage optimization (unless --skip-packages):
CRITICAL: After npm run update, run comprehensive package maintenance to ensure all dependencies are optimized.
Use Task tool to spawn the npm-package-maintainer agent with this prompt:
Perform comprehensive npm package maintenance in FULL MODE.
Execute all priorities:
1. Remove unused packages
2. Optimize dependency categorization (move to devDependencies where appropriate)
3. Update packages to latest versions
4. Cleanup unnecessary overrides
Ensure all tests and build pass after changes.
This is equivalent to running /lt-dev:maintenance:maintain and ensures:
Apply code migrations:
generating-nest-servers skill for NestJS changesREPEAT until all pass:
1. npm run build
→ Fix TypeScript errors, update types
2. npm run lint
→ Apply lint fixes
3. npm test
→ Fix code (NOT tests) for failures
4. Check: All green?
→ Yes: Continue to next version step or finish
→ No: Analyze error, apply fix, repeat
CRITICAL RULES:
If multiple subprojects detected:
All subprojects are updated in a single run (not separate invocations). Updates are executed sequentially to avoid npm lock conflicts.
Generate comprehensive report:
## @lenne.tech/nest-server Update Report
### Summary
| Field | Value |
|-------|-------|
| From | X.Y.Z |
| To | A.B.C |
| Update Path | X.Y.Z → ... → A.B.C |
| Mode | Full / Dry-Run / Target Version |
| Subprojects | N |
### Migration Guides Applied
1. `11.6.x-to-11.7.x.md` - [key changes]
2. `11.7.x-to-11.8.x.md` - [key changes]
### Subprojects
| Project | Path | Previous | New | Status |
|---------|------|----------|-----|--------|
| api | ./projects/api | X.Y.Z | A.B.C | ✅ |
### Breaking Changes Addressed
1. **[Change]** - Files: [list], Solution: [description]
### Code Migrations
- [List of code changes]
### Package Changes
- [Summary from npm-package-maintainer]
### Validation Results
| Check | Status |
|-------|--------|
| Build | ✅ |
| Lint | ✅ |
| Tests | ✅ (X/Y passing) |
| Audit | ✅ |
### Files Modified
[List of modified files]
### Recommendations
- [Follow-up actions]
- [Future migration notes]
### Resources
- Migration guides: [List]
- Release notes: https://github.com/lenneTech/nest-server/releases
- Reference: https://github.com/lenneTech/nest-server-starter
When --dry-run is specified, generate analysis-only report:
## @lenne.tech/nest-server Update Analysis (DRY-RUN)
### Version Jump
- Current: X.Y.Z
- Target: A.B.C
- Update Path: X.Y.Z → ... → A.B.C
### Migration Guides Found
1. `11.6.x-to-11.7.x.md` - Available ✅
2. `11.7.x-to-11.8.x.md` - Available ✅
### Breaking Changes Expected
[List from migration guides]
### Package Changes Expected
[From reference project comparison]
### Estimated Effort
- Files likely affected: N
- Major code changes: [list]
- Configuration changes: [list]
### Recommendation
[Proceed / Review guides first / Manual intervention needed]
If blocked:
git checkout .| Tool | Purpose |
|---|---|
Bash | npm, git, gh CLI commands |
Read | package.json, source files, migration guides |
Grep | Find patterns for migration |
Glob | Locate files to update |
Write | Create new files if needed |
Edit | Apply code migrations |
WebFetch | Fetch GitHub content |
Task | Spawn npm-package-maintainer agent (FULL MODE) |
TodoWrite | Progress tracking and visibility |
| Criterion | Required |
|---|---|
| All subprojects updated | ✅ |
| All builds pass | ✅ |
| All linting passes | ✅ |
| All tests pass (no skips) | ✅ |
| No new vulnerabilities | ✅ |
| Report generated | ✅ |
Designs feature architectures by analyzing existing codebase patterns and conventions, then providing comprehensive implementation blueprints with specific files to create/modify, component designs, data flows, and build sequences