-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·153 lines (132 loc) · 6.45 KB
/
install.sh
File metadata and controls
executable file
·153 lines (132 loc) · 6.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/env bash
# Agent-Litmus Installer
# "The test your tests have to pass."
#
# Usage: curl -fsSL https://raw.githubusercontent.com/saisumantatgit/Agent-Litmus/main/install.sh | bash
set -euo pipefail
REPO="saisumantatgit/Agent-Litmus"
BRANCH="main"
RAW_BASE="https://raw.githubusercontent.com/${REPO}/${BRANCH}"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'
echo -e "${CYAN}"
echo ' ╔═══════════════════════════════════════════╗'
echo ' ║ Agent-Litmus Installer ║'
echo ' ║ "The test your tests have to pass." ║'
echo ' ╚═══════════════════════════════════════════╝'
echo -e "${NC}"
# ─── Detect CLI ─────────────────────────────────────────────────────
detect_cli() {
if command -v claude &>/dev/null; then
echo "claude-code"
elif command -v cursor &>/dev/null || [ -d ".cursor" ]; then
echo "cursor"
elif command -v codex &>/dev/null; then
echo "codex"
elif command -v aider &>/dev/null; then
echo "aider"
else
echo "generic"
fi
}
CLI=$(detect_cli)
echo -e "${GREEN}Detected CLI:${NC} ${CLI}"
# ─── Create directories ─────────────────────────────────────────────
echo -e "${YELLOW}Creating directories...${NC}"
mkdir -p .claude/skills/test-audit
mkdir -p .claude/skills/edge-analysis
mkdir -p .claude/skills/strength-analysis
mkdir -p .claude/skills/test-fix
mkdir -p .claude/skills/test-report
mkdir -p .claude/commands
mkdir -p .claude/agents
# ─── Download core files ─────────────────────────────────────────────
download() {
local src="$1"
local dst="$2"
echo -e " ${CYAN}Downloading${NC} ${dst}"
curl -fsSL "${RAW_BASE}/${src}" -o "${dst}" 2>/dev/null || {
echo -e " ${RED}Failed:${NC} ${src}"
return 1
}
}
echo -e "${YELLOW}Downloading skills...${NC}"
download ".claude/skills/test-audit/SKILL.md" ".claude/skills/test-audit/SKILL.md"
download ".claude/skills/edge-analysis/SKILL.md" ".claude/skills/edge-analysis/SKILL.md"
download ".claude/skills/strength-analysis/SKILL.md" ".claude/skills/strength-analysis/SKILL.md"
download ".claude/skills/test-fix/SKILL.md" ".claude/skills/test-fix/SKILL.md"
download ".claude/skills/test-report/SKILL.md" ".claude/skills/test-report/SKILL.md"
echo -e "${YELLOW}Downloading commands...${NC}"
download ".claude/commands/litmus-scan.md" ".claude/commands/litmus-scan.md"
download ".claude/commands/litmus-edge.md" ".claude/commands/litmus-edge.md"
download ".claude/commands/litmus-strength.md" ".claude/commands/litmus-strength.md"
download ".claude/commands/litmus-fix.md" ".claude/commands/litmus-fix.md"
download ".claude/commands/litmus-report.md" ".claude/commands/litmus-report.md"
echo -e "${YELLOW}Downloading agents...${NC}"
download ".claude/agents/assertion-analyzer.md" ".claude/agents/assertion-analyzer.md"
download ".claude/agents/edge-detector.md" ".claude/agents/edge-detector.md"
download ".claude/agents/mutation-reasoner.md" ".claude/agents/mutation-reasoner.md"
download ".claude/agents/test-improver.md" ".claude/agents/test-improver.md"
download ".claude/agents/quality-aggregator.md" ".claude/agents/quality-aggregator.md"
echo -e "${YELLOW}Downloading references...${NC}"
mkdir -p references
download "references/violation-types.md" "references/violation-types.md"
download "references/assertion-classification.md" "references/assertion-classification.md"
download "references/edge-case-taxonomy.md" "references/edge-case-taxonomy.md"
echo -e "${YELLOW}Downloading template...${NC}"
mkdir -p templates
download "templates/litmus-protocol.yaml" "templates/litmus-protocol.yaml"
# ─── CLI-specific setup ─────────────────────────────────────────────
case "$CLI" in
claude-code)
echo -e "${YELLOW}Setting up Claude Code plugin...${NC}"
mkdir -p .claude-plugin
download ".claude-plugin/plugin.json" ".claude-plugin/plugin.json"
download ".claude-plugin/hooks.json" ".claude-plugin/hooks.json"
;;
cursor)
echo -e "${YELLOW}Setting up Cursor rules...${NC}"
mkdir -p .cursor/rules
download "adapters/cursor/.cursor/rules/litmus.md" ".cursor/rules/litmus.md"
;;
codex)
echo -e "${YELLOW}Setting up Codex agent...${NC}"
download "adapters/codex/AGENTS.md" "AGENTS.md"
;;
aider)
echo -e "${YELLOW}Setting up Aider config...${NC}"
if [ -f ".aider.conf.yml" ]; then
echo -e " ${YELLOW}Warning:${NC} .aider.conf.yml exists. Saving Litmus config as .aider.litmus.yml"
download "adapters/aider/.aider.conf.yml" ".aider.litmus.yml"
else
download "adapters/aider/.aider.conf.yml" ".aider.conf.yml"
fi
;;
generic)
echo -e "${YELLOW}Setting up generic adapter...${NC}"
mkdir -p prompts
download "prompts/litmus-scan.md" "prompts/litmus-scan.md"
download "prompts/litmus-edge.md" "prompts/litmus-edge.md"
download "prompts/litmus-strength.md" "prompts/litmus-strength.md"
download "prompts/litmus-fix.md" "prompts/litmus-fix.md"
download "prompts/litmus-report.md" "prompts/litmus-report.md"
;;
esac
# ─── Done ────────────────────────────────────────────────────────────
echo ""
echo -e "${GREEN}Agent-Litmus installed successfully.${NC}"
echo ""
echo -e " Commands available:"
echo -e " ${CYAN}/litmus-scan${NC} Scan a test file for 12 violation types"
echo -e " ${CYAN}/litmus-edge${NC} Identify edge cases and check coverage"
echo -e " ${CYAN}/litmus-strength${NC} Thought-experiment mutation testing"
echo -e " ${CYAN}/litmus-fix${NC} Generate improved test code"
echo -e " ${CYAN}/litmus-report${NC} Project-wide Test Quality Score"
echo ""
echo -e " Quick start:"
echo -e " ${YELLOW}/litmus-scan path/to/your.test.ts${NC}"
echo ""