specrails-core 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.claude/skills/openspec-apply-change/SKILL.md +156 -0
  2. package/.claude/skills/openspec-archive-change/SKILL.md +114 -0
  3. package/.claude/skills/openspec-bulk-archive-change/SKILL.md +246 -0
  4. package/.claude/skills/openspec-continue-change/SKILL.md +118 -0
  5. package/.claude/skills/openspec-explore/SKILL.md +290 -0
  6. package/.claude/skills/openspec-ff-change/SKILL.md +101 -0
  7. package/.claude/skills/openspec-new-change/SKILL.md +74 -0
  8. package/.claude/skills/openspec-onboard/SKILL.md +529 -0
  9. package/.claude/skills/openspec-sync-specs/SKILL.md +138 -0
  10. package/.claude/skills/openspec-verify-change/SKILL.md +168 -0
  11. package/README.md +245 -0
  12. package/VERSION +1 -0
  13. package/bin/specrails-core.js +41 -0
  14. package/commands/setup.md +871 -0
  15. package/install.sh +451 -0
  16. package/package.json +34 -0
  17. package/prompts/analyze-codebase.md +87 -0
  18. package/prompts/generate-personas.md +61 -0
  19. package/prompts/infer-conventions.md +72 -0
  20. package/templates/agents/sr-architect.md +194 -0
  21. package/templates/agents/sr-backend-developer.md +54 -0
  22. package/templates/agents/sr-backend-reviewer.md +139 -0
  23. package/templates/agents/sr-developer.md +146 -0
  24. package/templates/agents/sr-doc-sync.md +167 -0
  25. package/templates/agents/sr-frontend-developer.md +48 -0
  26. package/templates/agents/sr-frontend-reviewer.md +132 -0
  27. package/templates/agents/sr-product-analyst.md +36 -0
  28. package/templates/agents/sr-product-manager.md +148 -0
  29. package/templates/agents/sr-reviewer.md +265 -0
  30. package/templates/agents/sr-security-reviewer.md +178 -0
  31. package/templates/agents/sr-test-writer.md +163 -0
  32. package/templates/claude-md/root.md +50 -0
  33. package/templates/commands/sr/batch-implement.md +282 -0
  34. package/templates/commands/sr/compat-check.md +271 -0
  35. package/templates/commands/sr/health-check.md +396 -0
  36. package/templates/commands/sr/implement.md +973 -0
  37. package/templates/commands/sr/product-backlog.md +195 -0
  38. package/templates/commands/sr/propose-spec.md +44 -0
  39. package/templates/commands/sr/refactor-recommender.md +169 -0
  40. package/templates/commands/sr/update-product-driven-backlog.md +272 -0
  41. package/templates/commands/sr/why.md +96 -0
  42. package/templates/personas/persona.md +43 -0
  43. package/templates/personas/the-maintainer.md +78 -0
  44. package/templates/rules/layer.md +8 -0
  45. package/templates/security/security-exemptions.yaml +20 -0
  46. package/templates/settings/confidence-config.json +17 -0
  47. package/templates/settings/settings.json +15 -0
  48. package/update.sh +825 -0
