summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Vincent <jesse@fsck.com>2025-10-28 02:27:32 +0000
committerJesse Vincent <jesse@fsck.com>2025-10-28 02:27:32 +0000
commit22f57e7cb0f1928d0e76fa03026e6efffaeefea3 (patch)
tree7f00b6ea0e463622ddd76146264fee0f4c0c1b7b
parentda9f4f1eddc741cce4c5b4864342e9068caec211 (diff)
Improve README and add update checking to bootstrap
- Make README more egalitarian: 'AI coding assistants' vs 'Claude Code' - Reorganize installation: 'Claude Code (via Plugin Marketplace)' and 'Codex (Experimental)' - Add update checking to bootstrap with 3-second timeout protection - Bootstrap now checks if local installation is behind GitHub and suggests 'git pull' - Network failures or timeouts don't block bootstrap (graceful fallback)
-rwxr-xr-x.codex/superpowers-codex37
-rw-r--r--README.md6
2 files changed, 40 insertions, 3 deletions
diff --git a/.codex/superpowers-codex b/.codex/superpowers-codex
index 9ecc1fd..0066977 100755
--- a/.codex/superpowers-codex
+++ b/.codex/superpowers-codex
@@ -3,14 +3,40 @@
const fs = require('fs');
const path = require('path');
const os = require('os');
+const { execSync } = require('child_process');
// Paths
const homeDir = os.homedir();
const superpowersSkillsDir = path.join(homeDir, '.codex', 'superpowers', 'skills');
const personalSkillsDir = path.join(homeDir, '.codex', 'skills');
const bootstrapFile = path.join(homeDir, '.codex', 'superpowers', '.codex', 'superpowers-bootstrap.md');
+const superpowersRepoDir = path.join(homeDir, '.codex', 'superpowers');
// Utility functions
+function checkForUpdates() {
+ try {
+ // Quick check with 3 second timeout to avoid delays if network is down
+ const output = execSync('git fetch origin && git status --porcelain=v1 --branch', {
+ cwd: superpowersRepoDir,
+ timeout: 3000,
+ encoding: 'utf8',
+ stdio: 'pipe'
+ });
+
+ // Parse git status output to see if we're behind
+ const statusLines = output.split('\n');
+ for (const line of statusLines) {
+ if (line.startsWith('## ') && line.includes('[behind ')) {
+ return true; // We're behind remote
+ }
+ }
+ return false; // Up to date
+ } catch (error) {
+ // Network down, git error, timeout, etc. - don't block bootstrap
+ return false;
+ }
+}
+
function extractFrontmatter(filePath) {
try {
const content = fs.readFileSync(filePath, 'utf8');
@@ -144,6 +170,17 @@ function runBootstrap() {
console.log('# ================================');
console.log('');
+ // Check for updates (with timeout protection)
+ if (checkForUpdates()) {
+ console.log('## Update Available');
+ console.log('');
+ console.log('⚠️ Your superpowers installation is behind the latest version.');
+ console.log('To update, run: `cd ~/.codex/superpowers && git pull`');
+ console.log('');
+ console.log('---');
+ console.log('');
+ }
+
// Show the bootstrap instructions
if (fs.existsSync(bootstrapFile)) {
console.log('## Bootstrap Instructions:');
diff --git a/README.md b/README.md
index 2a61463..6776255 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Superpowers
-Give Claude Code superpowers with a comprehensive skills library of proven techniques, patterns, and workflows.
+A comprehensive skills library of proven techniques, patterns, and workflows for AI coding assistants.
## What You Get
@@ -21,7 +21,7 @@ Read the introduction: [Superpowers for Claude Code](https://blog.fsck.com/2025/
## Installation
-### Via Plugin Marketplace (Recommended)
+### Claude Code (via Plugin Marketplace)
```bash
# In Claude Code
@@ -41,7 +41,7 @@ Read the introduction: [Superpowers for Claude Code](https://blog.fsck.com/2025/
# /superpowers:execute-plan - Execute plan in batches
```
-### Codex Installation (Experimental)
+### Codex (Experimental)
**Note:** Codex support is experimental and may require refinement based on user feedback.