René's URL Explorer Experiment


Title: fix: squad.agent.md silently disappears after upgrade when template source is missing · Issue #730 · github/squad · GitHub

Open Graph Title: fix: squad.agent.md silently disappears after upgrade when template source is missing · Issue #730 · github/squad

X Title: fix: squad.agent.md silently disappears after upgrade when template source is missing · Issue #730 · github/squad

Description: Bug .github/agents/squad.agent.md can silently disappear or become empty after running squad upgrade or squad init. This happens because multiple code paths skip file creation without warning when the template source (squad.agent.md.temp...

Open Graph Description: Bug .github/agents/squad.agent.md can silently disappear or become empty after running squad upgrade or squad init. This happens because multiple code paths skip file creation without warning when ...

X Description: Bug .github/agents/squad.agent.md can silently disappear or become empty after running squad upgrade or squad init. This happens because multiple code paths skip file creation without warning when ...

Opengraph URL: https://github.com/github/squad/issues/730

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix: squad.agent.md silently disappears after upgrade when template source is missing","articleBody":"## Bug\n\n`.github/agents/squad.agent.md` can silently disappear or become empty after running `squad upgrade` or `squad init`. This happens because multiple code paths skip file creation without warning when the template source (`squad.agent.md.template`) is missing.\n\n## Root Causes (3 code paths)\n\n### 1. Silent skip in upgrade.ts (version-current path)\n**File:** `packages/squad-cli/src/cli/core/upgrade.ts` ~line 497-504\n\nWhen the CLI version is already current, the upgrade refreshes `squad.agent.md` — but if the template source doesn't exist, it silently skips with no warning:\n```typescript\nif (storage.existsSync(agentSrc)) {  // ← silently skips if missing!\n  storage.copySync(agentSrc, agentDest);\n  stampVersion(agentDest, cliVersion);\n}\n```\n\n### 2. Silent skip in SDK init.ts\n**File:** `packages/squad-sdk/src/config/init.ts` ~line 1032-1038\n\nSame pattern — no `else` clause when template is missing:\n```typescript\nif (templatesDir && storage.existsSync(join(templatesDir, 'squad.agent.md.template'))) {\n  // writes file\n}  // ← NO ELSE! File never created if template missing\n```\n\n### 3. No recovery from empty file state\n`doctor.ts` already detects empty `squad.agent.md` (test at line 271-280 confirms this is a known condition), but there's no automatic recovery path.\n\n## Expected Behavior\n\n- If the template source is missing during upgrade/init, **warn the user** instead of silently skipping\n- Post-upgrade validation should verify `squad.agent.md` is non-empty\n- `doctor` should offer a recovery action, not just a warning\n\n## Steps to Reproduce\n\n1. Install squad-cli\n2. Run `squad init` in a repo (creates `.github/agents/squad.agent.md`)\n3. Corrupt or remove the template source from the CLI's templates directory\n4. Run `squad upgrade`\n5. Observe: `squad.agent.md` is silently not refreshed (or remains empty)\n\n## Affected Files\n\n- `packages/squad-cli/src/cli/core/upgrade.ts`\n- `packages/squad-sdk/src/config/init.ts`\n- `packages/squad-cli/src/cli/commands/doctor.ts`","author":{"url":"https://github.com/diberry","@type":"Person","name":"diberry"},"datePublished":"2026-04-01T22:14:26Z","url":"https://github.com/github/squad/issues/730"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e0031543-491a-1724-4791-f8554a60c736
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC964:3A4875:1F33906:29864A3:6B017765
html-safe-nonce3428ccadaecb81a177d9b929c9e61bd6600390d22b9c1a3bb2ceb157952a8bf2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTY0OjNBNDg3NToxRjMzOTA2OjI5ODY0QTM6NkIwMTc3NjUiLCJ2aXNpdG9yX2lkIjoiNDI1OTk1MDE1ODg0ODAzMDU2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac069a7bcd0471c3590f94b39f1346385cc774118a46367c6855b7d41ceb6c4286
hovercard-subject-tagissue:4190202284
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/squad/730/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9332e3ae191f2272a31e31d36bd3eac2b4ac0709150b60bebc91b82cc6da53a2/github/squad/issues/730
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9332e3ae191f2272a31e31d36bd3eac2b4ac0709150b60bebc91b82cc6da53a2/github/squad/issues/730
og:image:altBug .github/agents/squad.agent.md can silently disappear or become empty after running squad upgrade or squad init. This happens because multiple code paths skip file creation without warning when ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamediberry
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/github/squad git https://github.com/github/squad.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id1151205052
octolytics-dimension-repository_nwogithub/squad
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1151205052
octolytics-dimension-repository_network_root_nwogithub/squad
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/github/squad/issues/730#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fsquad%2Fissues%2F730
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fsquad%2Fissues%2F730
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=github%2Fsquad
Reloadhttps://github.com/github/squad/issues/730
Reloadhttps://github.com/github/squad/issues/730
Reloadhttps://github.com/github/squad/issues/730
githubhttps://github.com/github
squadhttps://github.com/github/squad
Codehttps://github.com/github/squad
Issues108 (108)https://github.com/github/squad/issues
Pull requests26 (26)https://github.com/github/squad/pulls
Discussionshttps://github.com/github/squad/discussions
Actionshttps://github.com/github/squad/actions
Projectshttps://github.com/github/squad/projects
Security and qualityhttps://github.com/github/squad/security
Insightshttps://github.com/github/squad/insights
https://github.com/github/squad
New issuehttps://github.com/login?return_to=https://github.com/github/squad/issues/730
New issuehttps://github.com/login?return_to=https://github.com/github/squad/issues/730
#762https://github.com/github/squad/pull/762
fix: squad.agent.md silently disappears after upgrade when template source is missinghttps://github.com/github/squad/issues/730#top
#762https://github.com/github/squad/pull/762
bugSomething isn't workinghttps://github.com/github/squad/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/diberry
diberryhttps://github.com/diberry
on Apr 1, 2026https://github.com/github/squad/issues/730#issue-4190202284
diberryhttps://github.com/diberry
bugSomething isn't workinghttps://github.com/github/squad/issues?q=state%3Aopen%20label%3A%22bug%22
on Apr 1, 2026https://github.com/github/squad/issues/730#event-24128820684
diberryhttps://github.com/diberry
on Apr 1, 2026https://github.com/github/squad/issues/730#event-24129502724
test(#730): add failing tests for squad.agent.md silent deletion bugshttps://github.com/github/squad/commit/b46398ec12a9e42cd0d70393ca1f7f066f1bb598
#730https://github.com/github/squad/issues/730
b46398ehttps://github.com/github/squad/commit/b46398ec12a9e42cd0d70393ca1f7f066f1bb598
fix(#730): prevent squad.agent.md silent deletion — 3 code path fixeshttps://github.com/github/squad/commit/aa62be3f2f229e8f1440f0e37c12a52ed0f69995
#730https://github.com/github/squad/issues/730
aa62be3https://github.com/github/squad/commit/aa62be3f2f229e8f1440f0e37c12a52ed0f69995
docs: add CHANGELOG entry for #730 agent file resilience fixhttps://github.com/github/squad/commit/0f8a879e564f1ea8521de7125fe9d8bea95e67a7
#730https://github.com/github/squad/issues/730
0f8a879https://github.com/github/squad/commit/0f8a879e564f1ea8521de7125fe9d8bea95e67a7
fix(#730): prevent squad.agent.md silent deletionhttps://github.com/github/squad/commit/fa4cbba0f711dad8fd2adf5f5ab168e27a0a5ffe
#730https://github.com/github/squad/issues/730
fa4cbbahttps://github.com/github/squad/commit/fa4cbba0f711dad8fd2adf5f5ab168e27a0a5ffe
fix(#730): prevent squad.agent.md silent deletion — 3 code path fixeshttps://github.com/github/squad/commit/e78d78152207f737cd7a7568cfac0515d43e0b5e
#730https://github.com/github/squad/issues/730
e78d781https://github.com/github/squad/commit/e78d78152207f737cd7a7568cfac0515d43e0b5e
fix(#730): prevent squad.agent.md silent deletion — 3 code path fixeshttps://github.com/github/squad/commit/f0731d4ba86b5ff10cfe53c02ad1156dcdcbe977
#730https://github.com/github/squad/issues/730
f0731d4https://github.com/github/squad/commit/f0731d4ba86b5ff10cfe53c02ad1156dcdcbe977
fix(cli,sdk): warn when squad.agent.md template is missing during upg…https://github.com/github/squad/commit/e06d1d4235093abbd5ae61177129120d7cfcb19a
e06d1d4https://github.com/github/squad/commit/e06d1d4235093abbd5ae61177129120d7cfcb19a
fix(cli,sdk): warn when squad.agent.md template is missing during upg…https://github.com/github/squad/commit/ec9a1fb07f76ce3f05cabfde28a7af4d10544154
ec9a1fbhttps://github.com/github/squad/commit/ec9a1fb07f76ce3f05cabfde28a7af4d10544154
fix(cli,sdk): warn when squad.agent.md template is missing during upg…https://github.com/github/squad/commit/55d1cd09504825b7d20b0643957adeb5ac318d21
55d1cd0https://github.com/github/squad/commit/55d1cd09504825b7d20b0643957adeb5ac318d21
fix(cli,sdk): warn when squad.agent.md template is missing during upg…https://github.com/github/squad/commit/655b4839c7898b30b2b6d03a1995dcd39fd7df0c
655b483https://github.com/github/squad/commit/655b4839c7898b30b2b6d03a1995dcd39fd7df0c
fix(cli,sdk): warn when squad.agent.md template is missing during upg…https://github.com/github/squad/commit/27f07cf6e6cfb978d789a8da9e90951247fe98c1
27f07cfhttps://github.com/github/squad/commit/27f07cf6e6cfb978d789a8da9e90951247fe98c1
diberryhttps://github.com/diberry
completedhttps://github.com/github/squad/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#762https://github.com/github/squad/pull/762
on Apr 3, 2026https://github.com/github/squad/issues/730#event-24176956395
diberryhttps://github.com/diberry
on Apr 3, 2026https://github.com/github/squad/issues/730#event-24186565390
fix(cli,sdk): warn when squad.agent.md template is missing during upg…https://github.com/github/squad/commit/85f7ff62a32be3787bd905dadcaeb02d462901ed
https://docs.github.com/articles/closing-issues-via-commit-messages
85f7ff6https://github.com/github/squad/commit/85f7ff62a32be3787bd905dadcaeb02d462901ed
Sign up for freehttps://github.com/signup?return_to=https://github.com/github/squad/issues/730
Sign in to commenthttps://github.com/login?return_to=https://github.com/github/squad/issues/730
bugSomething isn't workinghttps://github.com/github/squad/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.