-
Notifications
You must be signed in to change notification settings - Fork 0
Install fstack skills for Cursor cloud sessions #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "install": "sh scripts/install-cursor-cloud-skills.sh" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-build |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-check |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-counselors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-design |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-document |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-interview |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-learn |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-nail |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-plan |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-push |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-roast |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-run |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../skills/fstack-simplify |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/bin/sh | ||
| # Install fstack skills into the Cursor Cloud Agent home path so they persist | ||
| # across cloud sessions that reuse this environment. | ||
| # | ||
| # Idempotent: safe to re-run from .cursor/environment.json install. | ||
| # Canonical skills stay in skills/; this only copies into ~/.cursor/skills. | ||
|
|
||
| set -eu | ||
|
|
||
| root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd) | ||
| src="$root/skills" | ||
| dest="${CURSOR_CLOUD_SKILLS_HOME:-${HOME}/.cursor/skills}" | ||
|
|
||
| if [ ! -d "$src" ]; then | ||
| printf '%s\n' "ERROR: missing skills directory: $src" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| mkdir -p "$dest" | ||
|
|
||
| installed=0 | ||
| for skill_dir in "$src"/*/; do | ||
| [ -d "$skill_dir" ] || continue | ||
| name=$(basename "$skill_dir") | ||
| if [ ! -f "$skill_dir/SKILL.md" ]; then | ||
| printf '%s\n' "skip $name (no SKILL.md)" | ||
| continue | ||
| fi | ||
| rm -rf "$dest/$name" | ||
| cp -R "$skill_dir" "$dest/$name" | ||
| installed=$((installed + 1)) | ||
| printf '%s\n' "installed $name -> $dest/$name" | ||
| done | ||
|
|
||
| if [ "$installed" -eq 0 ]; then | ||
| printf '%s\n' 'ERROR: no skills installed.' >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| printf '%s\n' "Installed $installed Cursor cloud skill(s) into $dest." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,45 @@ while IFS= read -r file; do | |
| fi | ||
| done < "$files_file" | ||
|
|
||
| cursor_env="$root/.cursor/environment.json" | ||
| cursor_skills="$root/.cursor/skills" | ||
| install_script="$root/scripts/install-cursor-cloud-skills.sh" | ||
|
|
||
| if [ ! -f "$cursor_env" ]; then | ||
| printf 'ERROR: missing .cursor/environment.json for Cursor cloud skill install.\n' >&2 | ||
| failures=$((failures + 1)) | ||
| elif ! grep -Fq 'scripts/install-cursor-cloud-skills.sh' "$cursor_env"; then | ||
| printf 'ERROR: .cursor/environment.json must run scripts/install-cursor-cloud-skills.sh.\n' >&2 | ||
| failures=$((failures + 1)) | ||
| fi | ||
|
|
||
| if [ ! -f "$install_script" ]; then | ||
| printf 'ERROR: missing scripts/install-cursor-cloud-skills.sh.\n' >&2 | ||
| failures=$((failures + 1)) | ||
| fi | ||
|
|
||
| if [ ! -d "$cursor_skills" ]; then | ||
| printf 'ERROR: missing .cursor/skills for Cursor project discovery.\n' >&2 | ||
| failures=$((failures + 1)) | ||
| else | ||
| while IFS= read -r name; do | ||
| [ -n "$name" ] || continue | ||
| if [ ! -e "$cursor_skills/$name/SKILL.md" ]; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a link is accidentally aimed at another valid skill—for example, AGENTS.md reference: AGENTS.md:L56-L58 Useful? React with 👍 / 👎. |
||
| printf 'ERROR: .cursor/skills/%s does not resolve to SKILL.md.\n' "$name" >&2 | ||
| failures=$((failures + 1)) | ||
| fi | ||
| done < "$names_file" | ||
|
|
||
| for entry in "$cursor_skills"/*; do | ||
| [ -e "$entry" ] || continue | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a skill is removed or renamed but its checked-in Cursor link remains, the link becomes dangling, causing AGENTS.md reference: AGENTS.md:L55-L56 Useful? React with 👍 / 👎. |
||
| name=$(basename "$entry") | ||
| if [ ! -f "$root/skills/$name/SKILL.md" ]; then | ||
| printf 'ERROR: .cursor/skills/%s has no matching skills/%s.\n' "$name" "$name" >&2 | ||
| failures=$((failures + 1)) | ||
| fi | ||
| done | ||
| fi | ||
|
|
||
| if [ "$failures" -ne 0 ]; then | ||
| printf 'Validation failed: %s problem(s) across %s skill(s).\n' "$failures" "$count" >&2 | ||
| exit 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a reused cloud environment after a skill is removed or renamed, this loop visits only current source directories, so the previous copy remains under
~/.cursor/skillsand Cursor continues discovering retired instructions even though the refresh reports success. Track previously managed fstack names and remove obsolete ones without pruning unrelated personal skills.AGENTS.md reference: AGENTS.md:L55-L58
Useful? React with 👍 / 👎.