Preface
- Who this book is for
- What this book will not do
- The rule that holds the book together
- Permission comes before curiosity
- Privacy: the code is also data
- Not legal advice
- How to use this book
- What you need
- What success looks like
1. What Counts as a Legacy App, and Why Small Ones Are Different
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step: build a one-page system profile
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
2. First Aid: Inventory, Access, and a Safety Net
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
3. Rescue, Rewrite, or Retire?
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
4. Mapping the System with AI
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
5. Capturing Current Behavior
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
6. Quick Security Wins
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
7. Upgrading the Runtime One Step at a Time
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
8. Cleaning Up Without Breaking It
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
9. The Strangler Path for Small Systems
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
10. Moving the Data Safely
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
11. Working with AI on Old Code
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
12. Talking to the Business Owner
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
13. Testing, Staging, and Cutover
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
14. Documentation and Handover
- What you will learn
- Composite scenario
- The idea in plain words
- Safety net first
- Step by step
- How to verify the result
- What AI typically gets wrong at this step
- Common mistakes
- Chapter checklist
- Summary
- Try it on a copy of your own project
15. Composite Walkthroughs
- What you will learn
- The idea in plain words
- Safety net first
- Walkthrough 1: A small order-and-inventory system in PHP
- Walkthrough 2: A Delphi desktop billing app with a database
- Walkthrough 3: A small organization’s booking script
- What the three cases have in common
- How to verify your own walkthrough
- What AI typically gets wrong across all three
- Common mistakes across all three
- Chapter checklist
- Summary
- Try it on a copy of your own project
Appendix A: Triage Checklist
- 1. Permission and scope
- 2. What the system does
- 3. What exists
- 4. Ownership and access
- 5. Safety net
- 6. Risk scores
- 7. Decision
- Stop conditions
Appendix B: Restore-Test Checklist
- Before you start
- Restore the code
- Restore the data
- Prove the application works
- Record the result
- If it fails
Appendix C: Behavior-Capture Template
- Scenario sheet
- Preserve-or-fix list
- Notes for the next runner
Appendix D: Security Quick-Win Checklist
- 1. Exposed secrets
- 2. Configuration hygiene
- 3. Passwords and sessions
- 4. Access control
- 5. Uploads
- 6. Database accounts
- 7. Dependencies
- 8. Remaining risk
- Stop conditions
Appendix E: Upgrade Log Template
- System baseline (before any upgrade)
- Target and reason
- Rung log
- Issues found
- Deferred items
- Cutover record
- Lessons
Appendix F: Cutover and Rollback Checklist
- Go/no-go (decide at: ________)
- Runbook
- Rollback triggers
- Rollback steps
- After the window
- Sign-off
Appendix G: Prompt Library for Legacy Work
- Before you start
- 1. Session rules block
- 2. Explain code for a newcomer
- 3. List entry points
- 4. Trace one flow
- 5. Find jobs and integrations
- 6. Draft characterization cases
- 7. Constrained refactor
- 8. Review a diff
- 9. Upgrade impact analysis
- 10. Defensive security review
- 11. Owner summary
- 12. Post-cutover review
- Using the answers
Appendix H: Handover Document Template
- 1. What this system does
- 2. Who uses it
- 3. Where it runs
- 4. How to get a working copy
- 5. Runbook
- 6. Accounts and access
- 7. Known risks
- 8. Decisions already made
- 9. Tests and rollback
- 10. Maintenance calendar
- 11. Contacts
- 12. Handover confirmation