Skip to content

Commit 4f36be6

Browse files
committed
Refactor for more plugins in same marketplace
1 parent c020324 commit 4f36be6

2 files changed

Lines changed: 73 additions & 50 deletions

File tree

test/plugin-structure-test.sh

Lines changed: 71 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# plugin-structure-test.sh - Essential structural validation for Claude Code plugin
5-
# Tests only critical requirements: manifest valid, required files exist, scripts executable
4+
# plugin-structure-test.sh - Essential structural validation for multi-plugin marketplace
5+
# Tests marketplace manifest and all 3 plugins (stepwise-core, stepwise-git, stepwise-web)
66

77
# Get script directory
88
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -13,89 +13,112 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
1313
source "$SCRIPT_DIR/test-helpers.sh"
1414

1515
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
16-
echo "🔍 Plugin Structure Tests (Essential Only)"
16+
echo "🔍 Multi-Plugin Marketplace Structure Tests"
1717
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
1818
echo "Project root: $PROJECT_ROOT"
1919
echo ""
2020

2121
cd "$PROJECT_ROOT"
2222

2323
# ============================================================================
24-
# Test 1: Plugin manifest is valid JSON
24+
# Test 1: Marketplace manifest is valid
2525
# ============================================================================
26-
section "Test 1: Plugin manifest"
26+
section "Test 1: Marketplace manifest"
2727

28-
assert_file_exists ".claude-plugin/plugin.json" "plugin.json exists"
28+
assert_file_exists ".claude-plugin/marketplace.json" "marketplace.json exists"
2929

3030
if command -v jq >/dev/null 2>&1; then
31-
if jq empty .claude-plugin/plugin.json 2>/dev/null; then
31+
if jq empty .claude-plugin/marketplace.json 2>/dev/null; then
3232
TESTS_RUN=$((TESTS_RUN + 1))
3333
TESTS_PASSED=$((TESTS_PASSED + 1))
34-
echo -e "${GREEN}${NC} plugin.json is valid JSON"
34+
echo -e "${GREEN}${NC} marketplace.json is valid JSON"
3535
else
3636
TESTS_RUN=$((TESTS_RUN + 1))
3737
TESTS_FAILED=$((TESTS_FAILED + 1))
38-
echo -e "${RED}${NC} plugin.json is invalid JSON"
38+
echo -e "${RED}${NC} marketplace.json is invalid JSON"
3939
fi
4040

41-
NAME=$(jq -r '.name // empty' .claude-plugin/plugin.json)
42-
assert_not_empty "$NAME" "plugin.json has name field"
41+
NAME=$(jq -r '.name // empty' .claude-plugin/marketplace.json)
42+
assert_not_empty "$NAME" "marketplace.json has name field"
43+
44+
OWNER_NAME=$(jq -r '.owner.name // empty' .claude-plugin/marketplace.json)
45+
assert_not_empty "$OWNER_NAME" "marketplace.json has owner.name field"
46+
47+
PLUGINS_COUNT=$(jq '.plugins | length' .claude-plugin/marketplace.json)
48+
if [ "$PLUGINS_COUNT" -eq 3 ]; then
49+
TESTS_RUN=$((TESTS_RUN + 1))
50+
TESTS_PASSED=$((TESTS_PASSED + 1))
51+
echo -e "${GREEN}${NC} marketplace.json has 3 plugins"
52+
else
53+
TESTS_RUN=$((TESTS_RUN + 1))
54+
TESTS_FAILED=$((TESTS_FAILED + 1))
55+
echo -e "${RED}${NC} marketplace.json should have 3 plugins, has $PLUGINS_COUNT"
56+
fi
4357
fi
4458

4559
# ============================================================================
46-
# Test 2: All required files exist
60+
# Test 2: Core plugin structure (stepwise-core)
4761
# ============================================================================
48-
section "Test 2: Required files"
62+
section "Test 2: stepwise-core plugin"
63+
64+
assert_file_exists "core/.claude-plugin/plugin.json" "core/plugin.json exists"
65+
assert_file_exists "core/README.md" "core/README.md exists"
4966

5067
# Commands
51-
assert_file_exists "commands/research_codebase.md" "research_codebase command"
52-
assert_file_exists "commands/create_plan.md" "create_plan command"
53-
assert_file_exists "commands/iterate_plan.md" "iterate_plan command"
54-
assert_file_exists "commands/implement_plan.md" "implement_plan command"
55-
assert_file_exists "commands/validate_plan.md" "validate_plan command"
56-
assert_file_exists "commands/commit.md" "commit command"
68+
assert_file_exists "core/commands/research_codebase.md" "research_codebase command"
69+
assert_file_exists "core/commands/create_plan.md" "create_plan command"
70+
assert_file_exists "core/commands/iterate_plan.md" "iterate_plan command"
71+
assert_file_exists "core/commands/implement_plan.md" "implement_plan command"
72+
assert_file_exists "core/commands/validate_plan.md" "validate_plan command"
5773

