Skip to content

feat: add template sync agentic workflow#128

Merged
TechWatching merged 15 commits intomainfrom
add-template-sync-workflow
Mar 30, 2026
Merged

feat: add template sync agentic workflow#128
TechWatching merged 15 commits intomainfrom
add-template-sync-workflow

Conversation

@TechWatching
Copy link
Copy Markdown
Owner

@TechWatching TechWatching commented Mar 30, 2026

  • Replace corepack enable || npm install -g pnpm with npm install -g pnpm@$(node -p "require('./package.json').packageManager.split('@')[1]") to pin the exact pnpm version from packageManager field without relying on corepack
  • Add name: "Template sync" to template-sync.md frontmatter and update all occurrences in template-sync.lock.yml so the workflow shows correctly in the Actions UI

Alexandre Nédélec and others added 8 commits March 30, 2026 21:44
Adds a gh-aw (GitHub Agentic Workflow) that automatically detects changes
in the upstream nuxt-ui-templates/saas template and selectively applies
relevant improvements to this site.

- .github/workflows/template-sync.md: gh-aw markdown workflow with full
  instructions for the agent (apply/adapt/skip rules, validation, Playwright
  screenshots, PR creation)
- .github/workflows/template-sync.lock.yml: compiled GitHub Actions workflow
  (generated by 'gh aw compile'; manually extended with upload-artifact step
  for Playwright screenshots)
- .github/template-sync-state.json: tracks lastSyncedCommit initialized to
  d548b61351af9ef0802da1946d26b2c35a3db449 (the template SHA from the initial
  site bootstrap commit)
- .github/aw/actions-lock.json: pinned action SHAs for security (managed by gh-aw)
- .gitattributes: marks *.lock.yml as linguist-generated and merge=ours
- .github/workflows/ci.yml: added 'pnpm run generate' build step

How it works:
1. Runs weekly on Monday or on workflow_dispatch
2. Skips if a template-sync PR is already open (no duplicates)
3. Agent reads upstream changes, applies them per customization rules
4. Runs pnpm install + typecheck + lint locally
5. Starts pnpm dev, takes Playwright screenshots of key pages
6. Screenshots uploaded as workflow artifact (30-day retention, not committed to git)
7. Creates a PR with a summary of changes and link to artifact

To run locally: gh aw run template-sync
To recompile: gh aw compile .github/workflows/template-sync.md
  (then re-add the 'Upload Playwright screenshots' step to the lock.yml)

Required secrets: COPILOT_GITHUB_TOKEN (GitHub Copilot API token for the agent)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the Node.js playwright script with playwright-cli commands.
playwright-cli is a token-efficient CLI tool designed for coding agents
with simple commands like 'open', 'goto', 'screenshot', 'close'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove Step 6 (dev server + screenshots) - too complex for GH Actions sandbox
- Add fallback for missing template-sync-state.json (use initial baseline SHA)
- Add better-sqlite3 rebuild instructions for --ignore-scripts fallback
- Recompile lock.yml without screenshot artifact upload step

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
package.json, pnpm-lock.yaml, and .github/template-sync-state.json are
protected by default. Since this workflow explicitly manages these files,
set protected-files: allowed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
.npmrc was changed upstream (shamefully-hoist removed) but wasn't in the
apply list, so the agent silently skipped it. Also add a catch-all rule
so unlisted files are applied by default instead of ignored.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Syncs with upstream template which deleted this file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sync with upstream template: tailwindcss ^4.2.2 added as explicit dep,
.npmrc removed from apply rules since the file no longer exists.
Also add catch-all rule for unlisted upstream files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Previous instructions said 'shared dependencies' which the agent interpreted
narrowly, missing most version bumps and new packages. Now explicitly states:
update all matching versions, add new packages, never remove, never downgrade,
and run pnpm install to regenerate lockfile.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TechWatching TechWatching marked this pull request as ready for review March 30, 2026 22:40
Copilot AI review requested due to automatic review settings March 30, 2026 22:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a scheduled GitHub Agentic Workflow (gh-aw) to sync changes from nuxt-ui-templates/saas into this blog repo, and tightens CI by building the generated site.

Changes:

  • Introduces template-sync agent instructions (.md) and the compiled Actions workflow (*.lock.yml) plus state/lock metadata under .github/.
  • Updates CI to run pnpm run generate in addition to lint + typecheck.
  • Updates dependencies (adds tailwindcss) and removes .npmrc.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
package.json Adds tailwindcss dependency.
.npmrc Removes pnpm config file.
.github/workflows/template-sync.md Defines gh-aw agent instructions for syncing from upstream template.
.github/workflows/template-sync.lock.yml Compiled GitHub Actions workflow generated from the gh-aw markdown file.
.github/workflows/ci.yml Adds a build (pnpm run generate) step to CI.
.github/template-sync-state.json Stores baseline sync state (last synced commit + date).
.github/copilot-instructions.md Expands repository Copilot guidance and project context.
.github/aw/actions-lock.json Adds pinned action SHAs metadata for gh-aw.
.gitattributes Marks workflow lock files as generated and forces merge=ours.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alexandre Nédélec and others added 2 commits March 31, 2026 00:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alexandre Nédélec and others added 2 commits March 31, 2026 00:59
…kflow

# Conflicts:
#	.github/copilot-instructions.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TechWatching TechWatching merged commit 06db044 into main Mar 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants