An agentic skills framework & software development methodology that works.
fix: address code review issues in opencode support branch
Claude6ecd72c5bfb8
diff --git a/.codex/superpowers-codex b/.codex/superpowers-codexindex 970050c39..fe587fb7d 100755--- a/.codex/superpowers-codex+++ b/.codex/superpowers-codex@@ -207,34 +207,12 @@ function runUseSkill(skillName) {return;}- // Extract frontmatter and content+ // Extract frontmatter and content using shared core functionslet content, frontmatter;try {const fullContent = fs.readFileSync(skillFile, 'utf8');const { name, description } = skillsCore.extractFrontmatter(skillFile);-- // Extract just the content after frontmatter- const lines = fullContent.split('\n');- let inFrontmatter = false;- let frontmatterEnded = false;- const contentLines = [];-- for (const line of lines) {- if (line.trim() === '---') {- if (inFrontmatter) {- frontmatterEnded = true;- continue;- }- inFrontmatter = true;- continue;- }-- if (frontmatterEnded || !inFrontmatter) {- contentLines.push(line);- }- }-- content = contentLines.join('\n').trim();+ content = skillsCore.stripFrontmatter(fullContent);frontmatter = { name, description };} catch (error) {console.log(`Error reading skill file: ${error.message}`);diff --git a/.opencode/plugin/superpowers.js b/.opencode/plugin/superpowers.jsindex 79ceccfec..784c151cb 100644--- a/.opencode/plugin/superpowers.js+++ b/.opencode/plugin/superpowers.js@@ -17,10 +17,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));export const SuperpowersPlugin = async ({ project, client, $, directory, worktree }) => {const homeDir = os.homedir();const projectSkillsDir = path.join(directory, '.opencode/skills');- const superpowersSkillsDir = path.join(homeDir, '.config/opencode/superpowers/skills');+ // Derive superpowers skills dir from plugin location (works for both symlinked and local installs)+ const superpowersSkillsDir = path.resolve(__dirname, '../../skills');const personalSkillsDir = path.join(homeDir, '.config/opencode/skills');- const promptsDir = path.join(homeDir, '.config/opencode/prompts');- const promptFile = path.join(promptsDir, 'superpowers.txt');return {tool: {diff --git a/tests/opencode/run-tests.sh b/tests/opencode/run-tests.shindex 3ccd93d36..28538bb2d 100755--- a/tests/opencode/run-tests.sh+++ b/tests/opencode/run-tests.sh@@ -94,7 +94,7 @@ for test in "${tests[@]}"; doif [ ! -f "$test_path" ]; thenecho " [SKIP] Test file not found: $test"- ((skipped++))+ skipped=$((skipped + 1))continuefi@@ -111,13 +111,13 @@ for test in "${tests[@]}"; doduration=$((end_time - start_time))echo ""echo " [PASS] $test (${duration}s)"- ((passed++))+ passed=$((passed + 1))elseend_time=$(date +%s)duration=$((end_time - start_time))echo ""echo " [FAIL] $test (${duration}s)"- ((failed++))+ failed=$((failed + 1))fielse# Capture output for non-verbose mode@@ -125,7 +125,7 @@ for test in "${tests[@]}"; doend_time=$(date +%s)duration=$((end_time - start_time))echo " [PASS] (${duration}s)"- ((passed++))+ passed=$((passed + 1))elseend_time=$(date +%s)duration=$((end_time - start_time))@@ -133,7 +133,7 @@ for test in "${tests[@]}"; doecho ""echo " Output:"echo "$output" | sed 's/^/ /'- ((failed++))+ failed=$((failed + 1))fifidiff --git a/tests/opencode/test-skills-core.sh b/tests/opencode/test-skills-core.shindex 40f2bf61e..223f9edd1 100755--- a/tests/opencode/test-skills-core.sh+++ b/tests/opencode/test-skills-core.sh@@ -30,17 +30,8 @@ description: A test skill for unit testingThis is the content.EOF-# Run Node.js test-result=$(node --input-type=module <<'NODESCRIPT'-import { extractFrontmatter } from '$HOME/.config/opencode/superpowers/lib/skills-core.js';-const result = extractFrontmatter(process.env.TEST_HOME + '/test-skill/SKILL.md');-console.log(JSON.stringify(result));-NODESCRIPT-) 2>&1 || true--# Try alternative approach if module import fails-if ! echo "$result" | grep -q "test-skill"; then- result=$(node -e "+# Run Node.js test using inline function (avoids ESM path resolution issues in test env)+result=$(node -e "const path = require('path');const fs = require('fs');@@ -76,7 +67,6 @@ function extractFrontmatter(filePath) {const result = extractFrontmatter('$TEST_HOME/test-skill/SKILL.md');console.log(JSON.stringify(result));" 2>&1)-fiif echo "$result" | grep -q '"name":"test-skill"'; thenecho " [PASS] extractFrontmatter parses name correctly"