-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·183 lines (157 loc) · 5.3 KB
/
install.sh
File metadata and controls
executable file
·183 lines (157 loc) · 5.3 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/bin/bash
# Bug Shepherd Installer
# Copies commands, agents, and templates to your project's .claude/ directory.
set -e
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
BOLD='\033[1m'
echo ""
echo -e "${BOLD}Bug Shepherd${NC} — Zero-code bug triage for PMs"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
# Determine script directory (where bug-shepherd was cloned/downloaded)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Determine target project directory
if [ -n "$1" ]; then
TARGET_DIR="$1"
else
TARGET_DIR="$(pwd)"
fi
echo -e "Installing to: ${BLUE}${TARGET_DIR}${NC}"
echo ""
# Check if .claude directory exists
if [ ! -d "${TARGET_DIR}/.claude" ]; then
echo -e "${YELLOW}No .claude/ directory found. Creating it.${NC}"
mkdir -p "${TARGET_DIR}/.claude"
fi
# Create subdirectories
mkdir -p "${TARGET_DIR}/.claude/commands"
mkdir -p "${TARGET_DIR}/.claude/agents"
mkdir -p "${TARGET_DIR}/.claude/adapters"
# Step 1: Ask for tracker
echo -e "${BOLD}Step 1: Bug Tracker${NC}"
echo "Which bug tracker do you use?"
echo " 1) Jira"
echo " 2) Linear"
echo " 3) GitHub Issues"
echo ""
read -p "Enter choice (1-3): " tracker_choice
case $tracker_choice in
1) TRACKER="jira" ;;
2) TRACKER="linear" ;;
3) TRACKER="github-issues" ;;
*) echo -e "${RED}Invalid choice. Defaulting to Jira.${NC}"; TRACKER="jira" ;;
esac
echo ""
# Step 2: Project details
echo -e "${BOLD}Step 2: Project Details${NC}"
read -p "Project name (display name): " PROJECT_NAME
read -p "Tracker project key (e.g., PROJ, owner/repo): " TRACKER_PROJECT
read -p "Live site URL (where bugs are reproduced): " LIVE_URL
echo ""
# Step 3: Team details (optional)
echo -e "${BOLD}Step 3: Team Details${NC} (press Enter to skip)"
read -p "Git email for commits: " GIT_EMAIL
read -p "Your tracker user ID: " ASSIGNEE_ID
echo ""
# Step 4: Copy files
echo -e "${BOLD}Step 4: Installing files${NC}"
echo ""
# Commands
echo -n " Commands... "
cp "${SCRIPT_DIR}/commands/"*.md "${TARGET_DIR}/.claude/commands/"
echo -e "${GREEN}done${NC} (5 commands)"
# Agent
echo -n " Agent... "
cp "${SCRIPT_DIR}/agents/"*.md "${TARGET_DIR}/.claude/agents/"
echo -e "${GREEN}done${NC} (1 agent)"
# Adapter
echo -n " Adapter... "
cp "${SCRIPT_DIR}/adapters/${TRACKER}.md" "${TARGET_DIR}/.claude/adapters/"
echo -e "${GREEN}done${NC} (${TRACKER})"
# Templates (only if they don't already exist)
echo -n " Templates... "
for template in learning-log.md quality-gate.md backlog-live.md; do
if [ ! -f "${TARGET_DIR}/.claude/${template}" ]; then
cp "${SCRIPT_DIR}/templates/${template}" "${TARGET_DIR}/.claude/"
else
echo -ne "${YELLOW}(${template} exists, skipping)${NC} "
fi
done
echo -e "${GREEN}done${NC}"
# Generate config
echo -n " Configuration... "
cat > "${TARGET_DIR}/.claude/triage.config.yaml" << EOF
# Bug Shepherd Configuration
# Generated by installer on $(date -u +"%Y-%m-%dT%H:%M:%SZ")
project:
name: "${PROJECT_NAME}"
tracker: "${TRACKER}"
tracker_project: "${TRACKER_PROJECT}"
live_url: "${LIVE_URL}"
locales: []
reproduction:
tool: "playwright"
viewports: [1440, 820, 375]
timeout_per_bug: 30
parallel_agents: 5
bugs_per_agent: 6
safety:
never_auto_cancel:
- "scroll behavior"
- "touch interaction"
- "animation"
- "viewport-dependent"
auto_cancel_rules: []
recent_activity_days: 90
skip_assigned: true
review:
tech_stack_rules: []
max_line_diff: 10
require_evidence: true
team:
git_email: "${GIT_EMAIL}"
assignee_id: "${ASSIGNEE_ID}"
sprint_detection: "auto"
sprint_id: ""
tracker_config: {}
EOF
echo -e "${GREEN}done${NC}"
# Copy docs for reference
echo -n " Documentation... "
mkdir -p "${TARGET_DIR}/.claude/docs"
cp "${SCRIPT_DIR}/docs/"*.md "${TARGET_DIR}/.claude/docs/"
echo -e "${GREEN}done${NC}"
echo ""
echo -e "${GREEN}${BOLD}Bug Shepherd installed.${NC}"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "Installed files:"
echo " .claude/commands/shepherd-*.md (5 slash commands)"
echo " .claude/agents/reproduction-checker.md"
echo " .claude/adapters/${TRACKER}.md"
echo " .claude/triage.config.yaml"
echo " .claude/learning-log.md"
echo " .claude/quality-gate.md"
echo " .claude/backlog-live.md"
echo " .claude/docs/ (reference docs)"
echo ""
echo "Next steps:"
echo " 1. Review .claude/triage.config.yaml and add project-specific settings"
echo " 2. Open Claude Code and run /shepherd-sync to pull your bug backlog"
echo " 3. Run /shepherd-triage to start checking bug reproducibility"
echo ""
echo "Commands:"
echo " /shepherd-sync Sync bugs from ${TRACKER}"
echo " /shepherd-start Begin investigating a specific bug"
echo " /shepherd-triage Mass-check reproducibility (parallel)"
echo " /shepherd-review Quality gate before pushing a fix"
echo " /shepherd-learn Capture lessons from this session"
echo ""
echo -e "Read the docs: ${BLUE}${TARGET_DIR}/.claude/docs/${NC}"
echo ""