package/install.sh ADDED
@@ -0,0 +1,451 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # specrails installer
5
+ # Installs the agent workflow system into any repository.
6
+ # Step 1 of 2: Prerequisites + scaffold. Step 2: Run /setup inside Claude Code.
7
+
8
+ # Detect pipe mode (curl | bash) vs local execution
9
+ if [[ -z "${BASH_SOURCE[0]:-}" || "${BASH_SOURCE[0]:-}" == "bash" ]]; then
10
+ # Running via pipe — clone repo to temp dir
11
+ SPECRAILS_TMPDIR="$(mktemp -d)"
12
+ trap 'rm -rf "$SPECRAILS_TMPDIR"' EXIT
13
+ git clone --depth 1 https://github.com/fjpulidop/specrails.git "$SPECRAILS_TMPDIR/specrails" 2>/dev/null || {
14
+ echo "Error: failed to clone specrails repository." >&2
15
+ exit 1
16
+ }
17
+ SCRIPT_DIR="$SPECRAILS_TMPDIR/specrails"
18
+ else
19
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20
+ fi
21
+ REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "")"
22
+
23
+ # Colors
24
+ RED='\033[0;31m'
25
+ GREEN='\033[0;32m'
26
+ YELLOW='\033[1;33m'
27
+ BLUE='\033[0;34m'
28
+ CYAN='\033[0;36m'
29
+ BOLD='\033[1m'
30
+ NC='\033[0m'
31
+
32
+ # ─────────────────────────────────────────────
33
+ # Argument parsing
34
+ # ─────────────────────────────────────────────
35
+
36
+ CUSTOM_ROOT_DIR=""
37
+ AUTO_YES=false
38
+
39
+ while [[ $# -gt 0 ]]; do
40
+ case "$1" in
41
+ --root-dir)
42
+ if [[ -z "${2:-}" ]]; then
43
+ echo "Error: --root-dir requires a path argument." >&2
44
+ exit 1
45
+ fi
46
+ CUSTOM_ROOT_DIR="$2"
47
+ shift 2
48
+ ;;
49
+ --yes|-y)
50
+ AUTO_YES=true
51
+ shift
52
+ ;;
53
+ *)
54
+ echo "Unknown argument: $1" >&2
55
+ echo "Usage: install.sh [--root-dir <path>] [--yes|-y]" >&2
56
+ exit 1
57
+ ;;
58
+ esac
59
+ done
60
+
61
+ # Override REPO_ROOT if --root-dir was provided
62
+ if [[ -n "$CUSTOM_ROOT_DIR" ]]; then
63
+ REPO_ROOT="$(cd "$CUSTOM_ROOT_DIR" 2>/dev/null && pwd)" || {
64
+ echo "Error: --root-dir path does not exist or is not accessible: $CUSTOM_ROOT_DIR" >&2
65
+ exit 1
66
+ }
67
+ if [[ ! -d "$REPO_ROOT" ]]; then
68
+ echo "Error: --root-dir path is not a directory: $CUSTOM_ROOT_DIR" >&2
69
+ exit 1
70
+ fi
71
+ fi
72
+
73
+ # Detect if running from within the specrails source repo itself
74
+ if [[ -z "$CUSTOM_ROOT_DIR" && -f "$SCRIPT_DIR/install.sh" && -d "$SCRIPT_DIR/templates" && "$SCRIPT_DIR" == "$REPO_ROOT"* ]]; then
75
+ # We're inside the specrails source — ask for target repo
76
+ echo ""
77
+ echo -e "${YELLOW}⚠${NC} You're running the installer from inside the specrails source repo."
78
+ echo -e " specrails installs into a ${BOLD}target${NC} repository, not into itself."
79
+ echo ""
80
+ read -p " Enter the path to the target repo (or 'q' to quit): " TARGET_PATH
81
+ if [[ "$TARGET_PATH" == "q" || -z "$TARGET_PATH" ]]; then
82
+ echo " Aborted. No changes made."
83
+ exit 0
84
+ fi
85
+ # Expand ~ and resolve path
86
+ TARGET_PATH="${TARGET_PATH/#\~/$HOME}"
87
+ REPO_ROOT="$(cd "$TARGET_PATH" 2>/dev/null && pwd)" || {
88
+ echo "Error: path does not exist or is not accessible: $TARGET_PATH" >&2
89
+ exit 1
90
+ }
91
+ if [[ ! -d "$REPO_ROOT/.git" ]]; then
92
+ echo -e "${YELLOW}⚠${NC} Warning: $REPO_ROOT does not appear to be a git repository."
93
+ if [ "$AUTO_YES" = true ]; then CONTINUE_NOGIT="y"; else read -p " Continue anyway? (y/n): " CONTINUE_NOGIT; fi
94
+ if [[ "$CONTINUE_NOGIT" != "y" && "$CONTINUE_NOGIT" != "Y" ]]; then
95
+ echo " Aborted. No changes made."
96
+ exit 0
97
+ fi
98
+ fi
99
+ fi
100
+
101
+ print_header() {
102
+ echo ""
103
+ echo -e "${BOLD}${CYAN}╔══════════════════════════════════════════════╗${NC}"
104
+ echo -e "${BOLD}${CYAN}║ specrails installer v0.1 ║${NC}"
105
+ echo -e "${BOLD}${CYAN}║ Agent Workflow System for Claude Code ║${NC}"
106
+ echo -e "${BOLD}${CYAN}╚══════════════════════════════════════════════╝${NC}"
107
+ echo ""
108
+ }
109
+
110
+ ok() { echo -e " ${GREEN}✓${NC} $1"; }
111
+ warn() { echo -e " ${YELLOW}⚠${NC} $1"; }
112
+ fail() { echo -e " ${RED}✗${NC} $1"; }
113
+ info() { echo -e " ${BLUE}→${NC} $1"; }
114
+ step() { echo -e "\n${BOLD}$1${NC}"; }
115
+
116
+ generate_manifest() {
117
+ local version
118
+ version="$(cat "$SCRIPT_DIR/VERSION")"
119
+
120
+ local installed_at
121
+ installed_at="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
122
+
123
+ # Write version file
124
+ printf '%s\n' "$version" > "$REPO_ROOT/.specrails-version"
125
+
126
+ # Build artifact checksums for all files under templates/
127
+ local artifacts_json=""
128
+ local first=true
129
+ while IFS= read -r -d '' filepath; do
130
+ local relpath
131
+ relpath="templates/${filepath#"$SCRIPT_DIR/templates/"}"
132
+ local checksum
133
+ checksum="sha256:$(shasum -a 256 "$filepath" | awk '{print $1}')"
134
+ if [ "$first" = true ]; then
135
+ first=false
136
+ else
137
+ artifacts_json="${artifacts_json},"
138
+ fi
139
+ artifacts_json="${artifacts_json}
140
+ \"${relpath}\": \"${checksum}\""
141
+ done < <(find "$SCRIPT_DIR/templates" -type f -not -path '*/node_modules/*' -not -name 'package-lock.json' -print0 | sort -z)
142
+
143
+ # Include commands/setup.md
144
+ local setup_checksum
145
+ setup_checksum="sha256:$(shasum -a 256 "$SCRIPT_DIR/commands/setup.md" | awk '{print $1}')"
146
+ if [ -n "$artifacts_json" ]; then
147
+ artifacts_json="${artifacts_json},"
148
+ fi
149
+ artifacts_json="${artifacts_json}
150
+ \"commands/setup.md\": \"${setup_checksum}\""
151
+
152
+ cat > "$REPO_ROOT/.specrails-manifest.json" << EOF
153
+ {
154
+ "version": "${version}",
155
+ "installed_at": "${installed_at}",
156
+ "artifacts": {${artifacts_json}
157
+ }
158
+ }
159
+ EOF
160
+ }
161
+
162
+ # ─────────────────────────────────────────────
163
+ # Phase 1: Prerequisites
164
+ # ─────────────────────────────────────────────
165
+
166
+ print_header
167
+
168
+ step "Phase 1: Checking prerequisites"
169
+
170
+ # 1.1 Git repository
171
+ if [[ -z "$REPO_ROOT" ]]; then
172
+ fail "Not inside a git repository and no --root-dir provided."
173
+ echo " Usage: install.sh [--root-dir <path>]"
174
+ exit 1
175
+ fi
176
+ if [[ -n "$CUSTOM_ROOT_DIR" ]]; then
177
+ ok "Install root (--root-dir): $REPO_ROOT"
178
+ else
179
+ ok "Git repository root: $REPO_ROOT"
180
+ fi
181
+
182
+ # 1.2 Claude Code CLI
183
+ if command -v claude &> /dev/null; then
184
+ CLAUDE_VERSION=$(claude --version 2>/dev/null || echo "unknown")
185
+ ok "Claude Code CLI: $CLAUDE_VERSION"
186
+ else
187
+ fail "Claude Code CLI not found."
188
+ echo ""
189
+ echo " Install it with: npm install -g @anthropic-ai/claude-code"
190
+ echo " Or see: https://docs.anthropic.com/en/docs/claude-code"
191
+ exit 1
192
+ fi
193
+
194
+ # 1.3 npm
195
+ if command -v npm &> /dev/null; then
196
+ NPM_VERSION=$(npm --version 2>/dev/null)
197
+ ok "npm: v$NPM_VERSION"
198
+ HAS_NPM=true
199
+ else
200
+ warn "npm not found. Required for OpenSpec CLI."
201
+ echo ""
202
+ if [ "$AUTO_YES" = true ]; then INSTALL_NPM="y"; else read -p " Install npm via nvm? (y/n): " INSTALL_NPM; fi
203
+ if [ "$INSTALL_NPM" = "y" ] || [ "$INSTALL_NPM" = "Y" ]; then
204
+ info "Installing nvm + node..."
205
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
206
+ export NVM_DIR="$HOME/.nvm"
207
+ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
208
+ nvm install --lts
209
+ nvm use --lts
210
+ ok "npm installed: v$(npm --version)"
211
+ HAS_NPM=true
212
+ else
213
+ warn "Skipping npm install. OpenSpec CLI will not be available."
214
+ HAS_NPM=false
215
+ fi
216
+ fi
217
+
218
+ # 1.4 OpenSpec CLI
219
+ if command -v openspec &> /dev/null; then
220
+ OPENSPEC_VERSION=$(openspec --version 2>/dev/null || echo "unknown")
221
+ ok "OpenSpec CLI: $OPENSPEC_VERSION"
222
+ HAS_OPENSPEC=true
223
+ elif [ -f "$REPO_ROOT/node_modules/.bin/openspec" ]; then
224
+ ok "OpenSpec CLI: found in node_modules"
225
+ HAS_OPENSPEC=true
226
+ else
227
+ warn "OpenSpec CLI not found."
228
+ if [ "$HAS_NPM" = true ]; then
229
+ if [ "$AUTO_YES" = true ]; then INSTALL_OPENSPEC="y"; else read -p " Install OpenSpec CLI globally? (y/n): " INSTALL_OPENSPEC; fi
230
+ if [ "$INSTALL_OPENSPEC" = "y" ] || [ "$INSTALL_OPENSPEC" = "Y" ]; then
231
+ info "Installing OpenSpec CLI..."
232
+ npm install -g @openspec/cli 2>/dev/null && {
233
+ ok "OpenSpec CLI installed"
234
+ HAS_OPENSPEC=true
235
+ } || {
236
+ warn "Global install failed. Trying local..."
237
+ cd "$REPO_ROOT" && npm install @openspec/cli 2>/dev/null && {
238
+ ok "OpenSpec CLI installed locally"
239
+ HAS_OPENSPEC=true
240
+ } || {
241
+ fail "Could not install OpenSpec CLI."
242
+ HAS_OPENSPEC=false
243
+ }
244
+ }
245
+ else
246
+ warn "Skipping OpenSpec install. Spec-driven workflow will be limited."
247
+ HAS_OPENSPEC=false
248
+ fi
249
+ else
250
+ warn "Cannot install OpenSpec without npm."
251
+ HAS_OPENSPEC=false
252
+ fi
253
+ fi
254
+
255
+ # 1.5 GitHub CLI (optional)
256
+ if command -v gh &> /dev/null; then
257
+ if gh auth status &> /dev/null; then
258
+ ok "GitHub CLI: authenticated"
259
+ HAS_GH=true
260
+ else
261
+ warn "GitHub CLI installed but not authenticated. Run: gh auth login"
262
+ HAS_GH=false
263
+ fi
264
+ else
265
+ warn "GitHub CLI (gh) not found. GitHub Issues backlog will be unavailable."
266
+ HAS_GH=false
267
+ fi
268
+
269
+ # 1.6 OSS detection (requires gh auth; degrades gracefully)
270
+ IS_OSS=false
271
+ HAS_PUBLIC_REPO=false
272
+ HAS_CI=false
273
+ HAS_CONTRIBUTING=false
274
+
275
+ if [ "$HAS_GH" = true ]; then
276
+ _REPO_PRIVATE=$(gh repo view --json isPrivate --jq '.isPrivate' 2>/dev/null || echo "unknown")
277
+ if [ "$_REPO_PRIVATE" = "false" ]; then
278
+ HAS_PUBLIC_REPO=true
279
+ fi
280
+ if ls "$REPO_ROOT/.github/workflows/"*.yml > /dev/null 2>&1; then
281
+ HAS_CI=true
282
+ fi
283
+ if [ -f "$REPO_ROOT/CONTRIBUTING.md" ] || [ -f "$REPO_ROOT/.github/CONTRIBUTING.md" ]; then
284
+ HAS_CONTRIBUTING=true
285
+ fi
286
+ if [ "$HAS_PUBLIC_REPO" = true ] && [ "$HAS_CI" = true ] && [ "$HAS_CONTRIBUTING" = true ]; then
287
+ IS_OSS=true
288
+ ok "OSS project detected (public repo + CI + CONTRIBUTING.md)"
289
+ fi
290
+ fi
291
+
292
+ # 1.7 JIRA CLI (optional)
293
+ if command -v jira &> /dev/null; then
294
+ ok "JIRA CLI: found"
295
+ HAS_JIRA=true
296
+ else
297
+ HAS_JIRA=false
298
+ # Don't warn here — JIRA is only relevant if chosen during /setup.
299
+ # If the user selects JIRA in /setup and it's not installed, the setup
300
+ # wizard will offer to install it (go-jira via brew/go, or Atlassian CLI).
301
+ fi
302
+
303
+ # ─────────────────────────────────────────────
304
+ # Phase 2: Detect existing setup
305
+ # ─────────────────────────────────────────────
306
+
307
+ step "Phase 2: Detecting existing setup"
308
+
309
+ EXISTING_SETUP=false
310
+
311
+ if [ -d "$REPO_ROOT/.claude" ]; then
312
+ if [ -d "$REPO_ROOT/.claude/agents" ] && [ "$(ls -A "$REPO_ROOT/.claude/agents" 2>/dev/null)" ]; then
313
+ warn "Existing .claude/agents/ found with content"
314
+ EXISTING_SETUP=true
315
+ fi
316
+ if [ -d "$REPO_ROOT/.claude/commands" ] && [ "$(ls -A "$REPO_ROOT/.claude/commands" 2>/dev/null)" ]; then
317
+ warn "Existing .claude/commands/ found with content"
318
+ EXISTING_SETUP=true
319
+ fi
320
+ if [ -d "$REPO_ROOT/.claude/rules" ] && [ "$(ls -A "$REPO_ROOT/.claude/rules" 2>/dev/null)" ]; then
321
+ warn "Existing .claude/rules/ found with content"
322
+ EXISTING_SETUP=true
323
+ fi
324
+ fi
325
+
326
+ if [ -d "$REPO_ROOT/openspec" ]; then
327
+ warn "Existing openspec/ directory found"
328
+ EXISTING_SETUP=true
329
+ fi
330
+
331
+ if [ "$EXISTING_SETUP" = true ]; then
332
+ echo ""
333
+ warn "This repo already has some agent/command/openspec artifacts."
334
+ if [ "$AUTO_YES" = true ]; then CONTINUE="y"; else read -p " Continue and merge with existing setup? (y/n): " CONTINUE; fi
335
+ if [ "$CONTINUE" != "y" ] && [ "$CONTINUE" != "Y" ]; then
336
+ info "Aborted. No changes made."
337
+ exit 0
338
+ fi
339
+ else
340
+ ok "Clean repo — no existing .claude/ or openspec/ artifacts"
341
+ fi
342
+
343
+ # ─────────────────────────────────────────────
344
+ # Phase 3: Install artifacts
345
+ # ─────────────────────────────────────────────
346
+
347
+ step "Phase 3: Installing specrails artifacts"
348
+
349
+ # Create directory structure
350
+ mkdir -p "$REPO_ROOT/specrails"
351
+ mkdir -p "$REPO_ROOT/.claude/commands"
352
+ mkdir -p "$REPO_ROOT/.claude/setup-templates/agents"
353
+ mkdir -p "$REPO_ROOT/.claude/setup-templates/commands"
354
+ mkdir -p "$REPO_ROOT/.claude/setup-templates/rules"
355
+ mkdir -p "$REPO_ROOT/.claude/setup-templates/personas"
356
+ mkdir -p "$REPO_ROOT/.claude/setup-templates/claude-md"
357
+ mkdir -p "$REPO_ROOT/.claude/setup-templates/settings"
358
+ mkdir -p "$REPO_ROOT/.claude/setup-templates/prompts"
359
+ mkdir -p "$REPO_ROOT/.claude/agent-memory/explanations"
360
+
361
+ # Copy the /setup command
362
+ cp "$SCRIPT_DIR/commands/setup.md" "$REPO_ROOT/.claude/commands/setup.md"
363
+ ok "Installed /setup command"
364
+
365
+ # Copy templates
366
+ cp -r "$SCRIPT_DIR/templates/"* "$REPO_ROOT/.claude/setup-templates/"
367
+ ok "Installed setup templates"
368
+
369
+ # Write OSS detection results for /setup
370
+ cat > "$REPO_ROOT/.claude/setup-templates/.oss-detection.json" << EOF
371
+ {
372
+ "is_oss": $IS_OSS,
373
+ "signals": {
374
+ "public_repo": $HAS_PUBLIC_REPO,
375
+ "has_ci": $HAS_CI,
376
+ "has_contributing": $HAS_CONTRIBUTING
377
+ }
378
+ }
379
+ EOF
380
+ ok "OSS detection results written"
381
+
382
+ # Copy security exemptions config (skip if already exists — preserve user exemptions)
383
+ if [ ! -f "${REPO_ROOT}/.claude/security-exemptions.yaml" ]; then
384
+ cp "${SCRIPT_DIR}/templates/security/security-exemptions.yaml" "${REPO_ROOT}/.claude/security-exemptions.yaml"
385
+ ok "Created .claude/security-exemptions.yaml"
386
+ fi
387
+
388
+ # Copy prompts
389
+ if [ -d "$SCRIPT_DIR/prompts" ] && [ "$(ls -A "$SCRIPT_DIR/prompts" 2>/dev/null)" ]; then
390
+ cp -r "$SCRIPT_DIR/prompts/"* "$REPO_ROOT/.claude/setup-templates/prompts/"
391
+ ok "Installed prompts"
392
+ fi
393
+
394
+ # Initialize OpenSpec if available and not already initialized
395
+ if [ "$HAS_OPENSPEC" = true ] && [ ! -d "$REPO_ROOT/openspec" ]; then
396
+ info "Initializing OpenSpec..."
397
+ cd "$REPO_ROOT" && openspec init 2>/dev/null && {
398
+ ok "OpenSpec initialized"
399
+ } || {
400
+ warn "OpenSpec init failed — you can run 'openspec init' manually later"
401
+ }
402
+ fi
403
+
404
+ # ─────────────────────────────────────────────
405
+ # Phase 3b: Write version and manifest
406
+ # ─────────────────────────────────────────────
407
+
408
+ step "Phase 3b: Writing version and manifest"
409
+
410
+ generate_manifest
411
+ ok "Written .specrails-version ($(cat "$REPO_ROOT/.specrails-version"))"
412
+ ok "Written .specrails-manifest.json"
413
+
414
+ # ─────────────────────────────────────────────
415
+ # Phase 4: Summary & next steps
416
+ # ─────────────────────────────────────────────
417
+
418
+ step "Phase 4: Installation complete"
419
+
420
+ echo ""
421
+ echo -e "${BOLD}${GREEN}Installation summary:${NC}"
422
+ echo ""
423
+ echo " Files installed:"
424
+ echo " .claude/commands/setup.md ← The /setup command"
425
+ echo " .claude/setup-templates/ ← Templates (temporary, removed after setup)"
426
+ echo " .specrails-version ← Installed specrails version"
427
+ echo " .specrails-manifest.json ← Artifact checksums for update detection"
428
+ echo ""
429
+
430
+ echo -e "${BOLD}Prerequisites:${NC}"
431
+ echo ""
432
+ [ "$HAS_NPM" = true ] && ok "npm" || warn "npm (optional)"
433
+ [ "$HAS_OPENSPEC" = true ] && ok "OpenSpec" || warn "OpenSpec (optional)"
434
+ [ "$HAS_GH" = true ] && ok "GitHub CLI" || warn "GitHub CLI (optional, for GitHub Issues backlog)"
435
+ [ "$HAS_JIRA" = true ] && ok "JIRA CLI" || info "JIRA CLI not found (optional, for JIRA backlog)"
436
+ echo ""
437
+
438
+ echo -e "${BOLD}${CYAN}Next steps:${NC}"
439
+ echo ""
440
+ echo " 1. Open Claude Code in this repo:"
441
+ echo ""
442
+ echo -e " ${BOLD}cd $REPO_ROOT && claude${NC}"
443
+ echo ""
444
+ echo " 2. Run the setup wizard:"
445
+ echo ""
446
+ echo -e " ${BOLD}/setup${NC}"
447
+ echo ""
448
+ echo " Claude will analyze your codebase, ask about your users,"
449
+ echo " research the competitive landscape, and generate all agents,"
450
+ echo " commands, rules, and personas adapted to your project."
451
+ echo ""
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "specrails-core",
3
+ "version": "0.7.1",
4
+ "description": "Agent Workflow System installer for Claude Code",
5
+ "bin": {
6
+ "specrails-core": "bin/specrails-core.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "install.sh",
11
+ "update.sh",
12
+ "templates/",
13
+ "prompts/",
14
+ ".claude/skills/",
15
+ "commands/",
16
+ "VERSION"
17
+ ],
18
+ "engines": {
19
+ "node": ">=18.0.0"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/fjpulidop/specrails-core.git"
24
+ },
25
+ "keywords": [
26
+ "claude",
27
+ "claude-code",
28
+ "ai-agents",
29
+ "workflow",
30
+ "developer-tools"
31
+ ],
32
+ "license": "MIT",
33
+ "author": "fjpulidop"
34
+ }
@@ -0,0 +1,87 @@
1
+ # Codebase Analysis Prompt
2
+
3
+ Analyze this repository to understand its architecture, stack, and conventions.
4
+
5
+ ## What to detect
6
+
7
+ ### 1. Languages & Frameworks
8
+ - Scan for language-specific files: `*.py`, `*.ts`, `*.tsx`, `*.js`, `*.go`, `*.rs`, `*.java`, `*.kt`, `*.rb`, `*.cs`, `*.swift`
9
+ - Check dependency files: `requirements.txt`, `pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`, `pom.xml`, `Gemfile`, `*.csproj`
10
+ - Identify frameworks from imports: FastAPI, Django, Flask, Express, Next.js, React, Vue, Angular, Spring, Gin, Actix, Rails, etc.
11
+
12
+ ### 2. Architecture Layers
13
+ For each detected layer, identify:
14
+ - **Name**: e.g., "Backend", "Frontend", "Core", "API", "Mobile", "CLI"
15
+ - **Path**: e.g., `backend/`, `src/`, `frontend/`, `app/`, `lib/`
16
+ - **Tech**: e.g., "FastAPI (Python)", "React + TypeScript", "Go package"
17
+ - **Tag**: e.g., `[backend]`, `[frontend]`, `[core]`, `[mobile]`, `[test]`
18
+
19
+ ### 3. CI/CD Commands
20
+ Parse `.github/workflows/*.yml`, `.gitlab-ci.yml`, `Jenkinsfile`, `Makefile`, `package.json` scripts to find:
21
+ - **Lint** commands (ruff, eslint, golangci-lint, clippy, rubocop)
22
+ - **Format** commands (ruff format, prettier, gofmt, rustfmt)
23
+ - **Test** commands (pytest, vitest, jest, go test, cargo test)
24
+ - **Build** commands (tsc, vite build, go build, cargo build)
25
+ - **Type check** commands (tsc --noEmit, mypy, pyright)
26
+
27
+ ### 4. Conventions
28
+ Read 3-5 representative source files from each layer to detect:
29
+ - Naming style (snake_case, camelCase, PascalCase)
30
+ - Import organization patterns
31
+ - Error handling approach
32
+ - Testing patterns (framework, mocking, fixtures)
33
+ - API style (REST, GraphQL, tRPC, gRPC)
34
+ - State management (if frontend)
35
+ - Database access pattern (ORM, raw SQL, repository pattern)
36
+
37
+ ### 5. Project Warnings
38
+ Look for:
39
+ - Concurrency constraints
40
+ - Authentication patterns
41
+ - State management gotchas
42
+ - Known test isolation issues
43
+ - Environment-specific behavior
44
+
45
+ ## Output Format
46
+
47
+ Return a structured analysis:
48
+
49
+ ```yaml
50
+ project:
51
+ name: "project-name"
52
+ description: "One-line description"
53
+
54
+ stack:
55
+ - layer: "Backend"
56
+ tech: "FastAPI (Python 3.11)"
57
+ path: "backend/"
58
+ tag: "[backend]"
59
+ - layer: "Frontend"
60
+ tech: "React 19 + TypeScript + Vite"
61
+ path: "frontend/"
62
+ tag: "[frontend]"
63
+
64
+ ci:
65
+ backend:
66
+ lint: "ruff check ."
67
+ format: "ruff format --check ."
68
+ test: "pytest tests/ -q"
69
+ frontend:
70
+ lint: "npm run lint"
71
+ typecheck: "npx tsc --noEmit"
72
+ test: "npx vitest run"
73
+
74
+ conventions:
75
+ backend:
76
+ - "Routes are thin: validate → call service → return model"
77
+ - "Services own business logic"
78
+ - "Repository pattern for data access"
79
+ frontend:
80
+ - "Functional components with hooks"
81
+ - "TanStack Query for server state"
82
+ - "Tailwind for styling"
83
+
84
+ warnings:
85
+ - "Auth: All endpoints require authentication"
86
+ - "Tests: Fixtures must use scope='function'"
87
+ ```
@@ -0,0 +1,61 @@
1
+ # Persona Generation Prompt
2
+
3
+ Generate Value Proposition Canvas personas for the target users of this project.
4
+
5
+ ## Input
6
+
7
+ The user has described their target users in natural language. Use this description to:
8
+
9
+ 1. **Research the competitive landscape** using WebSearch:
10
+ - Search for existing tools these users currently use
11
+ - Find common pain points and frustrations in forums (Reddit, HN, product reviews)
12
+ - Identify feature gaps in competitor products
13
+ - Understand workflow patterns and daily routines
14
+
15
+ 2. **Generate a detailed VPC persona** for each user type that includes:
16
+
17
+ ### Profile
18
+ - **Nickname + Role**: A memorable name and short role description
19
+ - **Age range**: Typical demographic
20
+ - **Key behaviors**: 4-5 bullet points describing how they work/interact with tools
21
+ - **Tools currently used**: List of specific competitor products/tools
22
+ - **Spending pattern**: If relevant (monthly spend, budget constraints)
23
+ - **Mindset**: How they think about the problem space
24
+
25
+ ### Value Proposition Canvas
26
+
27
+ #### Customer Jobs (6-8 entries)
28
+ | Type | Job |
29
+ |------|-----|
30
+ | **Functional** | Concrete tasks they need to accomplish |
31
+ | **Social** | How they want to be perceived by others |
32
+ | **Emotional** | How they want to feel |
33
+
34
+ #### Pains (6-8 entries, graded by severity)
35
+ | Severity | Pain |
36
+ |----------|------|
37
+ | **Critical** | Major blockers — things that cause real frustration or wasted time |
38
+ | **High** | Significant issues that affect daily workflow |
39
+ | **Medium** | Annoyances that are tolerable but reduce satisfaction |
40
+ | **Low** | Minor inconveniences |
41
+
42
+ #### Gains (6-8 entries, graded by impact)
43
+ | Impact | Gain |
44
+ |--------|------|
45
+ | **High** | Game-changing improvements that would make them switch tools |
46
+ | **Medium** | Meaningful improvements to their workflow |
47
+ | **Low** | Nice-to-haves |
48
+
49
+ ### Key Insight
50
+ > The single most important unmet need that this project can uniquely address. This should be the intersection of a critical pain + a high-impact gain that no competitor handles well.
51
+
52
+ ### Sources
53
+ List the actual URLs used during research (competitive analysis, forums, reviews, documentation).
54
+
55
+ ## Quality Criteria
56
+
57
+ - **Grounded in research**: Every pain and gain should be traceable to real user feedback, not assumptions
58
+ - **Specific, not generic**: "Spending 30 minutes swapping cards between decks" > "Managing multiple decks is hard"
59
+ - **Actionable**: Each pain/gain should suggest a potential feature
60
+ - **Differentiated**: Personas should have meaningfully different needs — if they're too similar, merge them
61
+ - **Realistic**: Don't invent fantasy users — base on actual market segments