soba-cli 0.1.0
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.
- checksums.yaml +7 -0
- data/.claude/commands/osoba/add-backlog.md +173 -0
- data/.claude/commands/osoba/implement.md +151 -0
- data/.claude/commands/osoba/plan.md +217 -0
- data/.claude/commands/osoba/review.md +133 -0
- data/.claude/commands/osoba/revise.md +176 -0
- data/.claude/commands/soba/implement.md +88 -0
- data/.claude/commands/soba/plan.md +93 -0
- data/.claude/commands/soba/review.md +91 -0
- data/.claude/commands/soba/revise.md +76 -0
- data/.devcontainer/.env +2 -0
- data/.devcontainer/Dockerfile +3 -0
- data/.devcontainer/LICENSE +21 -0
- data/.devcontainer/README.md +85 -0
- data/.devcontainer/bin/devcontainer-common.sh +50 -0
- data/.devcontainer/bin/down +35 -0
- data/.devcontainer/bin/rebuild +10 -0
- data/.devcontainer/bin/up +11 -0
- data/.devcontainer/compose.yaml +28 -0
- data/.devcontainer/devcontainer.json +53 -0
- data/.devcontainer/post-attach.sh +29 -0
- data/.devcontainer/post-create.sh +62 -0
- data/.devcontainer/setup/01-os-package.sh +19 -0
- data/.devcontainer/setup/02-npm-package.sh +22 -0
- data/.devcontainer/setup/03-mcp-server.sh +33 -0
- data/.devcontainer/setup/04-tool.sh +17 -0
- data/.devcontainer/setup/05-soba-setup.sh +66 -0
- data/.devcontainer/setup/scripts/functions/install_apt.sh +77 -0
- data/.devcontainer/setup/scripts/functions/install_npm.sh +71 -0
- data/.devcontainer/setup/scripts/functions/mcp_config.sh +14 -0
- data/.devcontainer/setup/scripts/functions/print_message.sh +59 -0
- data/.devcontainer/setup/scripts/setup/mcp-markdownify.sh +39 -0
- data/.devcontainer/sync-envs.sh +58 -0
- data/.envrc.sample +7 -0
- data/.rspec +4 -0
- data/.rubocop.yml +70 -0
- data/.rubocop_airbnb.yml +2 -0
- data/.rubocop_todo.yml +74 -0
- data/.tool-versions +1 -0
- data/CLAUDE.md +20 -0
- data/LICENSE +21 -0
- data/README.md +384 -0
- data/README_ja.md +384 -0
- data/Rakefile +18 -0
- data/bin/soba +120 -0
- data/config/config.yml.example +36 -0
- data/docs/business/INDEX.md +6 -0
- data/docs/business/overview.md +42 -0
- data/docs/business/workflow.md +143 -0
- data/docs/development/INDEX.md +10 -0
- data/docs/development/architecture.md +69 -0
- data/docs/development/coding-standards.md +152 -0
- data/docs/development/distribution.md +26 -0
- data/docs/development/implementation-guide.md +103 -0
- data/docs/development/testing-strategy.md +128 -0
- data/docs/development/tmux-management.md +253 -0
- data/docs/document_system.md +58 -0
- data/lib/soba/commands/config/show.rb +63 -0
- data/lib/soba/commands/init.rb +778 -0
- data/lib/soba/commands/open.rb +144 -0
- data/lib/soba/commands/start.rb +442 -0
- data/lib/soba/commands/status.rb +175 -0
- data/lib/soba/commands/stop.rb +147 -0
- data/lib/soba/config_loader.rb +32 -0
- data/lib/soba/configuration.rb +268 -0
- data/lib/soba/container.rb +48 -0
- data/lib/soba/domain/issue.rb +38 -0
- data/lib/soba/domain/phase_strategy.rb +74 -0
- data/lib/soba/infrastructure/errors.rb +23 -0
- data/lib/soba/infrastructure/github_client.rb +399 -0
- data/lib/soba/infrastructure/lock_manager.rb +129 -0
- data/lib/soba/infrastructure/tmux_client.rb +331 -0
- data/lib/soba/services/ansi_processor.rb +92 -0
- data/lib/soba/services/auto_merge_service.rb +133 -0
- data/lib/soba/services/closed_issue_window_cleaner.rb +96 -0
- data/lib/soba/services/daemon_service.rb +83 -0
- data/lib/soba/services/git_workspace_manager.rb +102 -0
- data/lib/soba/services/issue_monitor.rb +29 -0
- data/lib/soba/services/issue_processor.rb +215 -0
- data/lib/soba/services/issue_watcher.rb +193 -0
- data/lib/soba/services/pid_manager.rb +87 -0
- data/lib/soba/services/process_info.rb +58 -0
- data/lib/soba/services/queueing_service.rb +98 -0
- data/lib/soba/services/session_logger.rb +111 -0
- data/lib/soba/services/session_resolver.rb +72 -0
- data/lib/soba/services/slack_notifier.rb +121 -0
- data/lib/soba/services/status_manager.rb +74 -0
- data/lib/soba/services/test_process_manager.rb +84 -0
- data/lib/soba/services/tmux_session_manager.rb +251 -0
- data/lib/soba/services/workflow_blocking_checker.rb +73 -0
- data/lib/soba/services/workflow_executor.rb +256 -0
- data/lib/soba/services/workflow_integrity_checker.rb +151 -0
- data/lib/soba/templates/claude_commands/implement.md +88 -0
- data/lib/soba/templates/claude_commands/plan.md +93 -0
- data/lib/soba/templates/claude_commands/review.md +91 -0
- data/lib/soba/templates/claude_commands/revise.md +76 -0
- data/lib/soba/version.rb +5 -0
- data/lib/soba.rb +44 -0
- data/lib/tasks/gem.rake +75 -0
- data/soba-cli.gemspec +59 -0
- metadata +430 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
set -e
|
3
|
+
|
4
|
+
# Get the directory where this script is located
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
6
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
7
|
+
|
8
|
+
# Path to .tool-versions and .env files
|
9
|
+
TOOL_VERSIONS_FILE="$PROJECT_ROOT/.tool-versions"
|
10
|
+
ENV_FILE="$SCRIPT_DIR/.env"
|
11
|
+
|
12
|
+
# Check if .tool-versions exists
|
13
|
+
if [ ! -f "$TOOL_VERSIONS_FILE" ]; then
|
14
|
+
echo "Error: .tool-versions file not found at $TOOL_VERSIONS_FILE"
|
15
|
+
exit 1
|
16
|
+
fi
|
17
|
+
|
18
|
+
# Extract Ruby version from .tool-versions
|
19
|
+
RUBY_VERSION=$(grep "^ruby " "$TOOL_VERSIONS_FILE" | awk '{print $2}')
|
20
|
+
|
21
|
+
if [ -z "$RUBY_VERSION" ]; then
|
22
|
+
echo "Error: Ruby version not found in .tool-versions"
|
23
|
+
exit 1
|
24
|
+
fi
|
25
|
+
|
26
|
+
echo "Found Ruby version: $RUBY_VERSION"
|
27
|
+
|
28
|
+
# Get compose project name from directory
|
29
|
+
COMPOSE_PROJECT_NAME=$(basename "$PROJECT_ROOT")
|
30
|
+
echo "Found compose project name: $COMPOSE_PROJECT_NAME"
|
31
|
+
|
32
|
+
# Create or update .env file
|
33
|
+
if [ -f "$ENV_FILE" ]; then
|
34
|
+
# Update existing RUBY_VERSION line or add if not exists
|
35
|
+
if grep -q "^RUBY_VERSION=" "$ENV_FILE"; then
|
36
|
+
sed -i "s/^RUBY_VERSION=.*/RUBY_VERSION=$RUBY_VERSION/" "$ENV_FILE"
|
37
|
+
echo "Updated RUBY_VERSION in $ENV_FILE"
|
38
|
+
else
|
39
|
+
echo "RUBY_VERSION=$RUBY_VERSION" >> "$ENV_FILE"
|
40
|
+
echo "Added RUBY_VERSION to $ENV_FILE"
|
41
|
+
fi
|
42
|
+
|
43
|
+
# Update existing COMPOSE_PROJECT_NAME line or add if not exists
|
44
|
+
if grep -q "^COMPOSE_PROJECT_NAME=" "$ENV_FILE"; then
|
45
|
+
sed -i "s/^COMPOSE_PROJECT_NAME=.*/COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME/" "$ENV_FILE"
|
46
|
+
echo "Updated COMPOSE_PROJECT_NAME in $ENV_FILE"
|
47
|
+
else
|
48
|
+
echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" >> "$ENV_FILE"
|
49
|
+
echo "Added COMPOSE_PROJECT_NAME to $ENV_FILE"
|
50
|
+
fi
|
51
|
+
else
|
52
|
+
# Create new .env file
|
53
|
+
echo "RUBY_VERSION=$RUBY_VERSION" > "$ENV_FILE"
|
54
|
+
echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME" >> "$ENV_FILE"
|
55
|
+
echo "Created $ENV_FILE with RUBY_VERSION and COMPOSE_PROJECT_NAME"
|
56
|
+
fi
|
57
|
+
|
58
|
+
echo "Environment variables synchronized successfully!"
|
data/.envrc.sample
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# GitHub Personal Access Token for soba-cli
|
2
|
+
# Required for GitHub API operations
|
3
|
+
export GITHUB_TOKEN=your_github_token_here
|
4
|
+
|
5
|
+
# Slack Webhook URL (Optional)
|
6
|
+
# Used for sending notifications to Slack
|
7
|
+
export SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
inherit_from:
|
2
|
+
- .rubocop_todo.yml
|
3
|
+
- .rubocop_airbnb.yml
|
4
|
+
|
5
|
+
require:
|
6
|
+
- rubocop-airbnb
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
AllCops:
|
11
|
+
TargetRubyVersion: 3.2
|
12
|
+
NewCops: enable
|
13
|
+
Exclude:
|
14
|
+
- 'vendor/**/*'
|
15
|
+
- 'spec/fixtures/**/*'
|
16
|
+
- 'tmp/**/*'
|
17
|
+
- '.git/**/*'
|
18
|
+
- '.bundle/**/*'
|
19
|
+
- 'Gemfile.lock'
|
20
|
+
|
21
|
+
# Project specific overrides
|
22
|
+
Metrics/BlockLength:
|
23
|
+
Exclude:
|
24
|
+
- 'spec/**/*'
|
25
|
+
- '*.gemspec'
|
26
|
+
- 'Rakefile'
|
27
|
+
- 'bin/soba'
|
28
|
+
|
29
|
+
Metrics/MethodLength:
|
30
|
+
Max: 20
|
31
|
+
Exclude:
|
32
|
+
- 'bin/soba'
|
33
|
+
|
34
|
+
Metrics/ClassLength:
|
35
|
+
Max: 150
|
36
|
+
|
37
|
+
Layout/LineLength:
|
38
|
+
Max: 120
|
39
|
+
Exclude:
|
40
|
+
- 'spec/**/*'
|
41
|
+
|
42
|
+
# Allow Japanese comments in documentation
|
43
|
+
Style/AsciiComments:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
# For CLI application
|
47
|
+
Style/GlobalVars:
|
48
|
+
Exclude:
|
49
|
+
- 'bin/soba'
|
50
|
+
|
51
|
+
# For RSpec
|
52
|
+
RSpec/MultipleExpectations:
|
53
|
+
Max: 3
|
54
|
+
|
55
|
+
RSpec/ExampleLength:
|
56
|
+
Max: 15
|
57
|
+
|
58
|
+
RSpec/NestedGroups:
|
59
|
+
Max: 4
|
60
|
+
|
61
|
+
# This is a Rails-specific cop that doesn't apply to CLI applications
|
62
|
+
Airbnb/ClassOrModuleDeclaredInWrongFile:
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
# Rails-specific cops that don't apply to CLI applications
|
66
|
+
Rails/Pluck:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Rails/PluckInWhere:
|
70
|
+
Enabled: false
|
data/.rubocop_airbnb.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2025-09-19 16:18:38 UTC using RuboCop version 1.32.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: app/**/*, lib/**/*
|
12
|
+
Airbnb/ConstAssignedInWrongFile:
|
13
|
+
Exclude:
|
14
|
+
- 'lib/soba/container.rb'
|
15
|
+
|
16
|
+
# Offense count: 20
|
17
|
+
# Configuration parameters: Include.
|
18
|
+
# Include: app/**/*, lib/**/*
|
19
|
+
Airbnb/ModuleMethodInWrongFile:
|
20
|
+
Exclude:
|
21
|
+
- 'lib/soba/infrastructure/github_client.rb'
|
22
|
+
|
23
|
+
# Offense count: 1
|
24
|
+
Airbnb/NoTimeout:
|
25
|
+
Exclude:
|
26
|
+
- 'lib/soba/services/pid_manager.rb'
|
27
|
+
|
28
|
+
# Offense count: 8
|
29
|
+
Airbnb/OptArgParameters:
|
30
|
+
Exclude:
|
31
|
+
- 'lib/soba/commands/start.rb'
|
32
|
+
- 'lib/soba/commands/status.rb'
|
33
|
+
- 'lib/soba/commands/stop.rb'
|
34
|
+
- 'lib/soba/services/pid_manager.rb'
|
35
|
+
|
36
|
+
# Offense count: 3
|
37
|
+
Airbnb/SimpleModifierConditional:
|
38
|
+
Exclude:
|
39
|
+
- 'lib/soba/commands/status.rb'
|
40
|
+
- 'lib/soba/domain/issue.rb'
|
41
|
+
- 'spec/spec_helper.rb'
|
42
|
+
|
43
|
+
# Offense count: 4
|
44
|
+
# This cop supports safe autocorrection (--autocorrect).
|
45
|
+
# Configuration parameters: EnforcedStyle.
|
46
|
+
# SupportedStyles: leading, trailing
|
47
|
+
Layout/DotPosition:
|
48
|
+
Exclude:
|
49
|
+
- 'spec/integration/github_client_spec.rb'
|
50
|
+
|
51
|
+
# Offense count: 8
|
52
|
+
# This cop supports safe autocorrection (--autocorrect).
|
53
|
+
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
|
54
|
+
Layout/EmptyLineBetweenDefs:
|
55
|
+
Exclude:
|
56
|
+
- 'lib/soba.rb'
|
57
|
+
|
58
|
+
# Offense count: 86
|
59
|
+
# This cop supports safe autocorrection (--autocorrect).
|
60
|
+
# Configuration parameters: EnforcedStyle.
|
61
|
+
# SupportedStyles: final_newline, final_blank_line
|
62
|
+
Layout/TrailingEmptyLines:
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
# Offense count: 1
|
66
|
+
Style/MixinUsage:
|
67
|
+
Exclude:
|
68
|
+
- 'bin/soba'
|
69
|
+
|
70
|
+
# Offense count: 1
|
71
|
+
# This cop supports safe autocorrection (--autocorrect).
|
72
|
+
Style/MultilineIfModifier:
|
73
|
+
Exclude:
|
74
|
+
- 'spec/spec_helper.rb'
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.4.5
|
data/CLAUDE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Guideline
|
2
|
+
|
3
|
+
## Top-Level Rules
|
4
|
+
|
5
|
+
- Run independent processes concurrently, not sequentially.
|
6
|
+
- Think only in English; respond only in Japanese.
|
7
|
+
- Use **Contex7 MCP** to check library usage.
|
8
|
+
- Save temp design notes as `./.tmp/` in Markdown.
|
9
|
+
- After **Write/Edit**, always verify with **Read**, even if system says "(no content)".
|
10
|
+
- Be critical, not obedient—but stay respectful.
|
11
|
+
|
12
|
+
## Context
|
13
|
+
|
14
|
+
- Document System: @docs/document_system.md
|
15
|
+
|
16
|
+
## Documents
|
17
|
+
|
18
|
+
- Business: @docs/business/INDEX.md
|
19
|
+
- Development: @docs/development/INDEX.md
|
20
|
+
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Sho DOUHASHI
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,384 @@
|
|
1
|
+
# soba CLI
|
2
|
+
|
3
|
+
[](https://github.com/douhashi/soba-cli/releases)
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
5
|
+
[](https://www.ruby-lang.org/)
|
6
|
+
|
7
|
+
[日本語版はこちら](README_ja.md)
|
8
|
+
|
9
|
+
Autonomous GitHub Issue workflow automation CLI that bridges GitHub Issues with Claude Code, enabling AI-driven development cycles.
|
10
|
+
|
11
|
+
## Overview
|
12
|
+
|
13
|
+
soba CLI automates the entire development workflow from issue creation to pull request merging. It monitors GitHub Issues, automatically processes them through planning, implementation, review, and merge phases using Claude Code AI assistance.
|
14
|
+
|
15
|
+
## Key Features
|
16
|
+
|
17
|
+
- 🤖 **Autonomous Workflow**: Fully automated issue-to-merge pipeline
|
18
|
+
- 🏷️ **Label-Driven State Management**: Progress tracking via GitHub labels
|
19
|
+
- 🔄 **Continuous Processing**: Automatic polling and phase transitions
|
20
|
+
- 🎯 **Priority Management**: Sequential processing by issue number
|
21
|
+
- 🪟 **Tmux Integration**: Visual monitoring of AI processes
|
22
|
+
- 🔀 **Git Worktree Support**: Isolated branch management
|
23
|
+
- 🚀 **Auto-Merge**: Automatic PR merging after approval
|
24
|
+
|
25
|
+
## Workflow
|
26
|
+
|
27
|
+
```mermaid
|
28
|
+
graph TD
|
29
|
+
A[Multiple soba:todo] -->|soba: Priority check| B[One becomes soba:queued]
|
30
|
+
B -->|soba: Immediately| C[soba:planning]
|
31
|
+
C -->|Claude: Plan creation| D[soba:ready]
|
32
|
+
D -->|soba: Auto-detect| E[soba:doing]
|
33
|
+
E -->|Claude: Implement & PR| F[soba:review-requested]
|
34
|
+
F -->|soba: Auto-detect| G[soba:reviewing]
|
35
|
+
G -->|Claude: Approve| H[soba:done + PR:soba:lgtm]
|
36
|
+
G -->|Claude: Request changes| I[soba:requires-changes]
|
37
|
+
I -->|soba: Auto-detect| K[soba:revising]
|
38
|
+
K -->|Claude: Apply fixes| F
|
39
|
+
H -->|soba: Auto-merge| J[soba:merged]
|
40
|
+
J -->|Next queuing| A
|
41
|
+
```
|
42
|
+
|
43
|
+
## Installation
|
44
|
+
|
45
|
+
### As a Ruby Gem
|
46
|
+
|
47
|
+
```bash
|
48
|
+
gem install soba-cli
|
49
|
+
```
|
50
|
+
|
51
|
+
### From Source
|
52
|
+
|
53
|
+
```bash
|
54
|
+
# Clone the repository
|
55
|
+
git clone https://github.com/douhashi/soba-cli.git
|
56
|
+
cd soba-cli
|
57
|
+
|
58
|
+
# Install dependencies
|
59
|
+
bundle install
|
60
|
+
|
61
|
+
# Run from source
|
62
|
+
bin/soba --help
|
63
|
+
```
|
64
|
+
|
65
|
+
## Quick Start
|
66
|
+
|
67
|
+
### ⚠ Important Notice ⚠
|
68
|
+
|
69
|
+
soba uses `--dangerously-skip-permissions` by default to support AI-driven autonomous development. (This can be disabled in the configuration file)
|
70
|
+
|
71
|
+
When using default settings, please take necessary precautions such as using devcontainers and restricting external access.
|
72
|
+
|
73
|
+
---
|
74
|
+
|
75
|
+
1. **Initialize configuration**
|
76
|
+
```bash
|
77
|
+
soba init
|
78
|
+
```
|
79
|
+
|
80
|
+
2. **Configure settings**
|
81
|
+
Edit `.soba/config.yml`:
|
82
|
+
```yaml
|
83
|
+
github:
|
84
|
+
token: ${GITHUB_TOKEN}
|
85
|
+
repository: owner/repo
|
86
|
+
```
|
87
|
+
|
88
|
+
3. **Start automation**
|
89
|
+
```bash
|
90
|
+
soba start
|
91
|
+
```
|
92
|
+
|
93
|
+
4. **Create an issue with label**
|
94
|
+
Add `soba:todo` label to any GitHub issue to start automated processing.
|
95
|
+
|
96
|
+
## Configuration
|
97
|
+
|
98
|
+
Configuration file location: `.soba/config.yml` (in project root)
|
99
|
+
|
100
|
+
### Full Configuration Example
|
101
|
+
|
102
|
+
```yaml
|
103
|
+
# GitHub settings
|
104
|
+
github:
|
105
|
+
# Personal Access Token (can use environment variable)
|
106
|
+
token: ${GITHUB_TOKEN}
|
107
|
+
# Target repository (format: owner/repo)
|
108
|
+
repository: douhashi/soba-cli
|
109
|
+
|
110
|
+
# Workflow settings
|
111
|
+
workflow:
|
112
|
+
# Issue polling interval in seconds (default: 20)
|
113
|
+
interval: 20
|
114
|
+
# Use tmux for Claude execution (default: true)
|
115
|
+
use_tmux: true
|
116
|
+
# Enable automatic PR merging (default: true)
|
117
|
+
auto_merge_enabled: true
|
118
|
+
# Clean up tmux windows for closed issues (default: true)
|
119
|
+
closed_issue_cleanup_enabled: true
|
120
|
+
# Cleanup interval in seconds (default: 300)
|
121
|
+
closed_issue_cleanup_interval: 300
|
122
|
+
# Command delay for tmux panes in seconds (default: 3)
|
123
|
+
tmux_command_delay: 3
|
124
|
+
|
125
|
+
# Slack notifications
|
126
|
+
slack:
|
127
|
+
# Webhook URL for Slack notifications
|
128
|
+
# Get your webhook URL from: https://api.slack.com/messaging/webhooks
|
129
|
+
webhook_url: ${SLACK_WEBHOOK_URL}
|
130
|
+
# Enable notifications for phase starts (default: false)
|
131
|
+
notifications_enabled: false
|
132
|
+
|
133
|
+
# Git settings
|
134
|
+
git:
|
135
|
+
# Base path for git worktrees
|
136
|
+
worktree_base_path: .git/soba/worktrees
|
137
|
+
# Auto-setup workspace on phase start (default: true)
|
138
|
+
setup_workspace: true
|
139
|
+
|
140
|
+
# Phase commands (optional - for custom Claude commands)
|
141
|
+
phase:
|
142
|
+
plan:
|
143
|
+
command: claude
|
144
|
+
options:
|
145
|
+
- --dangerously-skip-permissions
|
146
|
+
parameter: '/soba:plan {{issue-number}}'
|
147
|
+
implement:
|
148
|
+
command: claude
|
149
|
+
options:
|
150
|
+
- --dangerously-skip-permissions
|
151
|
+
parameter: '/soba:implement {{issue-number}}'
|
152
|
+
review:
|
153
|
+
command: claude
|
154
|
+
options:
|
155
|
+
- --dangerously-skip-permissions
|
156
|
+
parameter: '/soba:review {{issue-number}}'
|
157
|
+
revise:
|
158
|
+
command: claude
|
159
|
+
options:
|
160
|
+
- --dangerously-skip-permissions
|
161
|
+
parameter: '/soba:revise {{issue-number}}'
|
162
|
+
```
|
163
|
+
|
164
|
+
### Environment Variables
|
165
|
+
|
166
|
+
| Variable | Description | Required |
|
167
|
+
|----------|-------------|----------|
|
168
|
+
| `GITHUB_TOKEN` | GitHub Personal Access Token with repo/read:org/write:discussion scopes | Yes |
|
169
|
+
| `SLACK_WEBHOOK_URL` | Slack Webhook URL | No |
|
170
|
+
|
171
|
+
### Claude Command Templates
|
172
|
+
|
173
|
+
Soba automatically deploys Claude command templates to `.claude/commands/soba/` during initialization. These templates define the workflow automation commands for each phase:
|
174
|
+
|
175
|
+
|
176
|
+
- **plan.md** - Issue planning phase template
|
177
|
+
- **implement.md** - Implementation phase template
|
178
|
+
- **review.md** - PR review phase template
|
179
|
+
- **revise.md** - Revision phase template
|
180
|
+
|
181
|
+
These templates are included in the gem package and can be found in:
|
182
|
+
[lib/soba/templates/claude_commands/](lib/soba/templates/claude_commands/)
|
183
|
+
|
184
|
+
## Commands
|
185
|
+
|
186
|
+
### `soba init`
|
187
|
+
Initialize soba configuration in the current project.
|
188
|
+
|
189
|
+
```bash
|
190
|
+
# Basic initialization
|
191
|
+
soba init
|
192
|
+
|
193
|
+
# Interactive mode
|
194
|
+
soba init --interactive
|
195
|
+
```
|
196
|
+
|
197
|
+
### `soba start`
|
198
|
+
Start the workflow automation daemon.
|
199
|
+
|
200
|
+
```bash
|
201
|
+
# Start in daemon mode (background)
|
202
|
+
soba start
|
203
|
+
|
204
|
+
# Start in daemon mode
|
205
|
+
soba start --daemon
|
206
|
+
|
207
|
+
# Start with specific issue
|
208
|
+
soba start 123
|
209
|
+
|
210
|
+
# Start without tmux
|
211
|
+
soba start --no-tmux
|
212
|
+
```
|
213
|
+
|
214
|
+
### `soba status`
|
215
|
+
Show daemon status and recent logs.
|
216
|
+
|
217
|
+
```bash
|
218
|
+
# Basic status
|
219
|
+
soba status
|
220
|
+
|
221
|
+
# Show more log lines
|
222
|
+
soba status --log 50
|
223
|
+
|
224
|
+
# Output as JSON
|
225
|
+
soba status --json
|
226
|
+
```
|
227
|
+
|
228
|
+
### `soba stop`
|
229
|
+
Stop the running daemon.
|
230
|
+
|
231
|
+
```bash
|
232
|
+
# Graceful stop
|
233
|
+
soba stop
|
234
|
+
|
235
|
+
# Force stop immediately
|
236
|
+
soba stop --force
|
237
|
+
|
238
|
+
# Custom timeout
|
239
|
+
soba stop --timeout 60
|
240
|
+
```
|
241
|
+
|
242
|
+
### `soba open`
|
243
|
+
Open or list tmux sessions for tasks.
|
244
|
+
|
245
|
+
```bash
|
246
|
+
# Open tmux session
|
247
|
+
soba open
|
248
|
+
|
249
|
+
# List all active sessions
|
250
|
+
soba open --list
|
251
|
+
```
|
252
|
+
|
253
|
+
### `soba config`
|
254
|
+
Display current configuration.
|
255
|
+
|
256
|
+
```bash
|
257
|
+
# Show configuration
|
258
|
+
soba config
|
259
|
+
|
260
|
+
# Use specific config file
|
261
|
+
soba --config /path/to/config.yml config
|
262
|
+
```
|
263
|
+
|
264
|
+
## Label System
|
265
|
+
|
266
|
+
### Issue Labels (State Management)
|
267
|
+
|
268
|
+
| Label | State | Description |
|
269
|
+
|-------|-------|-------------|
|
270
|
+
| `soba:todo` | Waiting | New issue awaiting processing |
|
271
|
+
| `soba:queued` | Queued | Selected for processing |
|
272
|
+
| `soba:planning` | Planning | Claude creating implementation plan |
|
273
|
+
| `soba:ready` | Ready | Plan complete, awaiting implementation |
|
274
|
+
| `soba:doing` | Implementing | Claude working on implementation |
|
275
|
+
| `soba:review-requested` | Review Pending | PR created, awaiting review |
|
276
|
+
| `soba:reviewing` | Reviewing | Claude reviewing PR |
|
277
|
+
| `soba:done` | Complete | Review approved, ready to merge |
|
278
|
+
| `soba:requires-changes` | Changes Needed | Review requested modifications |
|
279
|
+
| `soba:revising` | Revising | Claude applying requested changes |
|
280
|
+
| `soba:merged` | Merged | PR merged and issue closed |
|
281
|
+
|
282
|
+
### PR Labels
|
283
|
+
|
284
|
+
| Label | Description |
|
285
|
+
|-------|-------------|
|
286
|
+
| `soba:lgtm` | Review approved, eligible for auto-merge |
|
287
|
+
|
288
|
+
## Development
|
289
|
+
|
290
|
+
### Directory Structure
|
291
|
+
|
292
|
+
```
|
293
|
+
lib/
|
294
|
+
├── soba/
|
295
|
+
│ ├── cli/ # CLI framework setup
|
296
|
+
│ ├── commands/ # Command implementations
|
297
|
+
│ ├── domain/ # Domain models
|
298
|
+
│ ├── services/ # Business logic
|
299
|
+
│ └── infrastructure/ # External integrations
|
300
|
+
```
|
301
|
+
|
302
|
+
### Running Tests
|
303
|
+
|
304
|
+
```bash
|
305
|
+
# Run all tests
|
306
|
+
bundle exec rspec
|
307
|
+
|
308
|
+
# Run with coverage
|
309
|
+
bundle exec rake coverage
|
310
|
+
|
311
|
+
# Run specific test suite
|
312
|
+
bundle exec rspec spec/unit/
|
313
|
+
```
|
314
|
+
|
315
|
+
### Code Quality
|
316
|
+
|
317
|
+
```bash
|
318
|
+
# Run Rubocop (Airbnb style)
|
319
|
+
bundle exec rubocop
|
320
|
+
|
321
|
+
# Auto-fix violations
|
322
|
+
bundle exec rubocop -a
|
323
|
+
|
324
|
+
# Security audit
|
325
|
+
bundle exec bundler-audit
|
326
|
+
```
|
327
|
+
|
328
|
+
### Git Hooks
|
329
|
+
|
330
|
+
The project uses pre-commit hooks for code quality:
|
331
|
+
- Automatic Rubocop fixes
|
332
|
+
- Re-staging after auto-fixes
|
333
|
+
- Block commits with manual fix requirements
|
334
|
+
|
335
|
+
Setup hooks:
|
336
|
+
```bash
|
337
|
+
./scripts/setup-hooks.sh
|
338
|
+
```
|
339
|
+
|
340
|
+
## Requirements
|
341
|
+
|
342
|
+
- Ruby >= 3.0
|
343
|
+
- Git
|
344
|
+
- tmux (optional, but recommended)
|
345
|
+
- GitHub Personal Access Token
|
346
|
+
- Claude Code CLI (`claude` command)
|
347
|
+
|
348
|
+
## Architecture
|
349
|
+
|
350
|
+
soba CLI follows a layered architecture:
|
351
|
+
- **Commands Layer**: CLI command definitions and parsing
|
352
|
+
- **Domain Layer**: Core business models and logic
|
353
|
+
- **Services Layer**: Workflow orchestration and state management
|
354
|
+
- **Infrastructure Layer**: GitHub API and external tool integration
|
355
|
+
|
356
|
+
For detailed architecture documentation, see [docs/development/architecture.md](docs/development/architecture.md).
|
357
|
+
|
358
|
+
## Contributing
|
359
|
+
|
360
|
+
1. Fork the repository
|
361
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
362
|
+
3. Commit changes (`git commit -m 'Add amazing feature'`)
|
363
|
+
4. Push to branch (`git push origin feature/amazing-feature`)
|
364
|
+
5. Open a Pull Request
|
365
|
+
|
366
|
+
Please ensure:
|
367
|
+
- All tests pass (`bundle exec rspec`)
|
368
|
+
- Rubocop checks pass (`bundle exec rubocop`)
|
369
|
+
- Code coverage remains high
|
370
|
+
|
371
|
+
## License
|
372
|
+
|
373
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
374
|
+
|
375
|
+
## Support
|
376
|
+
|
377
|
+
- **Issues**: [GitHub Issues](https://github.com/douhashi/soba-cli/issues)
|
378
|
+
- **Discussions**: [GitHub Discussions](https://github.com/douhashi/soba-cli/discussions)
|
379
|
+
|
380
|
+
## Acknowledgments
|
381
|
+
|
382
|
+
- Powered by [Claude Code](https://claude.ai/code) for AI-driven development
|
383
|
+
- Built with [GLI](https://github.com/davetron5000/gli) for CLI framework
|
384
|
+
- Styled with [Airbnb Ruby Style Guide](https://github.com/airbnb/ruby)
|