### Install AutoSpec Binary Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/quickstart.md This process involves downloading a pre-compiled binary from the releases page, making it executable, and moving it to a directory in your PATH. This is the recommended installation method for general users. Ensure ~/.local/bin is in your PATH. ```bash chmod +x autospec-* mkdir -p ~/.local/bin mv autospec-* ~/.local/bin/autospec ``` -------------------------------- ### Install AutoSpec from Source Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/quickstart.md This sequence of commands clones the AutoSpec repository, builds the binary from source using Make, and installs it to a system-wide location. This method is recommended for contributors. ```bash # Clone the repository git clone https://github.com/ariel-frischer/autospec.git cd autospec # Build the binary make build # Install to /usr/local/bin (requires sudo) sudo make install ``` -------------------------------- ### Build and Install autospec from Source Source: https://github.com/ariel-frischer/autospec/blob/main/site/quickstart.md Installs autospec by cloning the repository, building the binary, and then installing it. This method is useful if you need to work with the latest development code or contribute to the project. ```bash git clone https://github.com/ariel-frischer/autospec.git cd autospec make build sudo make install ``` -------------------------------- ### Autospec Configuration Example (YAML) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/quickstart.md An example configuration file (`config.yml`) for autospec, demonstrating essential settings such as agent selection, retry attempts, specification directory, command timeout, preflight checks, and implementation method. ```yaml # Agent settings (recommended) agent_preset: claude # Built-in agent: claude | gemini | cline | codex | opencode | goose custom_agent_cmd: "" # Custom agent template with {{PROMPT}} placeholder # Maximum retry attempts (default: 0, range: 0-10) # Controls how many times to retry on validation failure max_retries: 0 # Specs directory (default: "./specs") # Where feature specifications are stored specs_dir: ./specs # Command timeout in seconds (default: 2400 = 40 minutes, 0 = no timeout) # Set to limit long-running operations (range: 0 or 1-604800) timeout: 2400 # Skip preflight dependency checks (default: false) # Set to true to bypass health checks skip_preflight: false # Implementation method (default: phases) # Valid values: phases | tasks | single-session implement_method: phases ``` -------------------------------- ### Install Go on Ubuntu/Debian Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs Go version 1.21+ on Ubuntu/Debian systems. It provides instructions for using snap, a universal package manager, for easy installation and management of Go. ```bash # Download from https://go.dev/dl/ or use snap sudo snap install go --classic ``` -------------------------------- ### Install golangci-lint via Go Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the golangci-lint tool, a Go linters aggregator, using the Go install command. This method works across all platforms where Go is installed and is recommended for general use. ```bash go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest ``` -------------------------------- ### Example Autospec Worktree Setup Script Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/worktree.md A bash script demonstrating how to set up a worktree. It receives worktree path, name, and branch as arguments, and uses environment variables like WORKTREE_PATH and SOURCE_REPO. The example includes installing dependencies and copying environment files. ```bash #!/bin/bash set -e cd "$WORKTREE_PATH" echo "Setting up: $WORKTREE_NAME ($WORKTREE_BRANCH)" # Install dependencies npm install # Copy local environment cp "$SOURCE_REPO/.env.local" .env.local 2>/dev/null || true echo "Setup complete!" ``` -------------------------------- ### Autospec Example Feature Descriptions Source: https://github.com/ariel-frischer/autospec/blob/main/site/quickstart.md Examples of feature descriptions used with the `autospec run -a` command, categorized by domain such as API, Authentication, Database, Testing, and DevOps. ```bash # API Features autospec run -a "Add a health check endpoint at /health that returns JSON status" autospec run -a "Add rate limiting middleware with configurable limits per route" autospec run -a "Implement pagination for all list endpoints" # Authentication autospec run -a "Add JWT authentication with refresh token support" autospec run -a "Add OAuth2 login with Google and GitHub providers" # Database autospec run -a "Add database connection pooling with configurable pool size" autospec run -a "Implement soft delete for user records with restore functionality" # Testing autospec run -a "Add integration tests for the payment processing module" # DevOps autospec run -a "Add Dockerfile with multi-stage build for production" autospec run -a "Create GitHub Actions CI pipeline with test and lint stages" ``` -------------------------------- ### Verify golangci-lint Installation Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md This command verifies the installation of golangci-lint by displaying its version. It confirms that the linter is installed and accessible from the command line. ```bash golangci-lint --version ``` -------------------------------- ### Verify Go Installation Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md This command verifies the installation of the Go programming language by displaying its version. It's a standard check to ensure Go is correctly set up. ```bash go version ``` -------------------------------- ### Install Go on macOS Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Go programming language on macOS using the Homebrew package manager. This is a convenient way for macOS users to manage Go installations. ```bash brew install go ``` -------------------------------- ### Verify AutoSpec Installation Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/quickstart.md This command checks if the AutoSpec binary has been successfully installed and is accessible in your system's PATH. It should output the installed version number. ```bash autospec version ``` -------------------------------- ### Autospec Run Commands Source: https://github.com/ariel-frischer/autospec/blob/main/site/quickstart.md Examples of using the `autospec run` command with different stage flags to generate specifications and plans. Supports various combinations for different workflow needs. ```bash # All core stages autospec run -a "feature" # Planning only (specify + plan + tasks) autospec run -spt "feature" # or: autospec prep "feature" # Specify + clarify (refine spec with questions) autospec run -sr "feature" # All stages + checklist + analyze autospec run -alz "feature" ``` -------------------------------- ### E2E Test Setup and Execution in Go Source: https://github.com/ariel-frischer/autospec/blob/main/tests/mocks/README.md Example Go code demonstrating how to use the E2EEnv helper for setting up and running E2E tests. It covers initializing the environment, setting up prerequisites like autospec init and git, and executing commands. ```go func TestMyE2E(t *testing.T) { env := testutil.NewE2EEnv(t) // Set up prerequisites env.SetupAutospecInit() env.SetupConstitution() env.InitGitRepo() env.CreateBranch("001-feature") // Run command and check result result := env.Run("specify", "My feature description") require.Equal(t, 0, result.ExitCode) require.True(t, env.SpecExists("001-feature")) } ``` -------------------------------- ### Install Go on Arch Linux Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Go programming language on Arch Linux using the pacman package manager. This command ensures that a recent version of Go is available for development. ```bash sudo pacman -S go ``` -------------------------------- ### Install Go on Fedora Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Go programming language on Fedora Linux using the dnf package manager. This command is necessary for developers who need Go for building and running Go applications. ```bash sudo dnf install golang ``` -------------------------------- ### Install Git on Ubuntu/Debian Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Git package on Ubuntu and Debian-based Linux distributions using the apt-get package manager. This is a common step for setting up version control on these systems. ```bash sudo apt-get install git ``` -------------------------------- ### Install Git on Fedora Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Git package on Fedora Linux using the dnf package manager. This command is used to set up Git for development and version control. ```bash sudo dnf install git ``` -------------------------------- ### Install golangci-lint on Fedora Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the golangci-lint tool on Fedora Linux using the dnf package manager. This command makes the linter available for code quality checks. ```bash sudo dnf install golangci-lint ``` -------------------------------- ### Install golangci-lint on macOS Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the golangci-lint tool on macOS using the Homebrew package manager. This command simplifies the process of adding the linter to your development environment. ```bash brew install golangci-lint ``` -------------------------------- ### Install autospec Shell Completion (Quick Start) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/SHELL-COMPLETION.md Automatically detects the shell and installs completions by appending configuration to the shell's rc file. It also creates backups of configuration files and ensures idempotency. ```bash # Auto-detect your shell and install completions autospec completion install # Or specify a shell explicitly autospec completion install bash autospec completion install zsh autospec completion install fish autospec completion install powershell ``` -------------------------------- ### Verify Git Installation Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md This command verifies the installation of Git, a version control system essential for autospec's spec detection from branch names and general version control operations. Ensure Git is installed and accessible. ```bash git --version ``` -------------------------------- ### Install Git on Arch Linux Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Git package on Arch Linux using the pacman package manager. This command ensures that Git is available for version control operations. ```bash sudo pacman -S git ``` -------------------------------- ### Install golangci-lint on Arch Linux (AUR) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs golangci-lint on Arch Linux from the Arch User Repository (AUR) using either yay or paru helpers. This provides a system-packaged version of the linter. ```bash # or paru -S golangci-lint ``` -------------------------------- ### Autospec Common Commands Reference Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/quickstart.md A quick reference for frequently used autospec commands, including options for completing the full workflow, preparing for implementation, executing implementation stages, checking status, running health checks, and accessing help. ```bash autospec all "Add user auth" autospec prep "Add export" autospec implement autospec implement 001-dark-mode autospec status autospec st -v autospec doctor autospec --help ``` -------------------------------- ### Application Initialization with Event Subscriptions (Go) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/events.md Demonstrates setting up event subscriptions during application initialization. It includes creating a notification handler and subscribing it to events, ensuring the unsubscribe function is deferred. ```go func main() { // Create notification handler notifHandler := notify.NewHandler(cfg.Notifications) // Subscribe to events (returns unsubscribe func) unsubscribe := notifHandler.Subscribe() defer unsubscribe() // Run CLI if err := rootCmd.Execute(); err != nil { os.Exit(1) } } ``` -------------------------------- ### Troubleshooting: Autospec Not Found (Bash) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/quickstart.md This command is used to install the autospec binary to the system's PATH, resolving the 'autospec: command not found' error. It typically involves copying the binary to a standard executable location. ```bash sudo make install ``` -------------------------------- ### Prompt Injection Example (Bash) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/architecture.md Illustrates how to inject guidance text into phase commands for Claude integration. This example shows a `plan` command with an additional argument that focuses on security best practices, which is then translated into a specific Claude CLI command. ```bash autospec plan "Focus on security best practices" # Executes: claude -p "/autospec.plan \"Focus on security best practices\"" ``` -------------------------------- ### Configuration Priority Example (Bash) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/architecture.md Demonstrates the configuration layering strategy for autospec, showing how environment variables, local configuration files, global configuration files, and hardcoded defaults are prioritized. This example highlights that environment variables take precedence. ```bash # Priority 1: Environment variable export AUTOSPEC_MAX_RETRIES=5 # Priority 2: Local config echo 'max_retries: 0' > .autospec/config.yml # Priority 3: Global config echo 'max_retries: 2' > ~/.config/autospec/config.yml # Result: max_retries = 5 (environment wins) ``` -------------------------------- ### Install Claude Code CLI (Native Linux Installer) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Claude Code CLI using a native installer script for Linux. This is the recommended method for Linux users and ensures the CLI is set up correctly. ```bash curl -fsSL https://claude.ai/install.sh | bash ``` -------------------------------- ### Setting up Specs Directory Structure (Go) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/testing-mocks.md Illustrates how to set up a specs directory structure within an isolated Git repository. This includes creating nested directories and writing spec files. ```go gi := testutil.NewGitIsolation(t) // Creates specs/test-feature/ directory specDir := gi.SetupSpecsDir("test-feature") // Write a spec file specPath := gi.WriteSpec(specDir) // Creates spec.yaml with valid content ``` -------------------------------- ### Install notify-send on Fedora Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/troubleshooting.md Installs the 'notify-send' utility on Fedora Linux using dnf. This is necessary for desktop notifications on Fedora systems. ```bash # Fedora sudo dnf install libnotify ``` -------------------------------- ### Install notify-send on Debian/Ubuntu Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/troubleshooting.md Installs the 'notify-send' utility on Debian-based Linux distributions (like Ubuntu) using apt. This is a prerequisite for desktop notifications. ```bash # Debian/Ubuntu sudo apt install libnotify-bin ``` -------------------------------- ### Autospec Init Command Syntax and Examples Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/reference.md Demonstrates the basic syntax and various usage examples of the 'autospec init' command, including interactive and non-interactive modes, path arguments, and flag usage. ```bash autospec init [path] [flags] # Interactive mode examples autospec init autospec init /path/to/project autospec init ~/projects/my-app autospec init my-new-project autospec init . autospec init --here autospec init --project autospec init --force autospec init /path/to/project --project # Non-interactive mode examples autospec init --no-agents autospec init --ai claude \ --sandbox \ --no-use-subscription \ --skip-permissions \ --gitignore \ --constitution autospec init --ai claude \ --no-sandbox \ --no-use-subscription \ --no-skip-permissions \ --no-gitignore \ --no-constitution ``` -------------------------------- ### Verify Claude Code CLI Installation Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md This command verifies the installation of the Claude Code CLI by checking its version. This is a crucial step to ensure that the CLI is properly installed and accessible in your system's PATH. ```bash claude --version ``` -------------------------------- ### Install notify-send on Arch Linux Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/troubleshooting.md Installs the 'notify-send' utility on Arch Linux using pacman. This package provides the necessary tools for desktop notifications. ```bash # Arch sudo pacman -S libnotify ``` -------------------------------- ### Build and Test Go Code with Make Source: https://github.com/ariel-frischer/autospec/blob/main/AGENTS.md This snippet demonstrates common build and testing commands for Go projects using the Make utility. It covers building the project, running tests in quiet and verbose modes, formatting code, and running linters. Ensure Go 1.25+ and Make are installed. ```bash # Build & Dev make build # Build for current platform make test # Run all tests (quiet, shows failures only) make test-v # Run all tests (verbose, for debugging) make fmt # Format Go code (run before committing) make lint # Run all linters ``` -------------------------------- ### Troubleshoot Git Isolation Setup (Go) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/testing-mocks.md This Go code demonstrates the correct ways to set up git isolation for tests. It shows the preferred method using `testutil.NewGitIsolation(t)` and an alternative using `testutil.WithIsolatedGitRepo(t)`, which returns a cleanup function to be deferred. ```go // Correct gi := testutil.NewGitIsolation(t) // Or cleanup := testutil.WithIsolatedGitRepo(t) def cleanup() ``` -------------------------------- ### Install Claude Code CLI on Arch Linux (AUR) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Claude Code CLI from the Arch User Repository (AUR) on Arch Linux using yay or paru. This provides a package-managed installation for the CLI. ```bash # or paru -S claude-code ``` -------------------------------- ### Install Claude Code CLI via npm Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Claude Code CLI globally using npm, the Node Package Manager. This method requires Node.js and npm to be installed first and is suitable for cross-platform use. ```bash # First install Node.js # Arch: sudo pacman -S nodejs npm # Fedora: sudo dnf install nodejs npm # Ubuntu: sudo apt install nodejs npm npm install -g @anthropic-ai/claude-code ``` -------------------------------- ### Build, Test, and Lint autospec Project Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Provides the make commands for building the autospec binary, running tests, executing linters, and formatting the code. These commands are essential for contributing to the project and maintaining code quality. ```bash make build # Build the binary make test # Run tests make lint # Run linters make fmt # Format code ``` -------------------------------- ### First-Time Project Setup (Bash) Source: https://github.com/ariel-frischer/autospec/blob/main/CLAUDE.md Outlines the sequence of bash commands required for initializing a new project with autospec. This includes setup, dependency verification, and initial preparation for feature development. ```bash autospec init # Interactive setup (config + agent + constitution) autospec doctor # Verify dependencies autospec prep "feature" # specify → plan → tasks autospec implement # Execute tasks ``` -------------------------------- ### Full Autospec Configuration Example Source: https://github.com/ariel-frischer/autospec/blob/main/site/reference/configuration.md A comprehensive example of the `.autospec/config.yml` file, illustrating various settings including core configurations, cclean output formatting, worktree management, and notification preferences. ```yaml # .autospec/config.yml # Core settings agent_preset: claude use_subscription: true # Use Claude subscription, not API credits max_retries: 3 specs_dir: ./specs state_dir: ~/.autospec/state timeout: 2400 skip_preflight: false skip_confirmations: false implement_method: phases auto_commit: false max_history_entries: 500 view_limit: 5 # Cclean output formatting cclean: verbose: false line_numbers: false style: default # Worktree management worktree: base_dir: "" prefix: "" setup_script: "" auto_setup: true track_status: true copy_dirs: - .autospec - .claude # Notifications notifications: enabled: true type: both sound_file: "" on_command_complete: true on_stage_complete: false on_error: true on_long_running: false long_running_threshold: 2m ``` -------------------------------- ### Go Imports Example Source: https://github.com/ariel-frischer/autospec/blob/main/AGENTS.md Demonstrates the standard Go import grouping: standard library, external packages, and internal packages, separated by blank lines. ```go import ( "fmt" "os" "github.com/spf13/cobra" "github.com/ariel-frischer/autospec/internal/config" ) ``` -------------------------------- ### Go Context-Aware CLI Command Lifecycle Wrapper Example Source: https://github.com/ariel-frischer/autospec/blob/main/AGENTS.md Shows the context-aware version of the lifecycle wrapper, `lifecycle.RunWithHistoryContext`, which accepts a `context.Context` for cancellation and deadlines. ```go return lifecycle.RunWithHistoryContext(cmd.Context(), notifHandler, historyLogger, "cmd-name", specName, func() error { return orch.ExecuteXxx(...) }) ``` -------------------------------- ### Autospec Recommended Workflow Example Source: https://github.com/ariel-frischer/autospec/blob/main/README.md Demonstrates the recommended workflow for generating a specification, reviewing it, and then proceeding with the plan, tasks, and implement stages using the 'autospec run' command. ```bash autospec run -s "Add user authentication with OAuth" autospec run -pti ``` -------------------------------- ### Global Event Dispatcher Setup and Usage (Go) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/events.md Sets up and utilizes a global event dispatcher using the 'github.com/kelindar/event' package. Provides functions for subscribing to events and publishing them to all registered handlers. ```go package events import "github.com/kelindar/event" // Global dispatcher instance var bus = event.NewDispatcher() // Subscribe registers a handler for a specific event type. // Returns an unsubscribe function that MUST be deferred. func Subscribe[T event.Event](handler func(T)) func() { return event.Subscribe(bus, handler) } // Publish emits an event to all registered subscribers. func Publish[T event.Event](e T) { event.Publish(bus, e) } ``` -------------------------------- ### Install Xcode Command Line Tools on macOS Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/PREREQUISITES.md Installs the Xcode Command Line Tools on macOS, which includes Git and other essential development utilities. This command is necessary for users on macOS to fulfill Git requirements. ```bash xcode-select --install ``` -------------------------------- ### Retry Context Example with Multiple Errors (Text) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/internals.md This example demonstrates the retry context format when multiple schema validation errors occur. It shows the retry count, the header, a list of specific errors, and the preserved original arguments. ```text RETRY 2/3 Schema validation failed: - missing required field: feature.branch - invalid enum value for user_stories[0].priority: expected one of [P1, P2, P3] - invalid type for requirements.functional[0].testable: expected bool, got string Create a user authentication feature ``` -------------------------------- ### Install and Use Standalone Sandbox Runtime (srt) Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/CLAUDE-AGENT-SDK-EVALUATION.md Demonstrates how to install the standalone sandbox runtime (srt) via npm and execute commands within a sandbox environment. It highlights basic usage and custom settings configuration. Note: Platform support varies (Linux, macOS, Windows/WSL2 not supported). ```bash npm install -g @anthropic-ai/sandbox-runtime # Sandbox any command srt "" # With custom settings srt --settings .srt-settings.json "claude /autospec.implement" ``` -------------------------------- ### Shell Completion Setup for Autospec CLI Source: https://context7.com/ariel-frischer/autospec/llms.txt Configure shell completion for the autospec CLI to enhance command-line productivity. Supports automatic shell detection and installation for bash, zsh, and fish, as well as manual generation of completion scripts for custom setups. ```bash # Auto-detect shell and install completions autospec completion install # Install for specific shell autospec completion install bash autospec completion install zsh autospec completion install fish # Generate completion script (manual setup) autospec completion bash > /etc/bash_completion.d/autospec autospec completion zsh > "${fpath[1]}/_autospec" ``` -------------------------------- ### Handling Autospec Missing Dependencies Errors Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/troubleshooting.md This guide covers scenarios where autospec encounters missing dependencies (exit code 4), preventing execution. It suggests running 'autospec doctor' for diagnosis and provides instructions for installing necessary tools like the Claude CLI. ```bash # Run doctor to diagnose autospec doctor ``` ```bash # Install Claude CLI - see https://claude.ai/download ``` -------------------------------- ### Autospec Implementation Modes Source: https://github.com/ariel-frischer/autospec/blob/main/site/quickstart.md Options for controlling the implementation mode in autospec. Supports default single session per phase, per-task isolation, single session for simple features, and resuming from specific points. ```bash # Default: One session per phase autospec implement # Per-task isolation (recommended for complex features) autospec implement --tasks # Single session (for small/simple specs) autospec implement --single-session # Resume from specific point autospec implement --from-phase 3 autospec implement --from-task T005 autospec implement --task T003 # Single task only ``` -------------------------------- ### Enable Notifications in Autospec Configuration Source: https://github.com/ariel-frischer/autospec/blob/main/docs/public/troubleshooting.md Example configuration snippet showing how to explicitly enable notifications in the .autospec/config.yml file. This is a solution if notifications are disabled. ```yaml # .autospec/config.yml notifications: enabled: true ``` -------------------------------- ### Running Go Tests and Benchmarks Source: https://github.com/ariel-frischer/autospec/blob/main/docs/internal/go-best-practices.md Provides common command-line instructions for running Go tests and benchmarks. It covers running all tests with race detection and coverage, executing a single test, and running benchmarks with memory profiling. ```bash # All tests with race detection and coverage go test -v -race -cover ./... # Single test go test -v -run TestValidateSpecFile ./internal/validation/ # Benchmarks go test -bench=. -benchmem ./internal/validation/ ``` -------------------------------- ### Bash Script for Autospec Worktree Setup Source: https://github.com/ariel-frischer/autospec/blob/main/internal/commands/autospec.worktree-setup.md A POSIX-compatible bash script designed to be run when creating new Git worktrees. It copies essential configuration files and executes package manager install commands. The script is idempotent and handles missing directories gracefully. ```bash #!/bin/bash # setup-worktree.sh - Project-specific worktree setup script # Generated by autospec worktree gen-script # # Usage: Called automatically by 'autospec worktree create' or run manually: # ./setup-worktree.sh # # Environment variables (set by worktree create command): # WORKTREE_PATH - Path to the new worktree # WORKTREE_NAME - Name of the worktree # WORKTREE_BRANCH - Branch checked out in worktree # SOURCE_REPO - Path to source repository set -euo pipefail # Get worktree path from argument or environment WORKTREE_PATH="${1:-${WORKTREE_PATH:-}}" SOURCE_REPO="${SOURCE_REPO:-$(git rev-parse --show-toplevel)}" if [ -z "$WORKTREE_PATH" ]; then echo "Error: Worktree path required. Usage: $0 " exit 1 fi echo "Setting up worktree at: $WORKTREE_PATH" echo "Source repository: $SOURCE_REPO" # Function to copy directory if it exists copy_if_exists() { local src="$SOURCE_REPO/$1" local dst="$WORKTREE_PATH/$1" if [ -d "$src" ]; then echo "Copying $1..." mkdir -p "$(dirname "$dst")" cp -r "$src" "$dst" fi } # Copy essential configuration directories # Autospec-related (REQUIRED for autospec workflows) copy_if_exists ".autospec" # Constitution, config, memory, scripts copy_if_exists ".claude/commands" # Claude Code slash commands (plural) copy_if_exists ".opencode/command" # OpenCode slash commands (singular, NOT .opencode/) # Copy OpenCode config file if it exists if [ -f "$SOURCE_REPO/opencode.json" ]; then echo "Copying opencode.json..." cp "$SOURCE_REPO/opencode.json" "$WORKTREE_PATH/opencode.json" fi # IDE/Editor configuration (if detected) # copy_if_exists ".vscode" # copy_if_exists ".idea" # Run package manager install commands cd "$WORKTREE_PATH" # (Include detected package manager commands) echo "Worktree setup complete!" ``` -------------------------------- ### Default autospec Configuration Source: https://github.com/ariel-frischer/autospec/blob/main/site/quickstart.md Displays the default configuration settings for autospec. These settings can be customized in the `config.yml` file. ```yaml claude_cmd: claude max_retries: 0 specs_dir: ./specs state_dir: ~/.autospec/state timeout: 0 ```