Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/growth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This folder holds the minimum set of docs needed to turn ProfitCtl into somethin
16. Follow [Source-Of-Truth Guidance](source-of-truth-guidance.md) before updating any tracker.
17. Run the weekly motion from [Design-Partner Operating System](design-partner-operating-system.md).
18. Capture each serious evaluator with [Design-Partner Evaluation Template](design-partner-evaluation-template.md).
19. Use `bash scripts/growth/scaffold-weekly-review.sh --owner "<name>"` to generate the weekly review shell and dashboard row.

## What These Docs Are For

Expand Down
8 changes: 8 additions & 0 deletions docs/growth/adoption-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ Use one row per week.

Update the dashboard every Friday after the weekly evaluator review.

Fastest path:

```bash
bash scripts/growth/scaffold-weekly-review.sh --owner "<name>"
```

That script scaffolds the weekly review markdown and prints a dashboard row with the current release version and GitHub release download count when `gh` is available.

1. Pull the current release version and download trend from GitHub Releases.
2. Check the Linear issues for the active design-partner pipeline.
3. Count completed installs, activations, calibrations, and commitments from evaluator notes.
Expand Down
8 changes: 8 additions & 0 deletions docs/growth/weekly-review-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Use this template every Friday after the design-partner and adoption dashboard review.

To scaffold a fresh private copy with the latest release metadata:

```bash
bash scripts/growth/scaffold-weekly-review.sh --owner "<name>"
```

Keep the generated review file in a private operating system. Do not commit live evaluator notes to the public repository.

## Week Summary

- Week of:
Expand Down
184 changes: 184 additions & 0 deletions scripts/growth/scaffold-weekly-review.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
#!/usr/bin/env bash
set -euo pipefail

usage() {
cat <<'EOF'
Usage:
scaffold-weekly-review.sh [options]

Options:
--week-of YYYY-MM-DD Week start date to use in the review file.
--owner NAME Owner name for the review.
--release-version VERSION Release version to record.
--release-downloads COUNT Release downloads to record.
--homebrew-installs COUNT Homebrew installs to record.
--output PATH Markdown output file path.
--force Overwrite the output file if it already exists.
--help Show this help text.

If --release-version or --release-downloads are omitted, the script will try to
read the latest GitHub release for IntelIP/ProfitCtl via `gh release view`.

The generated markdown is an operator artifact. Keep the resulting file in a
private system of record rather than committing live evaluator notes to the
public repository.
EOF
}

week_of="$(date -u +%Y-%m-%d)"
owner=""
release_version=""
release_downloads=""
homebrew_installs=""
output_path=""
force="false"

while [[ $# -gt 0 ]]; do
case "$1" in
--week-of)
week_of="${2:-}"
shift 2
;;
--owner)
owner="${2:-}"
shift 2
;;
--release-version)
release_version="${2:-}"
shift 2
;;
--release-downloads)
release_downloads="${2:-}"
shift 2
;;
--homebrew-installs)
homebrew_installs="${2:-}"
shift 2
;;
--output)
output_path="${2:-}"
shift 2
;;
Comment on lines +38 to +61
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 shift 2 unguarded when option value is omitted

Every value-taking option (e.g. --week-of, --owner, --output) uses ${2:-} to silently accept an empty value, but still calls shift 2. If one of these flags is passed as the very last argument (no value following), $# is 1, shift 2 exits with a non-zero status, and set -e kills the script with no useful message.

A common guard pattern:

--week-of)
  [[ $# -ge 2 ]] || { echo "Missing value for --week-of" >&2; exit 1; }
  week_of="$2"
  shift 2
  ;;
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/growth/scaffold-weekly-review.sh
Line: 38-61

Comment:
**`shift 2` unguarded when option value is omitted**

Every value-taking option (e.g. `--week-of`, `--owner`, `--output`) uses `${2:-}` to silently accept an empty value, but still calls `shift 2`. If one of these flags is passed as the very last argument (no value following), `$#` is 1, `shift 2` exits with a non-zero status, and `set -e` kills the script with no useful message.

A common guard pattern:

```bash
--week-of)
  [[ $# -ge 2 ]] || { echo "Missing value for --week-of" >&2; exit 1; }
  week_of="$2"
  shift 2
  ;;
```

How can I resolve this? If you propose a fix, please make it concise.

--force)
force="true"
shift
;;
--help)
usage
exit 0
;;
*)
echo "Unknown option: $1" >&2
usage >&2
exit 1
;;
esac
done

if [[ -z "${output_path}" ]]; then
output_path="/tmp/profitctl-weekly-review-${week_of}.md"
fi

if [[ -e "${output_path}" && "${force}" != "true" ]]; then
echo "Output already exists: ${output_path}. Use --force to overwrite." >&2
exit 1
fi

if [[ -z "${release_version}" || -z "${release_downloads}" ]]; then
if command -v gh >/dev/null 2>&1; then
if release_json="$(gh release view --repo IntelIP/ProfitCtl --json tagName,assets 2>/dev/null)"; then
if [[ -z "${release_version}" ]]; then
release_version="$(printf '%s' "${release_json}" | python3 -c 'import json,sys; data=json.load(sys.stdin); print(data.get("tagName",""))')"
fi
if [[ -z "${release_downloads}" ]]; then
release_downloads="$(printf '%s' "${release_json}" | python3 -c 'import json,sys; data=json.load(sys.stdin); print(sum(a.get("downloadCount",0) for a in data.get("assets",[])))')"
Comment on lines +91 to +94
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Undocumented python3 dependency may cause unexpected exit

python3 is called inside the if gh ... block without a prior command -v python3 guard. With set -euo pipefail active, if python3 is absent (e.g. minimal CI, Alpine containers) the script exits with a cryptic "command not found" error instead of gracefully leaving the release fields empty. The usage block and --help output also don't mention this requirement.

Consider using gh's built-in --jq flag (no extra binary needed) or adding a guard similar to the gh check:

if [[ -z "${release_version}" ]]; then
  release_version="$(gh release view --repo IntelIP/ProfitCtl --json tagName --jq '.tagName' 2>/dev/null || true)"
fi
if [[ -z "${release_downloads}" ]]; then
  release_downloads="$(gh release view --repo IntelIP/ProfitCtl --json assets --jq '[.assets[].downloadCount] | add // 0' 2>/dev/null || true)"
fi
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/growth/scaffold-weekly-review.sh
Line: 91-94

Comment:
**Undocumented `python3` dependency may cause unexpected exit**

`python3` is called inside the `if gh ...` block without a prior `command -v python3` guard. With `set -euo pipefail` active, if `python3` is absent (e.g. minimal CI, Alpine containers) the script exits with a cryptic "command not found" error instead of gracefully leaving the release fields empty. The usage block and `--help` output also don't mention this requirement.

Consider using `gh`'s built-in `--jq` flag (no extra binary needed) or adding a guard similar to the `gh` check:

```bash
if [[ -z "${release_version}" ]]; then
  release_version="$(gh release view --repo IntelIP/ProfitCtl --json tagName --jq '.tagName' 2>/dev/null || true)"
fi
if [[ -z "${release_downloads}" ]]; then
  release_downloads="$(gh release view --repo IntelIP/ProfitCtl --json assets --jq '[.assets[].downloadCount] | add // 0' 2>/dev/null || true)"
fi
```

How can I resolve this? If you propose a fix, please make it concise.

fi
fi
fi
fi

mkdir -p "$(dirname "${output_path}")"

cat > "${output_path}" <<EOF
# Weekly Review Template

Use this template every Friday after the design-partner and adoption dashboard review.

## Week Summary

- Week of: ${week_of}
- Owner: ${owner}
- Release version: ${release_version}
- Notes:

## Dashboard Snapshot

- New targets added:
- Targets contacted:
- Replies received:
- Installs completed:
- First compare runs completed:
- Calibration requests received:
- Design-partner commitments:
- Release downloads: ${release_downloads}
- Homebrew installs: ${homebrew_installs}

## What Changed

- What improved this week:
- What regressed:
- What stayed flat:
- Which benchmark pair got the clearest response:

## Friction Review

- Install friction:
- Activation friction:
- Scenario mapping friction:
- Output or trust friction:
- Repeated blocker theme:

## Evaluator Notes

- Evaluators to keep:
- Evaluators to drop:
- Evaluators needing follow-up:
- New signals from the best conversations:

## Source Check

- Is the dashboard current:
- Are evaluator notes current:
- Are Linear issues current:
- Are benchmark reports current:

## Decisions

Choose one primary direction for next week:

- improve onboarding
- improve scenario mapping
- improve output clarity
- continue outreach with the current motion

## Linear Follow-Through

- 1:
- 2:
- 3:

## Next Week

- top 3 targets:
- one product fix:
- one docs fix:
- one outreach change:
EOF

cat <<EOF
Wrote weekly review scaffold to:
${output_path}

Dashboard row:
| ${week_of} | ${release_version} | | | | | | | | ${release_downloads} | ${homebrew_installs} | | |
EOF
Loading