بنقرة واحدة
dayarc-upgrade
Check for and apply updates to the Dayarc agent package from GitHub.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Check for and apply updates to the Dayarc agent package from GitHub.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Render brief from template and deliver to configured targets (email, GitHub issue, terminal).
Read and write memory JSON files in the user's dayarc folder.
Generate structured talking points for performance reviews, 1:1s, and self-assessments from accumulated monthly summaries.
Extract corrections from user's reply to a brief email.
Conversationally configure a new signal source connector (Jira, ADO, Linear, Slack, etc.), generate a custom COLLECT skill, and register it in config.json.
Initialize Dayarc data directories, user config, and optional scheduler on first run or reconfiguration.
| name | Dayarc Upgrade |
| description | Check for and apply updates to the Dayarc agent package from GitHub. |
User asks to update, upgrade, or check for new versions of the agent — including upgrading to a specific branch or commit, or returning to stable main.
First, determine how Dayarc was installed:
# Check plugin install
$pluginHit = Get-ChildItem -Path (Join-Path $HOME ".copilot\installed-plugins") -Filter "plugin.json" -Recurse -ErrorAction SilentlyContinue | Where-Object {
(Get-Content $_.FullName -Raw | ConvertFrom-Json).name -eq "dayarc"
} | Select-Object -First 1
# Check git clone
$cloneDir = Join-Path $HOME ".dayarc-agent"
$isClone = Test-Path (Join-Path $cloneDir ".git")
$pluginHit exists → use copilot plugin update dayarc$isClone is true → use git-based upgrade (below)If installed as a plugin, do not run the upgrade yourself. Plugin upgrades are managed by the Copilot CLI's built-in slash command, which only the user can invoke from chat. Instruct the user:
To upgrade the Dayarc plugin, run
/plugin update dayarcin this chat. Once it finishes, ask me again and I'll re-register the scheduler if needed.
If the user reports the slash command has completed, run the After Update scheduler re-registration steps (skip the file-copy step — the plugin system handles that).
Preview branches are not supported for plugin installs. If the user asks for a preview branch, tell them to use the git clone install method instead.
Check whether ~/.dayarc-agent/.preview exists. If it does, warn the user:
⚠️ Preview build active — you are running a pre-release commit (
<contents of .preview>). This build may be unstable. Say "upgrade to stable" to return tomain.
cd ~/.dayarc-agent
git fetch origin main
Compare HEAD vs origin/main:
git log HEAD..origin/main --onelinegit pull --ff-only origin main
If fast-forward fails (local modifications), tell the user:
Local changes detected. Run
irm https://raw.githubusercontent.com/YuiZhou/dayarc-agent/main/setup.ps1 | iexto reinstall cleanly.
After a successful stable update, if ~/.dayarc-agent/.preview exists, delete it.
Triggered when the user says something like:
Steps:
Warn the user upfront:
⚠️ Preview builds may be unstable and are not suitable for production use. Proceed?
Wait for explicit confirmation ("yes" / "ok" / "proceed"). If the user does not confirm, abort.
Guard local changes — stash any uncommitted changes first:
cd ~/.dayarc-agent
git stash --include-untracked
Note the stash result. If the working tree is clean, note that too (nothing to stash).
Fetch the ref:
git fetch origin <branch-or-sha>
If the ref looks like a branch name (not a 40-char or abbreviated hex SHA), fetch it as:
git fetch origin refs/heads/<branch>:refs/remotes/origin/<branch>
Resolve to a commit SHA:
git rev-parse FETCH_HEAD
Detach HEAD to that commit:
git checkout --detach FETCH_HEAD
Write the .preview marker with the ref description and resolved SHA:
feat/triage-bot @ abc1234f
Full path: ~/.dayarc-agent/.preview
Run After Update steps (copy files, re-register scheduler if applicable).
Report:
✅ Now running preview:
feat/triage-bot @ abc1234f. Say "upgrade to stable" to return tomain.
If git fetch or git checkout fails (e.g., invalid ref), tell the user the ref could not be found and abort without modifying any files.
Triggered when the user says "upgrade to stable", "rollback", or "go back to main".
cd ~/.dayarc-agent
git fetch origin main
git checkout main
git pull --ff-only origin main
Remove-Item -Path ".preview" -ErrorAction SilentlyContinue
Then run After Update steps as normal. Report:
✅ Restored to stable
main. Preview mode cleared.
Read CHANGELOG.md and summarize what changed since the previous HEAD.
Git clone only: Copy updated files to ~/.copilot/ (agent profile + skills). Skip for plugin installs — the plugin system handles this.
Re-apply user connector MCP entries: Read ~/Documents/dayarc/config.json → connectors. For each connector entry that has an mcp field, apply the following logic:
Read current mcp.json into $mcpConfig
For each $connector in config.json → connectors where $connector.mcp exists:
$name = $connector.name
If $mcpConfig.mcpServers does NOT have key $name:
Build new entry:
command = $connector.mcp.command
args = $connector.mcp.args
env = { for each var in $connector.mcp.env_vars: $var → "REPLACE_ME" }
Add $mcpConfig.mcpServers[$name] = new entry
Mark $name as restored
Write updated mcp.json back
If any connectors were restored, tell the user:
✅ Restored MCP config for connector(s): {restored names}. Your actual credentials were not stored here — check
mcp.jsonand replace anyREPLACE_MEvalues if needed.
If env_vars is empty or absent for a connector, add the entry with no env block.
Skip this step entirely if no connector in config.json has an mcp field.
Re-register scheduler if this machine owns one: Read ~/Documents/dayarc/config.json. The scheduler field is an array of { machine, am_time, pm_time } entries. Find the entry where machine matches $env:COMPUTERNAME. If found, find the scheduler.ps1 path (same discovery logic as the scheduler script itself) and re-register:
# Find scheduler.ps1 (plugin or clone)
$pluginHit = Get-ChildItem -Path (Join-Path $HOME ".copilot\installed-plugins") -Filter "scheduler.ps1" -Recurse -ErrorAction SilentlyContinue | Where-Object { (Split-Path $_.DirectoryName -Leaf) -ne "skills" } | Select-Object -First 1
if ($pluginHit) { $script = $pluginHit.FullName }
else { $script = Join-Path $HOME ".dayarc-agent\scheduler.ps1" }
Unregister-ScheduledTask -TaskName "Dayarc-AM" -Confirm:$false -ErrorAction SilentlyContinue
Unregister-ScheduledTask -TaskName "Dayarc-PM" -Confirm:$false -ErrorAction SilentlyContinue
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable
Register-ScheduledTask -TaskName "Dayarc-AM" -Action (New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -File `"$script`" -trigger am") -Trigger (New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday,Tuesday,Wednesday,Thursday,Friday -At $amTime) -Settings $settings -Description "Dayarc morning brief"
Register-ScheduledTask -TaskName "Dayarc-PM" -Action (New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoProfile -File `"$script`" -trigger pm") -Trigger (New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday,Tuesday,Wednesday,Thursday,Friday -At $pmTime) -Settings $settings -Description "Dayarc evening brief"
Read am_time and pm_time from the matching entry (default: 08:00 / 20:00).
If no entry matches this machine, skip this step.
Note: The scheduler.ps1 script auto-detects the correct agent name at runtime (dayarc:dayarc for plugin, dayarc for user-level). Re-registering the scheduler after a migration from user-level to plugin (or vice versa) is sufficient — no manual agent name changes needed.
Report the new version (latest tag or commit short hash).
When upgrading from a user-level install (~/.dayarc-agent/ + ~/.copilot/skills/dayarc-*) to a plugin install:
dayarc to dayarc:dayarc.scheduler.ps1 script handles this automatically — it detects the install method at startup and uses the correct agent name.Remove-Item -Path (Join-Path $HOME ".copilot\agents\dayarc.agent.md") -ErrorAction SilentlyContinue
Get-ChildItem -Path (Join-Path $HOME ".copilot\skills") -Filter "dayarc-*" -Directory | Remove-Item -Recurse -Force
If the old ~/.dayarc-agent/ clone is no longer needed:
Remove-Item -Path (Join-Path $HOME ".dayarc-agent") -Recurse -Force
scheduler.ps1.git describe --tags --always in ~/.dayarc-agent/.copilot plugin list or read plugin.json version field.