5874
# Agents
59-
assert_file_exists "agents/codebase-locator.md" "codebase-locator agent"
60-
assert_file_exists "agents/codebase-analyzer.md" "codebase-analyzer agent"
61-
assert_file_exists "agents/codebase-pattern-finder.md" "codebase-pattern-finder agent"
62-
assert_file_exists "agents/thoughts-locator.md" "thoughts-locator agent"
63-
assert_file_exists "agents/thoughts-analyzer.md" "thoughts-analyzer agent"
64-
65-
# Documentation
66-
assert_file_exists "README.md" "README.md"
67-
assert_file_exists "CLAUDE.md" "CLAUDE.md"
75+
assert_file_exists "core/agents/codebase-locator.md" "codebase-locator agent"
76+
assert_file_exists "core/agents/codebase-analyzer.md" "codebase-analyzer agent"
77+
assert_file_exists "core/agents/codebase-pattern-finder.md" "codebase-pattern-finder agent"
78+
assert_file_exists "core/agents/thoughts-locator.md" "thoughts-locator agent"
79+
assert_file_exists "core/agents/thoughts-analyzer.md" "thoughts-analyzer agent"
80+
81+
# Skill structure
82+
assert_dir_exists "core/skills/thoughts-management" "Skill directory exists"
83+
assert_dir_exists "core/skills/thoughts-management/scripts" "scripts directory exists"
84+
assert_file_exists "core/skills/thoughts-management/SKILL.md" "SKILL.md exists"
85+
assert_contains "core/skills/thoughts-management/SKILL.md" "name: thoughts-management" "SKILL.md has name"
86+
87+
# Scripts are executable
88+
assert_file_exists "core/skills/thoughts-management/scripts/thoughts-init" "thoughts-init exists"
89+
assert_executable "core/skills/thoughts-management/scripts/thoughts-init" "thoughts-init is executable"
90+
assert_file_exists "core/skills/thoughts-management/scripts/thoughts-sync" "thoughts-sync exists"
91+
assert_executable "core/skills/thoughts-management/scripts/thoughts-sync" "thoughts-sync is executable"
92+
assert_file_exists "core/skills/thoughts-management/scripts/thoughts-metadata" "thoughts-metadata exists"
93+
assert_executable "core/skills/thoughts-management/scripts/thoughts-metadata" "thoughts-metadata is executable"
6894

6995
# ============================================================================
70-
# Test 3: Skill structure (core functionality)
96+
# Test 3: Git plugin structure (stepwise-git)
7197
# ============================================================================
72-
section "Test 3: Skill structure"
73-
74-
# Directory structure
75-
assert_dir_exists "skills/thoughts-management" "Skill directory exists"
76-
assert_dir_exists "skills/thoughts-management/scripts" "scripts directory exists"
98+
section "Test 3: stepwise-git plugin"
7799

78-
# SKILL.md with valid content
79-
assert_file_exists "skills/thoughts-management/SKILL.md" "SKILL.md exists"
80-
assert_contains "skills/thoughts-management/SKILL.md" "name: thoughts-management" "SKILL.md has name"
100+
assert_file_exists "git/.claude-plugin/plugin.json" "git/plugin.json exists"
101+
assert_file_exists "git/README.md" "git/README.md exists"
102+
assert_file_exists "git/commands/commit.md" "commit command exists"
81103

82-
# All three required scripts exist and are executable
83-
assert_file_exists "skills/thoughts-management/scripts/thoughts-init" "thoughts-init exists"
84-
assert_executable "skills/thoughts-management/scripts/thoughts-init" "thoughts-init is executable"
85-
86-
assert_file_exists "skills/thoughts-management/scripts/thoughts-sync" "thoughts-sync exists"
87-
assert_executable "skills/thoughts-management/scripts/thoughts-sync" "thoughts-sync is executable"
104+
# ============================================================================
105+
# Test 4: Web plugin structure (stepwise-web)
106+
# ============================================================================
107+
section "Test 4: stepwise-web plugin"
88108

89-
assert_file_exists "skills/thoughts-management/scripts/thoughts-metadata" "thoughts-metadata exists"
90-
assert_executable "skills/thoughts-management/scripts/thoughts-metadata" "thoughts-metadata is executable"
109+
assert_file_exists "web/.claude-plugin/plugin.json" "web/plugin.json exists"
110+
assert_file_exists "web/README.md" "web/README.md exists"
111+
assert_file_exists "web/agents/web-search-researcher.md" "web-search-researcher agent exists"
91112

92113
# ============================================================================
93-
# Test 4: Critical content validation
114+
# Test 5: Root documentation
94115
# ============================================================================
95-
section "Test 4: Critical content"
116+
section "Test 5: Root documentation"
96117

97-
assert_contains "README.md" "stepwise-dev" "README documents plugin"
118+
assert_file_exists "README.md" "README.md exists"
119+
assert_file_exists "CLAUDE.md" "CLAUDE.md exists"
98120
assert_file_exists ".gitignore" ".gitignore exists"
121+
assert_contains "README.md" "stepwise-dev" "README documents marketplace"
99122

100123
# ============================================================================
101124
# Summary

test/thoughts-structure-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━
2323
echo "Test directory: $TEST_DIR"
2424
echo ""
2525

26-
# Use scripts from the Skill directory
27-
SCRIPTS_DIR="$PROJECT_ROOT/skills/thoughts-management/scripts"
26+
# Use scripts from the Skill directory (in core plugin)
27+
SCRIPTS_DIR="$PROJECT_ROOT/core/skills/thoughts-management/scripts"
2828
export PATH="$SCRIPTS_DIR:$PATH"
2929

3030
# ============================================================================

0 commit comments

Comments
 (0)