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
24 changes: 24 additions & 0 deletions .agents/skills/source-command-gsd-join-discord/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: "source-command-gsd-join-discord"
description: "Join the GSD Discord community"
---

# source-command-gsd-join-discord

Use this skill when the user asks to run the migrated source command `gsd-join-discord`.

## Command Template

<objective>
Display the Discord invite link for the GSD community server.
</objective>

<output>
# Join the GSD Discord

Connect with other GSD users, get help, share what you're building, and stay updated.

**Invite link:** https://discord.gg/gsd

Click the link or paste it into your browser to join.
</output>
121 changes: 121 additions & 0 deletions .agents/skills/source-command-gsd-reapply-patches/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
name: "source-command-gsd-reapply-patches"
description: "Reapply local modifications after a GSD update"
---

# source-command-gsd-reapply-patches

Use this skill when the user asks to run the migrated source command `gsd-reapply-patches`.

## Command Template

<purpose>
After a GSD update wipes and reinstalls files, this command merges user's previously saved local modifications back into the new version. Uses intelligent comparison to handle cases where the upstream file also changed.
</purpose>

<process>

## Step 1: Detect backed-up patches

Check for local patches directory:

```bash
# Global install (path templated at install time)
PATCHES_DIR=./.Codex/gsd-local-patches
# Local install fallback
if [ ! -d "$PATCHES_DIR" ]; then
PATCHES_DIR=./.Codex/gsd-local-patches
fi
```

Read `backup-meta.json` from the patches directory.

**If no patches found:**

```
No local patches found. Nothing to reapply.

Local patches are automatically saved when you run /gsd:update
after modifying any GSD workflow, command, or agent files.
```

Exit.

## Step 2: Show patch summary

```
## Local Patches to Reapply

**Backed up from:** v{from_version}
**Current version:** {read VERSION file}
**Files modified:** {count}

| # | File | Status |
|---|------|--------|
| 1 | {file_path} | Pending |
| 2 | {file_path} | Pending |
```

## Step 3: Merge each file

For each file in `backup-meta.json`:

1. **Read the backed-up version** (user's modified copy from `gsd-local-patches/`)
2. **Read the newly installed version** (current file after update)
3. **Compare and merge:**

- If the new file is identical to the backed-up file: skip (modification was incorporated upstream)
- If the new file differs: identify the user's modifications and apply them to the new version

**Merge strategy:**

- Read both versions fully
- Identify sections the user added or modified (look for additions, not just differences from path replacement)
- Apply user's additions/modifications to the new version
- If a section the user modified was also changed upstream: flag as conflict, show both versions, ask user which to keep

4. **Write merged result** to the installed location
5. **Report status:**
- `Merged` — user modifications applied cleanly
- `Skipped` — modification already in upstream
- `Conflict` — user chose resolution

## Step 4: Update manifest

After reapplying, regenerate the file manifest so future updates correctly detect these as user modifications:

```bash
# The manifest will be regenerated on next /gsd:update
# For now, just note which files were modified
```

## Step 5: Cleanup option

Ask user:

- "Keep patch backups for reference?" → preserve `gsd-local-patches/`
- "Clean up patch backups?" → remove `gsd-local-patches/` directory

## Step 6: Report

```
## Patches Reapplied

| # | File | Status |
|---|------|--------|
| 1 | {file_path} | ✓ Merged |
| 2 | {file_path} | ○ Skipped (already upstream) |
| 3 | {file_path} | ⚠ Conflict resolved |

{count} file(s) updated. Your local modifications are active again.
```

</process>

<success_criteria>

- [ ] All backed-up patches processed
- [ ] User modifications merged into new version
- [ ] Conflicts resolved with user input
- [ ] Status reported for each file
</success_criteria>
Loading
Loading