feat: add template sync agentic workflow#128
Merged
TechWatching merged 15 commits intomainfrom Mar 30, 2026
Merged
Conversation
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>
There was a problem hiding this comment.
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-syncagent instructions (.md) and the compiled Actions workflow (*.lock.yml) plus state/lock metadata under.github/. - Updates CI to run
pnpm run generatein 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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
….json Agent-Logs-Url: https://github.com/TechWatching/techwatching.dev/sessions/57f8235f-e01a-4464-b8d9-409f5f6dddcf Co-authored-by: TechWatching <15186176+TechWatching@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ck file Agent-Logs-Url: https://github.com/TechWatching/techwatching.dev/sessions/50823b31-cd18-4341-a018-a439fc658af9 Co-authored-by: TechWatching <15186176+TechWatching@users.noreply.github.com>
…kflow # Conflicts: # .github/copilot-instructions.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
corepack enable || npm install -g pnpmwithnpm install -g pnpm@$(node -p "require('./package.json').packageManager.split('@')[1]")to pin the exact pnpm version frompackageManagerfield without relying on corepackname: "Template sync"totemplate-sync.mdfrontmatter and update all occurrences intemplate-sync.lock.ymlso the workflow shows correctly in the Actions UI