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
20 changes: 16 additions & 4 deletions .github/scripts/sync-pstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
CHANGELOG_FILE = "changelog.json"

PER_PAGE = 100
MAX_PAGES = 2
MAX_PAGES = 100
MAX_ENTRIES = 100

SOURCE_URL = f"https://github.com/{UPSTREAM_OWNER}/{UPSTREAM_REPO}/tree/{UPSTREAM_BRANCH}/{UPSTREAM_PATH}"
Expand Down Expand Up @@ -47,15 +47,18 @@ def api_request(url, token):
raise


def fetch_commits(token, last_sha=None):
def fetch_commits(token, since=None, last_sha=None):
commits = []
truncated = False
for page in range(1, MAX_PAGES + 1):
params = {
"path": UPSTREAM_PATH,
"sha": UPSTREAM_BRANCH,
"per_page": PER_PAGE,
"page": page,
}
if since:
params["since"] = since
qs = urllib.parse.urlencode(params)
url = f"https://api.github.com/repos/{UPSTREAM_OWNER}/{UPSTREAM_REPO}/commits?{qs}"
page_commits = api_request(url, token)
Expand All @@ -66,6 +69,10 @@ def fetch_commits(token, last_sha=None):
break
if len(page_commits) < PER_PAGE:
break
if page == MAX_PAGES:
truncated = True
if truncated:
print(f"Warning: reached max page limit ({MAX_PAGES}); fetched {len(commits)} commits. Some older commits may be missing.", file=sys.stderr)
return commits


Expand Down Expand Up @@ -120,10 +127,12 @@ def main():
print("No GITHUB_TOKEN found; using unauthenticated requests (low rate limit).", file=sys.stderr)

old = load_changelog()
entries = old.get("entries", [])
last_sha = old.get("lastCommitSha", "")
since = entries[0].get("date") if entries else None

try:
commits = fetch_commits(token, last_sha=last_sha)
commits = fetch_commits(token, since=since, last_sha=last_sha)
except Exception as e:
print(f"Failed to fetch upstream commits: {e}", file=sys.stderr)
sys.exit(1)
Expand All @@ -136,8 +145,10 @@ def main():
try:
idx = next(i for i, c in enumerate(commits) if c.get("sha") == last_sha)
new_commits = commits[:idx]
print(f"Found last known commit {last_sha[:8]} at index {idx}.")
except StopIteration:
new_commits = commits
print(f"Warning: last known commit {last_sha[:8]} not in fetched history; using {len(commits)} commits since {since}.", file=sys.stderr)
else:
new_commits = commits

Expand All @@ -147,6 +158,7 @@ def main():

new_entries = [parse_entry(c) for c in new_commits]
existing_map = {e["sha"]: e for e in old.get("entries", [])}
new_count = sum(1 for e in new_entries if e["sha"] not in existing_map)
for entry in new_entries:
existing_map[entry["sha"]] = entry

Expand All @@ -162,7 +174,7 @@ def main():
"entries": combined,
}
save_changelog(data)
print(f"Updated {CHANGELOG_FILE}: +{len(new_entries)} new entries, {len(combined)} total, last={latest['sha'][:8]}.")
print(f"Updated {CHANGELOG_FILE}: +{new_count} new entries, {len(combined)} total, last={latest['sha'][:8]}.")


if __name__ == "__main__":
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/sync-pstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ jobs:
python-version: '3.12'

- name: Poll upstream pstack changes
run: python3 .github/scripts/sync-pstack.py
id: sync
run: python3 .github/scripts/sync-pstack.py 2>&1 | tee sync.log
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Sync summary
if: always()
run: |
echo '### pstack sync summary' >> "$GITHUB_STEP_SUMMARY"
if [ -f sync.log ]; then
cat sync.log >> "$GITHUB_STEP_SUMMARY"
fi
if grep -q 'Warning:' sync.log 2>/dev/null; then
echo '' >> "$GITHUB_STEP_SUMMARY"
echo 'Warning: Sync completed with warnings. Review the log above to ensure no commits were missed.' >> "$GITHUB_STEP_SUMMARY"
fi

- name: Check for changes
id: changes
run: |
Expand Down
68 changes: 66 additions & 2 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,73 @@
{
"source": "https://github.com/cursor/plugins/tree/main/pstack",
"sourceUrl": "https://github.com/cursor/plugins/tree/main/pstack",
"lastUpdatedAt": "2026-07-10T15:04:06+00:00",
"lastCommitSha": "0dda29e839d15464a137af9935665a5a47ee09b8",
"lastUpdatedAt": "2026-07-13T11:10:51+00:00",
"lastCommitSha": "a29f5a8ca161b1de4ffc5484454958bebc04eaa5",
"entries": [
{
"sha": "a29f5a8ca161b1de4ffc5484454958bebc04eaa5",
"date": "2026-07-12T04:18:44Z",
"title": "pstack: bump version to 0.11.2 (#154)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/a29f5a8ca161b1de4ffc5484454958bebc04eaa5"
},
{
"sha": "8f008c41981dca484d5beaf688d3aa2ea4ecf89b",
"date": "2026-07-12T04:14:01Z",
"title": "pstack: add the teach skill (compose how + why into one explanation) (#153)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/8f008c41981dca484d5beaf688d3aa2ea4ecf89b"
},
{
"sha": "20bdb6cdfdd8ffa683befe62d76104e5654c861d",
"date": "2026-07-12T03:30:46Z",
"title": "pstack: bump version to 0.11.1 (#152)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/20bdb6cdfdd8ffa683befe62d76104e5654c861d"
},
{
"sha": "6714489fa233263f00e419f6cfc4759b07c81056",
"date": "2026-07-12T01:10:09Z",
"title": "maintain-verification-skill: cleanup granularity, re-doctor, evidence checks (#151)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/6714489fa233263f00e419f6cfc4759b07c81056"
},
{
"sha": "e42d29fd5c8fe4f13e3bee7f53b35f410f65aee8",
"date": "2026-07-12T00:17:43Z",
"title": "pstack: add create-verification-skill and maintain-verification-skill (#150)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/e42d29fd5c8fe4f13e3bee7f53b35f410f65aee8"
},
{
"sha": "9d2a3f2d12bbe0dca3e61bbc0e9dbfe2df09fb56",
"date": "2026-07-11T23:32:28Z",
"title": "pstack: give poteto-mode a human display name (#149)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/9d2a3f2d12bbe0dca3e61bbc0e9dbfe2df09fb56"
},
{
"sha": "9251b2666bc9876396825c1f0df5685dbdaaddb5",
"date": "2026-07-11T23:21:33Z",
"title": "pstack: lead the README with the two-step quickstart (#148)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/9251b2666bc9876396825c1f0df5685dbdaaddb5"
},
{
"sha": "a8145426e541afa424a403e3866496216c1b8142",
"date": "2026-07-11T02:25:05Z",
"title": "pstack: add model-the-domain principle; true up README (#147)",
"author": "poteto",
"authorUrl": "https://github.com/poteto",
"url": "https://github.com/cursor/plugins/commit/a8145426e541afa424a403e3866496216c1b8142"
},
{
"sha": "0dda29e839d15464a137af9935665a5a47ee09b8",
"date": "2026-07-09T01:49:43Z",
Expand Down