Inventory: competitor prices, as checked
Each Inventory entry can hold its plans' prices: the plan, the price, what it's per, when it was checked and where. Comparison and alternative pages, and new sections, state a competitor's price only as entered, with the month it was checked; a missing one is left out and listed as a to-do. A price checked more than six months ago is flagged on the entry and adds a to-do to every page that names the competitor. Prices go out and come back with the Inventory's YAML. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -143,6 +143,7 @@ func (c *Composer) Compose(ctx context.Context, in Inputs) (*Composed, error) {
|
||||
if len(e.Websites) > 0 {
|
||||
fmt.Fprintf(&b, "Their site: %s\n", e.Websites[0])
|
||||
}
|
||||
b.WriteString(e.PricesPrompt())
|
||||
}
|
||||
if s := in.Signal; s != nil {
|
||||
fmt.Fprintf(&b, "It's for the buying signal %q: companies that %s\n", s.Name, oneLine(s.Hypothesis))
|
||||
@@ -196,7 +197,7 @@ Rules:
|
||||
- Text fields may use Markdown inline (bold, links), as the examples do.
|
||||
- Links go only to the site's pages listed, to #anchors on this page, or to addresses you were given.
|
||||
- Never invent a customer, a quote, a testimonial, a number, a price, a statistic, a test or a result. Use only facts given here. Leave out a section rather than fill it with made-up proof.
|
||||
- Say nothing about a competitor beyond what you were given.
|
||||
- Say nothing about a competitor beyond what you were given. State a competitor's price only as listed, with the month it was checked ("$25 per agent per month, as of Nov 2026"); never work one out, round it or guess a missing one: leave the cell out and add it to needs.
|
||||
- path: where the page goes, like the site's other pages of its kind ("/something/"); use the one given if there is one.
|
||||
- title: under 60 characters; description: under 155, for search results.
|
||||
- needs: what a person must add or check before publishing (a real customer quote, a screenshot, a number to confirm…); empty if nothing.
|
||||
@@ -217,6 +218,9 @@ Rules:
|
||||
if in.Kind == "home" {
|
||||
out.Path = "/"
|
||||
}
|
||||
if in.Competitor != nil {
|
||||
out.Needs = append(out.Needs, priceChecks(in.Competitor)...)
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
@@ -783,3 +787,13 @@ func ClosePR(ctx context.Context, d *db.DB, g interface {
|
||||
}
|
||||
return SavePage(d, p)
|
||||
}
|
||||
|
||||
// priceChecks are the to-dos for a competitor's prices checked more than
|
||||
// six months ago.
|
||||
func priceChecks(e *inventory.Entry) []string {
|
||||
var out []string
|
||||
for _, p := range e.StalePrices(time.Now()) {
|
||||
out = append(out, fmt.Sprintf("Check %s's price %s: last checked %s.", e.Name, p.String(), p.CheckedOn()))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user