claude-intern 1.0.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.
- package/.env.sample +48 -0
- package/README.md +218 -0
- package/dist/index.js +309 -0
- package/package.json +70 -0
package/.env.sample
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Claude Intern Environment Configuration
|
|
2
|
+
# Copy this file to .env and update with your actual values
|
|
3
|
+
|
|
4
|
+
# JIRA Configuration
|
|
5
|
+
# Your JIRA instance URL (without trailing slash)
|
|
6
|
+
JIRA_BASE_URL=https://your-company.atlassian.net
|
|
7
|
+
|
|
8
|
+
# Your JIRA email address
|
|
9
|
+
JIRA_EMAIL=your-email@company.com
|
|
10
|
+
|
|
11
|
+
# Your JIRA API token
|
|
12
|
+
# Create one at: https://id.atlassian.com/manage-profile/security/api-tokens
|
|
13
|
+
# Option 1: Just the API token (will be combined with email above)
|
|
14
|
+
JIRA_API_TOKEN=your-api-token-here
|
|
15
|
+
# Option 2: If your token already includes email, use format: email@company.com:api-token
|
|
16
|
+
# JIRA_API_TOKEN=your-email@company.com:your-api-token-here
|
|
17
|
+
|
|
18
|
+
# Optional: Claude CLI Configuration
|
|
19
|
+
# Path to Claude CLI executable (defaults to 'claude' if not specified)
|
|
20
|
+
CLAUDE_CLI_PATH=claude
|
|
21
|
+
|
|
22
|
+
# Note: Claude will be run with --dangerously-skip-permissions and --max-turns 10
|
|
23
|
+
# This allows for elevated permissions and extended conversations for complex tasks
|
|
24
|
+
|
|
25
|
+
# Optional: Output Directory Configuration
|
|
26
|
+
# Base directory for saving task-related files (defaults to /tmp/claude-intern-tasks)
|
|
27
|
+
# CLAUDE_INTERN_OUTPUT_DIR=/tmp/claude-intern-tasks
|
|
28
|
+
|
|
29
|
+
# Optional: Enable verbose logging by default
|
|
30
|
+
# VERBOSE=true
|
|
31
|
+
|
|
32
|
+
# Optional: Pull Request Integration
|
|
33
|
+
# GitHub personal access token for creating pull requests
|
|
34
|
+
# Create one at: https://github.com/settings/tokens (needs 'repo' scope)
|
|
35
|
+
# GITHUB_TOKEN=your-github-token-here
|
|
36
|
+
|
|
37
|
+
# Bitbucket app password for creating pull requests
|
|
38
|
+
# Create one at: https://bitbucket.org/account/settings/app-passwords/
|
|
39
|
+
# Needs 'Repositories: Write' permission
|
|
40
|
+
# BITBUCKET_TOKEN=your-bitbucket-app-password-here
|
|
41
|
+
|
|
42
|
+
# Note: Bitbucket workspace is automatically detected from your git remote URL
|
|
43
|
+
|
|
44
|
+
# Optional: JIRA Status Transition After PR Creation
|
|
45
|
+
# Set the status to transition the JIRA task to after successfully creating a PR
|
|
46
|
+
# Common values: "In Review", "Code Review", "Under Review", "Ready for Review"
|
|
47
|
+
# Leave empty or comment out to skip status transition
|
|
48
|
+
# JIRA_PR_STATUS=In Review
|
package/README.md
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Claude Intern
|
|
2
|
+
|
|
3
|
+
Your AI intern for automatically implementing JIRA tasks using Claude. Supports both single task processing and batch processing of multiple tasks through JQL queries or explicit task lists. Pulls task details and feeds them to Claude for implementation with full automation of the development workflow.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
1. Install Bun (if not already installed):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
curl -fsSL https://bun.sh/install | bash
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. Install dependencies:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
3. Copy `.env.sample` to `.env` and configure your JIRA credentials:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cp .env.sample .env
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
4. Update `.env` with your JIRA details:
|
|
26
|
+
|
|
27
|
+
- `JIRA_BASE_URL`: Your JIRA instance URL (e.g., https://yourcompany.atlassian.net)
|
|
28
|
+
- `JIRA_EMAIL`: Your JIRA email address
|
|
29
|
+
- `JIRA_API_TOKEN`: Your JIRA API token (create one at https://id.atlassian.com/manage-profile/security/api-tokens)
|
|
30
|
+
|
|
31
|
+
Optional PR integration:
|
|
32
|
+
- `GITHUB_TOKEN`: GitHub personal access token for creating pull requests
|
|
33
|
+
- `BITBUCKET_TOKEN`: Bitbucket app password for creating pull requests
|
|
34
|
+
- `JIRA_PR_STATUS`: Auto-transition JIRA status after PR creation (e.g., "In Review")
|
|
35
|
+
|
|
36
|
+
The `.env.sample` file includes helpful comments and optional configuration options.
|
|
37
|
+
|
|
38
|
+
5. (Optional) Install globally to use from any directory:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
bun run install-global
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
### Single Task Processing
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Run with a JIRA task key (automatically runs Claude)
|
|
50
|
+
bun start TASK-123
|
|
51
|
+
|
|
52
|
+
# Development mode (same as start with Bun)
|
|
53
|
+
bun run dev TASK-123
|
|
54
|
+
|
|
55
|
+
# Skip Claude and just fetch/format the task
|
|
56
|
+
bun start TASK-123 -- --no-claude
|
|
57
|
+
|
|
58
|
+
# Skip git branch creation
|
|
59
|
+
bun start TASK-123 -- --no-git
|
|
60
|
+
|
|
61
|
+
# Use custom .env file
|
|
62
|
+
bun start TASK-123 -- --env-file /path/to/custom.env
|
|
63
|
+
|
|
64
|
+
# Specify custom output file
|
|
65
|
+
bun start TASK-123 -- -o my-task.md
|
|
66
|
+
|
|
67
|
+
# Verbose output for debugging
|
|
68
|
+
bun start TASK-123 -- -v
|
|
69
|
+
|
|
70
|
+
# Custom Claude CLI path
|
|
71
|
+
bun start TASK-123 -- --claude-path /path/to/claude
|
|
72
|
+
|
|
73
|
+
# Increase max turns for complex tasks
|
|
74
|
+
bun start TASK-123 -- --max-turns 50
|
|
75
|
+
|
|
76
|
+
# Skip automatic commit after Claude completes
|
|
77
|
+
bun start TASK-123 -- --no-auto-commit
|
|
78
|
+
|
|
79
|
+
# Create pull request after implementation
|
|
80
|
+
bun start TASK-123 -- --create-pr
|
|
81
|
+
|
|
82
|
+
# Create pull request targeting specific branch
|
|
83
|
+
bun start TASK-123 -- --create-pr --pr-target-branch develop
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Batch Processing (Multiple Tasks)
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Process multiple specific tasks
|
|
90
|
+
bun start PROJ-123 PROJ-124 PROJ-125
|
|
91
|
+
|
|
92
|
+
# Process tasks matching JQL query
|
|
93
|
+
bun start -- --jql "project = PROJ AND status = 'To Do'"
|
|
94
|
+
|
|
95
|
+
# Complex JQL with custom fields and conditions
|
|
96
|
+
bun start -- --jql "project = \"My Project\" AND cf[10016] <= 3 AND labels IN (FrontEnd, MobileApp)"
|
|
97
|
+
|
|
98
|
+
# Batch process with PR creation
|
|
99
|
+
bun start -- --jql "assignee = currentUser() AND status = 'To Do'" --create-pr
|
|
100
|
+
|
|
101
|
+
# High-complexity batch processing with extended turns
|
|
102
|
+
bun start -- --jql "labels = 'refactoring' AND type = Story" --max-turns 500 --create-pr
|
|
103
|
+
|
|
104
|
+
# Batch process with skipped clarity checks for faster processing
|
|
105
|
+
bun start PROJ-101 PROJ-102 PROJ-103 -- --skip-clarity-check --create-pr
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Examples
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
# Fetch JIRA task and run Claude automatically
|
|
112
|
+
bun start PROJ-456
|
|
113
|
+
|
|
114
|
+
# Just fetch and format (useful for reviewing before Claude runs)
|
|
115
|
+
bun start PROJ-456 -- --no-claude
|
|
116
|
+
|
|
117
|
+
# Then manually run Claude with the formatted output
|
|
118
|
+
claude -p --dangerously-skip-permissions --max-turns 10 < task-details.md
|
|
119
|
+
|
|
120
|
+
# Development mode (same as start with Bun)
|
|
121
|
+
bun run dev PROJ-456
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Global Usage (from any directory)
|
|
125
|
+
|
|
126
|
+
After installing globally, you can run the tool from any directory (especially useful when working in your project's git repository):
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Single task processing
|
|
130
|
+
claude-intern PROJ-123
|
|
131
|
+
|
|
132
|
+
# Multiple task processing
|
|
133
|
+
claude-intern PROJ-123 PROJ-124 PROJ-125
|
|
134
|
+
|
|
135
|
+
# JQL query processing
|
|
136
|
+
claude-intern --jql "project = PROJ AND status = 'To Do'"
|
|
137
|
+
claude-intern --jql "assignee = currentUser() AND labels = 'frontend' AND type = Bug"
|
|
138
|
+
|
|
139
|
+
# All the same options work with batch processing
|
|
140
|
+
claude-intern PROJ-123 PROJ-124 --no-claude --verbose
|
|
141
|
+
claude-intern --jql "status = 'To Do'" --create-pr --pr-target-branch develop
|
|
142
|
+
claude-intern --jql "priority = High" --max-turns 300 --skip-clarity-check
|
|
143
|
+
|
|
144
|
+
# Advanced batch scenarios
|
|
145
|
+
claude-intern --jql "\"Epic Link\" = PROJ-100" --create-pr
|
|
146
|
+
claude-intern --jql "sprint in openSprints() AND assignee = currentUser()" --max-turns 500
|
|
147
|
+
|
|
148
|
+
# Uninstall when no longer needed
|
|
149
|
+
bun run uninstall-global # (run from claude-intern directory)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## What it does
|
|
153
|
+
|
|
154
|
+
1. Fetches the JIRA task details including:
|
|
155
|
+
|
|
156
|
+
- Task description
|
|
157
|
+
- Custom fields (including links to Figma, external docs, etc.)
|
|
158
|
+
- Comments and discussion
|
|
159
|
+
|
|
160
|
+
2. Formats the information for Claude
|
|
161
|
+
|
|
162
|
+
3. Creates a feature branch named `feature/task-id` (e.g., `feature/proj-123`)
|
|
163
|
+
|
|
164
|
+
4. Runs `claude -p` with enhanced permissions and extended conversation limits for automatic implementation
|
|
165
|
+
|
|
166
|
+
5. Automatically commits all changes with a descriptive commit message after Claude completes successfully
|
|
167
|
+
|
|
168
|
+
6. Pushes the feature branch to remote repository (when creating PRs)
|
|
169
|
+
|
|
170
|
+
7. Optionally creates pull requests on GitHub or Bitbucket with detailed implementation summaries
|
|
171
|
+
|
|
172
|
+
## Requirements
|
|
173
|
+
|
|
174
|
+
- Bun runtime
|
|
175
|
+
- JIRA API access
|
|
176
|
+
- Claude CLI installed and configured
|
|
177
|
+
- Git (for automatic branch creation)
|
|
178
|
+
|
|
179
|
+
## Quick Start
|
|
180
|
+
|
|
181
|
+
1. Install globally: `bun run install-global`
|
|
182
|
+
2. Copy `.env.sample` to your project directory as `.env`
|
|
183
|
+
3. Configure your JIRA credentials in `.env`
|
|
184
|
+
4. Run from your project directory: `claude-intern PROJ-123`
|
|
185
|
+
|
|
186
|
+
See [USAGE.md](./USAGE.md) for detailed usage scenarios and troubleshooting.
|
|
187
|
+
See [GLOBAL_USAGE.md](./GLOBAL_USAGE.md) for quick reference on global installation.
|
|
188
|
+
See [ENV_SETUP.md](./ENV_SETUP.md) for comprehensive environment configuration guide.
|
|
189
|
+
|
|
190
|
+
## Features
|
|
191
|
+
|
|
192
|
+
### Core Functionality
|
|
193
|
+
- ✅ **Full TypeScript Support** - Type-safe development with comprehensive interfaces
|
|
194
|
+
- ✅ **JIRA API Integration** - Connects to any JIRA instance with proper authentication
|
|
195
|
+
- ✅ **Smart Link Detection** - Automatically finds Figma, GitHub, Confluence links in custom fields
|
|
196
|
+
- ✅ **Rich Text Processing** - Handles JIRA's Atlassian Document Format with proper conversion
|
|
197
|
+
- ✅ **HTML to Markdown Conversion** - Converts JIRA's rendered HTML descriptions to clean markdown format
|
|
198
|
+
- ✅ **Working Attachment Links** - Converts relative JIRA attachment URLs to clickable full URLs
|
|
199
|
+
- ✅ **Comment Threading** - Includes all task discussions and updates
|
|
200
|
+
|
|
201
|
+
### Batch Processing
|
|
202
|
+
- ✅ **Multiple Task Support** - Process multiple tasks with explicit task keys
|
|
203
|
+
- ✅ **JQL Query Integration** - Use JIRA Query Language for dynamic task selection
|
|
204
|
+
- ✅ **Complex JQL Support** - Custom fields, arrays, operators, and advanced conditions
|
|
205
|
+
- ✅ **Error Isolation** - Failed tasks don't stop processing of remaining work
|
|
206
|
+
- ✅ **Progress Tracking** - Real-time progress indicators for batch operations
|
|
207
|
+
- ✅ **Dynamic File Naming** - Unique output files prevent conflicts during batch processing
|
|
208
|
+
|
|
209
|
+
### Automation & Integration
|
|
210
|
+
- ✅ **Claude Integration** - Automatically runs `claude -p` with formatted context
|
|
211
|
+
- ✅ **Real-time Output** - All Claude output is visible in real-time during execution
|
|
212
|
+
- ✅ **CLI Interface** - Easy-to-use command line tool with comprehensive options
|
|
213
|
+
- ✅ **Git Integration** - Automatically creates feature branches for each task
|
|
214
|
+
- ✅ **Auto-Commit** - Commits changes automatically after Claude completes successfully
|
|
215
|
+
- ✅ **Pull Request Creation** - Automatically creates PRs on GitHub or Bitbucket with implementation details
|
|
216
|
+
- ✅ **Smart Repository Detection** - Automatically detects GitHub/Bitbucket and workspace from git remote
|
|
217
|
+
- ✅ **Error Handling** - Robust error handling and validation
|
|
218
|
+
- ✅ **Configurable** - Flexible options for output and Claude path
|