# Starter: Renewals and expansion

## What you build

You build an early alert for renewal risk. It gives a risk score to each renewal that is due soon. It then drafts the outreach for each renewal with a high score.

## What you need

- The file `pipeline.csv` in the `H2-Command-Center` folder, with renewals marked in the Type column. See [Export your Salesforce reports](/kit/01-salesforce-export).
- Or a renewals report export, saved as `renewals.csv` in the same folder.
- The columns Account Name, Opportunity Owner, Amount, Close Date, Next Step, Last Activity and Type.

In this starter, the Close Date of a renewal opportunity is the renewal date. If your team uses a different field, tell Claude the name of that column.

If you use the sample files, tell Claude. Claude then writes "sample data" in each title.

## 1. Build the view

This step gives you rung 1. The view is on rung 2 when it rebuilds from a new export.

```
Read renewals.csv in the H2-Command-Center folder. If that file is not there, read pipeline.csv. Do not change the file.
From pipeline.csv, keep only the records with Type = Renewal. If Type has no such value, show me the values and ask me.
Keep the renewals with a Close Date in the next 120 days, and the open renewals with a Close Date in the past.
Build a table with one row for each renewal. Use these columns: Account Name, Opportunity Name, Opportunity Owner, Amount, Close Date, Days to Renewal, Last Activity, Next Step.
Calculate Days to Renewal as the Close Date minus the export date. Sort the table by Days to Renewal, smallest first.
Below the table, show the number of renewals and the total Amount for each month.
State the export date at the top. Use the date of the file that you read.
Save the result as renewal-risk.md. Rebuild the file from the newest export each time I ask.
```

Make sure that the total agrees with Salesforce before you continue.

## 2. Add one alert

This step gives you rung 3. The alert is a score. The rule is in plain words, so that you can change each number.

- Days to renewal: 30 days or fewer, or a date in the past, adds 3 points.
- Days to renewal: 31 to 60 days adds 2 points. 61 to 90 days adds 1 point.
- Last activity: 30 days or more before the export date adds 2 points.
- Last activity: 14 to 29 days before the export date adds 1 point.
- Next step: an empty Next Step adds 2 points.
- Amount: an Amount in the top quarter of the renewals adds 1 point.
- A score of 5 or more is high. A score of 3 or 4 is medium. A lower score is low.

```
Add a risk score to each renewal in renewal-risk.md. Use the export date as "today".
Days to Renewal: add 3 points for 30 days or fewer, or for a date in the past.
Days to Renewal: add 2 points for 31 to 60 days, and 1 point for 61 to 90 days.
Last Activity: add 2 points for 30 days or more before the export date, 1 point for 14 to 29 days.
Next Step: add 2 points if it is empty.
Amount: add 1 point if the Amount is in the top quarter of the renewals.
Label a score of 5 or more "high", a score of 3 or 4 "medium" and a lower score "low".
Add the columns Score and Risk to the table. For each renewal, show the points from each rule.
Put a section named "Needs me" at the top. List each renewal with a high score, largest Amount first.
Write the score rule in plain words at the end of the file, so that I can change it.
If a column is not in the export, tell me which rule you cannot run. Do not guess a value.
Run the score now and show me what it found.
```

## 3. Add one action

This step gives you rung 4. Claude writes the drafts. The account owner reads each draft, corrects it and sends it.

```
For each renewal in "Needs me", draft an outreach message from the Opportunity Owner to the customer.
Start with "[contact name]". The export has no contact data, so do not make up a name.
Give the renewal date, ask for a call in the next two weeks and offer two topics for the call.
Keep each draft to six lines or fewer. Use only facts from the export. Do not give a price or a discount.
Add one line for the owner above each draft: the score and the reasons for it.
Save the drafts in renewal-risk.md in a section named "Drafts". Keep the export date at the top of the file.
Do not send a message. Only draft.
```

## 4. Schedule it

Follow the steps in [Schedule it](/kit/04-schedule-it). Change the day and the time to fit your week.

```
Schedule a task that repeats every Monday at 7:00 AM. The task rebuilds renewal-risk.md from the newest export, runs my score rule and writes the drafts. The task states the export date at the top. The task does not send a message. Run the task one time now.
```

## 5. Post it

```
Post these results to my page. Use the same title each time, so that a new version replaces the old version.
1. Title "Renewal-risk view", kind "view", rung 2: the totals for each month and the export date.
2. Title "Renewal-risk alert", kind "alert", rung 3: the score rule in plain words and the renewals with a high score.
3. Title "Renewal outreach draft", kind "action", rung 4: one example draft.
4. Title "Renewal-risk schedule", kind "schedule", rung 4: what runs, when it runs, what it reads and what it writes.
State the export date at the top of each result. Do not post an email address or a phone number.
Mark the steps "view", "alert", "act" and "schedule" as done.
```

## What good looks like

- The view shows the export date at the top, and the total agrees with Salesforce.
- You can read the score rule aloud, and a peer can change one number in it.
- Each renewal with a high score has a draft, and no draft goes out without an owner who reads it.
